/*
 * Pčelarski dnevnik — terenska aplikacija
 * Dizajn: "Tactile Functionalism" (Stitch), preveden u samostalan CSS.
 *
 * Nema Tailwinda, nema ikonskog fonta. Google fontovi se učitavaju ako ima
 * mreže i keširaju za kasnije; bez njih sve radi na sistemskom fontu.
 * Aplikacija koja na pčelinjaku čeka CDN je mrtva aplikacija.
 */

:root {
  --bg:        #FFF8F6;
  --surf:      #FFFFFF;
  --surf-lo:   #FBF2F0;
  --surf-mid:  #F5ECEA;
  --surf-hi:   #EFE6E4;
  --surf-dim:  #E9E1DF;
  --txt:       #1E1B1A;
  --txt-2:     #554336;
  --line:      #DBC2B0;
  --line-2:    #887364;

  --amber:     #B15F00;
  --amber-dk:  #8D4B00;
  --amber-lt:  #FFDCC3;
  --amber-on:  #2F1500;

  --slate:     #342F2E;
  --slate-on:  #F8EFED;

  --green:     #006B2F;
  --green-mid: #1E8642;
  --green-lt:  #95F8A7;
  --green-on:  #00210A;

  --red:       #BA1A1A;
  --red-lt:    #FFDAD6;
  --red-on:    #93000A;

  --warn:      #B45309;
  --warn-lt:   #FFEDD5;
  --warn-on:   #7C2D12;

  --blue:      #545F73;
  --blue-lt:   #D5E0F8;
  --blue-on:   #111C2D;

  --head: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r:   16px;
  --r-s: 12px;
  --touch: 56px;
  --nav-h: 84px;
}

/* Tema za jako sunce: bez polutonova. */
body.sunce {
  --bg: #FFFFFF; --surf: #FFFFFF; --surf-lo: #FFFFFF; --surf-mid: #F2F2F2; --surf-hi: #E8E8E8;
  --txt: #000; --txt-2: #000; --line: #000; --line-2: #000;
  --amber: #000; --amber-dk: #000; --amber-lt: #FFF; --amber-on: #000;
  --slate: #000; --green: #004D1F; --red: #A00000; --warn: #7A3000;
}
body.sunce .card, body.sunce .hive-card, body.sunce .btn-2, body.sunce .seg > button,
body.sunce .chip, body.sunce input, body.sunce textarea, body.sunce select { border-width: 3px; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body); font-size: 17px; font-weight: 500; line-height: 1.5;
  color: var(--txt); background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overscroll-behavior-y: contain;
}
h1, h2, h3, .head { font-family: var(--head); letter-spacing: -0.01em; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 30px; height: 30px; }

/* ---------- Zaglavlje ---------- */

.hdr {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg); border-bottom: 2px solid var(--surf-dim);
}
.hdr .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.hdr .brand img { width: 40px; height: 40px; border-radius: 10px; }
.hdr .brand h1 { font-size: 19px; line-height: 1.1; font-weight: 800; }
.hdr .brand small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }
.hdr .back { width: 44px; height: 44px; display: grid; place-items: center; margin-left: -8px; border-radius: 10px; }
.hdr .back:active { background: var(--surf-hi); }

.sync-badge {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 12px; border-radius: 999px;
  background: var(--slate); color: var(--slate-on);
  font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap;
}
.sync-badge.ok  { background: var(--green-lt); color: var(--green-on); }
.sync-badge.off { background: var(--warn-lt); color: var(--warn-on); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--amber); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Traka za odabir pčelinjaka */
.apiary-bar { display: flex; gap: 8px; padding: 12px 16px 0; }
.apiary-bar .sel {
  flex: 1; position: relative; min-height: 52px;
  background: var(--surf-mid); border: 2px solid transparent; border-radius: var(--r-s);
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
}
.apiary-bar .sel select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 18px;
}
.apiary-bar .sel span { font-weight: 700; font-size: 16px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apiary-bar .view {
  min-width: 78px; padding: 6px 10px; border-radius: var(--r-s); background: var(--surf-mid);
  display: flex; flex-direction: column; justify-content: center;
}
.apiary-bar .view b { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-2); }
.apiary-bar .view span { font-size: 14px; font-weight: 700; line-height: 1.15; }

