:root {
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #15211e;
  --muted: #5d6b67;
  --line: #e2e8e5;
  --brand: #0f5a4a;
  --brand-2: #14806a;
  --good: #1e8a4c;
  --bad: #d6336c;
  --neutral: #f08c00;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1614; --card: #18221f; --ink: #e8efec; --muted: #9aa9a4; --line: #2a3632;
    --brand: #3fb497; --brand-2: #57c9ab; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* το «hidden» υπερισχύει πάντα των κανόνων display */
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 16px 0 6px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
a { color: var(--brand-2); }
button { font: inherit; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; padding: 0; text-align: left; }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: .2px; }
.brand small { display: block; opacity: .8; font-size: .75rem; margin-top: -2px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: #0f5a4a; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.link { background: none; border: 0; color: #fff; opacity: .9; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }

.lead { color: var(--muted); margin: 0 0 20px; }
.primary, .secondary {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 600;
}
.primary { background: var(--brand); color: #fff; }
.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.big { padding: 20px; font-size: 1.1rem; margin: 18px 0; }

.manual { display: flex; gap: 8px; margin-bottom: 24px; }
.manual input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 1rem;
}
.manual button { border: 0; border-radius: 12px; padding: 0 16px; background: var(--brand-2); color: #fff; font-weight: 600; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 12px 0; border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: .9rem; }

.plist { list-style: none; padding: 0; margin: 0; }
.prow {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 4px; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: inherit; text-align: left;
}
.plist li:last-child .prow { border-bottom: 0; }
.prow img, .noimg { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; flex: none; }
.noimg { background: var(--line); }
.pinfo { flex: 1; min-width: 0; }
.pinfo strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pinfo small { color: var(--muted); }
.chip { min-width: 40px; text-align: center; padding: 4px 8px; border-radius: 999px; color: #fff; font-weight: 700; font-size: .9rem; }

.cam { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: #000; margin-top: 16px; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { position: absolute; left: 8%; right: 8%; top: 36%; height: 28%; border: 3px solid rgba(255,255,255,.9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff5a5a; animation: sweep 1.6s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateY(-30px); } to { transform: translateY(30px); } }
.hint { text-align: center; color: var(--muted); }

.phead { display: flex; gap: 14px; align-items: center; }
.phead img { width: 84px; height: 84px; object-fit: contain; border-radius: 12px; background: #fff; flex: none; }
.phead h1 { font-size: 1.2rem; margin: 0 0 4px; }
.phead p { margin: 0; color: var(--muted); font-size: .9rem; }

.phead .code { font-size: .8rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wrong { margin: -4px 4px 4px; font-size: .9rem; color: var(--muted); }
.wrong summary { cursor: pointer; text-align: right; color: var(--brand-2); font-weight: 600; }
.wrong p { margin: 8px 0; }
.score { position: relative; display: grid; place-items: center; padding: 18px 0 8px; }
.ring { width: 170px; height: 170px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: var(--c); stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.score .num { position: absolute; top: 72px; font-size: 3rem; font-weight: 800; line-height: 1; }
.score .num small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.score .band { margin-top: 8px; font-weight: 700; color: var(--c); font-size: 1.15rem; }
.score.none .num { position: static; font-size: 3rem; color: var(--muted); }
.score.none .band { color: var(--muted); font-weight: 500; text-align: center; font-size: 1rem; }

.capnote { text-align: center; color: var(--muted); font-size: .85rem; margin: 0 8px 8px; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts small { display: block; color: var(--muted); font-size: .85rem; }
.facts strong { font-weight: 600; }
.ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800; flex: none; }
.good .ic { background: var(--good); }
.bad .ic { background: var(--bad); }
.neutral .ic { background: var(--neutral); }
.missing { color: var(--muted); font-size: .85rem; }

.loading { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 60px 0; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { text-align: center; margin-top: 28px; }

.bands { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bands span { color: #fff; border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 8px; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.card ul, .refs { padding-left: 20px; margin: 8px 0 0; }
.card li { margin-bottom: 6px; }
.refs { font-size: .82rem; color: var(--muted); }

.foot { max-width: 560px; margin: 0 auto; padding: 8px 16px 28px; color: var(--muted); font-size: .78rem; text-align: center; }
.foot p { margin: 4px 0; }

/* ---------- Πλοήγηση ---------- */
body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a.primary, a.secondary { text-decoration: none; }
.brand, .link { text-decoration: none; }
.link { text-decoration: underline; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tabs a span { font-size: 1.25rem; line-height: 1.2; }
.tabs a.on { color: var(--brand-2); }
.tabs b {
  position: absolute; top: 4px; left: calc(50% + 8px); min-width: 17px; height: 17px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: .68rem; display: grid; place-items: center; padding: 0 4px;
}

/* ---------- Αρχική ---------- */
.shelfcta { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.shelfcta .emoji { font-size: 1.9rem; }
.shelfcta strong { display: block; }
.shelfcta small { color: var(--muted); }
.shelfcta .arrow { margin-left: auto; font-size: 1.6rem; color: var(--muted); }

/* ---------- Οδηγός ραφιού ---------- */
.catgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.catcard {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); color: inherit;
}
.catcard .emoji { font-size: 1.7rem; }
.catcard strong { font-size: .95rem; line-height: 1.25; }
.catcard small { color: var(--muted); font-size: .8rem; }
.back { display: inline-block; margin-top: 14px; color: var(--brand-2); text-decoration: none; font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.fchip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.plist.card { padding: 4px 12px; }
a.prow { text-decoration: none; }
.rank { width: 22px; flex: none; text-align: center; color: var(--muted); font-weight: 700; font-size: .85rem; }
.exis { display: inline-block; font-style: normal; font-size: .75rem; font-weight: 700; color: #b7791f; }
.note { display: block; font-style: italic; }
.exisnote { border-left: 4px solid #e0a526; }
.morelink { display: block; margin-top: 8px; color: var(--brand-2); font-weight: 600; text-decoration: none; }
.cmpbtn { margin-bottom: 8px; }

/* ---------- Σύγκριση ---------- */
.cmp { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px; }
.cmphead { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.cmphead a { color: inherit; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cmphead img, .cmphead .noimg { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; }
.cmphead strong { font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cmphead small { color: var(--muted); font-size: .78rem; }
.cmphead .x { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: var(--muted); font-size: 1.3rem; }
.score.small { padding: 6px 0 0; }
.score.small .ring { width: 92px; height: 92px; }
.score.small .num { top: 30px; font-size: 1.7rem; }
.score.small .num small { font-size: .7rem; }
.score.small .band { font-size: .8rem; margin-top: 4px; }
.cmptable th { width: 34%; font-weight: 600; color: var(--muted); }
.cmptable td { font-variant-numeric: tabular-nums; }
.cmptable td.better { color: var(--good); font-weight: 700; }
.card.suspect { border-left: 4px solid var(--neutral); }
.card.suspect h2 { color: var(--neutral); }
.card.suspect ul { margin: 0 0 8px; }

/* ---------- Εγκατάσταση εφαρμογής ---------- */
.installcta {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 14px 0 0; padding: 12px 14px; text-align: left;
  background: #e8f5f0; border: 1px solid #b9e2d3; border-radius: 16px; color: var(--ink);
}
.installcta img { border-radius: 12px; flex: none; }
.installcta strong { display: block; color: var(--brand); }
.installcta small { color: var(--muted); }
.installcta .arrow { margin-left: auto; font-size: 1.6rem; color: var(--brand); }
@media (prefers-color-scheme: dark) { .installcta { background: #16302a; border-color: #24524a; } }
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheetbox {
  position: relative; width: 100%; max-width: 560px; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center;
}
.sheetbox img { border-radius: 14px; }
.sheetbox h2 { margin: 10px 0 14px; }
.sheetbox .x { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 1.6rem; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; text-align: left; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.steps svg { vertical-align: -4px; }

/* ---------- Οθόνη υποδοχής ---------- */
.gate {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto;
}
.gatebox { width: 100%; max-width: 420px; text-align: center; }
.gatebox img { border-radius: 22px; box-shadow: 0 8px 24px rgba(15, 90, 74, .25); }
.gatebox h1 { font-size: 2rem; margin: 18px 0 0; color: var(--brand); }
.gatesub { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.gatelead { color: var(--muted); margin: 0 0 26px; }
.gatebox .big { margin: 0 0 6px; }
#gateSteps { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; margin: 4px 0 8px; }
.gateskip { background: none; border: 0; color: var(--muted); font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; padding: 12px; margin-top: 4px; }

/* ---------- Κουμπί «Πίσω» ---------- */
.backbtn {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 6px 0 -8px;
  border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff;
}
.backbtn:active { background: rgba(255, 255, 255, .3); }
.top .brand { margin-right: auto; }

/* Βαθμός A–E */
.gradecard { display: grid; justify-items: center; gap: 6px; padding: 16px 0 6px; }
.gradecard .scale { display: flex; gap: 3px; align-items: center; }
.gradecard .scale span { width: 40px; height: 44px; display: grid; place-items: center; color: #fff; font-weight: 800;
  font-size: 1.3rem; opacity: .35; border-radius: 6px; }
.gradecard .scale span:first-child { border-radius: 12px 6px 6px 12px; }
.gradecard .scale span:last-child { border-radius: 6px 12px 12px 6px; }
.gradecard .scale span.on { opacity: 1; width: 58px; height: 66px; font-size: 2.3rem; border-radius: 14px;
  box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(0,0,0,.25); }
.gradecard .glabel { font-size: 1.15rem; }
.gradecard .gnum { color: var(--muted); font-weight: 600; }
.gradecard.small { padding: 6px 0 0; gap: 4px; }
.gradecard.small .scale span { width: 20px; height: 24px; font-size: .75rem; }
.gradecard.small .scale span.on { width: 32px; height: 38px; font-size: 1.3rem; border-radius: 9px; }
.gradecard.small .glabel { font-size: .8rem; text-align: center; }
.gradecard.small .gnum { font-size: .75rem; }
li .pts { margin-left: auto; font-size: .85rem; color: var(--muted); white-space: nowrap; }
table.scales th { text-align: left; font-weight: 600; padding-right: 8px; vertical-align: top; }
table.scales td span { display: inline-block; margin: 0 8px 2px 0; font-size: .8rem; color: var(--muted); }
.sub { margin: -6px 0 8px; font-size: .8rem; }
