/* Γραμματεία v0.2
   Ιδέα: το γραφείο με τη σφραγίδα. Καθαρό ψυχρό χαρτί, μελάνι σφραγίδας για τις ενέργειες,
   έντονο κόκκινο μόνο για ό,τι καίγεται. Η μία «τολμηρή» στιγμή: η σφραγίδα όταν κάτι ολοκληρώνεται.
   Όλα τα μεγέθη σε rem → η ρύθμιση «μέγεθος γραμμάτων» μεγαλώνει ολόκληρη την εφαρμογή. */

@font-face {
  font-family: 'Commissioner';
  src: url('/fonts/commissioner.woff') format('woff');
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --bg: #edf0f3;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --ink: #14181f;
  --ink-2: #4a5260;
  --ink-3: #788190;
  --line: #dde2e8;
  --line-2: #c9d0d9;
  --accent: #2e3fa8;
  --accent-ink: #ffffff;
  --accent-soft: #e5e9fb;
  --red: #d0021b;
  --red-ink: #ffffff;
  --red-soft: #fde8eb;
  --amber: #b06500;
  --amber-soft: #fcf1de;
  --green: #1d7a4c;
  --green-soft: #e2f3ea;
  --stamp: #3346c4;
  --shadow: 0 1px 2px rgba(20, 24, 31, .06), 0 6px 20px -12px rgba(20, 24, 31, .25);
  --r-sheet: 22px;
  --r-group: 16px;
  --r-ctl: 12px;
  --font: 'Commissioner', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --tabbar-h: 4.1rem;
  color-scheme: light;
}
:root[data-theme='dark'] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { color-scheme: dark; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f1318; --surface: #181d24; --surface-2: #1f252e; --ink: #e9edf2; --ink-2: #aab3bf; --ink-3: #778292;
    --line: #29303a; --line-2: #36404c; --accent: #9eabff; --accent-ink: #0e1430; --accent-soft: #232b50;
    --red: #ff4757; --red-ink: #1c0306; --red-soft: #3b151a; --amber: #f2a33a; --amber-soft: #36280f;
    --green: #4cc38a; --green-soft: #12301f; --stamp: #9eabff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -18px rgba(0, 0, 0, .9);
  }
}
:root[data-theme='dark'] {
  --bg: #0f1318; --surface: #181d24; --surface-2: #1f252e; --ink: #e9edf2; --ink-2: #aab3bf; --ink-3: #778292;
  --line: #29303a; --line-2: #36404c; --accent: #9eabff; --accent-ink: #0e1430; --accent-soft: #232b50;
  --red: #ff4757; --red-ink: #1c0306; --red-soft: #3b151a; --amber: #f2a33a; --amber-soft: #36280f;
  --green: #4cc38a; --green-soft: #12301f; --stamp: #9eabff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -18px rgba(0, 0, 0, .9);
}

