/* Stewart Road brand colors (from stewartroad.org site.css):
   cream #FFFDFA · stone #CFCAC9 · stone-soft #EFEBE9 · sky #76C5DD · blue #205796 · blue-deep #17406F · ink #242121 · ink-soft #5E5858 */
:root {
  --bg: #EFEBE9; --surface: #FFFDFA; --ink: #242121; --muted: #5E5858; --soft: #463F3F;
  --line: #DFDAD8; --line-strong: #8C8584;
  --accent: #205796; --accent-dark: #17406F; --accent-soft: #E4EEF7; --sky: #76C5DD;
  --t1-bg: #F7E4DA; --t1: #9A3E1C; --t2-bg: #E4EEF7; --t2: #17406F; --t3-bg: #EFEBE9; --t3: #463F3F;
  --bad-bg: #FBE7E6; --bad: #B42318; --warn-bg: #FFF1D3; --warn: #7F4D00; --ok-bg: #E4F1EA; --ok: #2A6640;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: 'Space Grotesk', sans-serif; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--soft); color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-ghost { min-height: 40px; font-size: 15px; font-weight: 500; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 17px; }
.btn-xl { min-height: 56px; font-size: 17px; width: 100%; }
.btn-soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }

/* sign in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-brand h1 { font-size: 30px; }
.login-brand p { margin: 0; }
.login-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card p { margin: 0; }
.login-msg { background: var(--warn-bg); color: var(--warn); padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.mark { width: 40px; height: 40px; color: var(--accent); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.mark .logo { width: 100%; height: 100%; display: block; }
.mark-lg { width: 72px; height: 72px; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-row { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; line-height: 1.1; }
.me { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.me-name { font-weight: 600; font-size: 15px; }
.search-row { padding-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.search-label { font-size: 14px; font-weight: 600; color: var(--soft); }
.search-box { position: relative; display: flex; }
.search-box svg { position: absolute; left: 14px; top: 14px; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 16px 0 44px; font-size: 17px; background: var(--surface); }
.tabs { padding-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 42px; padding: 0 14px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); }
.tab[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab .count { font-size: 13px; padding: 1px 8px; border-radius: 999px; background: var(--t3-bg); color: var(--t3); }
.tab[aria-current="true"] .count { background: rgba(255,255,255,.22); color: #fff; }

/* layout */
.main { padding-top: 20px; padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.list-pane { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.detail-pane { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
body.narrow .main { display: block; }
body.narrow.show-detail .list-pane { display: none; }
body.narrow:not(.show-detail) .detail-pane { display: none; }
.list-head h2 { font-size: 24px; }
.list-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sort { min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--soft); border: 1px solid var(--line-strong); }
.sort[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border: 2px solid var(--accent); }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { width: 100%; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 14px; cursor: pointer; background: var(--surface); border: 2px solid var(--line); }
.row[aria-current="true"] { border-color: var(--accent); }
.row-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; }
.row-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.row-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-name { font-weight: 600; font-size: 17px; }
.row-sub { color: var(--muted); font-size: 14px; }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); }

