/* WK Family — Wong & Kuay Dental Group brand: navy and gold */
:root {
  --navy: #0B253C; --navy-2: #2A4560; --gold: #EABA7B; --gold-dark: #8A6A3A; --gold-ink: #7A5A2A; --gold-soft: #FFF8EC; --gold-line: #F0DDBE;
  --bg: #F7F5F1; --card: #FFFFFF; --line: #E6E0D6; --line-2: #EFEAE2; --ink: #14202B; --muted: #5B6672;
  --green: #1E6B45; --green-bg: #E3F2E9; --red: #9B1C14; --red-bg: #FBE7E5; --amber: #7A4A00; --amber-bg: #FDF0D8; --navy-bg: #E3EAF1; --grey-bg: #EEF0F2;
  --r: 16px; --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--navy); }
a:hover { color: var(--gold-dark); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font-family: inherit; font-size: 15px; }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.view { padding: 16px 16px 100px; display: flex; flex-direction: column; gap: 14px; }

/* top and bottom bars */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-weight: 800; font-size: 17px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--navy-2); background: transparent; color: var(--gold); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; flex: none; }
.icon-btn.outline { border-color: #D5CEC2; color: var(--muted); border-radius: 12px; }
.icon-btn.solid { background: var(--navy); border: none; color: var(--gold); border-radius: 12px; }
.card .icon-btn, .item .icon-btn { color: var(--muted); border-color: var(--line); }
.badge { position: absolute; top: 4px; right: 4px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
nav.bottom { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; height: 72px; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
nav.bottom a { text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
nav.bottom a.on { color: var(--navy); font-weight: 800; }
nav.bottom a.on svg { stroke: #B48A4E; }
.viewas, .demo-band { background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; font-weight: 700; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--gold-line); }
.demo-band { background: var(--navy-bg); color: var(--navy); border-color: #CBD6E2; justify-content: center; }

/* hero greeting */
.hero { background: var(--navy); color: #fff; margin: -16px -16px 0; padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.hero h1 { font-size: 24px; font-weight: 800; }
.hero p { margin: 0; color: #C3CEDA; font-size: 13px; }
.hero .purpose { color: var(--gold); font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.hero .hero-small { color: #C3CEDA; }

/* cards and rows */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 16px; font-weight: 800; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card.good { background: var(--gold-soft); border-color: var(--gold-line); }
.good-title { font-size: 13px !important; color: var(--gold-ink); letter-spacing: 0.4px; font-weight: 800; }
.card.good p { margin: 0; font-size: 14px; }
.row-card { flex-direction: row; align-items: center; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.card > .item:first-child, .card > .card-head + .item, .card-head + p + .item { border-top: 0; }
a.item.card { border: 1px solid var(--line); padding: 16px; flex-direction: row; align-items: center; }
.item.col { flex-direction: column; align-items: stretch; }
.item.unread .row-title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--gold); margin-right: 6px; vertical-align: middle; }
.btn-row { cursor: pointer; font: inherit; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-title { font-size: 14px; font-weight: 700; }
.row-sub { font-size: 12.5px; color: var(--muted); }
.row-right { display: flex; align-items: center; gap: 8px; flex: none; }
.row-icon { color: var(--navy); display: flex; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.kv { display: grid; grid-template-columns: minmax(88px, 36%) minmax(0, 1fr); gap: 8px 14px; font-size: 14px; align-items: baseline; }
.kv > * { min-width: 0; overflow-wrap: anywhere; }
.kv > span:nth-child(odd), .kv > strong:nth-child(odd) { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; margin: 0; }
.update { border-top: 1px solid var(--line-2); padding-top: 8px; }
.update p { margin: 0 0 4px; }
.empty { margin: 0; color: var(--muted); font-size: 14px; }
.calm { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--green); font-size: 14px; }
.calm svg { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.pad { padding: 0 4px; margin: 0; }
.tone-green { color: var(--green); } .tone-red { color: var(--red); } .tone-amber { color: var(--amber); } .tone-navy { color: var(--navy); } .tone-grey { color: var(--muted); }
.link { font-size: 13px; font-weight: 700; }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head p { margin: 0; font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; font-size: 13px; color: var(--muted); }
.back svg { width: 18px; height: 18px; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block-title { font-size: 16px; font-weight: 800; margin: 0 4px; }
ul.plain { margin: 0; padding-left: 18px; font-size: 14px; }

/* chips */
.chip { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; flex: none; }
.chip-navy { color: var(--navy); background: var(--navy-bg); } .chip-red { color: var(--red); background: var(--red-bg); } .chip-amber { color: var(--amber); background: var(--amber-bg); }
.chip-green { color: var(--green); background: var(--green-bg); } .chip-grey { color: var(--muted); background: var(--grey-bg); }

/* buttons */
.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #D5CEC2; background: #fff; color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); color: var(--gold); border: none; }
.btn-primary:hover { color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); border: none; }
.btn-gold.big { height: 52px; font-size: 16px; font-weight: 800; border-radius: 14px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* tiles, stats, bars */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.tile-title { font-size: 13px; font-weight: 800; color: var(--navy); }
.tile-line { font-size: 12.5px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats > div { background: #F4F6F8; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.stats strong { font-size: 20px; font-weight: 800; color: var(--navy); }
.stats span { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar > div { height: 8px; background: var(--gold); }
.note-amber { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: #FDF6E8; font-size: 13px; color: var(--ink); }
.note-amber svg { width: 18px; height: 18px; flex: none; color: var(--amber); }
.sched { display: grid; grid-template-columns: 56px minmax(0, 1fr); row-gap: 10px; column-gap: 8px; font-size: 14px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-size: 12px; }
.wk { background: #F4F6F8; border-radius: 10px; padding: 8px 0; }
.wk-today { background: var(--navy); color: var(--gold); font-weight: 800; }
.wk-off { background: transparent; border: 1px dashed #D5CEC2; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 6px; background: #EDE8DF; border-radius: 12px; padding: 4px; overflow-x: auto; }
.tab { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; color: var(--muted); text-decoration: none; display: flex; align-items: center; justify-content: center; padding: 0 10px; white-space: nowrap; cursor: pointer; font-size: 13px; }
.tab.on { background: #fff; color: var(--navy); }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
input, select, textarea { min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid #CFC7BA; background: #fff; color: var(--ink); font-weight: 500; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
select { width: auto; max-width: 100%; }
.form select, .sheet select { width: 100%; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; min-height: 36px; }
label.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--navy); flex: none; }
label.check.big { min-height: 44px; font-size: 14px; align-items: flex-start; padding: 6px 0; }
.check-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; } .check-row label.check { flex: 1; min-width: 0; } .check-row .btn { flex: none; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
legend { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.help { font-weight: 500; color: var(--muted); font-size: 12px; }
.scale { display: flex; gap: 8px; }
.pill { flex-direction: row; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { width: 48px; height: 48px; border-radius: 24px; border: 1px solid #CFC7BA; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; cursor: pointer; }
.pill input:checked + span { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.pill input:focus-visible + span { outline: 3px solid var(--gold); }

/* sheet and toast */
.sheet-wrap { position: fixed; inset: 0; background: rgba(11, 37, 60, 0.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.sheet-head .icon-btn { color: var(--muted); border-color: var(--line); }
.tour { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 20px); opacity: 0; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 60; max-width: 92%; transition: all .25s; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--red); }

/* rosters and tables */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: 10px; }
.rgrid, .dtable { border-collapse: collapse; font-size: 12px; }
.rgrid th, .rgrid td, .dtable th, .dtable td { border-bottom: 1px solid var(--line-2); padding: 2px; text-align: center; }
.rgrid thead th { position: sticky; top: 0; background: #FAF8F4; font-weight: 700; min-width: 30px; }
.rgrid th.we { color: var(--gold-ink); }
.rgrid tbody th { position: sticky; left: 0; background: #fff; text-align: left; padding: 4px 8px; min-width: 110px; font-weight: 700; z-index: 1; }
.cell { width: 30px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--navy); padding: 0; cursor: pointer; }
.cell.wide { width: 54px; font-size: 10px; }
.cell.c-OFF { background: #F4F6F8; color: var(--muted); } .cell.c-AL { background: var(--amber-bg); color: var(--amber); }
.cell.c-AM, .cell.c-FULL, .cell.c-SAT, .cell.c-SUN { background: var(--navy-bg); } .cell.c-PM { background: #E9E2F5; color: #4A2F7A; }
.cell.lv { outline: 2px solid var(--amber); }
.cell:disabled { cursor: default; opacity: 1; }
.cov td { font-weight: 700; color: var(--green); }
.cov td.short { color: var(--red); background: var(--red-bg); }
.dtable { width: 100%; }
.dtable th, .dtable td { padding: 8px 6px; white-space: nowrap; }
.dtable thead th { font-size: 11.5px; color: var(--muted); }
.dtable tbody th { text-align: left; }

/* login and splash */
.login { min-height: 100vh; padding: 48px 24px 32px; display: flex; flex-direction: column; gap: 14px; background: var(--navy); color: #fff; }
.login h1 { font-size: 28px; font-weight: 800; color: var(--gold); text-align: center; }
.login .purpose { text-align: center; color: var(--gold); letter-spacing: 1.6px; font-size: 12px; font-weight: 700; text-transform: uppercase; margin: 0; }
.login-logo { width: 96px; height: 96px; border-radius: 22px; align-self: center; }
.login label { color: #fff; }
.login .muted { color: #C3CEDA; }
.login .tabs { background: var(--navy-2); }
.login .tab { color: #C3CEDA; } .login .tab.on { background: #fff; color: var(--navy); }
.login .btn-primary { background: var(--gold); color: var(--navy); }
.notice { background: var(--gold-soft); color: var(--ink); padding: 12px 14px; border-radius: 12px; font-size: 14px; margin: 0; }
.splash, .loading { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.splash img { width: 72px; height: 72px; border-radius: 18px; }

/* QR print */
.qr { display: flex; justify-content: center; padding: 8px; }
.print-card { align-items: center; text-align: center; }
@media print {
  .top, nav.bottom, .row, .viewas, .demo-band, .page-head, .back { display: none !important; }
  .print-card { break-inside: avoid; border: 2px solid var(--navy); margin-bottom: 24px; }
}
@media (min-width: 600px) { body { background: #ECE7DE; } #app { box-shadow: 0 0 0 1px var(--line); } }

/* Mochi */
.mochi-fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: 86px; width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 6px 18px rgba(11,37,60,.28); z-index: 25; display: block; border: 0; padding: 0; background: none; cursor: pointer; }
.mochi-fab img { width: 56px; height: 56px; border-radius: 16px; display: block; }
.mochi-sheet { border-radius: 24px 24px 0 0; }
.mochi-head h2 { font-size: 20px; font-weight: 800; }
.mochi-head img { border-radius: 12px; }
.testas { display: flex; align-items: center; gap: 10px; background: var(--gold-soft); border: 1.5px dashed #E4C98F; border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.testas select { flex: 1; min-width: 0; }
.mic { width: 52px; height: 52px; border-radius: 26px; border: 0; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.mic.on { background: var(--gold); color: var(--navy); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.mochi-head { display: flex; gap: 12px; align-items: center; }
.mochi-head h1 { font-size: 22px; font-weight: 800; }
.mochi-head p { margin: 2px 0 0; }
.note-log { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 12.5px; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; padding: 8px 12px; }
.note-log svg { width: 16px; height: 16px; flex: none; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 120px; max-height: 48vh; overflow-y: auto; padding: 4px 0; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
.msg p { margin: 0; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.msg.me { align-self: flex-end; }
.msg.me p { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.mochi > div { display: flex; flex-direction: column; gap: 6px; }
.msg.mochi p { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.msg-cat { width: 32px; height: 32px; border-radius: 16px; flex: none; }
.typing p { color: var(--muted); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 40px; border-radius: 20px; border: 1px solid var(--gold-line); background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; font-size: 13px; padding: 0 14px; cursor: pointer; }
.ask { display: flex; gap: 8px; align-items: center; background: #fff; padding: 4px 0; }
.ask input { border-radius: 26px; min-height: 52px; padding: 0 18px; }
.ask input { flex: 1; }
.ask .btn { width: 52px; padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
details.logrow { border-top: 1px solid var(--line-2); padding: 10px 0; }
details.logrow summary { display: flex; gap: 10px; align-items: center; cursor: pointer; list-style: none; }
details.logrow.hl { background: var(--gold-soft); border-radius: 10px; padding: 10px; }
.p-mochi { position: fixed; right: max(16px, calc(50% - 264px)); bottom: 20px; z-index: 30; }

.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.btn-google img { width: 18px; height: 18px; }

/* v1.2: loading outline, welcome cards, booking checks */
.screen { display: flex; flex-direction: column; gap: 14px; }
.skel { display: flex; flex-direction: column; gap: 14px; }
.skel-line, .skel-card { background: linear-gradient(90deg, #ECE7DE 0%, #F5F1EA 50%, #ECE7DE 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 12px; }
.skel-line { height: 26px; } .skel-line.w60 { width: 60%; }
.skel-card { height: 96px; border-radius: var(--r); } .skel-card.short { height: 56px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-line, .skel-card { animation: none; } }
.tour-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(11, 37, 60, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tour-box { background: #fff; width: 100%; max-width: 420px; border-radius: 24px; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.tour-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tour-track::-webkit-scrollbar { display: none; }
.tour-card { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 12px; }
.tour-art { width: 112px; height: 112px; border-radius: 28px; background: var(--gold-soft); border: 1px solid var(--gold-line); display: flex; align-items: center; justify-content: center; color: var(--navy); }
.tour-art img { border-radius: 22px; }
.tour-art svg { width: 52px; height: 52px; stroke-width: 1.5; }
.tour-card h2 { font-size: 20px; font-weight: 800; color: var(--navy); }
.tour-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.tour-dots { display: flex; justify-content: center; gap: 6px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s; }
.tour-dots span.on { width: 22px; background: var(--gold); }
.daylist { background: #F7F5F1; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; margin: 0; }
.daylist p { margin: 0; }
.item.clash { background: var(--red-bg); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
a.card.setup-card { text-decoration: none; color: var(--ink); }
.req-sum { margin: 0; font-size: 15px; line-height: 1.6; }
.dtable.assign td { text-align: center; }
.dtable.assign input { width: 22px; height: 22px; min-height: 0; accent-color: var(--navy); }
.dtable.assign thead th { white-space: normal; min-width: 64px; font-size: 11px; }
.dtable.assign tbody th { position: sticky; left: 0; background: #fff; z-index: 1; }

.msg-sum { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 14px; padding: 12px 14px; }
.legend { margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend summary { cursor: pointer; font-weight: 700; color: var(--navy); min-height: 36px; display: flex; align-items: center; }
.legend dl { margin: 6px 0 0; display: grid; gap: 6px; }
.legend dt { font-weight: 700; color: var(--ink); }
.legend dd { margin: 0 0 4px; }
.dtable thead th[data-col] { cursor: help; }

.msg.mochi .bub { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.msg.mochi .bub p { background: none; border: 0; padding: 0; margin: 0 0 6px; border-radius: 0; }
.msg.mochi .bub p:last-child { margin-bottom: 0; }
.msg.mochi .bub ul, .msg.mochi .bub ol { margin: 2px 0 6px; padding-left: 20px; }
.msg.mochi .bub li { margin: 3px 0; }
.msg.mochi .bub strong { font-weight: 700; color: var(--navy); }

.cell-h { display: block; font-size: 9px; font-weight: 600; opacity: .8; line-height: 1.1; white-space: nowrap; }
.rgrid .cell.clash { outline: 2px solid var(--red); outline-offset: -2px; }

/* ---------- doctor pay (screens/docpay.js) ---------- */
.dp-jars { flex-direction: row; flex-wrap: wrap; gap: 10px; background: var(--navy); border-color: var(--navy); color: #fff; }
.dp-jar { position: relative; flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--navy-2); }
.dp-jar .muted { color: #C3CEDA; }
.dp-jar-label { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .3px; }
.dp-num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.dp-best { flex-basis: 100%; margin: 0; font-size: 13px; font-weight: 700; color: var(--gold); }
.dp-pop { animation: dp-pop .5s ease-out; }
.dp-pulse { animation: dp-pulse .45s ease-out; }
.dp-plus { position: absolute; right: 12px; top: 8px; font-weight: 800; font-size: 14px; color: var(--gold); pointer-events: none; animation: dp-float 1.4s ease-out forwards; }
.dp-ghost { position: fixed; z-index: 70; margin: 0; padding: 10px 12px; background: #fff; border: 1px solid var(--gold-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(11,37,60,.18);
  pointer-events: none; transition: transform .6s cubic-bezier(.5,0,.75,0), opacity .6s ease-in; transform-origin: center; }
.dp-ghost .row { display: none; }
.dp-gone { overflow: hidden; opacity: 0; transition: height .35s ease .2s, opacity .2s; padding: 0 !important; border: 0 !important; }
.dp-steps { display: flex; gap: 3px; flex: none; }
.dp-steps span { width: 10px; height: 10px; border-radius: 5px; background: var(--line); }
.dp-steps span.on { background: var(--green); }
details.dp-doc > summary { list-style: none; cursor: pointer; border-top: 0; padding: 0; }
details.dp-doc > summary::-webkit-details-marker { display: none; }
details.dp-doc[open] { background: var(--bg); }
@keyframes dp-float { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-28px); } }
@keyframes dp-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.04); box-shadow: 0 0 0 3px var(--gold); } 100% { transform: scale(1); box-shadow: none; } }
@keyframes dp-pop { 0% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dp-pop, .dp-pulse, .dp-plus { animation: none; } .dp-ghost, .dp-gone { transition: none; } }

/* ---------- languages ---------- */
:root[data-lang="zh"] body { font-family: Manrope, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.lang-pick { margin-top: 8px; }
.lang-pick .btn.on { font-weight: 800; color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- in-app QR scanner ---------- */
.scan-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(11,37,60,.85); display: flex; align-items: center; justify-content: center; padding: 16px; }
.scan-box { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.scan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scan-head h2 { margin: 0; font-size: 18px; }
.scan-view { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18% 14%; border: 3px solid var(--gold); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); }
.sheet [data-action] { width: 100%; justify-content: center; }

/* ---------- performance: rating, record, trend ---------- */
.rate-cat { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.rate-cat:last-child { margin-bottom: 0; }
.rate-cat legend { font-weight: 800; padding: 0; font-size: 15px; }
.rate-cat .help { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.rate3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.rate3 label { position: relative; display: block; margin: 0; }
.rate3 input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate3 span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; border: 1px solid #D5CEC2; background: #fff; color: var(--navy); font-weight: 700; font-size: 13.5px; text-align: center; padding: 4px 6px; cursor: pointer; line-height: 1.2; }
.rate3 input:checked + span { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.rate3 input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.h3 { font-size: 13px; font-weight: 800; color: var(--muted); margin: 12px 0 4px; letter-spacing: 0.2px; }
.said { margin: 0 0 6px; font-size: 14px; overflow-wrap: anywhere; }
.struck { text-decoration: line-through; color: var(--muted); }
.tl-good .row-title { color: var(--green); }
.score-big { font-size: 40px; font-weight: 800; color: var(--navy); line-height: 1; }
.trend { display: grid; grid-template-columns: 52px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 13px; }
.trend-m { font-weight: 700; line-height: 1.2; }
.trend-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trend .bar.att > div { background: var(--navy-2); }
.trend-v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 28px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
details.card[open] > summary::after { content: '▴'; }
/* Mochi v1.2.10: helpful? and the tip of the day */
.msg.mochi .fb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.msg.mochi .fb .icon-btn { min-width: 40px; min-height: 40px; font-size: 18px; }
.msg.mochi .fb input { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; min-width: 0; }
.msg.mochi p.fb-done { background: none; border: 0; padding: 0; margin: 0; }
.mochi-tip { display: flex; gap: 12px; align-items: flex-start; border-color: var(--gold-line); background: var(--gold-soft); }
.mochi-tip p { margin: 0 0 6px; }
.mochi-tip .muted.small { margin: 0 0 2px; font-weight: 700; color: var(--gold-ink); }
.testrow { border-top: 1px solid var(--line); padding: 8px 0; }
.testrow:first-child { border-top: 0; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--gold, #c9a227); border-radius: 4px; }
/* v1.2.13 smart people picker */
.field-person { display: grid; gap: 6px; }
.field-person .lbl { font-weight: 700; font-size: 14px; }
.pick-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; }
.pick-btn.chosen { color: var(--ink, inherit); }
.pick-btn.need { border-color: var(--red, #c0392b); }
.pick-btn svg { flex: none; width: 18px; height: 18px; opacity: .6; }
.pick-wrap { position: fixed; inset: 0; z-index: 1000; background: rgba(13, 35, 64, .45); display: flex; align-items: flex-end; justify-content: center; padding-top: env(safe-area-inset-top, 0px); }
.pick { background: var(--bg, #fff); width: 100%; max-width: 560px; max-height: 88vh; border-radius: 22px 22px 0 0; padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.pick-q { min-height: 46px; border: 1px solid var(--gold-line, #e6c98c); border-radius: 12px; padding: 0 14px; font: inherit; }
.pick-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
.pick-head { margin: 10px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink, #8a6a1f); }
.pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 0; background: transparent; padding: 10px 8px; border-radius: 10px; font: inherit; cursor: pointer; min-height: 44px; }
.pick-item:hover, .pick-item:focus-visible { background: var(--gold-soft, #fbf3e2); outline: none; }
.pick-name { font-weight: 600; }
.pick-sub { font-size: 12px; color: var(--muted); }
.pick-item.is-away .pick-name { color: var(--muted); }
.pick-role .pick-name { color: var(--navy, #0d2340); }
.pick-none, .pick-more { margin: 4px 8px; }
@media (min-width: 700px) { .pick-wrap { align-items: center; } .pick { border-radius: 22px; } }
/* Mochi: a task ready to give */
.task-draft { border: 1px solid var(--gold-line, #e6c98c); background: var(--gold-soft, #fbf3e2); border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; }
.task-draft .td-head { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink, #8a6a1f); background: none; border: 0; padding: 0; }
.task-draft .td-title { margin: 0; font-weight: 700; background: none; border: 0; padding: 0; }
.task-draft .td-sub { margin: 0 0 4px; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; }
/* v1.2.14: one-tap choices in forms, optional details folded away, the owner's brief */
.tapchips { gap: 6px; }
.tapchip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tapchip { position: relative; display: inline-flex; }
.tapchip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tapchip span { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 20px; border: 1px solid #CFC7BA; background: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.tapchip input:checked + span { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.tapchip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 1px; }
details.sheet-more { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--bg); }
details.sheet-more > summary { min-height: 46px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; }
details.sheet-more > summary::-webkit-details-marker { display: none; }
details.sheet-more > summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
details.sheet-more[open] { padding-bottom: 12px; display: flex; flex-direction: column; gap: 12px; }
details.sheet-more[open] > summary::after { content: '▴'; }
.sheet-sub { margin: 4px 0 0; font-weight: 800; color: var(--navy); }
.note-gold { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--gold-ink); }
.brief-sec h2 { font-size: 16px; }
.brief-line { margin: 6px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.brief-line strong { color: var(--navy); }
.brief-sugg { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; margin: 10px 0 0; }
.brief-sugg .because { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.qr-sm { display: flex; justify-content: center; padding: 8px 0; }
.camp-link { overflow-wrap: anywhere; font-size: 13px; }