/* μέγεθος γραμμάτων (Ρυθμίσεις → Εμφάνιση) */
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
html[data-size='s'] { font-size: 16px; }
html[data-size='m'] { font-size: 18px; }
html[data-size='l'] { font-size: 20px; }
html[data-size='xl'] { font-size: 23px; }

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.45 var(--font);
  font-feature-settings: 'tnum' 0;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1rem);
  -webkit-tap-highlight-color: transparent;
}
body.privacy #app { filter: blur(18px); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .84rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- κεφαλίδα ---------- */
.top {
  position: sticky; top: 0; z-index: 6; background: var(--bg);
  padding: calc(env(safe-area-inset-top) + .7rem) 1rem .55rem;
  display: flex; align-items: flex-end; gap: .75rem;
}
.top.scrolled { box-shadow: 0 1px 0 var(--line); }
.top .titles { flex: 1; min-width: 0; }
.top h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.top .sub { color: var(--ink-2); font-size: .9rem; margin-top: .15rem; }
.top .back { background: none; border: 0; color: var(--accent); padding: .2rem 0; font-weight: 600; cursor: pointer; font-size: .95rem; }
.iconbtn { position: relative; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.iconbtn svg { width: 1.3rem; height: 1.3rem; }
.badge-dot { position: absolute; top: -.15rem; right: -.15rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: .6rem; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }

main { max-width: 46rem; margin: 0 auto; padding: .25rem 1rem 1.5rem; }

/* σημερινή ημερομηνία: το «πρωτόκολλο» της ημέρας */
.daystamp { display: flex; align-items: baseline; gap: .6rem; margin: .2rem 0 .9rem; }
.daystamp .d { font-size: 3.2rem; font-weight: 800; letter-spacing: -.04em; line-height: .9; }
.daystamp .rest { display: flex; flex-direction: column; line-height: 1.15; }
.daystamp .wd { font-weight: 700; font-size: 1.1rem; }
.daystamp .my { color: var(--ink-2); font-size: .92rem; }

/* ---------- κόκκινη μπάρα επειγόντων ---------- */
.urgent {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  background: var(--red); color: var(--red-ink); border: 0; border-radius: var(--r-group);
  padding: .85rem 1rem; margin: 0 0 1rem; text-align: left; cursor: pointer;
  box-shadow: 0 8px 24px -12px var(--red);
}
.urgent .ic { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 1.1rem; }
:root[data-theme='dark'] .urgent .ic { background: rgba(0,0,0,.2); }
.urgent b { display: block; font-size: 1.02rem; }
.urgent span { font-size: .86rem; opacity: .95; }
.urgent .go { margin-left: auto; font-size: 1.4rem; font-weight: 300; }
.urgent-top { position: sticky; top: 0; z-index: 7; border-radius: 0; margin: 0; padding-top: calc(env(safe-area-inset-top) + .6rem); }

/* ---------- γρήγορη προσθήκη ---------- */
.qa { background: var(--surface); border-radius: var(--r-group); box-shadow: var(--shadow); padding: .35rem .35rem .35rem .9rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.qa input { flex: 1; border: 0; background: transparent; outline: none; min-height: 2.6rem; font-size: 1rem; min-width: 0; }
.qa button { flex: none; }
.chips-preview { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1.2rem; margin: .1rem .2rem .8rem; }
.chips-preview .hint { font-size: .8rem; color: var(--ink-3); }
.pchip { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pchip.priority2 { background: var(--red-soft); color: var(--red); }
.pchip.priority1 { background: var(--amber-soft); color: var(--amber); }
.pchip.amount { background: var(--green-soft); color: var(--green); }

/* ---------- ενότητες & ομάδες ---------- */
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 1.3rem .2rem .5rem; }
.sec h2 { font-size: 1.08rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.sec h2.red { color: var(--red); }
.sec .aside { color: var(--ink-3); font-size: .86rem; }
.group { background: var(--surface); border-radius: var(--r-group); box-shadow: var(--shadow); overflow: hidden; }
.group + .group { margin-top: .6rem; }

/* ---------- γραμμές (εργασίες & πληρωμές) ---------- */
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center;
  padding: .75rem .9rem .75rem .75rem; border-top: 1px solid var(--line); color: inherit; position: relative; min-height: 3.6rem;
}
.row:first-child { border-top: 0; }
.row::before { content: ''; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 4px; border-radius: 0 4px 4px 0; background: transparent; }
.row.p1::before { background: var(--amber); }
.row.p2::before { background: var(--red); }
.row:active { background: var(--surface-2); }
.row .main { min-width: 0; }
.row .title { font-weight: 600; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.row.done .title, .row.paid .title { text-decoration: line-through; text-decoration-color: var(--ink-3); color: var(--ink-3); }
.row .meta { font-size: .8rem; color: var(--ink-2); margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.row .meta .late { color: var(--red); font-weight: 700; }
.row .meta .soon { color: var(--amber); font-weight: 700; }
.row .meta .tag { display: inline-flex; align-items: center; gap: .25rem; }
.row .meta .tag i { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; }
.row .right { display: flex; align-items: center; gap: .6rem; }
.row.payrow .right { flex-direction: column; align-items: flex-end; gap: .3rem; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .kind { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: .95rem; flex: none; }
.row.overdue .kind { background: var(--red-soft); color: var(--red); }

/* κουμπί ολοκλήρωσης */
.check {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 2px solid var(--line-2); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: transparent; flex: none; padding: 0;
}
.check.p1 { border-color: var(--amber); }
.check.p2 { border-color: var(--red); background: var(--red-soft); }
.check:hover { color: var(--ink-3); }
.check.done { background: var(--green); border-color: var(--green); color: #fff; }
.check svg { width: 1rem; height: 1rem; }
.check.pay { width: auto; height: 1.8rem; border-radius: 999px; padding: 0 .65rem; color: var(--ink-2); font-size: .74rem; font-weight: 700; border-width: 1.5px; }
.check.pay.done { color: #fff; }

/* η σφραγίδα */
.stamp {
  position: absolute; right: 3.2rem; top: 50%; transform: translateY(-50%) rotate(-9deg);
  border: 3px solid var(--stamp); color: var(--stamp); border-radius: 8px; padding: .1rem .55rem;
  font-weight: 800; letter-spacing: .08em; font-size: .78rem; pointer-events: none; opacity: .85;
  mix-blend-mode: multiply;
}
:root[data-theme='dark'] .stamp { mix-blend-mode: normal; }
.stamp.anim { animation: stampin .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampin { 0% { transform: translateY(-50%) rotate(-24deg) scale(2.4); opacity: 0; } 60% { opacity: .95; } 100% { transform: translateY(-50%) rotate(-9deg) scale(1); opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .stamp.anim, .sheet, .toast { animation: none !important; } }

.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .25rem; }

/* σύνοψη πληρωμών */
.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: .2rem 0 .3rem; }
@media (min-width: 40rem) { .figs { grid-template-columns: repeat(4, 1fr); } }
.fig { background: var(--surface); border-radius: var(--r-ctl); padding: .7rem .85rem; box-shadow: var(--shadow); color: inherit; }
.fig .v { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fig .l { font-size: .8rem; color: var(--ink-2); }
.fig.red { background: var(--red); color: var(--red-ink); box-shadow: none; }
.fig.red .l { color: inherit; opacity: .9; }

.plan { display: block; padding: .8rem .95rem; border-top: 1px solid var(--line); color: inherit; }
.plan:first-child { border-top: 0; }
.plan .ph { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.bar { height: .4rem; background: var(--line); border-radius: .2rem; margin: .5rem 0 .35rem; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: .2rem; }

/* ---------- φίλτρα ---------- */
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem 0 .7rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: .4rem .85rem; white-space: nowrap; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip i { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: .05rem; }
.search { width: 100%; padding: .7rem .95rem; border-radius: var(--r-ctl); border: 1.5px solid var(--line); background: var(--surface); margin-bottom: .5rem; }

/* ---------- φόρμες ---------- */
.card { background: var(--surface); border-radius: var(--r-group); padding: 1rem; box-shadow: var(--shadow); margin-bottom: .8rem; }
.card h2 { font-size: 1.05rem; margin: 0 0 .25rem; }
.card > p { margin: 0 0 .8rem; color: var(--ink-2); font-size: .9rem; }
.field { display: block; margin-bottom: .75rem; }
.field > span { display: block; font-size: .8rem; color: var(--ink-2); margin-bottom: .3rem; font-weight: 600; }
.field input, .field select, .field textarea, .input {
  width: 100%; padding: .65rem .8rem; border-radius: var(--r-ctl); border: 1.5px solid var(--line); background: var(--surface-2);
  outline: none; min-height: 2.8rem;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.low input { border-color: var(--amber); }
.field textarea { min-height: 4.5rem; resize: vertical; }
.title-input { font-size: 1.25rem; font-weight: 700; border: 0; background: transparent; padding: .2rem 0; box-shadow: none; width: 100%; resize: none; outline: none; line-height: 1.3; overflow: hidden; margin-bottom: .6rem; font-family: inherit; color: inherit; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grid2 > * { min-width: 0; }
.grid2.wrap { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.field input, .field select { min-width: 0; max-width: 100%; }
.seg { display: flex; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-ctl); padding: .2rem; margin-bottom: .9rem; gap: .2rem; }
.seg button { flex: 1; border: 0; background: none; padding: .5rem .3rem; border-radius: .55rem; cursor: pointer; font-size: .88rem; color: var(--ink-2); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.prio button[data-p='1'].on { color: var(--amber); }
.seg.prio button[data-p='2'].on { background: var(--red); color: var(--red-ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.card > .toggle:first-of-type, .toggle.first { border-top: 0; }
.toggle input[type=checkbox] { width: 3rem; height: 1.75rem; appearance: none; -webkit-appearance: none; background: var(--line-2); border-radius: 1rem; position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.toggle input[type=checkbox]::after { content: ''; position: absolute; top: .2rem; left: .2rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input[type=checkbox]:checked { background: var(--accent); }
.toggle input[type=checkbox]:checked::after { transform: translateX(1.25rem); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; text-align: center;
  border: 1.5px solid var(--line-2); background: var(--surface); border-radius: var(--r-ctl); padding: .65rem 1rem;
  font-weight: 700; cursor: pointer; color: var(--ink); min-height: 2.8rem; font-size: .95rem;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.red { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.block { width: 100%; }
.btn.sm { padding: .35rem .75rem; min-height: 2.2rem; font-size: .84rem; border-radius: .6rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 1.15rem; height: 1.15rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.actions .btn { flex: 1 1 auto; }

/* υπο-εργασίες */
.subs { margin: .2rem 0 .6rem; }
.subrow { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.subrow:first-child { border-top: 0; }
.subrow .check { width: 1.7rem; height: 1.7rem; }
.subrow input.t { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; padding: .2rem 0; }
.subrow.done input.t { text-decoration: line-through; color: var(--ink-3); }
.subrow .x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; padding: .2rem .4rem; }

/* λεπτομέρειες πληρωμής */
.hero { padding: .6rem .2rem 1rem; }
.hero .amt { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hero .due { margin-top: .3rem; color: var(--ink-2); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; background: var(--line); color: var(--ink-2); margin-top: .5rem; }
.badge.overdue { background: var(--red); color: var(--red-ink); }
.badge.paid { background: var(--green-soft); color: var(--green); }
.badge.soon { background: var(--amber-soft); color: var(--amber); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; margin: 0; }
.kv dt { color: var(--ink-3); font-size: .9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.code { font-variant-numeric: tabular-nums; letter-spacing: .04em; font-weight: 600; }
.copy { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: .5rem; padding: .15rem .55rem; margin-left: .4rem; cursor: pointer; font-size: .78rem; font-weight: 700; }

/* σάρωση */
.drop { border: 2px dashed var(--line-2); border-radius: var(--r-sheet); padding: 1.7rem 1rem; text-align: center; background: var(--surface); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .icon { width: 3.2rem; height: 3.2rem; margin: 0 auto .6rem; color: var(--accent); }
.drop h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
.drop .actions { justify-content: center; margin-top: 1rem; }
.draft { position: relative; }
.draft .rm { position: absolute; top: .6rem; right: .6rem; border: 0; background: var(--surface-2); border-radius: 50%; width: 2rem; height: 2rem; cursor: pointer; color: var(--ink-2); }
.draft.off { opacity: .4; }
.draft .no { font-size: .8rem; color: var(--ink-3); margin-bottom: .5rem; font-weight: 700; }
.notes { background: var(--amber-soft); border-radius: var(--r-ctl); padding: .65rem .9rem; margin-bottom: .8rem; font-size: .9rem; }
.notes p { margin: .2rem 0; }
details.raw { margin-top: .6rem; }
details.raw pre { white-space: pre-wrap; font-size: .75rem; max-height: 16rem; overflow: auto; background: var(--surface-2); padding: .6rem; border-radius: .6rem; }
.progress { height: .25rem; border-radius: .2rem; background: var(--line); overflow: hidden; margin-top: .9rem; }
.progress i { display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- ημερολόγιο ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: .2rem 0 .6rem; }
.cal-head b { font-size: 1.15rem; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; background: var(--surface); border-radius: var(--r-group); padding: .5rem; box-shadow: var(--shadow); }
.cal .wd { text-align: center; font-size: .72rem; color: var(--ink-3); font-weight: 700; padding: .2rem 0; }
.cal .day { aspect-ratio: 1 / 1.05; border: 0; background: transparent; border-radius: .6rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: .3rem; cursor: pointer; gap: .15rem; min-width: 0; }
.cal .day .n { font-weight: 600; font-size: .92rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; }
.cal .day.out { opacity: .35; }
.cal .day.today .n { background: var(--ink); color: var(--bg); }
.cal .day.sel { background: var(--accent-soft); }
.cal .dots { display: flex; gap: .15rem; }
.cal .dots i { width: .38rem; height: .38rem; border-radius: 50%; background: var(--accent); }
.cal .dots i.pay { background: var(--green); }
.cal .dots i.red { background: var(--red); }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--ink-2); margin: .5rem .2rem 0; flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .35rem; background: var(--accent); }
.legend .pay::before { background: var(--green); }
.legend .red::before { background: var(--red); }

/* ---------- στατιστικά ---------- */
.chart { width: 100%; display: block; }
.chart text { fill: var(--ink-2); font-size: 11px; font-family: var(--font); }
.chart .val { fill: var(--ink); font-weight: 700; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .cbar { fill: var(--accent); }
.chart .cbar.proj { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.catbar { display: grid; grid-template-columns: minmax(0, 8rem) 1fr auto; gap: .6rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.catbar:first-child { border-top: 0; }
.catbar .track { height: .55rem; background: var(--surface-2); border-radius: .3rem; overflow: hidden; }
.catbar .track i { display: block; height: 100%; background: var(--accent); border-radius: .3rem; }
.tip { font-size: .86rem; color: var(--ink-2); min-height: 1.3rem; margin: .2rem 0 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data td, table.data th { padding: .35rem .2rem; border-top: 1px solid var(--line); text-align: left; }
table.data td:last-child, table.data th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- κάτω μπάρα ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.tabbar a, .tabbar button.plus { display: flex; flex-direction: column; align-items: center; gap: .15rem; color: var(--ink-3); font-size: clamp(11px, .68rem, 13px); font-weight: 600; position: relative; padding: .3rem 0; background: none; border: 0; cursor: pointer; min-width: 0; }
.tabbar a > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .1rem; }
.tabbar svg { width: 1.45rem; height: 1.45rem; }
.tabbar a.on { color: var(--accent); }
.tabbar button.plus span.pill { width: 3.3rem; height: 2.6rem; border-radius: 1rem; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 18px -8px var(--accent); }
.tabbar button.plus svg { width: 1.6rem; height: 1.6rem; }
.tabbar .dot { position: absolute; top: .1rem; left: calc(50% + .35rem); min-width: 1.05rem; height: 1.05rem; border-radius: .55rem; background: var(--red); color: #fff; font-size: .62rem; display: grid; place-items: center; padding: 0 .25rem; font-weight: 800; }

/* ---------- φύλλα & ειδοποιήσεις ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(8, 10, 14, .5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 36rem; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom)); animation: up .22s ease-out; max-height: 92vh; overflow: auto; }
.sheet h3 { font-size: 1.15rem; margin: 0 0 .35rem; }
.sheet p { margin: 0 0 .9rem; color: var(--ink-2); }
.sheet .btn.block, .sheet > .btn { width: 100%; margin-top: .5rem; }
.sheet .grab { width: 2.5rem; height: .3rem; border-radius: .2rem; background: var(--line-2); margin: -.4rem auto .8rem; }
@media (min-width: 40rem) { .sheet-bg { align-items: center; } .sheet { border-radius: var(--r-sheet); } }
@keyframes up { from { transform: translateY(2rem); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.menu-list { display: grid; gap: .5rem; margin-top: .6rem; }
.menu-list .btn { justify-content: flex-start; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .8rem); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: var(--r-ctl); z-index: 30; font-size: .92rem; box-shadow: var(--shadow); max-width: calc(100% - 2rem); animation: up .2s; display: flex; align-items: center; gap: .8rem; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 800; cursor: pointer; padding: 0; }
:root:not([data-theme='dark']) .toast button { color: #b9c3ff; }

/* ---------- είσοδος / κλείδωμα ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.login .card { width: 100%; max-width: 24rem; padding: 1.6rem 1.4rem; }
.login .mark { width: 3.6rem; height: 3.6rem; margin-bottom: .9rem; }
.login h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 .2rem; letter-spacing: -.02em; }
.login p { color: var(--ink-2); margin: 0 0 1.2rem; }
.err { color: var(--red); font-size: .9rem; min-height: 1.3em; margin: .3rem 0 .5rem; font-weight: 600; }
.bio { width: 5rem; height: 5rem; border-radius: 1.5rem; display: grid; place-items: center; margin: .4rem auto 1rem; background: var(--accent-soft); color: var(--accent); border: 0; cursor: pointer; }
.bio svg { width: 2.8rem; height: 2.8rem; }
.or { text-align: center; color: var(--ink-3); font-size: .85rem; margin: 1rem 0 .6rem; }

/* ρυθμίσεις */
.size-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .4rem 0 .2rem; }
.size-pick button { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: var(--r-ctl); padding: .5rem 0; cursor: pointer; font-weight: 700; color: var(--ink); }
.size-pick button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.size-pick button[data-s='s'] { font-size: 16px; } .size-pick button[data-s='m'] { font-size: 18px; }
.size-pick button[data-s='l'] { font-size: 20px; } .size-pick button[data-s='xl'] { font-size: 23px; }
.daypick { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0 .4rem; }
.lbl { font-size: .8rem; color: var(--ink-2); margin: .9rem 0 .4rem; font-weight: 600; }
.src { padding: .65rem 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.src:first-of-type { border-top: 0; }
.secret { background: var(--surface-2); border: 1.5px solid var(--line); border-radius: .6rem; padding: .6rem; overflow-wrap: anywhere; margin: .35rem 0 .6rem; font-size: .84rem; }
.feed-item { padding: .8rem .95rem; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: 0; }
.feed-item .t { font-weight: 700; }
.alert-item { padding: .85rem .95rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: start; }
.alert-item:first-child { border-top: 0; }
.alert-item .sev { width: .8rem; height: .8rem; border-radius: 50%; background: var(--red); margin-top: .35rem; }
.alert-item .sev.warning { background: var(--amber); }
.alert-item.ack { opacity: .55; }
.version { text-align: center; color: var(--ink-3); font-size: .8rem; margin: 1rem 0; }

.tag i, i.dotc { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; }
