/* Lilo design system — matches the product canvas boards:
   deep-teal chrome, teal primary, amber accent, soft light surfaces, DM Sans. */

:root {
  --ink: #1f2933;
  --ink-soft: #52606d;
  --ink-faint: #6b7684; /* AA on white; was #9aa5b1 (2.5:1) */
  --bg-grad: linear-gradient(160deg, #f3f6fb 0%, #e9eff7 100%);
  --card: #ffffff;
  --card-shadow: 0 14px 34px rgba(15, 35, 46, 0.09);
  --card-shadow-sm: 0 10px 26px rgba(15, 35, 46, 0.08);
  --line: #eef2f8;
  --line-strong: #dde3e2;
  --teal: #0e7c86;
  --teal-bright: #1ab0ba;
  --teal-grad: linear-gradient(135deg, #0e7c86, #1ab0ba);
  --teal-ink: #124b55;
  --amber: #f0a84b;
  --amber-deep: #e4712f;
  --amber-grad: linear-gradient(135deg, #f0a84b, #e4712f);
  --chrome: linear-gradient(185deg, #0a1e28 0%, #0e2d38 62%, #104049 100%);
  --good: #0f8a63;
  --good-bg: #e2f5ec;
  --warn: #c2611e;
  --warn-bg: #fdeedd;
  --bad: #c03d3d;
  --bad-bg: #fbe7e7;
  --info: #0e7c86;
  --info-bg: #e6f6f7;
  --radius: 16px;
  --field-bg: #ffffff;
  --dim-bg: #eef2f8;
  --code-bg: #f5f8fc;
  --track: #eef2f8;
  --backdrop: url('/assets/ka-dawn.jpg');
  --backdrop-opacity: 0.07;
  color-scheme: light;
}

/* ---------- dark theme: same brand, night chrome ---------- */
[data-theme="dark"] {
  --ink: #e7edf3;
  --ink-soft: #b4bfca;
  --ink-faint: #94a1ae;
  --bg-grad: linear-gradient(160deg, #0a1016 0%, #0c141d 100%);
  --card: #121b25;
  --card-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  --card-shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.42);
  --line: #1d2938;
  --line-strong: #2a3a4d;
  --teal: #2fb9c3;
  --teal-ink: #c3e9ee;
  --good: #35c494;
  --good-bg: rgba(38, 168, 118, 0.18);
  --warn: #ee9655;
  --warn-bg: rgba(228, 128, 52, 0.18);
  --bad: #ec7676;
  --bad-bg: rgba(222, 86, 86, 0.16);
  --info: #3bbcc6;
  --info-bg: rgba(36, 152, 162, 0.16);
  --field-bg: #0d1620;
  --dim-bg: #1b2735;
  --code-bg: #0e1822;
  --track: #1d2938;
  --backdrop: url('/assets/ka-dusk.jpg');
  --backdrop-opacity: 0.12;
  color-scheme: dark;
}

/* the Karoo breathes faintly behind the app in both themes; cards stay solid */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--backdrop);
  background-size: cover; background-position: center;
  opacity: var(--backdrop-opacity);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg-grad);
  min-height: 100vh;
  font-size: 14px;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
a { color: var(--teal); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px;
  font: 600 14px 'DM Sans', system-ui, sans-serif; cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-grad); color: #fff; box-shadow: 0 8px 18px rgba(13, 148, 160, .38); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-amber { background: var(--amber-grad); color: #fff; box-shadow: 0 8px 18px rgba(228, 113, 47, .32); }
.btn-ghost { background: var(--card); color: var(--ink-soft); border: 1px solid var(--line-strong); box-shadow: 0 2px 6px rgba(15,35,46,.05); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn[disabled] { opacity: .55; cursor: wait; filter: grayscale(.3); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.field input, .field select {
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px;
  font: 500 14px 'DM Sans', system-ui, sans-serif; color: var(--ink);
  background: var(--field-bg); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgba(26, 176, 186, .18); }
.field .hint { font-size: 11.5px; color: var(--ink-faint); }

.alert { border-radius: 10px; padding: 10px 13px; font-size: 13px; font-weight: 500; margin-bottom: 14px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--good-bg); color: var(--good); }
.alert-info { background: var(--info-bg); color: var(--info); }

/* ---------- chips & badges ---------- */
.chip { display: inline-block; border-radius: 100px; padding: 2px 9px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.chip-bad { background: var(--bad-bg); color: #a23232; }
.chip-warn { background: var(--warn-bg); color: #9a4a10; }
.chip-good { background: var(--good-bg); color: #0b6b4c; }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-dim { background: var(--dim-bg); color: var(--ink-soft); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.card-pad { padding: 18px 20px; }

.score-bar { height: 4px; background: #f1f5f4; border-radius: 2px; overflow: hidden; }
.score-bar > i { display: block; height: 100%; border-radius: 2px; }

/* ================= auth layout (login / signup) ================= */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  background:
    linear-gradient(185deg, rgba(8,26,34,0.88) 0%, rgba(10,33,42,0.78) 55%, rgba(12,44,52,0.82) 100%),
    url('/assets/ka-dusk.jpg') center / cover no-repeat,
    var(--chrome);
  color: #e7f2f5; padding: 48px 54px;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-hero .glow {
  position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,176,186,.28) 0%, transparent 65%);
  top: -140px; right: -160px; pointer-events: none;
}
.auth-hero .glow2 {
  position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(240,168,75,.17) 0%, transparent 65%);
  bottom: -120px; left: -120px; pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 700; color: #fff; }
.auth-hero h1 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; margin-top: 11vh; font-weight: 700; color: #fff; max-width: 480px; }
.auth-hero p.lede { color: #9fc3cc; font-size: 15px; max-width: 440px; line-height: 1.55; }
/* hand-set product vignette in the hero — layered, asymmetric, no stock art */
.hero-visual { position: relative; margin: 34px 0 10px; max-width: 420px; min-height: 230px; }
.hv-card {
  background: rgba(13, 42, 53, .74); border: 1px solid rgba(111, 212, 222, .14);
  border-radius: 16px; backdrop-filter: blur(6px); padding: 14px 16px;
  box-shadow: 0 22px 44px rgba(3, 14, 19, .5);
}
.hv-back { position: absolute; top: 0; right: -14px; width: 250px; transform: rotate(2.4deg); opacity: .85; }
.hv-front { position: relative; margin-top: 46px; width: 330px; transform: rotate(-1.2deg); }
.hv-row { display: flex; align-items: center; gap: 12px; }
.hv-k { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7fa6ae; }
.hv-host { display: block; font-weight: 700; font-size: 14.5px; color: #fff; }
.hv-sub { display: block; font-size: 11px; color: #7fa6ae; margin-top: 2px; }
.hv-chip { border-radius: 100px; padding: 3px 9px; font-size: 10px; font-weight: 700; }
.hv-ring { position: relative; width: 64px; height: 64px; flex: none; }
.hv-ring b { position: absolute; inset: 0; display: grid; place-items: center; color: #6fe0ab; font-size: 17px; }
.hv-rule { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: #c6dde2; padding: 7px 2px; border-bottom: 1px solid rgba(255,255,255,.06); }
.hv-pts { font-weight: 700; min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.hv-ref { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: #5f868f; }
.hv-float {
  position: absolute; right: 6px; bottom: -10px; display: flex; align-items: center; gap: 7px;
  background: rgba(16, 52, 60, .92); border: 1px solid rgba(240, 168, 75, .35);
  border-radius: 100px; padding: 7px 13px; font-size: 11px; font-weight: 600; color: #f6c789;
  box-shadow: 0 14px 30px rgba(3, 14, 19, .45); transform: rotate(1.6deg);
}
@media (max-width: 880px) { .hero-visual { display: none; } }

.auth-hero .points { margin-top: auto; display: flex; flex-direction: column; gap: 13px; font-size: 13.5px; color: #c6dde2; }
.auth-hero .points b { color: #fff; }
.auth-hero .pt { display: flex; gap: 10px; align-items: flex-start; }
.auth-hero .pt .dot-ic { flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; margin-top: -2px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.home-link {
  position: absolute; top: 18px; right: 22px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-faint); display: inline-flex; align-items: center; gap: 6px;
}
.home-link:hover { color: var(--teal); text-decoration: none; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 30px 32px; }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--ink-faint); font-size: 13px; margin: 0 0 20px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 16px; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 11px; font-weight: 700; letter-spacing: .06em; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }

.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-pick label {
  border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 13px 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s; display: block;
}
.kind-pick label b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.kind-pick label span { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; line-height: 1.4; }
.kind-pick input:checked + label { border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgba(26,176,186,.16); background: #f0f9fa; }

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { min-height: 230px; padding: 28px; }
  .auth-hero h1 { margin-top: 18px; font-size: 24px; }
  .auth-hero .points { display: none; }
}

/* ================= app shell ================= */
.shell { display: flex; min-height: 100vh; }
.rail {
  width: 60px; background: var(--chrome); display: flex; flex-direction: column;
  align-items: center; padding: 14px 0 12px; gap: 6px; flex: none;
  position: sticky; top: 0; height: 100vh;
}
.rail .logo { margin-bottom: 10px; }
.rail-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #8fa7ae; cursor: pointer; border: 0; background: transparent; position: relative;
  transition: color .15s, background .15s;
}
.rail-btn:hover { color: #d9ecef; background: rgba(255,255,255,.06); }
.rail-btn.active { color: #fff; background: var(--teal-grad); box-shadow: 0 6px 14px rgba(13,148,160,.5); }
.rail-btn .tip {
  position: absolute; left: 50px; top: 50%; transform: translateY(-50%);
  background: #0c232d; color: #e7f2f5; font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap; opacity: 0;
  pointer-events: none; transition: opacity .12s; z-index: 30;
}
.rail-btn:hover .tip, .rail-btn:focus-visible .tip { opacity: 1; }
.rail .me {
  margin-top: auto; width: 34px; height: 34px; border-radius: 100px;
  background: var(--amber-grad); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; border: 0; cursor: pointer;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--card); box-shadow: 0 1px 0 rgba(15,35,46,.04), 0 8px 22px rgba(15,35,46,.05);
  position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.topbar .where { font-weight: 700; font-size: 16px; }
.topbar .crumb { color: var(--ink-faint); font-weight: 500; }
.content { flex: 1; padding: 20px 22px 34px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--card-shadow-sm); padding: 16px 18px; }
.kpi .k { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.kpi .v { font-size: 28px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-faint); padding: 9px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: #f0f9fa; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { text-align: center; color: var(--ink-faint); padding: 44px 20px; font-size: 13.5px; }
.empty svg { display: block; margin: 0 auto 12px; }

.section-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13.5px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.section-title .ic { width: 26px; height: 26px; border-radius: 9px; display: inline-grid; place-items: center; }

.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.int-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--card-shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.int-card .mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; }
.int-card h3 { font-size: 14.5px; }
.int-card p { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.45; flex: 1; }

.drawer-mask { position: fixed; inset: 0; background: rgba(10,30,40,.42); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 94vw); z-index: 41;
  background: var(--card); box-shadow: -18px 0 48px rgba(0,0,0,.3);
  transform: translateX(102%); transition: transform .2s ease; overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer .dhead { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: #fff; }
.drawer .dbody { padding: 16px 22px 30px; }

.rule-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rule-row .pts { flex: none; min-width: 38px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rule-row .ev { color: var(--ink-faint); font-size: 11.5px; margin-top: 1px; }

.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; font-weight: 700; }

.skel { background: linear-gradient(90deg, var(--track) 25%, var(--dim-bg) 50%, var(--track) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .drawer, .drawer-mask { transition: none; } }

.btn:focus-visible, .rail-btn:focus-visible, .me:focus-visible, a:focus-visible {
  outline: 2px solid var(--teal-bright); outline-offset: 2px; border-radius: 8px;
}
.tbl tbody tr:focus-visible { background: #f0f9fa; outline: 2px solid var(--teal-bright); outline-offset: -2px; }
.field input:focus-visible, .field select:focus-visible, .inline-input:focus-visible {
  border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgba(26, 176, 186, .18); outline: none;
}

.label { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.inline-input {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 11px;
  font: 500 12px 'DM Sans', system-ui, sans-serif; color: var(--ink); background: #fff;
}

/* first-run setup panel: the signature vignette, restyled for light surfaces */
.setup-grid { display: grid; grid-template-columns: 1.2fr .9fr; gap: 28px; padding: 26px 30px; align-items: start; }
.step { display: flex; gap: 13px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.step.dim { opacity: .5; }
.step-num {
  flex: none; width: 26px; height: 26px; border-radius: 100px; background: var(--teal-grad);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; margin-top: -1px;
}
.step-sub { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.xc {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 12px;
  box-shadow: var(--card-shadow); transform: rotate(-1.2deg); max-width: 330px; justify-self: end;
}
.xc-row { display: flex; align-items: center; gap: 12px; }
.xc-host { display: block; font-weight: 700; font-size: 14px; }
.xc-sub { display: block; font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.xc-rule { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--ink-soft); padding: 7px 2px; border-bottom: 1px solid var(--line); }
.xc-rule b { min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.xc-ref { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--ink-faint); }
.xc-cap { font-size: 10.5px; color: var(--ink-faint); text-align: center; margin-top: 9px; }
@media (max-width: 880px) { .setup-grid { grid-template-columns: 1fr; } .xc { justify-self: center; transform: none; } }

/* roadmap: a dense editorial list, not a fake marketplace */
.rm-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-left: 3px solid var(--line-strong); border-bottom: 1px solid var(--line); font-size: 13px; }
.rm-row:last-child { border-bottom: 0; }
.rm-blurb { color: var(--ink-soft); font-size: 12px; flex: 1; min-width: 0; }
.rm-vote { flex: none; }
.rm-vote:hover { text-decoration: none; filter: brightness(.94); }

.drawer-x { width: 34px; height: 34px; padding: 0; border-radius: 9px; }

.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.98);
  width: min(560px, 94vw); max-height: 86vh; overflow-y: auto; z-index: 41;
  background: var(--card); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal-head h3 { font-size: 16px; flex: 1; min-width: 0; }
.modal-body { padding: 16px 22px 22px; }
.t360-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); margin: 16px 0 6px; }
.t360-h:first-child { margin-top: 0; }
.t360-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.t360-empty { font-size: 12px; color: var(--ink-faint); margin: 2px 0 6px; }

.support-banner {
  background: var(--amber-grad); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 8px 18px; display: flex; align-items: center; gap: 12px; position: relative; z-index: 4;
}
.support-banner .btn { background: rgba(255,255,255,.18); color: #fff; border: 0; }
.qr-box svg { border: 1px solid var(--line); border-radius: 12px; background: #fff; display: block; }

@media (max-width: 760px) {
  .rail { position: fixed; bottom: 0; top: auto; height: 56px; width: 100%; flex-direction: row; justify-content: center; padding: 8px 10px; z-index: 20; }
  .rail-btn .tip { display: none; }
  .rail .logo, .rail .me { display: none; }
  .shell { flex-direction: column; }
  .content { padding: 14px 16px 90px; }
  .topbar { padding: 0 16px; }
}

.btn-danger-ghost { color: var(--bad) !important; border-color: var(--bad) !important; }


/* ---------- profile menu (topbar) ---------- */
.pm-wrap { position: relative; }
.pm-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--card-shadow); padding: 8px; z-index: 60;
}
.pm-id { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pm-id b { display: block; font-size: 13px; word-break: break-all; }
.pm-id span { font-size: 11.5px; color: var(--ink-faint); }
.pm-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 9px; padding: 9px 12px;
  font: 600 13px 'DM Sans', system-ui, sans-serif; color: var(--ink-soft); cursor: pointer;
}
.pm-item:hover { background: var(--dim-bg); color: var(--ink); text-decoration: none; }
.pm-theme { display: flex; gap: 4px; padding: 6px 10px 8px; }
.pm-theme button {
  flex: 1; border: 1px solid var(--line-strong); background: var(--field-bg); color: var(--ink-soft);
  border-radius: 8px; padding: 7px 0; font: 600 11.5px 'DM Sans', system-ui, sans-serif; cursor: pointer;
}
.pm-theme button[aria-pressed="true"] { background: var(--teal-grad); color: #fff; border-color: transparent; }

/* selection follows the theme — the browser default looked broken on teal */
::selection { background: rgba(14, 124, 134, 0.25); color: var(--ink); }
[data-theme="dark"] ::selection { background: rgba(47, 185, 195, 0.45); color: #fff; }

/* ---------- compact density (per-user pref) ---------- */
.density-compact { font-size: 13px; }
.density-compact .tbl td { padding: 4px 6px; font-size: 12px; }
.density-compact .tbl th { padding: 3px 6px; }
.density-compact .kpi { padding: 10px 12px; }
.density-compact .kpi .v { font-size: 20px; }
.density-compact .card-pad { padding: 12px 14px; }
.density-compact .section-title { padding: 10px 14px 0; }
