/* ═══════════════════════════════════════════════════════════════════════
   THE MASTER SUITE — design system
   Pure white + true black + gold. Serif display, clean sans body. Serif display, clean sans body.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F4F4;
  --surface-3: #EAEAEA;
  --ink: #0A0A0A;
  --ink-2: #333333;
  --muted: #6B6B6B;
  --line: #E6E6E6;
  --line-2: #D2D2D2;
  --accent: #AE7A32;
  --accent-2: #E2B478;
  --accent-ink: #0A0A0A;
  --accent-soft: #F4F4F4;
  --on-ink: #E3B981;
  --good: #2E6A4E; --good-soft: #E3F0E8;
  --warn: #9A5B12; --warn-soft: #F7EAD7;
  --bad: #A23B3B; --bad-soft: #F6E1DF;
  --info: #3C5A7A; --info-soft: #E3EAF2;
  /* One quiet turquoise. It means "open": a free slot, a fresh lead, something
     available to take. The only cool accent in the system, desaturated so it
     never competes with the gold. */
  --open: #1D7A8C; --open-soft: #DBEDF2;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.18);
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --f-display: 'Sora', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rail: 232px;
  --top: 60px;
  color-scheme: light;
}
/* Dark is opt-in only: the app opens light for everyone, and the Dark mode
   toggle in the menu sets data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto-dark"] {
    --bg: #050505; --surface: #101010; --surface-2: #181818; --surface-3: #222222;
    --ink: #F5F5F5; --ink-2: #D4D4D4; --muted: #9A9A9A; --line: #262626; --line-2: #363636;
    --accent: #E3B981; --accent-2: #EECD9B; --accent-ink: #0A0A0A; --accent-soft: #1E1A12; --on-ink: #0A0A0A;
    --good: #6FBF95; --good-soft: #15261D; --warn: #E0A457; --warn-soft: #2A1F12;
    --bad: #E58A82; --bad-soft: #2C1715; --info: #8FB0D4; --info-soft: #152029;
    --open: #6BC2D6; --open-soft: #0E2329;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050505; --surface: #101010; --surface-2: #181818; --surface-3: #222222;
  --ink: #F5F5F5; --ink-2: #D4D4D4; --muted: #9A9A9A; --line: #262626; --line-2: #363636;
  --accent: #E3B981; --accent-2: #EECD9B; --accent-ink: #0A0A0A; --accent-soft: #1E1A12; --on-ink: #0A0A0A;
  --good: #6FBF95; --good-soft: #15261D; --warn: #E0A457; --warn-soft: #2A1F12;
  --bad: #E58A82; --bad-soft: #2C1715; --info: #8FB0D4; --info-soft: #152029;
    --open: #6BC2D6; --open-soft: #0E2329;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
/* default icon size — any svg without explicit sizing (class rules and width attributes still win) */
svg:not([width]) { width: 18px; height: 18px; flex-shrink: 0; }
.move-num svg { width: 13px; height: 13px; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
.display { font-family: var(--f-display); font-weight: 400; letter-spacing: -.01em; }
h1.display { font-size: clamp(30px, 4vw, 40px); line-height: 1.05; }
h2.display { font-size: 26px; line-height: 1.15; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -.005em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── layout ── */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--rail) 1fr; }
.rail {
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
  background: var(--surface); display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; font-family: var(--f-display); font-size: 20px; flex-shrink: 0;
}
.brand-name { font-family: var(--f-display); font-size: 20px; line-height: 1; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 3px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pillar {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.pillar:hover { background: var(--surface-2); text-decoration: none; }
.pillar.active { background: var(--ink); color: var(--bg); }
.pillar.active svg { color: var(--on-ink); }
.pillar svg { width: 19px; height: 19px; flex-shrink: 0; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.rail-foot .pillar { font-weight: 500; font-size: 13px; padding: 9px 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 15;
}
.topbar .grow { flex: 1; min-width: 0; }
.crumb { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 600; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }
.dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--line); flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.subnav {
  display: flex; gap: 4px; padding: 0 28px; border-bottom: 1px solid var(--line); overflow-x: auto;
  scrollbar-width: none; background: var(--bg);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  padding: 13px 12px 11px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; text-decoration: none;
}
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--ink); border-bottom-color: var(--accent); }