/* avatars + pills */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; font-size: 17px; }
.avatar-lg { width: 104px; height: 104px; font-size: 36px; font-family: 'Space Grotesk', sans-serif; border: 3px solid var(--accent-soft); }
.c0 { background: #E4EEF7; color: #17406F; } .c1 { background: #FDEBDD; color: #9A3412; } .c2 { background: #E4ECFB; color: #1E4FA8; }
.c3 { background: #EFE7F6; color: #5B3A86; } .c4 { background: #E7F3EA; color: #2F6B3A; } .c5 { background: #FFF3D6; color: #7A4A00; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tier-1 { background: var(--t1-bg); color: var(--t1); } .tier-2 { background: var(--t2-bg); color: var(--t2); } .tier-3 { background: var(--t3-bg); color: var(--t3); }
.tier-none { background: var(--surface); color: var(--t3); border: 1px solid var(--line-strong); }
.due { display: inline-block; padding: 4px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.due-bad { background: var(--bad-bg); color: var(--bad); } .due-warn { background: var(--warn-bg); color: var(--warn); }
.due-ok { background: var(--ok-bg); color: var(--ok); } .due-none { background: var(--t3-bg); color: var(--t3); }

/* detail */
.detail { padding: 24px; display: flex; flex-direction: column; gap: 22px; }
.placeholder { padding: 40px 28px; text-align: center; color: var(--muted); font-size: 17px; }
.d-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.d-who { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.d-face { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.d-face a { font-size: 13px; font-weight: 600; }
.d-name { display: flex; flex-direction: column; gap: 6px; }
.d-name h2 { font-size: 28px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.d-contact { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.assign-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; background: var(--bg); border-radius: 12px; }
.assign-box .handoff { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
select { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; font-size: 15px; background: var(--surface); max-width: 100%; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block h3 { font-size: 18px; }
textarea { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 16px; line-height: 1.45; resize: vertical; background: var(--surface); min-height: 110px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tier-btn { min-height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--surface); border: 2px solid var(--accent); cursor: pointer; }
.tier-btn strong { font-size: 16px; } .tier-btn span { font-size: 13px; }
.tier-btn[disabled] { background: var(--bg); color: var(--muted); border-color: var(--line); cursor: default; }
.history { display: flex; flex-direction: column; gap: 12px; }
.h-item { display: flex; gap: 12px; }
.h-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); margin-top: 7px; flex: 0 0 10px; }
.h-item.note .h-dot { background: var(--accent); }
.h-meta { font-size: 14px; color: var(--muted); }
.h-meta strong { color: var(--ink); }
.h-text { white-space: pre-wrap; }
.step-help { background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--soft); white-space: pre-line; }
.step-help summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 14px 16px; font-weight: 500; }

/* toast + modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 10px 10px 20px; border-radius: 14px; font-size: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 16px; z-index: 20; }
.toast span { padding: 6px 0; }
.toast button { min-height: 44px; padding: 0 18px; border-radius: 10px; border: none; background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.modal { position: fixed; inset: 0; background: rgba(27,31,35,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.dialog { width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.dialog h2 { font-size: 24px; line-height: 1.25; }
.dialog p { margin: 0; color: var(--soft); font-size: 17px; }
.dialog .btn { min-height: 56px; font-size: 18px; width: 100%; }
.dialog-actions { display: flex; flex-direction: column; gap: 10px; }

/* guide pages */
.guide-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.guide-top .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.guide { max-width: 760px; margin: 0 auto; padding: 28px 16px 64px; }
.guide h1 { font-size: 34px; line-height: 1.15; margin-bottom: 8px; }
.guide h2 { font-size: 26px; margin: 44px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.guide h3 { font-size: 19px; margin: 26px 0 8px; }
.guide p, .guide li { font-size: 17px; line-height: 1.6; }
.guide li { margin-bottom: 6px; }
.guide .lead { font-size: 18px; color: var(--soft); }
.guide table { width: 100%; border-collapse: collapse; margin: 12px 0 8px; font-size: 16px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.guide th, .guide td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.guide th { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.guide .table-wrap { overflow-x: auto; }
.guide .toc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 20px 0; }
.guide .toc ul { margin: 6px 0 0; padding-left: 20px; }
.guide .callout { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin: 14px 0; }
.guide .example { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-style: italic; }

/* guided tour */
#tour { position: fixed; inset: 0; z-index: 40; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(36,33,33,.62); outline: 3px solid var(--sky); transition: all .2s ease; pointer-events: none; }
.tour-card { position: fixed; background: var(--surface); border-radius: 16px; padding: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); box-sizing: border-box; width: 400px; }
.tour-card h2 { font-size: 22px; line-height: 1.25; }
.tour-card p { margin: 0; font-size: 17px; color: var(--soft); line-height: 1.5; }
.tour-count { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } }
