/* =========================================================
   ΑΟΘ Βοήθημα — στυλ
   Ανοιχτό θέμα ως βάση, σκούρο μέσω prefers-color-scheme
   ή data-theme="dark". Το data-theme="light" υπερισχύει.
   ========================================================= */

:root {
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --card: #ffffff;
  --card-2: #f8f9fd;
  --ink: #161a2e;
  --ink-2: #454b66;
  --ink-3: #6f7590;
  --line: #e1e4ef;
  --line-2: #cfd3e3;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eceafe;
  --accent: #0ea5a4;
  --good: #15803d;
  --good-soft: #e3f6ea;
  --bad: #c2410c;
  --bad-soft: #fdeee4;
  --warn: #b45309;
  --warn-soft: #fff4dc;
  --info: #1d4ed8;
  --info-soft: #e6eefe;
  --pink: #be185d;
  --pink-soft: #fde7f1;

  /* χρώματα διαγραμμάτων */
  --c-d: #2563eb;      /* ζήτηση */
  --c-s: #e11d48;      /* προσφορά */
  --c-3: #16a34a;
  --c-4: #d97706;
  --c-5: #7c3aed;
  --c-grid: #e6e8f1;
  --c-axis: #6b7192;

  --shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 4px 16px rgba(20, 24, 50, .06);
  --shadow-lg: 0 10px 40px rgba(20, 24, 50, .14);
  --r: 16px;
  --r-sm: 10px;
  --nav-h: 64px;
  --top-h: 56px;
  --maxw: 860px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1020;
    --bg-2: #141830;
    --card: #171b33;
    --card-2: #1c213d;
    --ink: #eef0fb;
    --ink-2: #c3c7de;
    --ink-3: #9096b5;
    --line: #2a3052;
    --line-2: #3a4170;
    --brand: #8b85ff;
    --brand-ink: #0d1020;
    --brand-soft: #262a55;
    --accent: #2dd4bf;
    --good: #4ade80;
    --good-soft: #15301f;
    --bad: #fb923c;
    --bad-soft: #3a2113;
    --warn: #fbbf24;
    --warn-soft: #362a10;
    --info: #7aa2ff;
    --info-soft: #18244a;
    --pink: #f472b6;
    --pink-soft: #3a1830;
    --c-d: #60a5fa;
    --c-s: #fb7185;
    --c-3: #4ade80;
    --c-4: #fbbf24;
    --c-5: #c4b5fd;
    --c-grid: #242a4a;
    --c-axis: #8a90b0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1020;
  --bg-2: #141830;
  --card: #171b33;
  --card-2: #1c213d;
  --ink: #eef0fb;
  --ink-2: #c3c7de;
  --ink-3: #9096b5;
  --line: #2a3052;
  --line-2: #3a4170;
  --brand: #8b85ff;
  --brand-ink: #0d1020;
  --brand-soft: #262a55;
  --accent: #2dd4bf;
  --good: #4ade80;
  --good-soft: #15301f;
  --bad: #fb923c;
  --bad-soft: #3a2113;
  --warn: #fbbf24;
  --warn-soft: #362a10;
  --info: #7aa2ff;
  --info-soft: #18244a;
  --pink: #f472b6;
  --pink-soft: #3a1830;
  --c-d: #60a5fa;
  --c-s: #fb7185;
  --c-3: #4ade80;
  --c-4: #fbbf24;
  --c-5: #c4b5fd;
  --c-grid: #242a4a;
  --c-axis: #8a90b0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}
img, svg { max-width: 100%; }
a { color: var(--brand); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 1; min-width: 0; }
.brand-mark {
  font-weight: 800; letter-spacing: .5px; font-size: 14px;
  background: linear-gradient(135deg, #6366f1, #0ea5a4); color: #fff;
  padding: 5px 9px; border-radius: 9px; flex: none;
}
.brand-text { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: none; }
  :root:not([data-theme="light"]) .ic-moon { display: block; }
}

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left));
  display: flex; justify-content: space-around; align-items: stretch;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.bottomnav a {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600; border-radius: 12px;
}
.bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.active svg { stroke-width: 2.3; }

/* ---------- Layout ---------- */
main { display: block; max-width: var(--maxw); margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 24px max(16px, env(safe-area-inset-right)); outline: none; }
.boot { padding: 40px; text-align: center; color: var(--ink-3); }
.view { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } html { scroll-behavior: auto; } }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; margin-top: 1.6em; }
h3 { font-size: 1.08rem; font-weight: 700; margin-top: 1.3em; }
p { margin: 0 0 .9em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .25em 0; }
small, .muted { color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
b, strong { font-weight: 700; }
.kw { font-weight: 700; color: var(--brand); }
.hl { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--warn) 30%, transparent) 0); padding: 0 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 22px 20px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #0ea5a4 120%);
  color: #fff; box-shadow: var(--shadow-lg); margin-bottom: 18px;
}
.hero h1 { color: #fff; margin-bottom: 6px; }
.hero p { color: rgba(255,255,255,.88); margin: 0; max-width: 46ch; }
.hero .badge-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .chip { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.hero-art { position: absolute; right: -10px; bottom: -14px; width: 170px; opacity: .22; pointer-events: none; }

/* ---------- Cards & grids ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card.flat { box-shadow: none; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
.section-title h2 { margin: 0; font-size: 1.12rem; }
.section-title a { font-size: .9rem; font-weight: 600; text-decoration: none; }

.tile {
  display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
  position: relative; min-width: 0;
}
.tile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.tile:active { transform: translateY(0); }
.tile .ico {
  flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px;
}
.ico { background: var(--tint, var(--brand-soft)); }
:root[data-theme="dark"] .ico { background: color-mix(in srgb, var(--tint, var(--brand)) 22%, var(--card-2)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico { background: color-mix(in srgb, var(--tint, var(--brand)) 22%, var(--card-2)); }
}
.tile .t-body { min-width: 0; flex: 1; }
.tile .t-kicker { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.tile .t-title { font-weight: 700; line-height: 1.3; margin: 2px 0 4px; }
.tile .t-sub { font-size: .88rem; color: var(--ink-3); line-height: 1.4; }
.tile .t-meta { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-3); }

.progress-bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; flex: 1; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: inherit; transition: width .4s ease; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px;
  font-size: .78rem; font-weight: 650; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn:hover { background: var(--bg-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 650; font-size: .88rem; color: var(--ink-2); cursor: pointer; min-height: 36px; }
.seg button.on { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }

/* ---------- Lesson content ---------- */
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.lesson-head { margin-bottom: 14px; }
.lesson-head .chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lesson-head .chip { white-space: normal; max-width: 100%; }
.lesson { font-size: 1.02rem; }
.lesson > p, .lesson > ul, .lesson > ol { max-width: 68ch; }

.box {
  border-radius: 14px; padding: 13px 15px 13px 15px; margin: 14px 0;
  border: 1px solid transparent; position: relative;
}
.box > :last-child { margin-bottom: 0; }
.box .box-t { display: flex; align-items: center; gap: 7px; font-weight: 750; font-size: .84rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.box.def { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.box.def .box-t { color: var(--info); }
.box.ex { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.box.ex .box-t { color: var(--good); }
.box.tip { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.box.tip .box-t { color: var(--brand); }
.box.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.box.warn .box-t { color: var(--warn); }
.box.out { background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: .93rem; }
.box.out .box-t { color: var(--ink-3); }
.box.key { background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 22%, transparent); }
.box.key .box-t { color: var(--pink); }

.formula {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px;
  font-size: 1.12rem; padding: 12px; margin: 12px 0; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; text-align: center;
}
.box .formula { background: color-mix(in srgb, var(--card) 70%, transparent); }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 3px; line-height: 1.15; }
.frac > span { padding: 1px 4px; white-space: nowrap; }
.frac > span:first-child { border-bottom: 1.6px solid currentColor; }
sub, sup { font-size: .72em; }

.table-wrap { overflow-x: auto; margin: 12px 0; border-radius: 12px; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; background: var(--card); }
th, td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg-2); font-weight: 700; color: var(--ink-2); font-size: .85rem; }
tr:last-child td { border-bottom: 0; }
td.l, th.l { text-align: left; white-space: normal; }
tr.hl-row td { background: color-mix(in srgb, var(--brand) 12%, var(--card)); font-weight: 700; }
td input { width: 76px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink); text-align: center; font: inherit; }

.steps { counter-reset: st; list-style: none; padding: 0; }
.steps > li { counter-increment: st; position: relative; padding-left: 38px; margin: 10px 0; }
.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: .85rem; display: grid; place-items: center;
}

