:root {
  --theme-primary: #c24e68;
  --theme-primary-dark: #9e3a52;
  --theme-primary-soft: #f8e6ea;
  --ink: #1c1410;
  --cream: #fff6e8;
  --gold: #f3c24a;
  --gold-deep: #c98912;
  --bg: #fbf4f1;
  --card: #ffffff;
  --text: #2a1c20;
  --muted: #7a5e66;
  --line: #eedfe3;
  --ok: #2f8a6a;
  --ok-soft: #e4f3ec;
  --rest: #8a7a74;
  --rest-soft: #f3eeea;
  --open-soft: #f8f1ea;
  --shadow: 0 8px 28px rgba(44, 20, 28, 0.07);
  --radius: 20px;
  --nav-h: 72px;
  --header-h: 56px;
  font-family: "Noto Sans CJK HK", "Noto Sans CJK TC", "Noto Sans", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ead9dc;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

img { display: block; max-width: 100%; }

.app {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

a.btn {
  text-decoration: none;
  color: inherit;
}
a.btn-primary { color: #fff; }
a.btn-ghost { color: var(--theme-primary-dark); }
a.btn-light { color: var(--text); }


/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 244, 241, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px 8px;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.brand-text {
  flex: 1;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.draft-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-primary-dark);
  background: var(--theme-primary-soft);
  border: 1px solid #efcdd4;
  border-radius: 999px;
  padding: 4px 8px;
}

.draft-banner {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  background: var(--cream);
  border-radius: 12px;
  padding: 6px 10px;
  line-height: 1.35;
}

/* ---------- screens ---------- */
.screens {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px calc(var(--nav-h) + 24px);
}

.screen { display: none; }
.screen.is-on { display: block; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-meta {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- section ---------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 18px 0 8px;
  letter-spacing: 0.02em;
}

.section-label .count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  background: var(--cream);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px 11px;
  margin-bottom: 8px;
}

.card-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.time-col {
  flex: 0 0 58px;
  text-align: left;
}

.time-main {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.time-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.card-body { flex: 1; min-width: 0; }

.svc {
  font-weight: 700;
  font-size: 16px;
}

.who {
  font-size: 14px;
  color: var(--text);
  margin-top: 2px;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.pill {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1.3;
}

.pill-wait { background: #fff3cc; color: #8a5a00; }
.pill-ok { background: var(--ok-soft); color: #1d6a50; }
.pill-rest { background: var(--rest-soft); color: var(--rest); }
.pill-open { background: var(--open-soft); color: #8a6a4a; }
.pill-note { background: var(--theme-primary-soft); color: var(--theme-primary-dark); }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
}

.btn img { width: 20px; height: 20px; }

.btn-primary {
  background: var(--theme-primary);
  color: #fff;
}

.btn-primary:active { background: var(--theme-primary-dark); }

.btn-ghost {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-dark);
}

.btn-ghost:active { background: #f0d4da; }

.btn:focus-visible {
  outline: 3px solid #f3c24a;
  outline-offset: 2px;
}

/* ---------- timetable ---------- */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}

.dow {
  border: none;
  background: transparent;
  padding: 8px 0 6px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 58px;
  color: var(--muted);
}

.dow .w { font-size: 11px; }
.dow .d { font-size: 16px; font-weight: 700; }
.dow.is-on {
  background: var(--theme-primary);
  color: #fff;
}
.dow.is-on .w { color: rgba(255,255,255,0.8); }

.timeline { position: relative; padding-left: 0; }

.slot {
  display: grid;
  grid-template-columns: 58px 16px 1fr;
  gap: 0 8px;
  min-height: 56px;
  align-items: stretch;
}

.slot-time {
  padding-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.slot-rail {
  position: relative;
}

.slot-rail::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.slot:first-child .slot-rail::before { top: 12px; }
.slot:last-child .slot-rail::before { bottom: auto; height: 12px; }

.dot {
  position: absolute;
  left: 2px;
  top: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line);
  border: 2px solid var(--bg);
  z-index: 1;
}

.slot.is-book .dot { background: var(--theme-primary); }
.slot.is-wait .dot { background: var(--gold-deep); }
.slot.is-rest .dot { background: var(--rest); }
.slot.is-open .dot { background: #e4cfc4; }

.slot-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.slot.is-open .slot-card {
  background: transparent;
  box-shadow: none;
  border: 1px dashed #e2cfc8;
  color: var(--muted);
}

.slot.is-rest .slot-card {
  background: var(--rest-soft);
  box-shadow: none;
}

/* ---------- clients ---------- */
.search {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 0 14px;
  margin-bottom: 12px;
}

.client {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  font-size: 15px;
}

.client .who { font-weight: 700; font-size: 16px; }
.quiet { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- booking detail ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--theme-primary-dark);
  font-weight: 700;
  margin: -4px 0 8px;
}

.back img { width: 28px; height: 28px; }

.detail-hero {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px 18px 18px;
  margin-bottom: 12px;
}

.detail-kicker {
  font-size: 12px;
  font-weight: 700;
  color: #8a5a00;
  background: #fff3cc;
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

.detail-when {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.kv {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px 10px;
  margin-top: 16px;
  font-size: 15px;
}

.kv dt { color: var(--muted); font-size: 13px; padding-top: 2px; }
.kv dd { margin: 0; font-weight: 600; }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + 16px);
  background: var(--ink);
  color: var(--cream);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 30;
}

.toast.is-on { display: block; }

/* ---------- bottom nav ---------- */
.nav {
  position: sticky;
  bottom: 0;
  z-index: 20;
  height: var(--nav-h);
  margin-top: auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px 8px 10px;
}

.nav-btn {
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  min-height: 56px;
  border-radius: 14px;
}

.nav-btn img {
  width: 28px;
  height: 28px;
}

.nav-btn.is-on {
  color: var(--theme-primary-dark);
  background: var(--theme-primary-soft);
}

.hidden-nav .nav { display: none; }
.hidden-nav .screens { padding-bottom: 24px; }
.hidden-nav .toast { bottom: 16px; }

/* ---------- prototype v2 additions ---------- */
.nav { grid-template-columns: repeat(4, 1fr); }

.toolbar {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.toolbar .btn { min-height: 42px; font-size: 13px; padding: 0 10px; }

.btn-compact { flex: 1; }
.btn-wide { flex: 1 1 100%; }
.btn-light {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-light:active { background: #f6eeef; }
.btn-danger-ghost {
  background: #f8ecec;
  color: #8a3a3a;
}

.icon-btn img,
.btn img[src*="whatsapp"],
.btn img[src*="phone"] {
  width: 18px;
  height: 18px;
}

.pill-hold { background: #f3e4c8; color: #7a4e16; }
.pill-new { background: var(--open-soft); color: #8a6a4a; }
.pill-regular { background: var(--theme-primary-soft); color: var(--theme-primary-dark); }
.pill-away { background: #fff3cc; color: #8a5a00; }

.reminder-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 10px 12px;
  margin: 0 0 12px;
  color: inherit;
}
.reminder-chip > div { flex: 1; min-width: 0; }
.reminder-chip .chip-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-primary-dark);
  margin-bottom: 2px;
}
.reminder-chip .chip-body { font-size: 13px; line-height: 1.35; }
.reminder-chip .chev { color: var(--muted); flex: 0 0 auto; font-weight: 700; }

.link-text {
  background: none;
  border: none;
  color: var(--theme-primary-dark);
  font-weight: 700;
  font-size: 13px;
  padding: 0;
  min-height: 0;
}

.page-head .link-text { margin-bottom: 2px; }

.dow { position: relative; }
.dow.is-leave { color: var(--rest); }
.dow.is-leave .d { font-weight: 700; }
.dow.is-leave.is-on { background: var(--rest); color: #fff; }
.dow .mark {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
}
.dow.is-on .mark { color: rgba(255,255,255,0.85); }

.hold-note {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 10px;
  line-height: 1.4;
}

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: none;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 14px 14px;
  color: inherit;
  min-height: 64px;
}
.menu-row:active { background: #fffaf9; }
.menu-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  font-weight: 700;
  font-size: 14px;
}
.menu-row .who { font-weight: 700; font-size: 15px; }
.menu-row .meta { margin-top: 1px; }
.menu-row .chev { margin-left: auto; color: var(--muted); font-weight: 700; }

.link-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.link-box .kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.link-slug {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  word-break: break-all;
  color: var(--ink);
}
.later-note {
  font-size: 12px;
  color: var(--muted);
  margin: 16px 0 4px;
  line-height: 1.45;
}

.svc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.svc-row .svc-main { flex: 1; min-width: 0; }
.svc-row .price {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.svc-row.is-pick {
  cursor: pointer;
  width: 100%;
  border: none;
  background: var(--card);
  text-align: left;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
  color: inherit;
}
.svc-row.is-pick.is-on {
  outline: 2px solid var(--theme-primary);
  outline-offset: 0;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.switch-row .lab { flex: 1; font-weight: 700; font-size: 14px; }
.switch-row .lab span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 48px;
  border: none;
  border-radius: 999px;
  background: #e2d4d6;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.16);
  transition: transform .16s ease;
}
.switch.is-on { background: var(--theme-primary); }
.switch.is-on::after { transform: translateX(20px); }

.leave-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 8px 0 14px; }
.leave-day {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  min-height: 72px;
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text);
}
.leave-day .w { font-size: 11px; color: var(--muted); }
.leave-day .d { font-size: 16px; font-weight: 700; }
.leave-day .st { font-size: 10px; font-weight: 700; color: var(--muted); }
.leave-day.is-off {
  background: var(--rest-soft);
  border-color: #e2d6d0;
}
.leave-day.is-off .st { color: var(--rest); }
.leave-day.is-today { outline: 2px solid var(--theme-primary); outline-offset: 0; }

.pass-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin: 8px 0 12px;
}
.pass-box {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.key {
  min-height: 48px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 20px;
  font-weight: 700;
}
.key:active { background: var(--theme-primary-soft); }
.key-mute { font-size: 13px; color: var(--muted); }

.reminder-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px 16px 14px 14px;
  display: flex;
  gap: 12px;
  margin: 8px 0 14px;
  border: 1px solid var(--line);
}
.reminder-card .app-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}
.reminder-card .app-name { font-size: 12px; font-weight: 700; }
.reminder-card .when { font-size: 11px; color: var(--muted); }
.reminder-card .body { font-size: 14px; margin-top: 4px; line-height: 1.4; }

/* client card as button */
button.card, button.slot-card {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  border: none;
}
button.card { display: block; }
.client-card { cursor: pointer; }

/* sheets */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 20, 28, 0.36);
  z-index: 40;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.overlay.is-on { display: flex; }
.sheet {
  width: 100%;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px 24px;
  box-shadow: 0 -8px 30px rgba(44, 20, 28, 0.12);
  max-height: 86%;
  overflow: auto;
}
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #e2d4d6;
  margin: 0 auto 12px;
}
.sheet-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.sheet-lead { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
.compose-box {
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.choice {
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
  color: inherit;
}
.choice .who { font-weight: 700; }
.choice:active { background: #fffaf9; }

/* public booking */
.slot-pick {
  width: 100%;
  text-align: left;
  border: 1px dashed #e2cfc8;
  background: transparent;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: inherit;
  font: inherit;
}
.slot-pick.is-on {
  border-style: solid;
  border-color: var(--theme-primary);
  background: #fff;
  box-shadow: var(--shadow);
}
.slot-pick.is-locked,
.slot-pick:disabled {
  border-style: solid;
  border-color: var(--line);
  background: #f3eeea;
  color: var(--muted);
}

.status-banner {
  background: var(--ok-soft);
  color: #1d6a50;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.app.is-bare .nav { display: none; }
.app.is-bare .screens { padding-bottom: 28px; }
.app.is-bare .toast { bottom: 16px; }
.app.is-bare .draft-banner { background: var(--cream); }

.preview-return {
  display: block;
  width: 100%;
  margin: 16px 0 4px;
  text-align: center;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-height: 40px;
}

.tiny-actions { margin-top: 10px; }

.svc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.svc-tile {
  border: none;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 12px;
  text-align: left;
  color: inherit;
  font: inherit;
  min-height: 72px;
}
.svc-tile.is-on { outline: 2px solid var(--theme-primary); outline-offset: 0; }
.svc-tile .svc { font-size: 15px; }
.locked-line {
  font-size: 13px;
  color: var(--muted);
  background: #f3eeea;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

.field { margin-bottom: 10px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0 12px;
}
.slot-card.is-tap { cursor: pointer; }


/* ---------- responsive: tablet & desktop ---------- */
@media (min-width: 768px) {
  html { font-size: 17px; }
  body {
    min-height: 100vh;
    padding: 24px;
  }
  .app {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    min-height: 0;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(44, 20, 28, 0.14);
    overflow: hidden;
  }
  .screens { padding: 12px 28px calc(var(--nav-h) + 28px); }
  .topbar { padding: 14px 28px 12px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-name { font-size: 18px; }
  .page-title { font-size: 28px; }
  .page-meta { font-size: 14px; }
  .btn { min-height: 52px; font-size: 16px; }
  .detail-when { font-size: 26px; }
  .card { padding: 16px 18px 15px; }
  #client-list,
  #service-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  #client-list .card,
  #service-list .card { margin-bottom: 0; }
  .sheet {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 22px 22px 0 0;
  }
  .hidden-nav .screens { padding-bottom: 32px; }
}

@media (min-width: 1100px) {
  html { font-size: 18px; }
  body { padding: 28px 32px; }
  .app {
    max-width: 1180px;
    height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    min-height: 0;
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;
  }
  .topbar {
    grid-column: 1 / -1;
    padding: 14px 32px 12px;
  }
  .screens {
    grid-column: 2;
    grid-row: 2;
    padding: 20px 36px 36px;
  }
  .nav {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    bottom: auto;
    height: auto;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 20px 14px;
    border-top: none;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
  }
  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 52px;
    padding: 0 14px;
    font-size: 15px;
    width: 100%;
  }
  .app.is-bare,
  .app.hidden-nav {
    grid-template-columns: 1fr;
  }
  .app.is-bare .screens,
  .app.hidden-nav .screens {
    grid-column: 1;
    padding: 20px 36px 36px;
  }
  .page-title { font-size: 32px; }
  .today-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 32px;
    align-items: start;
  }
  .menu-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #screen-login .keypad,
  #screen-login .pass-row,
  #screen-login .link-box,
  #screen-login .switch-row,
  #screen-login .actions,
  #screen-login .btn-wide {
    max-width: 440px;
  }
  .svc-grid { grid-template-columns: repeat(4, 1fr); }
}


/* ---------- intro, signup, named routes ---------- */
.intro-hero {
  text-align: center;
  padding: 18px 8px 8px;
}
.intro-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
}
.intro-hero .page-title { font-size: 28px; }
.intro-hero .page-meta {
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}
.intro-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin: 8px 0 16px;
}
.intro-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
.intro-list li { margin: 0 0 8px; }
.intro-list .mono,
.mono {
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-all;
}
.intro-actions { flex-wrap: wrap; }
.intro-actions .btn { flex: 1 1 100%; }
.signup-form { margin-top: 4px; }
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.4;
}
.signup-error {
  background: #f8ecec;
  color: #8a3a3a;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px;
}
.signup-error[hidden],
#login-error[hidden],
#public-notfound[hidden],
#signup-done[hidden] { display: none !important; }
.signup-done .status-banner { margin-top: 4px; }
.input-bad {
  border-color: #c24e68 !important;
  outline: 2px solid #f0d4da;
}

@media (min-width: 768px) {
  .intro-hero .page-title { font-size: 36px; }
  .intro-mark { width: 80px; height: 80px; }
  .intro-actions .btn { flex: 1 1 calc(50% - 6px); }
  .signup-form,
  #signup-done,
  #screen-home .intro-card,
  #screen-login .link-box,
  #screen-public { max-width: 640px; }
}
@media (min-width: 1100px) {
  .intro-hero .page-title { font-size: 40px; }
  #screen-home .intro-actions,
  #screen-home .later-note,
  #screen-signup .page-head,
  #screen-signup .back,
  .signup-form,
  #signup-done {
    max-width: 640px;
  }
}

.week-guest {
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
}


/* ---------- simulated inbox & account ---------- */
.inbox-chip {
  flex: 0 0 auto;
  position: relative;
  font-size: 11px;
  font-weight: 700;
  color: var(--theme-primary-dark);
  background: #fff;
  border: 1px solid #efcdd4;
  border-radius: 999px;
  padding: 4px 8px;
  min-height: 28px;
  cursor: pointer;
}
.inbox-chip:focus-visible {
  outline: 3px solid #f3c24a;
  outline-offset: 2px;
}
.inbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 10px;
}
.inbox-badge[hidden] { display: none !important; }
.app.is-guest .inbox-chip { display: none; }
.mail-card,
.inbox-item {
  width: 100%;
  text-align: left;
  border: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.inbox-item.is-unread { outline: 2px solid var(--theme-primary-soft); }
.inbox-item .who { font-weight: 700; font-size: 14px; }
.inbox-item .meta { margin-top: 2px; }
.mail-letter {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 18px;
  line-height: 1.55;
}
.mail-letter .mail-from,
.mail-letter .mail-to { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.mail-letter h2 { font-size: 18px; margin: 10px 0 12px; letter-spacing: -0.02em; }
.mail-letter p { margin: 0 0 10px; font-size: 14px; }
.mail-letter .mono { display: inline-block; margin: 4px 0 10px; }
#forgot-done[hidden],
#account-login-error[hidden],
#forgot-error[hidden] { display: none !important; }

@media (min-width: 768px) {
  #screen-account-login .signup-form,
  #screen-forgot .signup-form,
  #screen-activate,
  #screen-reset,
  #screen-auth,
  #screen-inbox,
  #screen-mail,
  #forgot-done { max-width: 640px; }
}
