/* Cost Reimbursement: AKS Hotels palette (gold #B0953C, grey #606060, charcoal) */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --surface-3: #e9e6de;
  --text: #1f2328;
  --muted: #5d6166;
  --line: #e3e0d7;
  --line-strong: #cfcabd;
  --gold: #b0953c; /* brand: fills, accents (text on it = --on-gold) */
  --gold-hover: #bca04a; /* lighter on hover keeps charcoal text at 6.2:1 */
  --gold-ink: #7a6529; /* gold for text/icons on light surfaces (5.6:1) */
  --gold-soft: #f5efdd;
  --on-gold: #1f2328;
  --chrome: #1c1f23; /* sidebar / top bar */
  --chrome-2: #272b30;
  --chrome-line: #353a40;
  --chrome-text: #eceae4;
  --chrome-muted: #aeaaa2;
  --chrome-gold: #c9ae5d;
  --ok: #1d7549;
  --ok-soft: #e2f2e9;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;
  --warn: #855600;
  --warn-soft: #fbf0d8;
  --focus: #7a6529;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(28 31 35 / 5%), 0 2px 8px rgb(28 31 35 / 4%);
  --shadow-lg: 0 12px 40px rgb(28 31 35 / 18%);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: light;
}
/* Dark theme: follows the device unless the user picked Light or Dark (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111316;
    --surface: #181b1f;
    --surface-2: #1f2328;
    --surface-3: #282d33;
    --text: #eceae4;
    --muted: #a6a39c;
    --line: #2c3137;
    --line-strong: #3c424a;
    --gold: #c9ae5d;
    --gold-hover: #d6be72;
    --gold-ink: #d4bc74;
    --gold-soft: #2b2718;
    --on-gold: #16191d;
    --chrome: #0c0e10;
    --chrome-2: #16191d;
    --chrome-line: #262a2f;
    --ok: #74d3a1;
    --ok-soft: #15301f;
    --bad: #ff8f86;
    --bad-soft: #3a1b19;
    --warn: #f0c46b;
    --warn-soft: #352a12;
    --focus: #d4bc74;
    --shadow: none;
    --shadow-lg: 0 12px 40px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111316;
  --surface: #181b1f;
  --surface-2: #1f2328;
  --surface-3: #282d33;
  --text: #eceae4;
  --muted: #a6a39c;
  --line: #2c3137;
  --line-strong: #3c424a;
  --gold: #c9ae5d;
  --gold-hover: #d6be72;
  --gold-ink: #d4bc74;
  --gold-soft: #2b2718;
  --on-gold: #16191d;
  --chrome: #0c0e10;
  --chrome-2: #16191d;
  --chrome-line: #262a2f;
  --ok: #74d3a1;
  --ok-soft: #15301f;
  --bad: #ff8f86;
  --bad-soft: #3a1b19;
  --warn: #f0c46b;
  --warn-soft: #352a12;
  --focus: #d4bc74;
  --shadow: none;
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 50%);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-bottom: calc(96px + var(--safe-b)); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1, .h1 { font-size: 1.5rem; font-weight: 650; }
h2, .h2 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0; }
.ico { width: 20px; height: 20px; flex: none; }
.ico.inline { width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: var(--gold-ink); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.85rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.splash { min-height: 100dvh; display: grid; place-items: center; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn.primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn:disabled { opacity: 0.65; cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- language switch ---------- */
.langs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.lang { border: 0; background: transparent; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 7px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); cursor: pointer; }
.lang.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }

/* ---------- brand mark ---------- */
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; flex: none; }
.mark .ico { width: 20px; height: 20px; }
.brand-text { display: grid; line-height: 1.2; min-width: 0; }
.brand-text small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--chrome-gold); }
.brand-text strong { font-size: 0.98rem; font-weight: 650; color: var(--chrome-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sign in ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-brand {
  background: var(--chrome); color: var(--chrome-text);
  padding: calc(20px + var(--safe-t)) 24px 28px; display: grid; gap: 18px; align-content: start;
  background-image: radial-gradient(120% 80% at 100% 0%, rgb(201 174 93 / 16%), transparent 60%);
}
.auth-brand .brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-brand .lead { display: grid; gap: 8px; }
.auth-brand h1 { font-size: 1.6rem; font-weight: 650; color: #fff; }
.auth-brand .lead p { color: var(--chrome-muted); }
.auth-brand .points { display: none; }
.auth-brand .langs { background: var(--chrome-2); border-color: var(--chrome-line); }
.auth-brand .lang { color: var(--chrome-muted); }
.auth-brand .lang.on { background: var(--chrome-gold); color: #16191d; }
.auth-main { padding: 24px 16px calc(28px + var(--safe-b)); display: grid; align-content: start; justify-items: center; }
.auth-card { width: 100%; max-width: 400px; padding: 24px; display: grid; gap: 16px; }
.auth-card h2 { font-size: 1.25rem; }
.auth-card .sub { color: var(--muted); margin-top: -8px; }
.auth-install { margin-top: 16px; }
@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(380px, 44%) 1fr; }
  .auth-brand { padding: 40px 48px; align-content: space-between; min-height: 100dvh; }
  .auth-brand h1 { font-size: 2.25rem; max-width: 14ch; }
  .auth-brand .points { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; color: var(--chrome-muted); }
  .auth-brand .points li { display: flex; gap: 12px; align-items: center; }
  .auth-brand .points .ico { color: var(--chrome-gold); }
  .auth-main { align-content: center; padding: 40px; }
  .auth-card { padding: 32px; }
}

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > .label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.req { color: var(--gold-ink); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--surface); font-size: 16px; /* 16px stops iOS zoom */
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 92px; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent); }
.field input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; padding-left: 10px; padding-right: 8px; }
.err { color: var(--bad); font-size: 0.9rem; display: flex; gap: 8px; align-items: flex-start; }
.err:empty { display: none; }

