/* Golden Hands Workspace: the design system and the shell.
   Colours come from the logo: navy for structure and actions, gold only for
   small brand touches. Status colours (green, amber, red) are kept apart from
   the brand. Text uses the same navy ink as the Office Procedures document.
   Light and dark are both designed; "auto" follows the computer. */

@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/poppins-700.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Poppins", var(--font);

  --bg:            light-dark(#F3F5F8, #0C121C);
  --surface:       light-dark(#FFFFFF, #121A27);
  --surface-2:     light-dark(#F7F9FB, #161F2E);
  --sunken:        light-dark(#EEF1F5, #0F1621);
  --hover:         light-dark(#F0F3F7, #1A2434);
  --border:        light-dark(#E1E6ED, #222D3E);
  --border-strong: light-dark(#C9D2DD, #2F3C51);
  --ink:           light-dark(#172434, #E4EAF2);
  --ink-2:         light-dark(#4B5B6E, #A2AFC0);
  --ink-3:         light-dark(#7A8899, #718096);

  --primary:       light-dark(#053272, #3A6FD1);
  --primary-hover: light-dark(#0B418F, #4A7EDD);
  --primary-soft:  light-dark(#E7EEF9, #1A2A44);
  --primary-ink:   light-dark(#053272, #8DB2F5);
  --on-primary:    #FFFFFF;
  --focus:         light-dark(#2F6FE4, #6EA0FF);
  --gold:          light-dark(#B8862B, #D4A53A);
  --gold-soft:     light-dark(#F7EFDF, rgba(212, 165, 58, .14));

  --ok:        light-dark(#1A7F4E, #4CC08A);
  --ok-soft:   light-dark(#E6F4EC, rgba(76, 192, 138, .14));
  --warn:      light-dark(#9A6200, #E5B04A);
  --warn-soft: light-dark(#FDF3DC, rgba(229, 176, 74, .14));
  --bad:       light-dark(#B42318, #F07A72);
  --bad-soft:  light-dark(#FCE9E7, rgba(240, 122, 114, .14));
  --info:      light-dark(#1D5FC2, #7EA6F2);
  --info-soft: light-dark(#E8F0FC, rgba(126, 166, 242, .14));

  --side-bg:     light-dark(#062B60, #0A1322);
  --side-ink:    rgba(255, 255, 255, .84);
  --side-ink-2:  rgba(255, 255, 255, .5);
  --side-hover:  rgba(255, 255, 255, .07);
  --side-active: rgba(255, 255, 255, .13);
  --side-line:   rgba(255, 255, 255, .1);
  --side-gold:   #D9AE4E;

  --shadow-1: 0 1px 2px light-dark(rgba(16, 24, 40, .06), rgba(0, 0, 0, .3));
  --shadow-2: 0 10px 30px light-dark(rgba(16, 24, 40, .14), rgba(0, 0, 0, .5)), 0 2px 6px light-dark(rgba(16, 24, 40, .06), rgba(0, 0, 0, .3));
  --radius: 8px;
  --radius-lg: 12px;
  --side-w: 248px;
  --top-h: 60px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* a logo image for one theme only */
.only-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-light { display: none; }
  :root:not([data-theme="light"]) .only-dark { display: block; }
}
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }

/* ── icons ───────────────────────────────────────────────── */
.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── boot + sign-in ──────────────────────────────────────── */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.signin {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, var(--side-bg) 0 4px, transparent 4px), var(--bg);
}
.signin-card {
  width: min(400px, 100%); padding: 40px 36px 30px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-2);
}
.signin-emblem { width: 96px; height: 98px; margin: 0 auto 16px; }
.wordmark { margin: 0; font-family: var(--font-brand); font-weight: 700; line-height: 1; }
.wm-name { display: block; font-size: 26px; letter-spacing: .3px; color: light-dark(#053272, #E4EAF2); }
.wm-trade {
  display: block; margin-top: 7px; padding-left: .52em;
  font-size: 12.5px; font-weight: 600; letter-spacing: .52em; color: var(--gold);
}
.signin-title { margin: 24px 0 22px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 15px; }
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 46px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; transition: background .15s, box-shadow .15s;
}
.google-btn:hover { background: var(--hover); box-shadow: var(--shadow-1); }
.signin-error {
  margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; text-align: left;
  background: var(--bad-soft); color: var(--bad); font-size: 13.5px;
}
.signin-foot { margin: 16px 0 0; color: var(--ink-3); font-size: 12.5px; }

/* ── the shell ───────────────────────────────────────────── */
.app {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}

.side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--side-bg); color: var(--side-ink);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 41px; }
.brand-text { display: flex; flex-direction: column; font-family: var(--font-brand); line-height: 1; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: .3px; color: #fff; }
.brand-trade { margin-top: 5px; font-size: 8.5px; font-weight: 600; letter-spacing: .5em; color: var(--side-gold); }

.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px 12px; scrollbar-width: thin; scrollbar-color: var(--side-line) transparent; }
.nav-group { margin: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-ink-2); }
.nav-group:first-child { margin-top: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 10px; border-radius: 8px;
  color: var(--side-ink); text-decoration: none; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--side-gold);
}
.nav-item .ic { opacity: .9; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--side-gold); color: #1B1405;
}
.nav-badge:empty { display: none; }

.side-foot { padding: 10px 10px 12px; border-top: 1px solid var(--side-line); }
.me {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px;
  background: none; color: var(--side-ink); text-align: left; cursor: pointer;
}
.me:hover, .me[aria-expanded="true"] { background: var(--side-hover); }
.me .avatar { width: 32px; height: 32px; font-size: 12.5px; background: rgba(255, 255, 255, .14); color: #fff; }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-name { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--side-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-link {
  display: block; margin: 8px 8px 0; font-size: 11.5px; color: var(--side-ink-2); text-decoration: none;
}
.notice-link:hover { color: var(--side-ink); text-decoration: underline; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  flex: none; display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 16px 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.page-title { flex: 1; min-width: 0; margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-title small { margin-left: 10px; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top .menu-btn { display: none; margin-left: -8px; }
.bell { position: relative; }
.bell-count {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700; line-height: 1;
  background: var(--bad); color: #fff; border: 2px solid var(--surface);
}

.banner {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 24px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--ink-2); font-size: 13px;
}
.banner a { font-weight: 600; }

.outlet { flex: 1; min-height: 0; overflow: auto; position: relative; }
.outlet.bleed { overflow: hidden; }
.module-root { min-height: 100%; }
.outlet.bleed .module-root { height: 100%; }

.page { max-width: 1240px; padding: 24px 28px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head .grow { flex: 1; min-width: 0; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.section-title { margin: 0; font-size: 16px; font-weight: 600; }

/* ── buttons and fields ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13.5px; text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn .ic { margin-left: -2px; }

.icon-btn {
  flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer;
  text-decoration: none; transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px light-dark(rgba(47, 111, 228, .15), rgba(110, 160, 255, .2)); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.check + .check { margin-top: 8px; }
.check:hover { background: var(--hover); }
.check input { margin: 2px 0 0; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.check b { display: block; font-weight: 600; }
.check span { display: block; font-size: 12.5px; color: var(--ink-2); }
.check.disabled { opacity: .65; cursor: default; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--border); }
.seg button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.seg button:hover:not(:disabled) { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button:disabled { opacity: .35; cursor: default; }

/* ── chips, badges, avatars ──────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--sunken); color: var(--ink-2);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.brand { background: var(--primary-soft); color: var(--primary-ink); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--primary); color: var(--on-primary);
}

.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; user-select: none;
  font-weight: 600; font-size: 13.5px; letter-spacing: .3px; color: #fff; background: #6B7C8F;
}

/* ── tables ──────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; z-index: 1; padding: 10px 14px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--hover); }
.table tbody tr.off td { color: var(--ink-3); }
.table .sub { display: block; font-size: 12px; color: var(--ink-3); }
.table .right { text-align: right; }
.cell-strong { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── sub-navigation inside a tab ─────────────────────────── */
.tabs { display: flex; gap: 4px; margin: -4px 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a {
  position: relative; padding: 10px 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); }
.tabs a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary-ink); }

/* ── empty, loading, cards ───────────────────────────────── */
.empty { padding: 56px 24px; text-align: center; color: var(--ink-2); }
.empty .ic { color: var(--ink-3); margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.empty p { margin: 0; }
.skeleton { display: grid; gap: 10px; padding: 16px; }
.skeleton i {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--sunken) 0%, var(--hover) 50%, var(--sunken) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton i:nth-child(3n) { width: 70%; }
.skeleton i:nth-child(3n+2) { width: 85%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px;
  background: var(--info-soft); color: var(--ink); font-size: 13px;
}
.note .ic { color: var(--info); margin-top: 1px; }
.note.warn { background: var(--warn-soft); }
.note.warn .ic { color: var(--warn); }

/* ── drawer (details open from the right) ────────────────── */
.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(8, 15, 28, .32); animation: fade .15s ease-out; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(480px, 100%);
  display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-2);
  border-left: 1px solid var(--border); animation: slide-in .18s cubic-bezier(.2, .8, .2, 1);
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 600; }
.drawer-head .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.drawer-foot .grow { flex: 1; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ── dialogs ─────────────────────────────────────────────── */
dialog.dlg {
  width: min(420px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
}
dialog.dlg::backdrop { background: rgba(8, 15, 28, .4); }
.dlg-body { padding: 22px 22px 8px; }
.dlg-body h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.dlg-body p { margin: 0 0 12px; color: var(--ink-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; }
.dlg-err { margin: 0 0 8px; color: var(--bad); font-size: 13px; }

/* ── popovers: the bell and the account menu ─────────────── */
.popover {
  position: fixed; z-index: 50; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-2);
  animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.bell-panel { top: calc(var(--top-h) - 4px); right: 12px; width: min(400px, calc(100% - 24px)); max-height: min(70vh, 640px); display: flex; flex-direction: column; }
.bell-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--border); }
.bell-head h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; }
.bell-list { flex: 1; min-height: 0; overflow-y: auto; }
.bell-item {
  display: flex; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--border);
  background: none; text-align: left; cursor: pointer; color: inherit;
}
.bell-item:hover { background: var(--hover); }
.bell-item .lvl { margin-top: 6px; width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; }
.bell-item.unread .lvl { background: var(--info); }
.bell-item.unread.urgent .lvl, .bell-item.unread.overdue .lvl { background: var(--bad); }
.bell-item.unread.due_soon .lvl { background: var(--warn); }
.bell-item .txt { flex: 1; min-width: 0; }
.bell-item .ttl { display: block; font-weight: 600; }
.bell-item:not(.unread) .ttl { font-weight: 500; color: var(--ink-2); }
.bell-item .bd { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.bell-item .when { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.bell-item .count { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.bell-foot { padding: 10px 18px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }

.me-menu { left: 12px; bottom: 74px; width: 236px; padding: 6px; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head b { display: block; }
.menu-head span { display: block; font-size: 12px; color: var(--ink-3); word-break: break-all; }
.menu-label { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.menu-theme { padding: 0 8px 8px; }
.menu-theme .seg { width: 100%; }
.menu-theme .seg button { flex: 1; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; color: var(--ink);
}
.menu-item:hover { background: var(--hover); }
.menu-sep { height: 1px; margin: 6px 0; background: var(--border); }

/* ── report a problem, and attaching images ──────────────── */
.report-btn { color: var(--ink-2); }
.pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pick-row .hint { font-size: 12px; color: var(--ink-3); }
.pick-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pick-thumbs:empty { display: none; }
.pick-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
  background: var(--sunken); border: 1px solid var(--border);
}
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-thumb button {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(8, 15, 28, .65); color: #fff; cursor: pointer;
}

/* ── toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px)); padding: 11px 16px; border-radius: 10px;
  background: light-dark(#172434, #E4EAF2); color: light-dark(#fff, #0C121C); font-size: 13.5px; box-shadow: var(--shadow-2);
}

/* ── the monitoring notice ───────────────────────────────── */
.doc { max-width: 720px; padding: 32px 28px 64px; }
.doc .kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.doc h1 { margin: 6px 0 4px; font-size: 24px; font-weight: 600; }
.doc .doc-meta { color: var(--ink-3); font-size: 13px; margin-bottom: 26px; }
.doc h2 { margin: 26px 0 8px; font-size: 15.5px; font-weight: 600; }
.doc p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.6; }
.doc ul { margin: 0 0 10px; padding-left: 20px; color: var(--ink-2); line-height: 1.6; }
.doc li { margin-bottom: 4px; }
.doc .ack { margin-top: 30px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.doc .ack p { flex: 1; margin: 0; }

/* ── phone ───────────────────────────────────────────────── */
.tabbar { display: none; }
.scrim { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(280px, 86vw);
    transform: translateX(-100%); transition: transform .2s cubic-bezier(.2, .8, .2, 1);
    padding-top: env(safe-area-inset-top);
  }
  .app.side-open .side { transform: none; box-shadow: var(--shadow-2); }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(8, 15, 28, .4); }
  .top .menu-btn { display: inline-grid; }
  .report-btn .label { display: none; }
  .report-btn { width: 38px; height: 38px; padding: 0; }
  .top { padding: env(safe-area-inset-top) 8px 0 12px; height: calc(var(--top-h) + env(safe-area-inset-top)); }
  .page-title { font-size: 17px; }
  .banner { padding: 8px 14px; }
  .main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
    height: calc(58px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer;
  }
  .tabbar .active { color: var(--primary-ink); }
  .tabbar .nav-badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10.5px; padding: 0 4px; background: var(--bad); color: #fff; }
  .page { padding: 18px 14px 40px; }
  .page-head { flex-wrap: wrap; }
  .doc { padding: 22px 16px 48px; }
  .row2 { grid-template-columns: 1fr; }
  .table th, .table td { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
