/* ============================================================
   MTM Room Booking — Mobile web
   Design tokens lifted from "MTM Room Booking Mobile.dc.html".
   ============================================================ */
:root {
  --bg: #0A0A0B;
  --card: #141417;
  --card-alt: #161619;
  --booked: #1A1A1E;
  --disabled: #1C1C20;

  --text: #F4F4F5;
  --text-dim: #9A9AA2;
  --text-soft: #C8C8CE;
  --text-label: #7A7A82;
  --text-mute: #5E5E66;

  --accent: #FFFFFF;
  --error: #FF7A6B;

  --b06: rgba(255, 255, 255, 0.06);
  --b07: rgba(255, 255, 255, 0.07);
  --b10: rgba(255, 255, 255, 0.10);
  --grid-line: rgba(255, 255, 255, 0.05);

  --hour: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', sans-serif;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulseGlow {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  100% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); }
}
@keyframes shimmer {
  0%   { opacity: 0.35; }
  50%  { opacity: 0.7; }
  100% { opacity: 0.35; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.app {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  justify-content: center;
}
.phone {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

/* ---------- brand logo ---------- */
.brand-logo {
  display: block;
  height: 17px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  flex-shrink: 0;
}
.sheet-head .brand-logo {
  height: 14px;
  max-width: 160px;
}

/* ---------- header ---------- */
.header {
  flex-shrink: 0;
  padding: 18px 20px 0;
  position: relative;
  overflow: hidden;
}
.header .glow {
  position: absolute;
  top: -110px;
  right: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 70%);
  pointer-events: none;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
}
.room-meta { text-align: right; }
.room-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.room-cap {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 5px;
}

.daynav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  position: relative;
}
.daynav .title { flex: 1; min-width: 0; text-align: center; }
.daynav .title .main {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.daynav .title .sub {
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
  color: var(--text-dim);
}
.daynav .title .sub.today { color: var(--accent); }

.subnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  position: relative;
}
.free-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  font-family: 'Archivo', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
.btn-nav {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  border: 1px solid var(--b10);
  background: var(--card);
  color: var(--text-soft);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s;
}
.btn-nav:hover { background: #1a1a1f; }
.btn-nav:active { background: #1E1E22; }

.btn-today {
  height: 34px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--b10);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.14s;
}
.btn-today:hover { background: var(--card); }

/* ---------- schedule ---------- */
.schedule { flex: 1; padding: 16px 20px 120px; }
.grid-row { display: flex; }
.hour-col {
  width: 46px;
  flex-shrink: 0;
  position: relative;
  height: calc(13 * var(--hour));
}
.hour-label {
  position: absolute;
  left: 0;
  right: 10px;
  transform: translateY(-50%);
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}
.grid {
  flex: 1;
  min-width: 0;
  position: relative;
  height: calc(13 * var(--hour));
  background: repeating-linear-gradient(180deg, var(--grid-line) 0 1px, transparent 1px var(--hour));
  border-radius: 14px;
  border: 1px solid var(--grid-line);
  overflow: hidden;
  cursor: pointer;
}
.seg { position: absolute; left: 6px; right: 6px; }
.seg-inner {
  position: relative;
  height: 100%;
  border-radius: 12px;
  background: var(--booked);
  border: 1px solid var(--b10);
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.seg-by {
  position: absolute;
  right: 12px;
  bottom: 7px;
  max-width: 60%;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.seg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  flex-shrink: 0;
}
.seg-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-time {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
  padding-left: 15px;
}
.seg.just-added .seg-inner {
  border-color: rgba(255, 255, 255, 0.55);
  animation: pulseGlow 1.4s ease-out 2;
}

/* skeleton */
.skel {
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  animation: shimmer 1.3s ease-in-out infinite;
}

/* legend */
.legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 18px;
}
.legend .item { display: flex; align-items: center; gap: 8px; }
.legend .sw {
  width: 26px;
  height: 17px;
  border-radius: 6px;
  border: 1px solid var(--b10);
  flex-shrink: 0;
}
.legend .sw.open {
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 6px);
}
.legend .sw.booked { background: var(--booked); }
.legend .lbl { font-size: 12px; color: var(--text-dim); font-weight: 500; }

/* error banner */
.error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 122, 107, 0.10);
  border: 1px solid rgba(255, 122, 107, 0.25);
}
.error-banner .msg {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--error);
  line-height: 1.35;
}
.error-banner .retry {
  flex-shrink: 0;
  height: 30px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--b10);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}
.error-banner .retry:hover { background: var(--card); }

/* ---------- fixed add button ---------- */
.add-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
}
.add-bar-inner {
  width: 100%;
  max-width: 560px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 10, 11, 0), rgba(10, 10, 11, 0.92) 40%);
}
.btn-add {
  pointer-events: auto;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: var(--bg);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 34px rgba(255, 255, 255, 0.22);
  transition: transform 0.1s;
}
.btn-add:active { transform: translateY(1px); }
.btn-add .plus { font-size: 22px; font-weight: 700; line-height: 1; margin-top: -2px; }

/* ---------- add sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  background: var(--bg);
  overflow-y: auto;
  animation: sheetIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.sheet-inner {
  width: 100%;
  max-width: 560px;
  padding: 18px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
}
/* keep fixed-height items (fields, confirm button) from being squished
   when the sheet content is taller than the viewport on mobile */
.sheet-inner > * { flex-shrink: 0; }
.sheet-glow {
  position: absolute;
  top: -120px;
  left: -100px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 70%);
  pointer-events: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.btn-cancel {
  height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--b10);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.14s;
}
.btn-cancel:hover { background: #161619; }
.btn-cancel .chev { font-size: 16px; line-height: 1; }

.sheet-eyebrow {
  margin-top: 26px;
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
}
.sheet-title {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 12px 0 0;
  position: relative;
}

.field-group { margin-top: 22px; position: relative; }
.field-group.first { margin-top: 26px; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-label);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.field-label .opt {
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-left: 4px;
}
.field {
  width: 100%;
  height: 56px;
  border-radius: 14px;
  background: var(--card-alt);
  border: 1px solid var(--b10);
  color: var(--text);
  font-family: 'Archivo', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 0 18px;
  outline: none;
  color-scheme: dark;
}
.field:focus { border-color: rgba(255, 255, 255, 0.24); }
.field::placeholder { color: var(--text-mute); font-weight: 500; }

.field-row { display: flex; gap: 12px; }
.field-row > div { flex: 1; min-width: 0; }
.select-wrap { position: relative; }
select.field {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-wrap .caret {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-label);
  font-size: 11px;
}

/* summary card */
.summary {
  margin-top: 24px;
  padding: 6px 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--b07);
  position: relative;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}
.summary-row .k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.summary-row .v {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.summary-row .v .dur { color: var(--accent); font-weight: 700; }
.summary-div { height: 1px; background: var(--b07); }

.time-error {
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
  margin-top: 14px;
}

.btn-confirm {
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 16px;
  font-family: 'Archivo', sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 22px;
  position: relative;
  transition: all 0.14s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-confirm.enabled {
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.22);
}
.btn-confirm.disabled {
  background: var(--disabled);
  color: var(--text-mute);
  cursor: not-allowed;
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.4px solid rgba(10, 10, 11, 0.35);
  border-top-color: var(--bg);
  animation: spin 0.7s linear infinite;
}

/* ---------- narrow phones ---------- */
/* Only affects real mobile viewports; the desktop view keeps a wide
   viewport so the 560px layout there is untouched. */
@media (max-width: 480px) {
  .sheet-title { font-size: 27px; }
  .sheet-eyebrow { font-size: 10.5px; }
}