.content { padding: 28px; max-width: 1240px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .lead { color: var(--muted); margin-top: 6px; max-width: 640px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── mobile ── */
.tabbar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 0 16px; }
  .subnav { padding: 0 12px; }
  .content { padding: 20px 16px 110px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; color: var(--muted); padding: 4px 0; text-decoration: none; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active svg { color: var(--accent); }
  .hide-sm { display: none !important; }
}
@media (min-width: 901px) { .show-sm { display: none !important; } }

/* ── surfaces ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.dark .display, .card.dark h3 { color: var(--on-ink); }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px 16px; }
.card.link { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.card.dark .muted { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.card.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.s { gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .g4.keep2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ── stats ── */
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--f-display); font-size: 34px; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .sub.good { color: var(--good); } .stat .sub.bad { color: var(--bad); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 14px var(--f-body); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); }
.btn.gold { background: var(--accent-2); color: var(--accent-ink); border-color: var(--accent-2); }
.btn.gold:hover { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font: 600 13px var(--f-body); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ── forms ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date],
input[type=time], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: 400 15px var(--f-body); min-width: 0;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
input[type=file] { font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.input-prefix { position: relative; }
.input-prefix > b { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; }
.input-prefix input { padding-left: 26px; }

/* ── lists / tables ── */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.item:last-child { border-bottom: 0; }
.item.click { cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.item.click:hover { background: var(--surface-2); }
.item .main-col { flex: 1; min-width: 0; }
.item .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--surface-2); }

/* ── badges / chips ── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--accent-soft); color: var(--accent); }
.badge.open { background: var(--open-soft); color: var(--open); }
/* A single 7px dot before a label. Lists stay black and white; the one point
   of colour is whatever actually has a state worth reading. */
.sdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.sdot.good { background: var(--good); } .sdot.warn { background: var(--warn); }
.sdot.bad { background: var(--bad); }   .sdot.info { background: var(--info); }
.sdot.gold { background: var(--accent); } .sdot.open { background: var(--open); }
.with-dot { display: inline-flex; align-items: center; gap: 7px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: 600 13px var(--f-body); color: var(--ink-2); cursor: pointer; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── progress ── */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .5s ease; }
.bar.good > i { background: var(--good); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); flex-shrink: 0; }
.ring > span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 14px; }

/* ── empty / loading ── */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .display { color: var(--ink); font-size: 22px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 48px 0; }
.pending-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); }

/* ── modal ── */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; gap: 12px; }
.modal-head h2 { font-family: var(--f-display); font-size: 24px; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 700px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* ── menus / popovers ── */
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); min-width: 240px; padding: 6px; z-index: 50; }
.menu a, .menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; font: 500 14px var(--f-body); color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu svg { width: 16px; height: 16px; flex-shrink: 0; }
.pending-note svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .notif { display: block; }
.pop-wrap { position: relative; }

/* ── toast ── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .2s; max-width: 90vw; }
.toast.err { background: var(--bad); color: #fff; }
@media (max-width: 900px) { .toasts { bottom: 90px; } }

/* ── next moves ── */
.move { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.move:last-child { border-bottom: 0; }
.move-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.move h4 { font-size: 15px; font-weight: 700; }
.move p { margin: 3px 0 8px; font-size: 13px; color: var(--muted); }

/* ── calendar ── */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 6px 0; letter-spacing: .06em; text-transform: uppercase; }
.cal-day { min-height: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); cursor: pointer; overflow: hidden; }
.cal-day.out { opacity: .45; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day .d { font-size: 12px; font-weight: 700; }
.cal-ev { font-size: 11px; padding: 2px 5px; border-radius: 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--accent); }
.cal-ev.requested { background: var(--warn-soft); border-left-color: var(--warn); }
.cal-ev.completed { background: var(--good-soft); border-left-color: var(--good); }
.cal-ev.confirmed { background: var(--info-soft); border-left-color: var(--info); }
.cal-ev.checked_in { background: var(--open-soft); border-left-color: var(--open); }
.cal-ev.cancelled, .cal-ev.no_show { opacity: .5; text-decoration: line-through; }
@media (max-width: 700px) { .cal-day { min-height: 54px; } .cal-ev { display: none; } .cal-day .count { display: block; } }
.cal-day .count { display: none; font-size: 10px; color: var(--accent); font-weight: 800; }
.timeline { position: relative; border-left: 1px solid var(--line); margin-left: 54px; }
.tl-hour { position: relative; height: 64px; border-top: 1px solid var(--line); }
.tl-hour > span { position: absolute; left: -54px; top: -8px; font-size: 11px; color: var(--muted); width: 46px; text-align: right; }
.tl-ev { position: absolute; left: 6px; right: 6px; border-radius: 8px; padding: 6px 8px; font-size: 12px; background: var(--accent-soft); border-left: 3px solid var(--accent); overflow: hidden; cursor: pointer; }
.tl-ev.requested { background: var(--warn-soft); border-left-color: var(--warn); }
.tl-ev.confirmed { background: var(--info-soft); border-left-color: var(--info); }
.tl-ev.checked_in { background: var(--open-soft); border-left-color: var(--open); }
.tl-ev.completed { background: var(--good-soft); border-left-color: var(--good); }
.tl-ev.cancelled, .tl-ev.no_show { opacity: .5; text-decoration: line-through; }
.tl-ev.completed { background: var(--good-soft); border-left-color: var(--good); }
.tl-ev b { display: block; font-size: 12.5px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { height: 40px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font: 600 13px var(--f-body); cursor: pointer; color: var(--ink); }
.slot:hover { border-color: var(--accent); }
.slot.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── misc ── */
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo-grid figure { margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); position: relative; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-grid figcaption { font-size: 12px; padding: 6px 8px; color: var(--muted); }
.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.step { flex-shrink: 0; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); cursor: pointer; border: 1px solid transparent; }
.step.done { background: var(--good-soft); color: var(--good); }
.step.active { background: var(--ink); color: var(--bg); }
.prose { font-size: 15.5px; line-height: 1.75; color: var(--ink-1); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.2;
  letter-spacing: -.02em; margin: 1.7em 0 .5em; color: var(--ink-0); }