details.fold { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin: 10px 0; overflow: hidden; }
details.fold > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▸"; margin-left: auto; transition: transform .2s; color: var(--ink-3); }
details.fold[open] > summary::after { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 14px 14px; }

.lesson-nav { display: flex; gap: 10px; justify-content: space-between; margin: 26px 0 8px; flex-wrap: wrap; }
.lesson-nav .btn { flex: 1 1 200px; }

/* ---------- Widgets ---------- */
.widget {
  border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  margin: 18px 0; overflow: hidden;
}
.widget-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(90deg, var(--brand-soft), transparent); border-bottom: 1px solid var(--line); }
.widget-head .w-ico { font-size: 20px; }
.widget-head .w-title { font-weight: 750; line-height: 1.25; }
.widget-head .w-sub { font-size: .8rem; color: var(--ink-3); }
.widget-body { padding: 14px; }
.w-cols { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .w-cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.chart { width: 100%; max-width: 560px; margin: 0 auto; height: auto; display: block; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart text { font-family: var(--font); fill: var(--ink-2); }
.ctrl { margin: 10px 0; }
.ctrl label { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.ctrl label output { font-family: var(--mono); color: var(--brand); font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--brand); height: 28px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, input.inp, select.inp {
  width: 100%; min-height: 42px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card-2); color: var(--ink); font: inherit; font-weight: 600;
}
.fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); margin: 10px 0; }
.readout { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); margin: 10px 0; }
.readout > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.readout .r-l { font-size: .74rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.readout .r-v { font-size: 1.12rem; font-weight: 800; font-family: var(--mono); }
.verdict { padding: 10px 12px; border-radius: 12px; font-weight: 650; margin: 10px 0; background: var(--bg-2); border: 1px solid var(--line); }
.verdict.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.verdict.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.verdict.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.verdict.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.calc-steps { font-size: .95rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.calc-steps div { margin: 4px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--ink-2); margin: 6px 2px; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

.pill-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill-btns button {
  border: 1px solid var(--line-2); background: var(--card-2); border-radius: 99px; padding: 7px 12px; cursor: pointer;
  font-size: .86rem; font-weight: 600; min-height: 38px; text-align: left;
}
.pill-btns button:hover { border-color: var(--brand); }
.pill-btns button.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.pill-btns button.ok { background: var(--good-soft); color: var(--good); border-color: var(--good); }
.pill-btns button.no { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

/* Sorting / classification game */
.sorter-item { padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); font-weight: 650; text-align: center; font-size: 1.05rem; margin: 6px 0 10px; }
.score-line { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-3); font-weight: 600; }

/* ---------- Quiz ---------- */
.quiz { margin-top: 28px; }
.quiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.quiz-head h2 { margin: 0; }
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 12px 0; box-shadow: var(--shadow); }
.q-num { font-size: .76rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.q-text { font-weight: 650; margin: 6px 0 10px; }
.q-opts { display: grid; gap: 8px; }
.q-opt {
  text-align: left; border: 1.5px solid var(--line-2); background: var(--card-2); border-radius: 12px;
  padding: 10px 12px; cursor: pointer; min-height: 46px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.4;
}
.q-opt:hover:not([disabled]) { border-color: var(--brand); }
.q-opt .letter { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: var(--bg-2); color: var(--ink-2); }
.q-opt.correct { border-color: var(--good); background: var(--good-soft); }
.q-opt.correct .letter { background: var(--good); color: #fff; }
.q-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.q-opt.wrong .letter { background: var(--bad); color: #fff; }
.q-opt[disabled] { cursor: default; }
.q-tf { display: flex; gap: 8px; }
.q-tf .q-opt { flex: 1; justify-content: center; font-weight: 750; }
.q-num-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.q-num-row input { flex: 1 1 140px; max-width: 220px; }
.q-expl { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: .94rem; background: var(--bg-2); border-left: 4px solid var(--ink-3); }
.q-expl.ok { border-left-color: var(--good); }
.q-expl.no { border-left-color: var(--bad); }
.q-expl b.ok { color: var(--good); }
.q-expl b.no { color: var(--bad); }
.quiz-result {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-soft), var(--card)); border: 1px solid var(--line); margin-top: 14px;
}
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--bg-2) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.ring > span { position: relative; font-size: .95rem; }

