:root {
  --bg: #F0F4EA;
  --paper: #FFFFFF;
  --leaf: #1F4B2C;
  --leaf-soft: #E3EDDD;
  --orange: #EE7D1A;
  --orange-deep: #BF5A06;
  --pith: #FFF1D6;
  --lemon: #FFE45C;
  --lemon-soft: #FFF6B8;
  --ink: #1B261D;
  --muted: #5B695D;
  --line: #CFD9C8;
  --grid: #BFC9B8;
  --red: #B3261E;
  --red-soft: #FCE8E6;
  --radius: 14px;
  --display: 'Secular One', 'Rubik', Arial, sans-serif;
  --body: 'Rubik', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); line-height: 1.5; min-height: 100vh;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--leaf); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark svg { width: 38px; height: 38px; display: block; }
.brand-name { font-family: var(--display); font-size: 1.45rem; }
.top-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.lang, .pill {
  border: 2px solid rgba(255,255,255,.55); background: transparent; color: #fff;
  border-radius: 99px; padding: 6px 16px; font-size: .9rem;
}
.lang:hover, .pill:hover { background: rgba(255,255,255,.14); }
.pill.good::before { content: '✓ '; }
.pill.bad { background: var(--red); border-color: var(--red); font-weight: 500; }

main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 120px; }

