/* Uvod v prehrano: videz aplikacije.
   Barve porcij so preverjene za barvno slabovidnost. Barva nikoli ne nosi pomena sama. */
:root {
  --bg: #F3F6F2;
  --surface: #FFFFFF;
  --ink: #18211C;
  --ink2: #55615A;
  --muted: #7C867F;
  --line: #E1E7E1;
  --brand: #F2C200;
  --brand-ink: #18211C;
  --soft: #FBF3CC;
  --c1: #eb6834; /* dlan */
  --c2: #1baf7a; /* pest */
  --c3: #eda100; /* odprta dlan */
  --c4: #2a78d6; /* palec */
  --good: #006300;
  --good-bg: #E3F3E3;
  --warn-bg: #FDEFC7;
  --warn: #7A5200;
  --bad: #B3261E;
  --shadow: 0 1px 2px rgba(24,33,28,.06), 0 4px 14px rgba(24,33,28,.05);
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121715; --surface: #1C221F; --ink: #EEF2EE; --ink2: #A9B4AD; --muted: #8A948E;
    --line: #2B342F; --soft: #332F14;
    --c1: #d95926; --c2: #199e70; --c3: #c98500; --c4: #3987e5;
    --good: #5FD35F; --good-bg: #1D3320; --warn-bg: #3A3010; --warn: #F5C95A; --bad: #F2807A;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121715; --surface: #1C221F; --ink: #EEF2EE; --ink2: #A9B4AD; --muted: #8A948E;
  --line: #2B342F; --soft: #332F14;
  --c1: #d95926; --c2: #199e70; --c3: #c98500; --c4: #3987e5;
  --good: #5FD35F; --good-bg: #1D3320; --warn-bg: #3A3010; --warn: #F5C95A; --bad: #F2807A;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); overflow-x: hidden; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--c4); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--ink); }

.shell { max-width: 480px; margin: 0 auto; padding: 0 16px 104px; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 5; }
.logo { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; flex: none; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sub { color: var(--ink2); font-size: 14px; }
.note { font-size: 12.5px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }

/* gumbi */
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; background: var(--brand); color: var(--brand-ink); min-height: 48px; }
.btn.ghost { background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.danger { background: var(--surface); border: 1.5px solid var(--bad); color: var(--bad); }

/* obrazci */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px; min-height: 48px;
}
textarea { min-height: 90px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.err { color: var(--bad); font-size: 13.5px; font-weight: 600; min-height: 1px; }
.ok-msg { color: var(--good); font-size: 13.5px; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.seg button { border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 8px; font-weight: 700; min-height: 48px; }
.seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* navada */
.habit { background: var(--soft); border-color: transparent; }
.habit h2 { margin: 4px 0 6px; font-size: 21px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.choice { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 6px; font-weight: 700; font-size: 14px; min-height: 54px; }
.choice[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.reply { margin-top: 12px; font-size: 14px; }

/* drsniki */
.slider { margin-top: 14px; }
.slider .lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; }
.slider .val { font-family: var(--font-display); font-weight: 800; font-size: 17px; }
input[type=range] { width: 100%; height: 44px; background: none; margin: 0; -webkit-appearance: none; appearance: none; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: var(--shadow); margin-top: -10px; }
input[type=range]::-moz-range-track { height: 10px; border-radius: 99px; background: var(--line); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); }
.ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: -4px; }

/* krogi porcij */
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.ring { background: none; border: 2px solid transparent; border-radius: 16px; padding: 6px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.ring[aria-pressed="true"] { border-color: var(--ink); background: var(--bg); }
.ring svg { width: 100%; max-width: 84px; height: auto; display: block; }
.ring .track { fill: none; stroke: var(--line); stroke-width: 12; }
.ring .arc { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .35s ease; }
.ring .rt { font-family: var(--font-display); font-weight: 800; font-size: 22px; fill: var(--ink); }
.ring .rl { font-size: 11.5px; font-weight: 700; color: var(--ink2); text-align: center; }
.detail { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.stepper { display: flex; gap: 8px; margin-top: 8px; }

/* pot */
.weeks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.wk { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-family: var(--font-display); font-weight: 800; font-size: 17px; display: grid; place-items: center; }
.wk.done { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.wk.now { border-color: var(--ink); border-width: 3px; }
.wk.lock { color: var(--muted); background: var(--bg); }
.wk[aria-pressed="true"] { outline: 3px solid var(--c4); outline-offset: 2px; }
.pbar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.pbar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s ease; }

/* grafi */
.chartwrap { position: relative; margin-top: 10px; }
.chartwrap svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chartwrap text { font-family: var(--font-body); font-size: 10px; fill: var(--muted); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 12px; min-width: 112px; box-shadow: var(--shadow); z-index: 3; }
.tip b { font-weight: 700; }
.tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 2px; }
.tip .key { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 600; }
.lg[aria-pressed="false"] { opacity: .45; }
.lg i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* lekcije */
.lesson { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.lesson .ck { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 800; }
.lesson.done .ck { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.lesson .t { flex: 1; min-width: 0; }

/* kartice za podrsanje */
.deck { position: relative; touch-action: pan-y; }
.deck .page { display: none; }
.deck .page.on { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: .3; } to { opacity: 1; } }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line); }
.dots button[aria-current="true"] { background: var(--ink); width: 22px; border-radius: 99px; }
.deck-nav { display: flex; gap: 8px; margin-top: 12px; }

/* klepet */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; }
.msg.ai { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--brand); color: var(--brand-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.compose { display: flex; gap: 8px; margin-top: 4px; }
.compose input { min-width: 0; }

/* trener */
.member { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.pill.ok { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tile b { font-family: var(--font-display); font-size: 25px; display: block; line-height: 1.1; }
.tile span { font-size: 12px; color: var(--ink2); }

/* navigacija */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 480px); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 6; }
.nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 700; color: var(--muted); border-radius: 12px; }
.nav button[aria-current="page"] { color: var(--ink); }
.nav svg { width: 54px; height: 30px; padding: 4px 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav button[aria-current="page"] svg { background: var(--brand); border-radius: 12px; color: var(--brand-ink); }

/* plast čez zaslon */
#sheet { position: fixed; inset: 0; background: rgba(10,15,12,.55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
#sheet .panel { background: var(--surface); width: min(100%, 480px); max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
#banner { position: fixed; top: calc(env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(100%, 480px); background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600; padding: 8px 16px; text-align: center; z-index: 25; }

/* vstopna stran */
.hero { padding: 28px 0 10px; }
.hero .mark { width: 64px; height: 64px; border-radius: 20px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 30px; }
.hero h1 { font-size: 32px; margin: 16px 0 8px; }
.feat { display: flex; gap: 12px; align-items: flex-start; }
.feat .n { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
