/* בתוקף — design tokens, layout, components */

:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #EFEBE3;
  --ink: #18212B;
  --ink-2: #4B5563;
  --ink-3: #59626E;
  --line: #E3DED4;
  --brand: #0E7C66;
  --brand-strong: #0A5E4D;
  --brand-soft: #DDF1EA;
  --brand-ink: #0A5E4D;
  --on-brand: #FFFFFF;
  --tint-s: 45%;
  --tint-bg: 92%;
  --tint-fg: 30%;
  --accent: #F2A33A;
  --accent-soft: #FDF1DD;
  --ret: #C2410C;
  --ret-soft: #FFEDD5;
  --ret-line: #FDBA74;
  --ret-end: #7C2D12;
  --ok: #16794A;
  --ok-soft: #E1F3E8;
  --warn: #8F5300;
  --warn-soft: #FCEFD7;
  --warn-line: #EDBE6A;
  --bad: #B42318;
  --bad-soft: #FCE6E3;
  --none: #5B6470;
  --none-soft: #ECEAE5;
  --violet: #6D28D9;
  --violet-soft: #EFE7FD;
  --shadow: 0 1px 2px rgba(24, 33, 43, .06), 0 6px 20px rgba(24, 33, 43, .06);
  --shadow-lg: 0 10px 40px rgba(24, 33, 43, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --ring: 0 0 0 3px var(--bg), 0 0 0 6px var(--brand);
  --font: 'Rubik', system-ui, 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  --nav-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1419; --surface: #171E25; --surface-2: #1F2830; --ink: #EDF1F5; --ink-2: #B9C3CD; --ink-3: #95A1AE; --line: #2A3540;
    --brand: #3CC7A3; --brand-strong: #6ADBBE; --brand-soft: #123D34; --on-brand: #04201A; --brand-ink: #3CC7A3; --tint-s: 25%; --tint-bg: 20%; --tint-fg: 75%;
    --accent: #F5B451; --accent-soft: #3A2A0E; --ret: #FB923C; --ret-soft: #3B1D0B; --ret-line: #9A4A14; --ret-end: #FFD9BF;
    --ok: #63D7A0; --ok-soft: #12352A; --warn: #F5B451; --warn-soft: #3A2A0E; --warn-line: #7A5717; --bad: #FF8E84; --bad-soft: #3D1714;
    --none: #A9B3BE; --none-soft: #232C35; --violet: #C4A7FF; --violet-soft: #2C2045;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1419; --surface: #171E25; --surface-2: #1F2830; --ink: #EDF1F5; --ink-2: #B9C3CD; --ink-3: #95A1AE; --line: #2A3540;
  --brand: #3CC7A3; --brand-strong: #6ADBBE; --brand-soft: #123D34; --on-brand: #04201A; --brand-ink: #3CC7A3; --tint-s: 25%; --tint-bg: 20%; --tint-fg: 75%;
  --accent: #F5B451; --accent-soft: #3A2A0E; --ret: #FB923C; --ret-soft: #3B1D0B; --ret-line: #9A4A14; --ret-end: #FFD9BF;
  --ok: #63D7A0; --ok-soft: #12352A; --warn: #F5B451; --warn-soft: #3A2A0E; --warn-line: #7A5717; --bad: #FF8E84; --bad-soft: #3D1714;
  --none: #A9B3BE; --none-soft: #232C35; --violet: #C4A7FF; --violet-soft: #2C2045;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
/* high contrast: pure ink, solid borders */
:root[data-contrast="high"] {
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F2F2F2; --ink: #000000; --ink-2: #000000; --ink-3: #1A1A1A; --line: #000000;
  --brand: #00513F; --brand-strong: #003328; --brand-soft: #E3F5EF; --brand-ink: #00513F; --violet: #4C1D95; --ok: #00512E; --warn: #5C3500; --bad: #8A0F06; --none: #000; --ret: #7A2600; --ret-end: #4A1600;
  --shadow: none; --shadow-lg: 0 0 0 3px #000;
  color-scheme: light;
}
:root[data-contrast="high"][data-theme="dark"] {
  --bg: #000000; --surface: #000000; --surface-2: #141414; --ink: #FFFFFF; --ink-2: #FFFFFF; --ink-3: #EEEEEE; --line: #FFFFFF;
  --brand: #7BF5D2; --brand-strong: #B5FFE9; --brand-soft: #0A2E25; --brand-ink: #7BF5D2; --on-brand: #000; --ok: #8CFFC0; --warn: #FFD27A; --bad: #FFB0A8; --none: #fff;
  --ok-soft: #000; --warn-soft: #000; --bad-soft: #000; --none-soft: #000; --accent-soft: #000; --violet: #D8C4FF; --violet-soft: #000; --ret: #FFB27A; --ret-soft: #000; --ret-end: #FFE0C8;
  color-scheme: dark;
}
:root[data-contrast="high"] .card, :root[data-contrast="high"] .doc, :root[data-contrast="high"] .folder, :root[data-contrast="high"] .stat,
:root[data-contrast="high"] .field input, :root[data-contrast="high"] .field select, :root[data-contrast="high"] .field textarea { border-width: 2px; border-color: var(--line); }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html[data-size="large"] { font-size: 112.5%; }
html[data-size="xl"] { font-size: 128%; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

.ic { width: 1.25em; height: 1.25em; flex: none; }
.ic-lg { width: 1.6em; height: 1.6em; }
.flip { transform: scaleX(-1); }

/* ---------- layout ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
main { width: 100%; max-width: 1040px; margin-inline: auto; padding: 20px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); outline: none; container-type: inline-size; container-name: main; }

.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav .nav-brand, .nav .nav-cta { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0 4px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: var(--nav-h); }
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; padding: 6px 2px 8px; color: var(--ink-3); text-decoration: none; font-size: .78rem; font-weight: 500;
}
.nav a .ic { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--brand-ink); }
.nav a[aria-current="page"] .ic { stroke-width: 2.4; }
.nav .nav-add a { color: var(--ink-2); }
.nav .nav-add .fab {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; margin-top: -26px;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent);
  transition: transform .15s ease;
}
.nav .nav-add a:active .fab { transform: scale(.94); }
.nav .nav-add .fab .ic { width: 28px; height: 28px; stroke-width: 2.4; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 0; height: 100vh; height: 100dvh; inset: auto; border-top: 0; border-inline-end: 1px solid var(--line);
    background: var(--surface); padding: 22px 14px; display: flex; flex-direction: column; gap: 18px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav .nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; color: var(--ink); }
  .nav-brand strong { font-size: 1.35rem; letter-spacing: -.01em; }
  .nav-brand small { display: block; color: var(--ink-3); font-size: .78rem; font-weight: 400; }
  .nav a.nav-cta { display: flex; justify-content: center; color: var(--on-brand); font-weight: 600; }
  .nav a.nav-cta:hover { background: var(--brand-strong); color: var(--on-brand); }
  .nav ul { display: flex; flex-direction: column; height: auto; gap: 2px; padding: 0; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; border-radius: 12px; font-size: 1rem; min-height: 46px; }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a[aria-current="page"] { background: var(--brand-soft); }
  .nav .nav-add { display: none; }
  main { padding: 36px 40px 64px; }
  .nav-foot { margin-top: auto; padding: 0 10px; color: var(--ink-3); font-size: .82rem; }
}
@media (max-width: 899px) { .nav-foot { display: none; } }

.logo { width: 40px; height: 40px; flex: none; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { outline: none; }
.eyebrow { color: var(--ink-3); font-size: .9rem; margin-bottom: 4px; }
.lead { color: var(--ink-2); font-size: 1.05rem; margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-weight: 500; min-height: 44px; margin: -8px 0 4px; }
.back:hover { color: var(--ink); }
section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-size: .92rem; font-weight: 500; text-decoration: none; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px;
  border-radius: 14px; border: 1.5px solid transparent; background: var(--surface-2); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-block { width: 100%; }
.btn-lg { min-height: 60px; font-size: 1.08rem; border-radius: 18px; padding-inline: 24px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- capture hero: one big camera button, a small file button beside it ---------- */
.capture { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 10px; }
.capture .btn { min-height: 92px; border-radius: 24px; white-space: normal; gap: 14px; padding: 14px 18px; }
.capture .btn-primary { justify-content: flex-start; text-align: start; font-size: 1.2rem; }
.capture .btn-primary small { display: block; font-weight: 400; font-size: .88rem; }
/* the slogan, the whole width of the button under the title: "בגדול" big, "באותיות הקטנות" small */
.capture .btn-primary { flex-wrap: wrap; row-gap: 10px; }
.capture .slogan { flex-basis: 100%; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--on-brand) 28%, transparent); font-size: .92rem; font-weight: 500; line-height: 1.45; }
.capture .slogan b { font-size: 1.35em; font-weight: 800; }
.capture .slogan small { display: inline; font-size: .8em; font-weight: 500; }
.capture .btn-secondary { flex-direction: column; gap: 6px; padding: 10px; font-size: .95rem; }
.capture .bub { width: 58px; height: 58px; background: color-mix(in srgb, var(--on-brand) 20%, transparent); color: inherit; }
.capture .bub .ic { width: 30px; height: 30px; }
.capture .btn-secondary .bub { width: 44px; height: 44px; background: var(--brand-soft); color: var(--brand-ink); }
.capture .btn-secondary .bub .ic { width: 24px; height: 24px; }