/* searchable picker field */
.picker-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); text-align: left; cursor: pointer;
  font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s;
}
.picker-btn:hover { border-color: var(--muted); }
.picker-btn:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent); }
.picker-btn .ico { color: var(--muted); margin-left: auto; }
.picker-val { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.picker-val b { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--gold-ink); flex: none; }
.picker-val span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-btn.empty .picker-val { color: var(--muted); }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.side { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 12px 10px 16px; background: var(--chrome); color: var(--chrome-text);
}
.topbar .brand-text { flex: 1; }
.topbar .icon-btn, .side .icon-btn { background: var(--chrome-2); border-color: var(--chrome-line); color: var(--chrome-text); }
.topbar .icon-btn:hover, .side .icon-btn:hover { background: var(--chrome-line); }
.topbar .langs, .side .langs { background: var(--chrome-2); border-color: var(--chrome-line); }
.topbar .lang, .side .lang { color: var(--chrome-muted); }
.topbar .lang.on, .side .lang.on { background: var(--chrome-gold); color: #16191d; }
.main { min-width: 0; }
.avatar-btn { border: 0; padding: 2px; border-radius: 50%; background: transparent; cursor: pointer; flex: none; }
.avatar-btn .avatar, .user-card .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--chrome-2); color: var(--chrome-gold); border: 1px solid var(--chrome-line); font-weight: 700; font-size: 0.85rem; }
.user-card.light { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.user-card.light .who { display: grid; min-width: 0; line-height: 1.35; }
.user-card.light small { color: var(--muted); }
.view { max-width: 1080px; margin: 0 auto; padding: 16px 16px calc(96px + var(--safe-b)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 0.92rem; }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabs button { position: relative; border: 0; background: none; padding: 10px 0 8px; display: grid; justify-items: center; gap: 2px; font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--text); }
.tabs button.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.tabs button.on .ico { color: var(--gold-ink); }

@media (min-width: 960px) {
  .app { grid-template-columns: 260px minmax(0, 1fr); }
  .topbar, .tabs { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh;
    padding: 20px 16px; background: var(--chrome); color: var(--chrome-text);
  }
  .side .brand { display: flex; gap: 12px; align-items: center; padding: 4px 6px; }
  .side nav { display: grid; gap: 4px; }
  .nav-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
    background: transparent; color: var(--chrome-muted); font-weight: 600; font-size: 0.92rem; cursor: pointer; text-align: left;
  }
  .nav-item:hover { background: var(--chrome-2); color: var(--chrome-text); }
  .nav-item.on { background: var(--chrome-2); color: #fff; box-shadow: inset 3px 0 0 var(--chrome-gold); }
  .nav-item.on .ico { color: var(--chrome-gold); }
  .side .foot { margin-top: auto; display: grid; gap: 12px; }
  .user-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--chrome-2); border: 1px solid var(--chrome-line); }
  .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--chrome-line); color: var(--chrome-gold); font-weight: 700; font-size: 0.85rem; flex: none; }
  .user-card .who { display: grid; min-width: 0; line-height: 1.3; }
  .user-card strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-card small { color: var(--chrome-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side .row-actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
  .view { padding: 32px 40px 48px; }
}

/* ---------- new submission ---------- */
.form { padding: 20px; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.form-cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.form-fields { display: grid; gap: 16px; align-content: start; }
.form-actions { display: grid; gap: 10px; }
.section-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 960px) {
  .form { padding: 28px; }
  .form-cols { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px; }
  .form-actions { grid-template-columns: auto auto; justify-content: end; }
  .form-actions .btn { min-width: 160px; }
}
.upload { display: grid; gap: 12px; align-content: start; }
.pick-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pick {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 8px; text-align: center;
  min-height: 100px; padding: 12px 6px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2);
  font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.pick .ico { width: 26px; height: 26px; color: var(--gold-ink); }
.pick:hover { border-color: var(--gold); background: var(--gold-soft); }
.pick:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.upload.has-file .pick { min-height: 64px; }
.upload.has-file .pick span { font-size: 0.75rem; }
@media (min-width: 960px) { .pick { min-height: 132px; } .upload.has-file .pick { min-height: 72px; } }
.preview { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.preview img, .preview .doc { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.preview .doc { display: grid; place-items: center; color: var(--gold-ink); }
.preview .meta { display: grid; min-width: 0; flex: 1; }
.preview .meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.92rem; font-weight: 600; }
.preview .meta small { color: var(--muted); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

/* ---------- list ---------- */
.list { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.filters { padding: 12px; display: grid; gap: 12px; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.range .icon-btn { height: 46px; width: 46px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; height: 34px; padding: 0 12px; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text); }
.chip b { font-weight: 700; font-size: 0.75rem; background: var(--surface-2); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip.on b { background: color-mix(in srgb, var(--surface) 22%, transparent); }
@media (min-width: 960px) {
  .filters { display: flex; justify-content: space-between; align-items: end; padding: 14px 16px; }
  .range { grid-template-columns: 180px 180px auto; }
}
.table { overflow: hidden; }
.thead { display: none; }
#rows { display: grid; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main side" "rem side";
  gap: 2px 12px; padding: 14px 16px; width: 100%; text-align: left; cursor: pointer; color: var(--text);
  background: var(--surface); border: 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row .c-id, .row .c-date { display: none; }
.row .c-main { grid-area: main; display: grid; gap: 2px; min-width: 0; }
.row .c-rem { grid-area: rem; font-size: 0.86rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .c-side { grid-area: side; display: grid; justify-items: end; align-content: start; gap: 4px; }
.row .c-side small { font-size: 0.78rem; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; font-variant-numeric: tabular-nums; }
.row .c-side .ico { width: 14px; height: 14px; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key { color: var(--gold-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.amt { font-variant-numeric: tabular-nums; font-weight: 650; }
@media (min-width: 960px) {
  .thead, .row { grid-template-columns: 72px 112px minmax(0, 1.3fr) minmax(0, 1.4fr) 140px; grid-template-areas: none; align-items: center; gap: 16px; padding: 12px 20px; }
  .thead { display: grid; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .row .c-id, .row .c-date { display: block; font-variant-numeric: tabular-nums; }
  .row .c-id { color: var(--muted); }
  .row .c-main, .row .c-rem, .row .c-side { grid-area: auto; }
  .row .c-side { justify-items: start; grid-auto-flow: column; justify-content: start; }
  .row .c-side small.only-mobile { display: none; }
}
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; white-space: nowrap; }
.badge .ico { width: 14px; height: 14px; }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.accepted { background: var(--ok-soft); color: var(--ok); }
.badge.rejected { background: var(--bad-soft); color: var(--bad); }

/* ---------- sheets (native <dialog>) ---------- */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; padding: 0; border: 0; color: var(--text);
  background: var(--bg); width: 100%; max-width: 640px; max-height: 92dvh; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg);
}
dialog.sheet:not([open]) { display: none; }
dialog.sheet[open] { animation: up 0.2s ease-out; }
dialog.sheet::backdrop { background: rgb(12 14 16 / 50%); }
dialog.sheet:focus { outline: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(20px + var(--safe-b)); display: grid; gap: 14px; }
.sheet-body .form { box-shadow: none; border: 0; padding: 0; background: transparent; }
.sheet-body .form-cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.sheet-body .form-actions { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  /* details: right-hand drawer; pickers & small sheets: centred */
  dialog.sheet { inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: none; max-width: 520px; border-radius: 0; }
  dialog.sheet[open] { animation: slide 0.2s ease-out; }
  dialog.sheet.small, dialog.sheet.picker-sheet { inset: 0; margin: auto; height: fit-content; max-height: 80dvh; max-width: 520px; border-radius: 16px; }
  dialog.sheet.small[open], dialog.sheet.picker-sheet[open] { animation: pop 0.15s ease-out; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0.4; } }
@keyframes pop { from { transform: scale(0.97); opacity: 0.4; } }

/* picker sheet */
.picker-sheet .sheet-body { gap: 8px; padding-top: 12px; }
.picker-sheet .sheet-body { grid-template-rows: auto auto minmax(0, 1fr); }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; min-height: 46px; padding: 10px 12px 10px 40px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: 16px;
}
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.6; cursor: pointer; }
.search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent); }
.count:empty { display: none; }
.options { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; max-height: min(60dvh, 480px); overflow-y: auto; }
.options li[role=option] { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.options li[role=option] b { min-width: 3.5ch; color: var(--gold-ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.options li[role=option] span { flex: 1; min-width: 0; }
.options li[role=option].none { color: var(--muted); font-style: italic; }
.options li[role=option]:hover, .options li[role=option].active { background: var(--surface-2); }
.options li[role=option][aria-selected=true] { background: var(--gold-soft); font-weight: 600; }
.options .tick { visibility: hidden; color: var(--gold-ink); }
.options li[aria-selected=true] .tick { visibility: visible; }
.options-empty { padding: 24px 12px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }

/* detail */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kv dt { color: var(--muted); font-size: 0.84rem; font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
img.full { width: 100%; max-height: 45dvh; object-fit: contain; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); display: block; }
.lock { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 0.92rem; }
.install-msg { margin: 0 0 6px; font-size: 1rem; }

/* toast + install banner */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 30;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--chrome); color: var(--chrome-text);
  font-weight: 600; font-size: 0.92rem; opacity: 0; pointer-events: none; transition: 0.2s; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
@media (min-width: 960px) { .toast { left: auto; right: 24px; bottom: 24px; transform: translateY(20px); } .toast.show { transform: none; } }
.install-banner {
  width: calc(100% - 32px); max-width: 1048px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}
.install-banner p { font-size: 0.92rem; display: flex; gap: 10px; align-items: center; }
.install-banner p .ico { color: var(--gold-ink); }
.install-banner div { display: flex; gap: 8px; margin-left: auto; }
@media (min-width: 960px) { .install-banner { width: calc(100% - 80px); max-width: 1000px; margin: 24px auto 0; } }

/* settings */
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; }
.seg .ico { width: 18px; height: 18px; }
.seg.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 14%); }
.seg.on .ico { color: var(--gold-ink); }
.sheet-body .langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; border-radius: 12px; }
.sheet-body .lang { height: 40px; border-radius: 9px; font-size: 0.86rem; }
.about { text-align: center; color: var(--muted); font-size: 0.8rem; line-height: 1.7; margin-top: 4px; }
.credit { display: inline-flex; align-items: center; min-height: 28px; padding: 0 6px; color: var(--muted); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.01em; }
.credit:hover { color: var(--gold-ink); text-decoration: underline; }
.auth-credit { margin-top: 28px; text-align: center; }

/* after a submission */
.done { padding: 40px 24px; display: grid; justify-items: center; text-align: center; gap: 12px; max-width: 560px; margin: 24px auto 0; }
.done h1:focus { outline: none; }
.done p { color: var(--muted); max-width: 42ch; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: pop 0.25s ease-out; }
.done-icon .ico { width: 32px; height: 32px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
.note.warn { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 0.88rem; }

/* list: search, loading skeleton, empty state */
.list-search input { min-height: 42px; }
@media (min-width: 960px) { .filters { flex-wrap: wrap; } .list-search { flex: 1 1 260px; max-width: 360px; order: 2; } .chips { order: 3; } }
.skeleton { display: grid; }
.sk-row { display: grid; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sk-row span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk-row span:first-child { width: 45%; } .sk-row span:last-child { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state > .ico { width: 40px; height: 40px; color: var(--gold-ink); }
.empty-state h2 { color: var(--text); }
.empty-state .btn { margin-top: 8px; }

/* sidebar foot */
.user-row { display: flex; gap: 8px; align-items: stretch; }
.user-row .user-card { flex: 1; min-width: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.user-row .user-card:hover { border-color: var(--chrome-gold); }
.user-row .icon-btn { height: auto; }

/* connectivity + update */
.net-bar { position: sticky; top: 0; z-index: 40; padding: calc(6px + var(--safe-t)) 16px 6px; text-align: center; font-size: 0.84rem; font-weight: 600; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn); }
.update-bar { position: fixed; z-index: 35; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); display: flex; gap: 12px; align-items: center; padding: 10px 10px 10px 16px; border-radius: 12px; background: var(--chrome); color: var(--chrome-text); box-shadow: var(--shadow-lg); font-size: 0.9rem; max-width: calc(100% - 32px); }
@media (min-width: 960px) { .update-bar { left: auto; right: 24px; bottom: 24px; transform: none; } }

/* installed-app feel: no rubber-band bounce or accidental selection of UI chrome */
html, body { overscroll-behavior-y: none; }
.tabs, .topbar, .side, .btn, .chip, .seg, .pick, .picker-btn, .nav-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea, .kv, .row-rem, .c-rem, .pre { -webkit-user-select: text; user-select: text; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 360px) {
  .pick { font-size: 0.74rem; min-height: 84px; }
  .topbar .lang { min-width: 28px; padding: 0 5px; }
}