/* ---------- Sadržaj ---------- */

.main { padding: 16px; max-width: 720px; margin: 0 auto; }
.stack > * + * { margin-top: 12px; }
.lbl { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-2); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--txt-2); }
.small { font-size: 14px; }
.center { text-align: center; }

.card {
  background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r); padding: 16px;
}
.card.strip { background: var(--surf-mid); border-color: transparent; padding: 12px 14px; }
.card.info  { background: var(--surf-lo); border-color: transparent; }

.empty { text-align: center; padding: 40px 20px; color: var(--txt-2); }
.empty b { display: block; font-family: var(--head); font-size: 20px; color: var(--txt); margin-bottom: 6px; }

/* Pilule stanja */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  background: var(--surf-hi); color: var(--txt-2);
}
.pill.ok   { background: var(--green-mid); color: #fff; }
.pill.okl  { background: var(--green-lt); color: var(--green-on); }
.pill.warn { background: var(--warn-lt); color: var(--warn-on); }
.pill.bad  { background: var(--red-lt); color: var(--red-on); }
.pill.info { background: var(--blue-lt); color: var(--blue-on); }
.pill.dark { background: var(--slate); color: var(--slate-on); }
.pill.amber{ background: var(--amber-lt); color: var(--amber-on); }
.pill.sync { background: var(--blue-lt); color: var(--blue-on); text-transform: uppercase; font-size: 11px; }

/* ---------- Kartica košnice (ekran 8) ---------- */

.hive-card {
  background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r);
  padding: 14px; display: grid; gap: 10px;
}
.hive-card.ok   { border-color: var(--green-mid); }
.hive-card.warn { border-color: var(--warn); }
.hive-card.bad  { border-color: var(--red); }
.hive-card .top { display: flex; gap: 12px; align-items: flex-start; }
.hive-card .num {
  width: 60px; height: 60px; flex: none; border-radius: 12px;
  background: var(--surf-mid); display: grid; place-items: center;
  font-family: var(--head); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.hive-card.ok   .num { background: var(--green-lt); color: var(--green-on); }
.hive-card.warn .num { background: var(--warn-lt); color: var(--warn-on); }
.hive-card.bad  .num { background: var(--red-lt); color: var(--red-on); }
.hive-card .ttl { font-family: var(--head); font-size: 20px; font-weight: 800; line-height: 1.15; }
.hive-card .sub { font-size: 14px; color: var(--txt-2); margin-top: 2px; }
.hive-card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hive-card .meta > div { background: var(--surf-lo); border-radius: 10px; padding: 8px 10px; }
.hive-card .meta b { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-2); margin-bottom: 2px; }
.hive-card .meta span { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.hive-card .alert { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.hive-card .alert.bad  { background: var(--red-lt); color: var(--red-on); }
.hive-card .alert.warn { background: var(--warn-lt); color: var(--warn-on); }
.hive-card .alert.ok   { background: var(--green-lt); color: var(--green-on); }
.hive-card .last { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--txt-2); }
.hive-card .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1.5px solid rgba(0,0,0,.25); }