.prose h3 { font-size: 18.5px; font-weight: 600; margin: 1.6em 0 .45em; color: var(--ink-0); }
.prose h4 { font-size: 15.5px; font-weight: 700; letter-spacing: .01em; margin: 1.4em 0 .4em; color: var(--ink-0); }
.prose strong { font-weight: 650; color: var(--ink-0); }
.prose em { font-style: italic; }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: .9em;
  background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 1.35em; }
.prose li { margin: 0 0 .42em; }
.prose blockquote { margin: 1.3em 0; padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent); color: var(--ink-1); font-style: italic; }
.prose blockquote strong { font-style: normal; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.9em 0; }
@media (max-width: 640px) { .prose { font-size: 15px; } .prose h2 { font-size: 22px; } }
.notice { font-size: 12px; color: var(--muted); border-left: 3px solid var(--line-2); padding: 4px 0 4px 12px; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: var(--r); overflow: hidden; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── auth / public ── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: #050505; color: #FFFFFF; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(227,185,129,.30); }
.auth-art::before { content: ''; position: absolute; right: -40px; bottom: -40px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(227,185,129,.18); }
.auth-art h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(32px, 3.8vw, 50px); line-height: 1.04; letter-spacing: -.034em; }
.auth-art h1 em { color: #E3B981; font-style: normal; }
.pillars-list { display: grid; grid-template-columns: repeat(3, auto); gap: 6px 28px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #E3B981; font-weight: 700; width: max-content; }
.sa-credit { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 9px; }
.sa-credit span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.42); }
.sa-credit img { width: 178px; height: auto; display: block; opacity: .92; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form .box { width: 100%; max-width: 400px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { padding: 28px 20px; min-height: 280px; } .pillars-list { grid-template-columns: repeat(2, auto); } }
@media (max-width: 900px) { .auth-art { gap: 20px; } .sa-credit img { width: 142px; } }
.tabs-inline { display: flex; background: var(--surface-2); padding: 4px; border-radius: 11px; gap: 4px; }
.tabs-inline button { flex: 1; height: 36px; border: 0; background: none; border-radius: 8px; font: 700 13px var(--f-body); color: var(--muted); cursor: pointer; }
.tabs-inline button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.public { max-width: 880px; margin: 0 auto; padding: 0 16px 60px; }
.pub-hero { padding: 40px 0 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pub-logo { width: 96px; height: 96px; border-radius: 24px; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-family: var(--f-display); font-size: 44px; overflow: hidden; flex-shrink: 0; }
.pub-logo img { width: 100%; height: 100%; object-fit: cover; }
.stars { color: var(--accent); letter-spacing: 2px; }

@media print {
  .rail, .topbar, .subnav, .tabbar, .no-print { display: none !important; }
  .app { display: block; } .content { padding: 0; } .card { box-shadow: none; border-color: #ccc; }
}

/* ── Locked account: trial ended or subscription lapsed ── */
.lock-wrap { display: flex; justify-content: center; padding: 8px 0 40px; }
.lock-card { width: 100%; max-width: 900px; }
.lock-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.lock-plan { display: flex; flex-direction: column; gap: 4px; }
.lock-price { font-family: var(--f-display); font-size: 34px; line-height: 1; margin: 12px 0 4px; }
.lock-price small { font-size: 13px; color: var(--muted); font-family: var(--f-body); margin-left: 3px; }
.lock-hl { list-style: none; margin: 10px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.lock-hl li { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.lock-hl svg { width: 13px; height: 13px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.lock-plan .btn { margin-top: auto; }

/* Platform wordmark in the rail (tenants with their own logo keep .brand-mark) */
.brand-logo { display: block; padding: 6px 8px 18px; }
.brand-logo img { width: 150px; height: auto; display: block; }
.brand-logo .brand-sub { margin-top: 8px; max-width: 160px; }