/* round icon "bubble": the big friendly icon used across the app */
.bub { width: 52px; height: 52px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--surface); color: var(--ink-2); }
.bub .ic { width: 28px; height: 28px; stroke-width: 2.1; }
.bub.sm { width: 40px; height: 40px; }
.bub.sm .ic { width: 22px; height: 22px; }
.bub.lg { width: 68px; height: 68px; }
.bub.lg .ic { width: 36px; height: 36px; }
.bub.hue { background: hsl(var(--hue, 170) var(--tint-s) var(--tint-bg)); color: hsl(var(--hue, 170) 55% var(--tint-fg)); }

/* ---------- cards / stats: big tinted tiles, one number and two words each ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stat {
  --t-soft: var(--surface); --t-ink: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  padding: 14px 8px 12px; min-height: 148px; border-radius: 24px; background: var(--t-soft); color: var(--t-ink);
  border: 1px solid color-mix(in srgb, var(--t-ink) 18%, transparent); text-decoration: none; transition: transform .12s;
}
a.stat:hover { border-color: var(--t-ink); }
a.stat:active { transform: scale(.98); }
.stat .bub { margin-bottom: 4px; color: var(--t-ink); }
.stat .num { font-size: 2.3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: .95rem; font-weight: 600; line-height: 1.25; }
.stat.ok { --t-soft: var(--ok-soft); --t-ink: var(--ok); }
.stat.warn { --t-soft: var(--warn-soft); --t-ink: var(--warn); }
.stat.ret { --t-soft: var(--ret-soft); --t-ink: var(--ret); }
.stat.reg { --t-soft: var(--violet-soft); --t-ink: var(--violet); }
/* registering in time is the one thing that costs money if missed: a wide tile on top */
.stat.reg { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; text-align: start; gap: 14px; min-height: 0; padding: 14px 16px; }
.stat.reg .bub { margin: 0; }
.stat.reg .reg-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat.reg .reg-text .num { font-size: 1.9rem; }
.stat.reg .reg-next, .stat.reg .reg-missed { font-size: .88rem; font-weight: 500; }
.stat.reg.urgent { background: var(--violet); color: var(--surface); border-color: var(--violet); }
.stat.reg.urgent .bub { background: var(--surface); color: var(--violet); }
.stat.reg .reg-missed { color: var(--bad); font-weight: 700; }
.stat.reg.urgent .reg-missed { color: inherit; }
.stat.value { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; min-height: 0; padding: 12px 16px; border-radius: 18px; background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.stat.value .num { font-size: 1.35rem; }
.stat.value .lbl { font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
@container main (max-width: 420px) { .stat { min-height: 136px; } .stat .num { font-size: 2rem; } .stat .lbl { font-size: .86rem; } }
:root[data-contrast="high"] .stat { border-width: 2px; border-color: var(--ink); }

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin-top: 16px;
  background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink);
}
.banner .ic { color: var(--warn); margin-top: 2px; }
.banner strong { display: block; }
.banner ul { margin: 4px 0 0; padding-inline-start: 18px; }
.banner.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.banner.info .ic { color: var(--brand-ink); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.banner.bad .ic { color: var(--bad); }

/* ---------- document rows ---------- */
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@container main (min-width: 900px) { .docs.two { grid-template-columns: 1fr 1fr; } }
.doc {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); min-height: 84px; transition: border-color .15s;
}
.doc:hover { border-color: var(--ink-3); }
.thumb {
  width: 60px; height: 60px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; flex: none;
  background: hsl(var(--hue, 170) var(--tint-s) var(--tint-bg)); color: hsl(var(--hue, 170) 55% var(--tint-fg));
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ic { width: 28px; height: 28px; }
.doc-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.doc-title { font-weight: 600; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-sub { color: var(--ink-3); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 5px; max-width: 260px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.bar.soon > span { background: var(--accent); }
.bar.expired > span { background: var(--none); }
.doc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@container main (max-width: 520px) {
  .doc { grid-template-columns: 52px minmax(0, 1fr); }
  .thumb { width: 52px; height: 52px; }
  .doc-side { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  white-space: nowrap; background: var(--none-soft); color: var(--none);
}
.chip .ic { width: 15px; height: 15px; }
.chip.active { background: var(--ok-soft); color: var(--ok); }
.chip.soon { background: var(--warn-soft); color: var(--warn); }
.chip.expired { background: var(--none-soft); color: var(--none); }
.chip.return { background: var(--ret-soft); color: var(--ret); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.register { background: var(--violet-soft); color: var(--violet); }
:root[data-contrast="high"] .chip { border: 1.5px solid currentColor; }

/* ---------- empty state: a big friendly icon and one light line ---------- */
.empty { text-align: center; padding: 30px 20px 26px; }
.empty svg.art { width: 170px; height: auto; margin: 0 auto 16px; }
.empty .bub { margin: 0 auto 12px; background: var(--surface-2); color: var(--ink-2); }
.empty h2 { font-size: 1.3rem; }
.empty p { color: var(--ink-2); max-width: 420px; margin: 8px auto 0; }

.tip { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--radius); padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.tip .ic { color: var(--warn); margin-top: 2px; }

/* ---------- folders: big icon, short name, the count as a number ---------- */
.folders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
@container main (min-width: 560px) { .folders { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container main (min-width: 860px) { .folders { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.folder {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; min-height: 132px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
}
.folder:hover { border-color: var(--ink-3); }
.folder .fi { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--hue) var(--tint-s) var(--tint-bg)); color: hsl(var(--hue) 55% var(--tint-fg)); }
.folder .fi .ic { width: 30px; height: 30px; }
.folder .fn { font-weight: 600; line-height: 1.3; margin-top: auto; }
.folder .fc { position: absolute; top: 14px; inset-inline-end: 14px; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; background: hsl(var(--hue) var(--tint-s) var(--tint-bg)); color: hsl(var(--hue) 55% var(--tint-fg)); }
.folder.dim { box-shadow: none; background: transparent; border-style: dashed; }
.folder.dim .fi { filter: grayscale(.8); }
.folder.dim .fc { font-weight: 500; font-size: .85rem; background: transparent; color: var(--ink-3); }
.years { display: flex; flex-wrap: wrap; gap: 8px; }
.years a { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 0 14px; min-height: 50px;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; font-size: 1.02rem; padding: 12px 0; }
.search .ic { color: var(--ink-3); }
.select { min-height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 14px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
legend { font-weight: 700; font-size: 1.08rem; padding: 0; float: inline-start; width: 100%; }
.fieldset-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@container main (min-width: 520px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field > label, .field .label { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 1rem;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.field input[dir="ltr"] { text-align: right; }
.hint { color: var(--ink-3); font-size: .86rem; }
.err { color: var(--bad); font-size: .9rem; font-weight: 500; }
.field.invalid input { border-color: var(--bad); }
.auto { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }
.auto .ic { width: 13px; height: 13px; }
.field.unsure input, .field.unsure select { border-color: var(--warn-line); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.auto.check { background: var(--warn-soft); color: var(--warn); }
.req { color: var(--bad); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s;
}
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.computed { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: .95rem; }
.computed strong { color: var(--ink); }

.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: inset-inline-start .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { inset-inline-start: 25px; }
.switch input:focus-visible { box-shadow: var(--ring); }
:root[data-contrast="high"] .switch input { border: 2px solid var(--ink); }

details.more > summary { cursor: pointer; font-weight: 700; font-size: 1.08rem; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .ic { transition: transform .2s; }
details.more[open] > summary .ic { transform: rotate(-90deg); }
details.more > .inner { display: grid; gap: 14px; margin-top: 12px; }

.form-layout { display: grid; gap: 20px; }
@container main (min-width: 880px) {
  .form-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .form-layout .preview { position: sticky; top: 24px; order: 2; }
}
.preview .pv-img { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.preview .pv-img img { width: 100%; max-height: 60vh; object-fit: contain; }
.preview .pv-strip { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.preview .pv-strip button { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; flex: none; cursor: pointer; background: var(--surface-2); }
.preview .pv-strip button[aria-current="true"] { border-color: var(--brand); }
.preview .pv-strip img { width: 100%; height: 100%; object-fit: cover; }
@container main (max-width: 879px) { .preview .pv-img img { max-height: 240px; } }

.sticky-actions {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 5; display: flex; gap: 10px;
  padding: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sticky-actions .btn-primary { flex: 1; }
@media (min-width: 900px) { .sticky-actions { bottom: 16px; } }

/* ---------- add flow ---------- */
.pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container main (min-width: 600px) { .pages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.page { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.page img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--surface-2); }
.page .tools { display: flex; justify-content: space-between; padding: 6px; gap: 6px; }
.page .tools .icon-btn { width: 44px; height: 44px; }
.page .pnum { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; padding: 2px 9px; border-radius: 999px; }
.add-page { display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: stretch; padding: 14px; border: 2px dashed var(--line); border-radius: var(--radius); min-height: 220px; }
.add-page .btn { width: 100%; }

.progress-card { text-align: center; padding: 36px 22px; }
.spinner { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; border: 6px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pbar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; max-width: 360px; margin: 18px auto 0; }
.pbar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; border-radius: inherit; }
.pbar.indeterminate span { width: 35%; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(120%); } 100% { transform: translateX(-320%); } }
.steps { list-style: none; padding: 0; margin: 20px auto 0; display: grid; gap: 8px; max-width: 360px; text-align: start; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.steps li.done { color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 600; }

.dropzone { display: none; }
body.dragging .dropzone {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--brand) 18%, transparent);
  border: 4px dashed var(--brand); font-size: 1.4rem; font-weight: 700; color: var(--brand-ink);
}

/* ---------- item ---------- */
.item-layout { display: grid; gap: 20px; }
@container main (min-width: 820px) { .item-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .item-layout .gallery { position: sticky; top: 24px; order: 2; } }
.gallery .main-img { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); cursor: zoom-in; display: block; width: 100%; padding: 0; }
.gallery .main-img img { width: 100%; max-height: 420px; object-fit: contain; }
.gallery .noimg { display: grid; place-items: center; min-height: 180px; color: var(--ink-3); gap: 8px; text-align: center; padding: 20px; }

.status-card { padding: 20px; border-radius: var(--radius); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.status-card.soon { background: var(--warn-soft); border-color: var(--warn-line); }
.status-card.expired, .status-card.none { background: var(--none-soft); border-color: var(--line); }
.status-card .big { font-size: 1.45rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.status-card.active .big { color: var(--ok); }
.status-card.soon .big { color: var(--warn); }
.status-card.expired .big, .status-card.none .big { color: var(--ink-2); }
.status-card .bar { max-width: none; height: 10px; margin-top: 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.status-card .ends { margin-top: 8px; color: var(--ink-2); }
.timeline-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-3); margin-top: 6px; }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--ink-3); padding-inline-end: 18px; font-size: .95rem; }
.facts dd { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.facts dd .heb { color: var(--ink-3); font-weight: 400; font-size: .9rem; }
.facts .mini { min-height: 36px; padding: 4px 10px; font-size: .85rem; border-radius: 10px; }
/* actions: an icon tile and a word or two each */
.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@container main (min-width: 600px) { .acts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 10px 6px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .92rem;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s, border-color .15s;
}
.act:hover { border-color: var(--ink-3); }
.act:active { transform: scale(.97); }
.act .bub { background: var(--brand-soft); color: var(--brand-ink); }
.act[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.ocr { white-space: pre-wrap; font-size: .9rem; color: var(--ink-2); background: var(--surface-2); padding: 14px; border-radius: 12px; max-height: 320px; overflow: auto; margin-top: 10px; }

.success { text-align: center; padding: 26px 18px; background: var(--brand-soft); border-radius: 24px; margin-bottom: 18px; }
.success > .bub { color: var(--brand-ink); }
.success h2 { margin-top: 10px; font-size: 1.35rem; }
.success-joke { margin-top: 8px !important; font-weight: 500; color: var(--brand-ink); }

/* ---------- traffic-light card ---------- */
.tl { display: grid; gap: 12px; margin-top: 16px; }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-head h2 { display: flex; align-items: center; gap: 8px; }
.tl-head h2 .ic { width: 24px; height: 24px; color: var(--brand); stroke-width: 2.4; flex: none; } /* the magnifier: reading the fine print */
.tl-bar { display: flex; gap: 3px; height: 10px; }
.tl-bar span { border-radius: 6px; }
.tl-bar .seg1 { flex: 1; background: var(--ok); }
.tl-bar .seg2 { flex: 5; background: var(--warn-soft); border: 1.5px dashed var(--warn-line); }
.tl-bar .seg2.secured { background: var(--ok-soft); border: 1.5px solid var(--ok); }
.tl-bar .seg2.lost { background: var(--none-soft); border: 1.5px dashed var(--none); }
.tl-group { border-radius: 14px; padding: 12px 14px; }
.tl-group h3 { display: flex; gap: 8px; align-items: center; font-size: 1.02rem; margin-bottom: 2px; }
.tl-group > p { margin: 4px 0; color: var(--ink-2); }
.tl-yellow, .tl-keep { background: var(--warn-soft); }
.tl-yellow h3, .tl-keep h3 { color: var(--warn); }
.tl-keep { padding-block: 8px; }
.tl-late { background: var(--bad-soft); border: 1.5px solid var(--bad); }
.tl-late h3 { color: var(--bad); }
.tl-green { background: var(--ok-soft); }
.tl-green h3 { color: var(--ok); }
.tl-red { background: var(--bad-soft); }
.tl-red h3 { color: var(--bad); }
.tl-gray { background: var(--surface-2); }
.tl-gray h3 { color: var(--ink-2); }
.tl-count { font-weight: 500; }
.tl-sub { font-weight: 600; color: var(--warn) !important; margin-top: 8px !important; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 9px 0; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.tl-row:first-child { border-top: 0; }
.tl-mark { display: grid; place-items: center; min-height: 24px; color: var(--ink-3); font-weight: 700; }
.tl-green .tl-mark { color: var(--ok); }
.tl-red .tl-mark { color: var(--bad); }
.tl-yellow .tl-mark, .tl-keep .tl-mark { color: var(--warn); }
.tl-mark.tl-ok { color: var(--ok); }
.tl-mark.tl-warn { color: var(--warn); }
.tl-okt { color: var(--ok); font-weight: 600; }
.tl-action input[type="checkbox"] { width: 24px; height: 24px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.tl-action label { cursor: pointer; }
.tl-due { display: block; color: var(--warn); font-weight: 600; font-size: .92rem; }
.tl-late .tl-due { color: var(--bad); }
.tl-btns { margin-top: 8px; }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: .92rem; border-radius: 12px; }
.tl-src { font: inherit; font-size: .84rem; color: var(--brand-ink); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; }
.tl-quote { margin-top: 2px; }
.tl-quote summary, .tl-more summary { cursor: pointer; color: var(--ink-3); font-size: .86rem; min-height: 28px; display: inline-flex; align-items: center; }
.tl-quote q { display: block; margin-top: 4px; padding: 6px 10px; border-inline-start: 3px solid var(--warn-line); color: var(--ink-2); font-size: .92rem; }
.tl-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--ok-soft); outline: none; }
.tl-done > .ic { color: var(--ok); margin-top: 2px; }
.tl-foot { font-size: .86rem; color: var(--ink-3); }
.tl-foot .ic { width: 1em; height: 1em; vertical-align: -2px; }
.tl-collapsing { overflow: hidden; transition: max-height .3s ease, opacity .3s ease, padding .3s ease; }
.tl-collapsing.go { max-height: 0 !important; opacity: 0; padding-block: 0; }
.success-reg { margin-top: 12px !important; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); text-align: start; }
.success-reg .ic { width: 1.1em; height: 1.1em; color: var(--warn); vertical-align: -3px; }
@container main (max-width: 520px) { .tl-row { grid-template-columns: 26px minmax(0, 1fr); } .tl-row > .tl-src { grid-column: 2; justify-self: start; } }
:root[data-contrast="high"] .tl-group { border: 2px solid var(--line); }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head h2 { text-align: center; }
.cal-head h2 small { display: block; color: var(--ink-3); font-weight: 400; font-size: .85rem; }
.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { font-size: .82rem; color: var(--ink-3); font-weight: 600; padding: 4px 0; }
.cal td { padding: 0; }
.day {
  width: 100%; aspect-ratio: 1 / 1.05; min-height: 44px; border-radius: 12px; border: 1px solid transparent; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 5px 2px 4px; gap: 1px; cursor: pointer; position: relative;
}
.day:hover { border-color: var(--line); }
.day .dn { font-weight: 600; font-size: .98rem; line-height: 1.2; }
.day .hd { font-size: .66rem; color: var(--ink-3); line-height: 1.1; }
.day .dots { display: flex; gap: 3px; margin-top: auto; min-height: 7px; flex-wrap: wrap; justify-content: center; }
.day .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--none); display: block; }
.day .dots i.warranty { background: var(--accent); }
.day .dots i.return { background: var(--ret); }
.day .dots i.buy { background: var(--brand); }
.day .dots i.register { background: var(--violet); }
.day.out { background: transparent; }
.day.out .dn { color: var(--ink-3); font-weight: 400; }
.day.out .hd { visibility: hidden; }
.day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.day[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.day[aria-pressed="true"] .hd { color: inherit; opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); }
.event:hover { border-color: var(--ink-3); }
.event .when { text-align: center; border-radius: 10px; padding: 6px 0; background: var(--surface-2); line-height: 1.15; }
.event .when b { display: block; font-size: 1.2rem; }
.event .when small { font-size: .72rem; color: var(--ink-3); }
.event.warranty .when { background: var(--accent-soft); }
.event.return .when { background: var(--ret-soft); }
.event.register .when { background: var(--violet-soft); }
.event .et { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event .es { font-size: .86rem; color: var(--ink-3); }
.cal-layout { display: grid; gap: 22px; }
@container main (min-width: 860px) { .cal-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }

/* ---------- settings ---------- */
.settings { display: grid; gap: 16px; }
.settings .card h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.settings .card h2 .ic { color: var(--brand-ink); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row:last-child { border-bottom: 0; }
.row .rl { flex: 1 1 220px; }
.row .rl span { display: block; color: var(--ink-3); font-size: .88rem; }
.engine { display: grid; gap: 10px; }
.engine label.opt { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; }
.engine label.opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.engine input[type="radio"] { width: 22px; height: 22px; accent-color: var(--brand); margin-top: 2px; }
.engine .on { color: var(--ink-3); font-size: .9rem; display: block; }
.keybox { display: flex; gap: 8px; flex-wrap: wrap; }
.keybox input { flex: 1 1 220px; }

/* ---------- dialog ---------- */
dialog {
  border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
}
dialog::backdrop { background: rgba(10, 16, 22, .55); }
dialog .dh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
dialog .db { padding: 8px 18px 18px; overflow: auto; max-height: calc(100dvh - 180px); display: grid; gap: 12px; }
dialog .df { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 18px 18px; border-top: 1px solid var(--line); }
dialog .df .btn { flex: 1 1 auto; }
dialog.viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; background: #0B0F13; color: #fff; }
dialog.viewer .vb { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; touch-action: pinch-zoom pan-x pan-y; }
dialog.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
dialog.viewer.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
dialog.viewer .vt { position: absolute; top: 12px; inset-inline: 12px; display: flex; justify-content: space-between; z-index: 2; }
dialog.viewer .icon-btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: transparent; }

/* ---------- toasts ---------- */
/* the family pilot: "הערה", low on the end side, above the bottom bar; hidden where a form keeps its save bar */
.fb-btn { position: fixed; z-index: 90; inset-inline-end: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .88rem; font-weight: 600;
  box-shadow: var(--shadow); cursor: pointer; }
.fb-btn .ic { width: 18px; height: 18px; color: var(--brand); }
.fb-btn:hover { color: var(--ink); border-color: var(--ink-3); }
@media (min-width: 900px) { .fb-btn { bottom: 16px; } }
@media print { .fb-btn { display: none; } }
.toasts { position: fixed; z-index: 95; inset-inline: 12px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; inset-inline-start: 276px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 520px; font-weight: 500;
  animation: rise .2s ease-out;
}
.toast button { background: transparent; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; cursor: pointer; min-height: 40px; padding: 0 8px; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.view-enter { animation: fadein .22s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* ---------- print ---------- */
@media print {
  .nav, .toasts, .btn, .icon-btn, .sticky-actions, .back, .skip, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .item-layout { grid-template-columns: 1fr !important; }
  .card, .status-card { box-shadow: none; border: 1px solid #999; }
  .gallery .main-img img { max-height: none; }
}

[tabindex="-1"]:focus { box-shadow: none; }
/* status when part of the warranty depends on registering, or that chance was missed */
.status-card.conditional { background: var(--warn-soft); border-color: var(--warn-line); }
.status-card.conditional .big { color: var(--warn); }
.status-card.lost { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.status-card.lost .big { color: var(--bad); }
.status-card .btn-row { margin-top: 12px; }
.status-card .timeline-labels span:nth-child(2) { text-align: center; }

/* "needs registration" tile: always first, full width, loud only when something is waiting */
.chip.lost { background: var(--bad-soft); color: var(--bad); }
.status-card .big .yrs { font-size: 1.7em; font-weight: 800; line-height: 1; letter-spacing: -.01em; }

/* ---------- warranty ruler (status card) ---------- */
.tbar { margin-top: 28px; }
.tbar-track { position: relative; height: 14px; border-radius: 8px; background: color-mix(in srgb, var(--surface) 75%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent); }
.tbar-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 8px; background: var(--ok); }
.tbar.soon .tbar-fill { background: var(--accent); }
.tbar.expired .tbar-fill { background: var(--none); }
.tbar-seg { position: absolute; inset-block: 0; }
.tbar-seg.base { inset-inline-start: 0; background: color-mix(in srgb, var(--ok) 30%, var(--surface)); border-start-start-radius: 8px; border-end-start-radius: 8px; }
.tbar-seg.extra { inset-inline-end: 0; border: 1.5px dashed var(--warn); border-start-end-radius: 8px; border-end-end-radius: 8px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tbar-seg.extra.lost { border-color: var(--none); }
.tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-inline-start: -1px; border-radius: 1px; background: var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent); }
.tick.major { top: -6px; bottom: -6px; }
.tbar-scale { position: relative; height: 16px; margin-top: 8px; font-size: .76rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tbar-scale span { position: absolute; top: 0; transform: translateX(50%); }
.tbar-now { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-inline-start: -1.5px; border-radius: 2px; background: var(--ink); z-index: 1; }
.tbar-now > span { position: absolute; bottom: 100%; inset-inline-start: 0; margin-bottom: 2px; transform: translateX(50%); font-size: .74rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tbar-now.at-start > span { transform: none; }
.tbar-now.at-end > span { transform: translateX(100%); }
.tbar + .timeline-labels { margin-top: 2px; }
.tbar-scale span.end { font-size: .9rem; font-weight: 800; top: -2px; }
/* the end of the warranty stands out, in the colour of its state */
.tbar { --end: var(--ok); }
.tbar.soon, .tbar.conditional { --end: var(--warn); }
.tbar.expired, .tbar.lost { --end: var(--none); }
.tick.end { top: -9px; bottom: -9px; width: 4px; margin-inline-start: -2px; border-radius: 2px; background: var(--end); box-shadow: none; }
.tbar-scale span.end { color: var(--end); }

/* ---------- saving and backup ---------- */
.save-card > p.muted { margin-bottom: 4px; }
.save-h { font-size: 1rem; margin: 18px 0 8px; }
.dests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dests + .dests { margin-top: 8px; }
.dest { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; }
.dest-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.dest-main { display: grid; gap: 2px; min-width: 0; }
.dest-main > span { color: var(--ink-2); font-size: .9rem; overflow-wrap: anywhere; }
.dest-main .ic { width: 1em; height: 1em; vertical-align: -2px; }
.dest-ok { color: var(--ok) !important; font-weight: 600; }
.dest-warn { color: var(--warn) !important; font-weight: 600; }
.dest-err { color: var(--bad) !important; }
.dest-off { color: var(--ink-3) !important; font-style: italic; }
.dest-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.save-checks { display: grid; gap: 2px; }
#bk-preview { margin-top: 10px; }
@container main (max-width: 520px) { .dest { grid-template-columns: 40px minmax(0, 1fr); } .dest-act { grid-column: 1 / -1; justify-content: flex-start; } }

/* ---------- invoice items ---------- */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 44px; gap: 8px; align-items: center; }
.line-row input { width: 100%; min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.line-row input[dir="ltr"] { text-align: right; }
.line-row input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.line-row .icon-btn { width: 44px; height: 44px; }
#lines-sum.mismatch { background: var(--warn-soft); color: var(--ink); }
#lines-sum .ic { flex: none; }
.lines-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.lines-table th, .lines-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: start; }
.lines-table td[dir="ltr"] { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines-table thead th { color: var(--ink-3); font-weight: 600; font-size: .85rem; }
.lines-table tfoot th, .lines-table tfoot td { font-weight: 700; border-bottom: 0; }
.lines-table tr.credit td { color: var(--ok); }
.lines-ok { color: var(--ok); font-weight: 600; margin-top: 8px; }
.lines-ok .ic { width: 1em; height: 1em; vertical-align: -2px; }
@container main (max-width: 520px) {
  .lines { gap: 14px; }
  .line-row { grid-template-columns: minmax(0, 1fr) 44px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .line-row:last-child { padding-bottom: 0; border-bottom: 0; }
  .line-row input[name="lineName"] { grid-column: 1 / -1; }
}

/* ---------- a row of the invoice with a warranty of its own ---------- */
.line-sub { display: flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--ok); font-size: .8rem; font-weight: 600; }
.line-sub .ic { width: 14px; height: 14px; flex: none; }
.lines-table .split-cell { width: 1%; white-space: nowrap; text-align: start; }
.lines-table thead .split-cell { font-size: .8rem; }
.split-ctl { display: inline-flex; align-items: center; gap: 4px; }
@container main (max-width: 520px) {
  .lines-table thead .split-cell { white-space: normal; }
  .split-ctl { flex-direction: column; align-items: flex-start; gap: 2px; }
  .split-ctl select { font-size: .82rem; padding: 2px 6px; }
}
.split-hit { display: inline-grid; place-items: center; width: 40px; height: 40px; cursor: pointer; }
.split-hit input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.split-ctl select { min-height: 38px; padding: 4px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; }
.split-ctl select:focus-visible { outline: none; box-shadow: var(--ring); }
.split-main { font-size: .8rem; color: var(--ink-3); }
.from-invoice { margin-top: 6px; }
.from-invoice a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
@media print { .lines-table .split-cell { display: none; } }

/* ---------- return window: a strip of days, unlike the smooth warranty ruler ---------- */
.return-card { margin-top: 12px; padding: 20px; border-radius: var(--radius); background: var(--ret-soft); border: 1px solid var(--ret-line); }
.return-card .big { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 12px; color: var(--ret); }
.return-card .big .yrs { font-size: 1.4em; font-weight: 800; line-height: 1; }
.return-card .ends { margin-top: 8px; color: var(--ink-2); }
.return-card.urgent { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.return-card.urgent .big { color: var(--bad); }
.rbar { margin-top: 14px; }
.rbar-top, .rbar-days, .rbar-scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.rbar-top span, .rbar-scale span { display: flex; justify-content: center; white-space: nowrap; }
.rbar-top span { min-height: 1.3em; font-size: .74rem; font-weight: 700; color: var(--ink); }
.rbar-days { align-items: end; height: 30px; }
.rbar-days i { height: 22px; border-radius: 5px; }
.rbar-days i.left { background: var(--ret); }
.rbar-days i.used { background: color-mix(in srgb, var(--ret) 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ret) 30%, transparent); }
.rbar-days i.last { height: 30px; background: var(--ret-end); }
.rbar-days i.today { outline: 2.5px solid var(--ink); outline-offset: 1.5px; }
.rbar-scale { margin-top: 6px; font-size: .76rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rbar-scale span.end { font-size: .9rem; font-weight: 800; color: var(--ret); }
.rbar + .timeline-labels { margin-top: 4px; }

/* ---------- a calm day: a friendly icon instead of a warning ---------- */
.banner.calm { align-items: center; gap: 14px; }
.banner.calm .bub { background: var(--surface); color: var(--brand-ink); }
.banner.calm .bub .ic { color: inherit; margin: 0; }

/* ---------- item head and status: the big icon, the big number ---------- */
.page-head.item-head { justify-content: flex-start; align-items: center; gap: 14px; }
.status-card .big .bub { background: var(--surface); color: inherit; }
.status-card .big .bub .ic, .return-card .big .bub .ic { width: 30px; height: 30px; }
.return-card .big .bub { background: var(--surface); color: inherit; }
.state-pill { display: inline-block; vertical-align: middle; margin-inline-start: 6px; padding: 3px 12px; border-radius: 999px; font-size: .62em; font-weight: 700;
  background: var(--surface); color: inherit; letter-spacing: 0; }

/* ---------- add: other ways, one icon and one line each ---------- */
.ways { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--ink-2); }
.ways li { display: flex; align-items: center; gap: 12px; }
.progress-card .success-joke { margin-top: 14px; }

/* ---------- section headings: the icon sits in a bubble ---------- */
.card > h2:first-child { display: flex; align-items: center; gap: 12px; }
.card > h2:first-child > svg.ic:first-child { box-sizing: content-box; width: 22px; height: 22px; padding: 9px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); }
.card-head { display: flex; align-items: center; gap: 12px; }
.quiet { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; }
.quiet .ic { color: var(--brand-ink); }

/* big text on a narrow phone (measured in em, so it reacts to the text-size setting): stack instead of squeeze */
@container main (max-width: 22em) {
  .capture { grid-template-columns: minmax(0, 1fr); }
  .capture .btn-secondary { flex-direction: row; min-height: 64px; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat.ret { grid-column: 1 / -1; flex-direction: row; min-height: 0; gap: 12px; padding: 12px 16px; }
  .stats .stat.ret .bub { margin: 0; }
  .acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- in repair: its own colour (blue), a card with the countdown to pickup ---------- */
:root { --fix: #1D5FA8; --fix-soft: #E4EFFB; --fix-line: #A9C8EE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fix: #8BBCFF; --fix-soft: #14283F; --fix-line: #2E4D73; } }
:root[data-theme="dark"] { --fix: #8BBCFF; --fix-soft: #14283F; --fix-line: #2E4D73; }
:root[data-contrast="high"] { --fix: #0B3D78; }
:root[data-contrast="high"][data-theme="dark"] { --fix: #A8CCFF; --fix-soft: #000; }
.repair-card { margin-bottom: 12px; padding: 20px; border-radius: var(--radius); background: var(--fix-soft); border: 1px solid var(--fix-line);
  --ret: var(--fix); --ret-end: color-mix(in srgb, var(--fix) 70%, var(--ink)); }
.repair-card .big { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 12px; color: var(--fix); }
.repair-card .big .bub { background: var(--surface); color: inherit; }
.repair-card .big .bub .ic { width: 30px; height: 30px; }
.repair-card .big .yrs { font-size: 1.4em; font-weight: 800; line-height: 1; }
.repair-card .ends { margin-top: 8px; color: var(--ink-2); }
.repair-card.ready { border-width: 2px; border-color: var(--fix); }
.chip.repair { background: var(--fix-soft); color: var(--fix); }
.event.repair .when { background: var(--fix-soft); }
.day .dots i.repair { background: var(--fix); }
.repair-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--ink); }
.repair-note .ic { color: var(--fix); flex: none; margin-top: 3px; }

/* ---------- the fine print: the bottom line, counters, a coverage map, hidden costs ---------- */
.fp-line { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.fp-line p { font-size: 1.05rem; line-height: 1.6; color: var(--ink); }
.fp-k { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.fp-k .ic { width: 16px; height: 16px; }
.st-ok { --t-soft: var(--ok-soft); --t-ink: var(--ok); }
.st-no { --t-soft: var(--bad-soft); --t-ink: var(--bad); }
.st-limit, .st-cost, .st-cond, .st-implied { --t-soft: var(--warn-soft); --t-ink: var(--warn); }
.st-gray, .st-unknown { --t-soft: transparent; --t-ink: var(--ink-3); }
.fp-counts { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }
.fp-counts > * { border-radius: 14px; padding: 8px 4px; text-align: center; font: inherit; font-size: .88rem; font-weight: 600; background: var(--t-soft); color: var(--t-ink);
  border: 1.5px solid transparent; }
.fp-counts.st-gray, .fp-counts .st-gray { border: 1.5px dashed var(--line); }
.fp-counts button { cursor: pointer; transition: transform .1s; }
.fp-counts button:hover { border-color: var(--t-ink); }
.fp-counts button:active { transform: scale(.97); }
.fp-counts button[aria-pressed="true"] { background: var(--t-ink); color: var(--surface); border-color: var(--t-ink); }
.fp-counts .zero { font-weight: 500; }
.fp-counts b { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.fp-mh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fp-prod[data-filter="ok"] li:not(.g-ok), .fp-prod[data-filter="part"] li:not(.g-part),
.fp-prod[data-filter="no"] li:not(.g-no), .fp-prod[data-filter="none"] li:not(.g-none) { display: none; }
.fp-h { font-size: 1rem; margin-top: 18px; }
.fp .tl-count { margin-top: 2px; }
.fp-hint { color: var(--ink-3); }
.fp-drawing { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: .88rem; color: var(--brand-ink); }
.fp-drawing .ic { width: 16px; height: 16px; flex: none; }
.fp-drawfail { flex-wrap: wrap; color: var(--ink-2); }
.fp-drawfail p { margin: 0; flex: 1 1 180px; }
/* the product, drawn (js/product-art.js), with a circle per topic on its part */
.fp-prod { position: relative; margin: 6px -18px 0; } /* the drawing takes the whole width of the card, padding included */
.fp-stage { position: relative; aspect-ratio: 4 / 3; max-width: 440px; margin: 0 auto 26px; } /* room under it for the lowest names */
.fp-stage .pa { position: absolute; inset: 0; width: 100%; height: 100%; }
.pa-b { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2.5; stroke-linejoin: round; }
.pa-s { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.pa-l { fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pa-d { fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-dasharray: 4 4; stroke-linecap: round; }
.pa-f { fill: var(--ink-3); }
.fp-on { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
/* the circle sits on its spot; its name hangs under it, on a small white label so it reads over the drawing */
.fp-on li { position: absolute; transform: translate(-50%, -22px); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fp-on .fp-n { padding: 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .74rem; line-height: 1.35; white-space: nowrap; }
.fp-spot {
  position: relative; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font: inherit;
  background: var(--t-soft); color: var(--t-ink); border: 2px solid var(--t-ink); transition: transform .12s;
}
.fp-spot.st-gray, .fp-spot.st-unknown, .fp-spot.st-implied, .fp-spot.unsure { border-style: dashed; }
.fp-spot.st-gray, .fp-spot.st-unknown { background: var(--surface); }
.fp-spot:hover { transform: scale(1.08); }
.fp-spot:active { transform: scale(.96); }
.fp-spot[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--t-ink); }
.fp-spot > .ic { width: 22px; height: 22px; }
/* each circle pulses twice when the card appears: it is there to be tapped */
.fp-spot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--t-ink); opacity: 0; pointer-events: none;
  animation: fp-pulse 1.4s ease-out calc(.3s + var(--i, 0) * .1s) 2; }
@keyframes fp-pulse { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.3); opacity: 0; } }
.fp-mk { position: absolute; top: -6px; inset-inline-start: -6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--t-ink); border: 1.5px solid var(--t-ink); }
.fp-mk .ic { width: 12px; height: 12px; stroke-width: 3; }
.fp-cap { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); text-align: center; font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.fp-around { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 6px; }
.fp-around li { width: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fp-n { font-weight: 600; font-size: .8rem; color: var(--ink-2); line-height: 1.2; text-align: center; }
/* no terms yet: the same drawing, circles waiting (not buttons, no pulse) */
.fp-wait .fp-spot { cursor: default; }
.fp-wait .fp-spot:hover { transform: none; }
.fp-wait .fp-spot::after { display: none; }
/* the bubble of a circle */
.fp-bubble {
  position: absolute; z-index: 6; width: min(290px, 100%); padding: 12px 14px; border-radius: 16px; background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--t-ink); box-shadow: var(--shadow-lg); line-height: 1.5; animation: fp-pop .16s ease-out;
}
.fp-bubble:focus { outline: none; }
.fp-bubble::before { content: ''; position: absolute; top: -8.5px; left: calc(var(--ax, 50%) - 7px); width: 14px; height: 14px; background: var(--surface);
  border-top: 1.5px solid var(--t-ink); border-left: 1.5px solid var(--t-ink); transform: rotate(45deg); }
.fp-bubble.up::before { top: auto; bottom: -8.5px; transform: rotate(225deg); }
@keyframes fp-pop { from { opacity: 0; transform: translateY(4px); } }
.fp-bt { display: flex; align-items: flex-start; gap: 10px; }
.fp-bt .bub { width: 42px; height: 42px; background: var(--t-soft); color: var(--t-ink); }
.fp-bt .bub .ic { width: 22px; height: 22px; }
.fp-bt h4 { font-size: 1.02rem; margin: 0 0 4px; }
.fp-bt .fp-x { margin-inline-start: auto; width: 40px; height: 40px; border-radius: 12px; }
.fp-bubble .fp-pill { font-size: .84rem; padding: 3px 10px; }
.fp-bubble p { margin: 8px 0 0; }
.fp-bd { display: flex; gap: 6px; align-items: center; font-size: .88rem; color: var(--ink-2); }
.fp-bd .ic { width: 16px; height: 16px; flex: none; }
.fp-more { margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; }
.fp-more .ic { width: 16px; height: 16px; }
.fp-costs { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--warn-soft); border: 1px solid var(--warn-line); }
.fp-costs > .ic { color: var(--warn); margin-top: 3px; }
.fp-costs ul { margin: 4px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.fp-partial { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); color: var(--ink-2); }
.fp-partial > .ic { margin-top: 3px; }
.fp-all { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
.fp-all > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.fp-all > summary::-webkit-details-marker { display: none; }
.fp-all > summary .ic:last-child { margin-inline-start: auto; transition: transform .2s; }
.fp-all[open] > summary .ic:last-child { transform: rotate(-90deg); }
/* one topic, opened from its bubble */
.fp-dh { display: flex; align-items: center; gap: 12px; }
.fp-dh .bub { background: var(--t-soft); color: var(--t-ink); }
.fp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--t-soft); color: var(--t-ink); font-weight: 700; }
.fp-pill .ic { width: 16px; height: 16px; }
.fp-date { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.fp-date .fp-src { display: block; }
.fp-row { margin-top: 14px; line-height: 1.6; }
.fp-q { margin: 8px 0 0; padding: 2px 12px; border-inline-start: 3px solid var(--line); color: var(--ink-2); font-size: .94rem; }
.fp-src { font-size: .84rem; color: var(--ink-3); margin-top: 4px; }
.fp-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.fp-tip > .ic { color: var(--warn); margin-top: 3px; }
:root[data-contrast="high"] .fp-counts > * { border: 2px solid var(--ink); }
:root[data-contrast="high"] .pa-s, :root[data-contrast="high"] .pa-l, :root[data-contrast="high"] .pa-d { stroke: var(--ink); }
.nowrap { white-space: nowrap; unicode-bidi: isolate; }

/* ---------- the terms store: changed terms, an unsure tile, rows not found in the document ---------- */
.fp-changed { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--violet-soft); border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); }
.fp-changed > .ic { color: var(--violet); margin-top: 3px; }
.fp-changed details { margin-top: 6px; }
.fp-changed summary { cursor: pointer; font-weight: 600; color: var(--violet); }
.fp-changed ul { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: .92rem; }
.fp-changed .fp-src { display: block; }
.fp-unsure { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
.tl-unverified h3 { color: var(--ink-3); }
.tl-unverified .tl-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 50%, transparent); }