/* ---------- Gumbi ---------- */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--touch); padding: 12px 18px;
  border-radius: var(--r-s); font-size: 17px; font-weight: 800;
  border: 2px solid transparent; transition: transform .06s;
}
.btn:active { transform: translateY(2px); }
.btn-1 { background: var(--amber); color: #fff; border-bottom: 4px solid var(--amber-dk); }
.btn-1.big { min-height: 64px; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; flex-direction: column; gap: 2px; }
.btn-1.big small { font-size: 11px; font-weight: 700; letter-spacing: .06em; opacity: .9; }
.btn-2 { background: var(--surf); color: var(--txt); border-color: var(--line); }
.btn-3 { background: var(--surf-mid); color: var(--txt); }
.btn-dark { background: var(--slate); color: var(--slate-on); }
.btn-ok { background: var(--green-mid); color: #fff; border-bottom: 4px solid var(--green); }
.btn-ghost { background: none; color: var(--amber-dk); min-height: 44px; }
.btn.sm { min-height: 44px; font-size: 15px; padding: 8px 14px; }
.btn.icon-only { width: var(--touch); flex: none; padding: 0; }

/* ---------- Forma za pregled (ekran 1) ---------- */

.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sec-h h2 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sec-h .req { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--amber-dk); }

/* Segmentirani izbor: velike ćelije, odabrana je tamna ili amber. */
.seg { display: grid; gap: 8px; }
.seg.c2 { grid-template-columns: repeat(2, 1fr); }
.seg.c3 { grid-template-columns: repeat(3, 1fr); }
.seg.c4 { grid-template-columns: repeat(4, 1fr); }
.seg.c5 { grid-template-columns: repeat(5, 1fr); }
.seg > button {
  min-height: var(--touch); padding: 8px 6px;
  background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r-s);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 15px; font-weight: 800; line-height: 1.15; text-align: center;
}
.seg > button small { font-size: 11px; font-weight: 600; color: var(--txt-2); }
.seg > button[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #fff; }
.seg > button[aria-pressed="true"] small { color: rgba(255,255,255,.85); }
.seg.dark > button[aria-pressed="true"] { background: var(--slate); border-color: var(--slate); color: var(--slate-on); }
.seg.ok > button[aria-pressed="true"] { background: var(--green-mid); border-color: var(--green-mid); }
.seg > button.danger[aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.seg.c5 > button { padding: 8px 2px; font-size: 13px; }
.seg.c5 > button small { font-size: 10px; }

/* Kvačice: redak s kvadratićem, cijeli redak je meta. */
.chips { display: grid; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 14px;
  background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r-s);
  font-size: 15px; font-weight: 700; text-align: left;
}
.chip .box {
  width: 26px; height: 26px; flex: none; border-radius: 6px;
  border: 2px solid var(--line-2); display: grid; place-items: center;
}
.chip .box svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.chip[aria-pressed="true"] { background: var(--amber-lt); border-color: var(--amber); color: var(--amber-on); }
.chip[aria-pressed="true"] .box { background: var(--amber); border-color: var(--amber); }
.chip[aria-pressed="true"] .box svg { opacity: 1; }
.chip.tint-blue { background: var(--blue-lt); border-color: transparent; color: var(--blue-on); }
.chip.tint-blue[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip.tint-blue[aria-pressed="true"] .box { background: #fff; border-color: #fff; }
.chip.tint-blue[aria-pressed="true"] .box svg { stroke: var(--blue); }
.chip.tint-red[aria-pressed="true"] { background: var(--red-lt); border-color: var(--red); color: var(--red-on); }
.chip.tint-red[aria-pressed="true"] .box { background: var(--red); border-color: var(--red); }
.chip.tint-green[aria-pressed="true"] { background: var(--green-lt); border-color: var(--green-mid); color: var(--green-on); }
.chip.tint-green[aria-pressed="true"] .box { background: var(--green-mid); border-color: var(--green-mid); }
.chips.c2 { grid-template-columns: 1fr 1fr; }
.chips.c2 .chip { flex-direction: column; text-align: center; gap: 4px; padding: 10px 8px; font-size: 14px; }

/* Brojač */
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: var(--touch); height: var(--touch); flex: none; border-radius: var(--r-s);
  background: var(--surf); border: 2px solid var(--line); font-size: 30px; font-weight: 800; line-height: 1;
}
.stepper button:active { background: var(--surf-mid); }
.stepper output {
  flex: 1; text-align: center; font-family: var(--head);
  font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.stepper output small { display: block; font-family: var(--body); font-size: 12px; font-weight: 700; color: var(--txt-2); letter-spacing: .06em; text-transform: uppercase; }

/* Da/Ne prekidač */
.yn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r-s); }
.yn .q b { display: block; font-size: 15px; }
.yn .q small { font-size: 13px; color: var(--txt-2); }
.yn .seg { grid-template-columns: 1fr 1fr; gap: 0; border: 2px solid var(--slate); border-radius: 10px; overflow: hidden; flex: none; width: 128px; }
.yn .seg > button { min-height: 48px; border: 0; border-radius: 0; background: var(--surf); }
.yn .seg > button[aria-pressed="true"] { background: var(--slate); color: var(--slate-on); }

/* Unosi */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select.native {
  width: 100%; min-height: var(--touch); padding: 12px 14px;
  font: inherit; font-size: 17px; font-weight: 600; color: var(--txt);
  background: var(--surf); border: 2px solid var(--line-2); border-radius: var(--r-s);
}
input:focus, textarea:focus, select.native:focus { border-color: var(--amber); border-width: 3px; outline: 0; padding: 11px 13px; }
textarea { min-height: 100px; resize: vertical; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.field .hint { font-size: 13px; color: var(--txt-2); margin-top: 6px; }

/* Glasovna bilješka (samo ljuska - vidi README) */
.voice { background: var(--amber); color: #fff; border-radius: var(--r); padding: 16px; display: flex; gap: 14px; align-items: center; border-bottom: 4px solid var(--amber-dk); }
.voice .mic { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.voice b { font-family: var(--head); font-size: 17px; text-transform: uppercase; letter-spacing: .02em; }
.voice small { display: block; font-size: 13px; opacity: .9; }

.voice { width: 100%; text-align: left; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background .15s; }
.voice.rec { background: var(--red); border-bottom-color: var(--red-on); }
.voice.rec .mic { animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 12px rgba(255,255,255,.22); } }
.vlist { display: grid; gap: 8px; margin-top: 10px; }
.vlist:empty { display: none; }
.vnote { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r-s); }
.vnote .vplay { width: var(--touch); height: var(--touch); flex: none; border-radius: 50%; background: var(--amber); color: #fff; display: grid; place-items: center; border-bottom: 3px solid var(--amber-dk); }
.vnote .vdel { width: 48px; height: 48px; flex: none; border-radius: 10px; color: var(--red); display: grid; place-items: center; }
.vnote .vdel:active { background: var(--red-lt); }
.vnote b { display: block; font-size: 15px; }
.vnote small { font-size: 13px; color: var(--txt-2); }
.tl .ev .vnote { margin-top: 10px; background: var(--surf-lo); border-color: transparent; }
.btn:disabled { opacity: .5; }

/* Fiksni gumb za spremanje - unutar dosega palca */
.save-bar { position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 30; margin-top: 24px; }

/* ---------- Čitač QR koda (ekran 2) ---------- */

.scan-wrap { position: relative; border-radius: var(--r); overflow: hidden; background: #111; aspect-ratio: 3/4; }
.scan-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 16px; pointer-events: none; }
.scan-overlay .tip { background: rgba(30,27,26,.82); color: #fff; border-radius: 12px; padding: 12px 14px; text-align: center; font-size: 15px; }
.scan-overlay .tip b { display: block; font-family: var(--head); font-size: 17px; }
.scan-overlay .hex { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%,-50%); }
.scan-overlay .hex polygon { fill: none; stroke: var(--amber-lt); stroke-width: 3; stroke-dasharray: 22 14; animation: dash 3s linear infinite; }
.scan-overlay .hex text { fill: #fff; font: 800 11px var(--body); letter-spacing: .1em; text-anchor: middle; }
@keyframes dash { to { stroke-dashoffset: -72; } }
.scan-overlay .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; pointer-events: auto; }
.scan-overlay .btns button { min-height: 52px; background: rgba(30,27,26,.82); color: #fff; border-radius: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.scan-overlay .btns button[aria-pressed="true"] { background: var(--amber); }

.scan-result .num-tile { width: 56px; height: 56px; border-radius: 12px; background: var(--amber); color: #fff; display: grid; place-items: center; }
.scan-result .kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px; background: var(--surf-lo); border-radius: 10px; font-size: 14px; }
.scan-result .kv b { color: var(--txt-2); font-weight: 600; }

/* ---------- Karton košnice (ekran 9) ---------- */

.karton-head { display: flex; gap: 12px; align-items: flex-start; }
.karton-head .n { font-family: var(--head); font-size: 34px; font-weight: 800; line-height: 1; }
.karton-head .qr { margin-left: auto; width: 60px; height: 60px; border-radius: 12px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--txt-2); text-align: center; gap: 2px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: var(--r-s); padding: 12px 14px; background: var(--surf-lo); border: 2px solid transparent; }
.tile b { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-2); margin-bottom: 4px; }
.tile .v { font-family: var(--head); font-size: 19px; font-weight: 800; line-height: 1.2; }
.tile small { display: block; font-size: 13px; color: var(--txt-2); margin-top: 2px; }
.tile.w { grid-column: 1 / -1; }
.tile.ok   { background: var(--green-lt); }  .tile.ok b, .tile.ok small { color: var(--green-on); }
.tile.warn { background: var(--warn-lt); }   .tile.warn b, .tile.warn small { color: var(--warn-on); }
.tile.bad  { background: var(--red-lt); }    .tile.bad b, .tile.bad small { color: var(--red-on); }
.tile.amber{ background: var(--amber-lt); }  .tile.amber b, .tile.amber small { color: var(--amber-on); }

.tl { display: grid; gap: 10px; }
.tl .ev { background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r); padding: 14px; border-left-width: 6px; }
.tl .ev.ok { border-left-color: var(--green-mid); }
.tl .ev.warn { border-left-color: var(--warn); }
.tl .ev.bad { border-left-color: var(--red); }
.tl .ev .d { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tl .ev .d b { font-family: var(--head); font-size: 16px; }
.tl .ev p { margin-top: 6px; font-size: 15px; }
.tl .ev .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Zadaci ---------- */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surf); border: 2px solid var(--surf-dim); border-radius: var(--r-s); }
.task .pr { width: 6px; align-self: stretch; border-radius: 3px; background: var(--line); flex: none; }
.task .pr.hitno { background: var(--red); } .task .pr.visoko { background: var(--warn); } .task .pr.srednje { background: var(--amber); }
.task b { display: block; font-size: 15px; }
.task small { font-size: 13px; color: var(--txt-2); }
.task .done { width: 48px; height: 48px; flex: none; border-radius: 10px; border: 2px solid var(--line); display: grid; place-items: center; color: var(--green); }