/* ---------- Extras: definitions, traps, flashcards ---------- */
.search {
  width: 100%; min-height: 46px; padding: 10px 14px 10px 40px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  color: var(--ink); font: inherit; margin: 6px 0 12px;
}
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll button { flex: none; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); border-radius: 99px; padding: 6px 12px; font-weight: 650; font-size: .85rem; cursor: pointer; min-height: 36px; }
.chips-scroll button.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.def-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0; }
.def-item .term { font-weight: 800; color: var(--brand); margin-bottom: 3px; }
.def-item .src { font-size: .76rem; color: var(--ink-3); margin-top: 6px; }
.ch-group-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 1.02rem; }
.trap { border-left: 4px solid var(--warn); }
.trap .wrong-line { color: var(--bad); font-weight: 650; }
.trap .right-line { color: var(--good); font-weight: 650; }

.flash-stage { perspective: 1200px; margin: 10px auto; max-width: 520px; }
.flashcard { position: relative; width: 100%; min-height: 260px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3,.7,.3,1); cursor: pointer; }
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard .face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px;
  padding: 22px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.flashcard .face.back { transform: rotateY(180deg); background: linear-gradient(160deg, var(--brand-soft), var(--card)); font-size: .98rem; text-align: left; align-items: flex-start; overflow-y: auto; }
.flashcard .face .fc-term { font-size: 1.5rem; font-weight: 800; }
.flashcard .face .fc-hint { margin-top: 14px; font-size: .8rem; color: var(--ink-3); }

.empty { text-align: center; color: var(--ink-3); padding: 30px 10px; }

/* ---------- Progress ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat .s-v { font-size: 1.5rem; font-weight: 800; }
.stat .s-l { font-size: .76rem; color: var(--ink-3); font-weight: 650; }
.lesson-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row .dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: var(--bg-2); color: var(--ink-3); }
.lesson-row .dot.done { background: var(--good); color: #fff; }
.lesson-row .lr-t { flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; }
.lesson-row .lr-s { font-size: .8rem; color: var(--ink-3); font-weight: 650; }

/* ---------- Toast / install ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 650; font-size: .92rem;
  box-shadow: var(--shadow-lg); z-index: 80; max-width: calc(100% - 32px); display: flex; gap: 10px; align-items: center;
  animation: fadeUp .25s ease both;
}
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-weight: 700; }

.install-card { display: flex; gap: 12px; align-items: center; }
.install-card .ico { font-size: 28px; }

/* ---------- Misc ---------- */
.kicker { font-size: .78rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.two-col { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.compare { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 12px 0; }
.compare > div { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--card); }
.compare > div h4 { margin: 0 0 6px; font-size: .98rem; }
.compare > div.a { border-top: 4px solid var(--c-d); }
.compare > div.b { border-top: 4px solid var(--c-s); }
.compare > div.c { border-top: 4px solid var(--c-3); }
.compare > div > :last-child { margin-bottom: 0; }
.footer-note { font-size: .82rem; color: var(--ink-3); text-align: center; margin: 26px 0 6px; line-height: 1.5; }
.footer-note a { color: var(--ink-3); }

/* ---------- Κουίζ ως καρτέλες ---------- */
.q-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.q-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--card);
  font-size: .8rem; font-weight: 800; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.q-dot.ok { background: var(--good); border-color: var(--good); color: #fff; }
.q-dot.no { background: var(--bad); border-color: var(--bad); color: #fff; }
.q-dot.cur { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
.q-stage { position: relative; overflow: hidden; }
.q-stage .q-card { margin: 6px 0; min-height: 220px; }
.q-stage .quiz-result { margin-top: 6px; }
.q-card.slide-l { animation: qInL .28s ease both; }
.q-card.slide-r { animation: qInR .28s ease both; }
@keyframes qInL { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes qInR { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-card.slide-l, .q-card.slide-r { animation: none; } }
.q-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.q-nav .q-count { font-weight: 800; color: var(--ink-3); font-size: .9rem; }
.q-nav .btn[hidden] { display: none !important; }