/* ---------- steps ---------- */
.steps { display: flex; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li {
  display: flex; align-items: center; gap: 10px; color: var(--muted);
  font-size: 1rem; padding: 6px 16px 6px 10px; border-radius: 99px; background: rgba(255,255,255,.55);
}
.steps li b {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--line); color: var(--ink); font-family: var(--display); font-weight: 400;
}
.steps li.on { color: var(--ink); background: var(--paper); box-shadow: 0 0 0 2px var(--orange); }
.steps li.on b { background: var(--orange); color: #fff; }
.steps li.done b { background: var(--leaf); color: #fff; }

h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; }
h1 { font-size: 2.1rem; line-height: 1.2; }
h2 { font-size: 1.4rem; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 6px 0 0; }

/* ---------- home ---------- */
.home { display: grid; justify-items: center; text-align: center; gap: 8px; padding-top: 8px; }
.slice-btn {
  position: relative; border: 0; background: none; padding: 0; margin: 22px 0 10px;
  width: min(360px, 78vw); aspect-ratio: 1; border-radius: 50%;
  transition: transform .2s;
}
.slice-btn:hover { transform: rotate(-4deg) scale(1.02); }
.slice-btn svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(191,90,6,.28)); }
.slice-btn .slice-label {
  position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px;
  font-family: var(--display); font-size: 1.55rem; color: var(--ink); text-align: center; padding: 0 22%;
  line-height: 1.15;
}
.slice-label .cam { width: 54px; height: 54px; background: var(--paper); border-radius: 50%; display: grid; place-items: center; box-shadow: 0 2px 0 var(--orange-deep); }
.slice-label .cam svg { width: 30px; height: 30px; filter: none; }
.slice-btn.drag { transform: scale(1.06); }
.slice-btn:disabled { filter: grayscale(.9); opacity: .5; cursor: not-allowed; }
.home .hint { color: var(--muted); max-width: 34ch; margin: 0; }
.table-line { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; color: var(--muted); }
.link-btn {
  background: none; border: 0; padding: 6px 4px; color: var(--leaf); font-weight: 500;
  text-decoration: underline; text-underline-offset: 4px; font-size: 1rem;
}
.recent { width: min(640px, 100%); margin-top: 28px; text-align: start; }
.recent h2 { margin-bottom: 8px; font-size: 1.15rem; }
.recent ul { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.recent li:last-child { border-bottom: 0; }
.recent .when { color: var(--muted); font-size: .92rem; }

/* ---------- notices ---------- */
.notice { border-radius: var(--radius); padding: 14px 18px; margin: 0 0 16px; border: 2px solid var(--line); background: var(--paper); }
.notice.warn { background: var(--lemon-soft); border-color: var(--lemon); }
.notice.err { background: var(--red-soft); border-color: var(--red); }
.notice b { font-weight: 600; }
.notice .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 99px; padding: 14px 28px; font-size: 1.1rem; font-weight: 500;
  background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line);
}
.btn:hover { box-shadow: inset 0 0 0 2px var(--leaf); }
.btn.main { background: var(--leaf); color: #fff; box-shadow: 0 3px 0 #11301B; }
.btn.main:hover { background: #2A6A3D; }
.btn.orange { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-deep); }
.btn.orange:hover { background: #F58D33; }
.btn.small { padding: 8px 18px; font-size: .95rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- reading ---------- */
.reading { display: grid; justify-items: center; gap: 14px; padding-top: 30px; text-align: center; }
.reading .spin { width: 150px; animation: turn 2.4s linear infinite; }
.reading img { max-height: 120px; max-width: 90%; border-radius: 10px; border: 1px solid var(--line); }
@keyframes turn { to { transform: rotate(360deg); } }

/* ---------- review ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.photo-card { display: flex; gap: 14px; align-items: center; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); padding: 10px; }
.photo-card img { max-width: 100%; max-height: 120px; object-fit: contain; display: block; border-radius: 8px; cursor: zoom-in; background: #eee; }
.photo-card p { margin: 8px 4px 2px; color: var(--muted); font-size: .9rem; }
@media (min-width: 1500px) { .review { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); } .photo-card { display: block; position: sticky; top: 12px; } .photo-card img { max-height: 70vh; } }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 12px; color: var(--muted); font-size: .95rem; align-items: center; }
.legend i { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: -4px; margin-inline-end: 6px; }
.legend .l-unsure { background: var(--lemon); }
.legend .l-edited { background: var(--paper); box-shadow: inset 0 -4px 0 var(--orange), inset 0 0 0 1px var(--grid); }

.sheet-wrap {
  overflow-x: auto; background: var(--paper); border: 2px solid var(--leaf); border-radius: 8px;
}
table.sheet { border-collapse: collapse; width: 100%; font-size: 1rem; }
.sheet th, .sheet td { border: 1px solid var(--grid); padding: 0; height: 46px; min-width: 6.8em; white-space: nowrap; }
.sheet .corner, .sheet .rn { min-width: 3.2em; width: 3.2em; background: #E9EEE4; color: var(--muted); text-align: center; font-size: .85rem; }
.sheet thead tr.letters th { background: #E9EEE4; color: var(--muted); font-weight: 400; font-size: .85rem; height: 28px; }
.sheet thead tr.heads th { background: var(--leaf-soft); font-weight: 600; padding: 0 10px; text-align: start; }
.sheet tbody tr.old td { background: #F6F8F3; color: #6D796F; padding: 0 10px; }
.sheet tbody tr.old.gap td { height: 26px; text-align: center; font-size: .85rem; color: var(--muted); background: repeating-linear-gradient(135deg, #F6F8F3, #F6F8F3 6px, #EEF2E9 6px, #EEF2E9 12px); }
.sheet td.cell { position: relative; background: #fff; }
.sheet td.cell input {
  width: 100%; height: 100%; min-height: 44px; border: 0; background: transparent; padding: 0 10px;
  font-size: 1.05rem; border-radius: 0; text-align: start;
}
.sheet td.cell input:focus { outline: 3px solid var(--orange); outline-offset: -3px; background: #FFFBF1; }
.sheet td.cell.unsure { background: var(--lemon); }
.sheet td.cell.unsure.seen { background: var(--lemon-soft); }
.sheet td.cell.edited { box-shadow: inset 0 -4px 0 var(--orange); }
.sheet td.auto { background: #F2F4EF; color: var(--muted); font-size: .85rem; padding: 0 10px; text-align: center; }
.sheet td.rm { min-width: 3em; width: 3em; text-align: center; background: #fff; }
.rm-btn { border: 0; background: none; font-size: 1.3rem; color: var(--red); width: 100%; height: 44px; }
.rm-btn:hover { background: var(--red-soft); }
.add-row { margin-top: 12px; }

.savebar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 5; background: var(--paper);
  border-top: 2px solid var(--leaf); padding: 12px 20px;
  display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.savebar .who { display: flex; align-items: center; gap: 8px; }
.savebar .who input { border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; width: 10em; background: #fff; }
.savebar .who input.need { border-color: var(--red); background: var(--red-soft); }
.savebar .acts { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.savebar .btn.main { padding: 14px 34px; font-size: 1.2rem; }

/* ---------- done ---------- */
.done { display: grid; justify-items: center; gap: 10px; text-align: center; padding-top: 40px; }
.done .tick { width: 120px; height: 120px; border-radius: 50%; background: var(--leaf); display: grid; place-items: center; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.done .tick svg { width: 64px; height: 64px; }
.done .row { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- overlay ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,32,22,.72); z-index: 20; display: grid; place-items: center; padding: 16px; overflow: auto; }
.overlay .box { background: var(--paper); border-radius: var(--radius); padding: 24px; max-width: 560px; width: 100%; }
.overlay .box h2 { margin-bottom: 10px; }
.overlay .box ul { padding-inline-start: 1.2em; }
.overlay.zoom { place-items: start center; cursor: zoom-out; }
.overlay.zoom img { max-width: none; width: min(1400px, 200%); border-radius: 6px; }
.overlay .box .row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.ok-t { color: var(--leaf); font-weight: 600; }
.bad-t { color: var(--red); font-weight: 600; }

@media (max-width: 900px) {
  html { font-size: 17px; }
  h1 { font-size: 1.7rem; }
  .top { padding: 10px 14px; }
  main { padding: 18px 14px 150px; }
  .savebar { padding: 10px 14px; }
  .savebar .acts { width: 100%; }
  .savebar .btn.main { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- ask ---------- */
.ask-log { display: grid; gap: 12px; margin: 18px 0; max-width: 820px; }
.bubble { padding: 14px 18px; border-radius: 16px; max-width: 92%; }
.bubble.me { background: var(--leaf); color: #fff; justify-self: start; border-end-start-radius: 4px; }
.bubble.bot { background: var(--paper); border: 1px solid var(--line); justify-self: end; border-end-end-radius: 4px; }
.bubble.busy { color: var(--muted); }
.bubble.err { background: var(--red-soft); border-color: var(--red); }
.answer p { margin: 0 0 .5em; } .answer ul { margin: 0 0 .5em; padding-inline-start: 1.2em; }
.bubble details { margin-top: 8px; color: var(--muted); font-size: .85rem; }
.bubble summary { cursor: pointer; }
.bubble .step { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; padding: 4px 0; direction: ltr; text-align: left; word-break: break-word; }
.ask-ex { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 2px solid var(--line); background: var(--paper); border-radius: 99px; padding: 6px 14px; font-size: .9rem; }
.chip:hover { border-color: var(--orange); }
.ask-box { display: flex; gap: 10px; align-items: flex-end; max-width: 820px; }
.ask-box textarea { flex: 1; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font: inherit; resize: vertical; background: #fff; }
.home .btn { margin-top: 6px; }

/* ---------- sign-in ---------- */
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; }
.btn.google { display: inline-flex; align-items: center; gap: 12px; background: #fff; text-decoration: none; margin-top: 14px; padding: 12px 26px; }
.savebar .who input[readonly] { background: var(--leaf-soft); border-color: var(--leaf-soft); }

/* ---------- several photos ---------- */
.gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery figure { margin: 0; position: relative; }
.gallery img { max-height: 120px; max-width: 160px; }
.gallery figcaption { position: absolute; inset-block-start: 4px; inset-inline-start: 4px; background: var(--orange); color: #fff; border-radius: 99px; min-width: 22px; height: 22px; display: grid; place-items: center; font-size: .8rem; font-weight: 600; }
.sheet .rn .src { color: var(--orange-deep); font-weight: 600; }
.file-status { list-style: none; padding: 0; margin: 6px 0; text-align: start; max-width: 520px; }
.file-status li { padding: 3px 0; color: var(--muted); word-break: break-all; }

/* ---------- home page ---------- */
.brand { cursor: pointer; }
.hub-title { text-align: center; margin: 8px 0 22px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 640px; margin: 0 auto 30px; }
.tile {
  position: relative; display: grid; align-content: center; justify-items: center; gap: 8px; text-align: center;
  aspect-ratio: 1; padding: 18px; border-radius: 22px; background: var(--paper); border: 3px solid var(--line);
  font-family: inherit; color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tile-cert { cursor: pointer; }
.tile-cert:hover:not(:disabled) { border-color: var(--orange); transform: translateY(-3px); box-shadow: 0 14px 24px -14px rgba(191,90,6,.55); }
.tile-cert:disabled { opacity: .55; cursor: not-allowed; }
.tile-art { position: relative; width: 58%; max-width: 150px; aspect-ratio: 1; display: grid; place-items: center; }
.tile-art svg { width: 100%; height: 100%; display: block; }
.tile-cam { position: absolute; inset: 0; margin: auto; width: 34%; height: 34%; background: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 2px 0 var(--orange-deep); }
.tile-cam svg { width: 62%; height: 62%; }
.tile-name { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.tile-sub { color: var(--muted); font-size: .9rem; line-height: 1.3; }
.tile-soon { border-style: dashed; background: transparent; color: var(--muted); cursor: default; }
.tile-art-soon { color: #9AA79A; }
.tile-soon .tile-name { color: var(--muted); }
.soon { position: absolute; inset-block-start: 12px; inset-inline-end: 12px; background: var(--lemon); color: var(--ink); border-radius: 99px; padding: 2px 12px; font-size: .8rem; font-weight: 600; }

.ask-hero { max-width: 820px; margin: 0 auto 26px; padding: 26px clamp(18px, 4vw, 34px) 22px; border-radius: 26px; background: var(--leaf); color: #fff; box-shadow: 0 22px 34px -26px rgba(15,50,25,.9); }
.ask-hero h2 { font-size: 1.9rem; color: #fff; }
.ask-lead { margin: 4px 0 16px; color: #D7E6D2; font-size: 1.05rem; }
.ask-field { display: flex; gap: 10px; align-items: stretch; background: #fff; border-radius: 18px; padding: 8px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.0); }
.ask-field:focus-within { box-shadow: 0 0 0 4px var(--lemon); }
.ask-field textarea { flex: 1; border: 0; outline: 0; resize: none; font: inherit; font-size: 1.15rem; padding: 10px 12px; color: var(--ink); background: transparent; min-height: 3.4rem; }
.ask-go { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 13px; padding: 0 22px; background: var(--orange); color: #fff; font: inherit; font-weight: 600; font-size: 1.1rem; box-shadow: 0 3px 0 var(--orange-deep); }
.ask-go svg { width: 22px; height: 22px; }
.ask-go:hover:not(:disabled) { background: #F58D33; }
.ask-go:disabled { opacity: .5; cursor: not-allowed; }
.ask-hero .ask-ex { margin: 14px 0 4px; }
.ask-hero .chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; font-size: .95rem; }
.ask-hero .chip:hover { background: rgba(255,255,255,.22); border-color: var(--lemon); }
.ask-hero .ask-log { margin: 14px 0 0; max-width: none; }
.ask-hero .bubble.me { background: var(--lemon); color: var(--ink); }
.ask-hero .bubble.bot { color: var(--ink); }
.ask-hero .bubble.busy { color: var(--muted); }
@media (max-width: 560px) {
  .tiles { gap: 12px; }
  .tile { padding: 12px; border-radius: 18px; }
  .tile-name { font-size: 1.35rem; }
  .tile-sub { display: none; }
  .ask-go span { display: none; }
  .ask-go { padding: 0 16px; }
}

/* ---------- dashboards ---------- */
.dash { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 18px clamp(14px, 3vw, 24px); margin: 12px 0; }
.dash-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.dash h3 { font-family: var(--display); font-weight: 400; font-size: 1.4rem; margin: 0; }
.dash h4 { font-family: var(--body); font-weight: 600; font-size: 1rem; margin: 18px 0 8px; color: var(--leaf); }
.dash-meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.dash-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.dash-actions .auto { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.dash-actions input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--leaf); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.kpi { background: var(--leaf-soft); border-radius: 14px; padding: 14px 16px; }
.kpi-label { color: var(--leaf); font-weight: 500; font-size: .95rem; }
.kpi-value { font-family: var(--display); font-size: 2.1rem; line-height: 1.15; margin-top: 2px; word-break: break-word; }
.kpi-hint { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.dtable { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.dtable table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.dtable th { background: var(--leaf); color: #fff; font-weight: 500; text-align: start; padding: 10px 14px; white-space: nowrap; }
.dtable td { padding: 9px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
.dtable tbody tr:nth-child(even) td { background: #F6F9F2; }
.dtable .num { text-align: end; font-variant-numeric: tabular-nums; }
.dtable tfoot td { font-weight: 600; background: var(--leaf-soft); border-top: 2px solid var(--leaf); }
.dnote { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.legend2 { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: .9rem; color: var(--muted); }
.legend2 i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -2px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 160px) 1fr; gap: 12px; align-items: center; }
.bar-label { font-weight: 500; overflow-wrap: anywhere; }
.bar-tracks { display: grid; gap: 4px; }
.bar-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.bar-track { background: #EEF3E9; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.bar-value { font-variant-numeric: tabular-nums; min-width: 6.5em; text-align: end; font-size: .95rem; }
.cols { display: flex; gap: 8px; align-items: flex-end; height: 210px; padding-top: 22px; border-bottom: 2px solid var(--line); }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.col-bars { flex: 1; display: flex; gap: 3px; align-items: flex-end; }
.col-bar { flex: 1; border-radius: 6px 6px 0 0; position: relative; min-width: 6px; }
.col-bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .75rem; white-space: nowrap; color: var(--ink); padding-bottom: 2px; }
.col-label { text-align: center; font-size: .8rem; color: var(--muted); padding-top: 6px; position: relative; top: 100%; margin-top: -1.6em; }
.cols { margin-bottom: 26px; }
.line-chart { width: 100%; height: auto; display: block; }
.saved { max-width: 820px; margin: 0 auto 26px; }
.saved > h2 { margin-bottom: 2px; }
.ask-hero .dash { margin-top: 10px; }
.ask-hero .bubble.bot { max-width: 100%; justify-self: stretch; }
.answer .dtable { margin: 8px 0; }
.dash-loading { opacity: .7; }

/* ---------- three squares ---------- */
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }
.tile-data { cursor: pointer; }
.tile-data:hover:not(:disabled) { border-color: var(--leaf); transform: translateY(-3px); box-shadow: 0 14px 24px -14px rgba(15,50,25,.6); }
.tile-data:disabled { opacity: .55; cursor: not-allowed; }
.tile-art-data { color: var(--leaf); }
@media (max-width: 560px) { .tiles { gap: 8px; } .tile { padding: 8px; } .tile-name { font-size: 1.05rem; } .soon { font-size: .7rem; padding: 1px 8px; inset-block-start: 6px; inset-inline-end: 6px; } }

/* ---------- concise dashboards ---------- */
.dash { padding: 16px clamp(14px, 3vw, 22px) 14px; }
.dash h3 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fixed-tag { font-family: var(--body); font-size: .72rem; font-weight: 500; background: var(--leaf-soft); color: var(--leaf); border-radius: 99px; padding: 1px 10px; }
.dash-head { margin-bottom: 8px; }
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 10px; background: #F4F7F0; border-radius: 12px; }
.period-label { color: var(--muted); font-size: .88rem; }
.period select, .period input { font: inherit; font-size: .95rem; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.period input[type=number] { width: 6.5em; }
.period-extra { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 6px; }
.dash .kpi { background: transparent; border: 2px solid var(--leaf-soft); padding: 12px 14px; }
.dash .kpi-value { font-size: 2.3rem; color: var(--leaf); }
.dash .kpi-label { color: var(--ink); font-weight: 600; }
.more-btn { margin-top: 8px; border: 0; background: none; color: var(--leaf); font: inherit; font-weight: 600; padding: 8px 2px; text-decoration: underline; text-underline-offset: 4px; }
.dash-detail { border-top: 1px dashed var(--line); margin-top: 4px; }
.dash-detail[hidden] { display: none; }

/* ---------- drill down: the lines behind a number ---------- */
.kpi.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.clickable:hover, .kpi.clickable:focus-visible { border-color: var(--orange); transform: translateY(-2px); }
.dtable tr.clickable { cursor: pointer; }
.dtable tbody tr.clickable:hover td { background: var(--lemon-soft); }
.bar-row.clickable { cursor: pointer; border-radius: 8px; }
.bar-row.clickable:hover { background: var(--lemon-soft); }
.rows-link { margin-inline-start: 10px; border: 0; background: none; color: var(--orange-deep); font: inherit; font-size: .85rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.overlay .box.wide { max-width: min(1100px, 96vw); max-height: 90vh; overflow: auto; }
.rows-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rows-table { max-height: 58vh; overflow: auto; }
.rows-table th { position: sticky; top: 0; z-index: 1; }

/* ---------- dashboard layout: KPI row, charts side by side, detail table ---------- */
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin: 10px 0; }
.chart-card { background: #FBFCF9; border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px 12px; margin: 0; }
.chart-card h4 { margin-top: 12px; }
.chart-box { position: relative; width: 100%; }
.kpi-change { font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.kpi-change span { font-weight: 400; }
.dtable th.sortable { cursor: pointer; user-select: none; }
.dtable th.sortable:hover { background: #2A6A3D; }
.rows-table th.sortable:hover { background: #2A6A3D; }
.pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pager .grow { flex: 1; }
.page-info { color: var(--muted); font-size: .9rem; }
@media (max-width: 768px) { .dash .kpis { grid-template-columns: repeat(2, 1fr); } .chart-row { grid-template-columns: 1fr; } }
@media print {
  body { background: #fff; }
  .top, .savebar, .period, .dash-actions, .more-btn, .rows-link, .ask-hero, .table-line, .link-btn { display: none !important; }
  .dash-detail[hidden] { display: block !important; }
  .dash { border: 1px solid #ccc; break-inside: avoid; box-shadow: none; }
  .kpi { border: 1px solid #ccc; }
}

/* ---------- ordering ---------- */
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sort-box { color: var(--muted); font-size: .85rem; margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; }
.sort-sel { font: inherit; font-size: .88rem; padding: 4px 8px; border: 2px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }

.err-detail { margin-top: 6px; color: var(--muted); font-size: .8rem; direction: ltr; text-align: left; word-break: break-word; }

/* ---------- link to the line in Google Sheets ---------- */
.row-link { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--orange-deep); background: #FFF1D6; text-decoration: none; font-weight: 700; font-size: .95rem; }
.row-link:hover, .row-link:focus-visible { background: var(--orange); color: #fff; }
.link-cell { text-align: center; width: 3em; }
.row-chip { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 6px; font-size: .9rem; }