/* ---------- Donja navigacija ---------- */

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--surf); border-top: 2px solid var(--surf-dim);
  display: grid; grid-template-columns: 1fr 1.35fr 1fr 1fr; gap: 6px;
}
.nav button {
  position: relative; border-radius: var(--r-s);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em; color: var(--txt-2);
}
.nav button[aria-current="page"] { color: var(--txt); background: var(--surf-mid); }
.nav button.primary { background: var(--amber); color: #fff; border-bottom: 4px solid var(--amber-dk); text-transform: uppercase; }
.nav button.primary[aria-current="page"] { background: var(--amber-dk); }
.nav .bdg { position: absolute; top: 4px; right: 10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ---------- Poruka ---------- */

.toast {
  position: fixed; left: 12px; right: 12px; z-index: 60;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  padding: 14px 16px; border-radius: var(--r-s);
  background: var(--slate); color: var(--slate-on); font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 10px;
  transition: opacity .2s, transform .2s;
}
.toast:not(.on) { opacity: 0; transform: translateY(16px); visibility: hidden; pointer-events: none; }
.toast.ok  { background: var(--green-mid); color: #fff; }
.toast.err { background: var(--red); color: #fff; }

.screen { display: none; }
.screen.on { display: block; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 640px) { .hive-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .hive-list > * + * { margin-top: 0; } }
