/* Merilo – oblikovanje
   Zasnova: orodje za teren. Velik kontrast (sonce), veliki gumbi (ena roka),
   rumena barva merilnega traku za glavno dejanje, grafit za besedilo. */

:root {
  --graphite: #1c222d;
  --graphite-2: #2b3340;
  --tape: #ffc72c;
  --tape-deep: #e8a900;
  --concrete: #eceeea;
  --paper: #ffffff;
  --line: #d9dcd6;
  --muted: #5d6571;
  --faint: #8a919b;
  --ok: #1d7f47;
  --ok-bg: #e2f3e8;
  --bad: #c2352b;
  --bad-bg: #fbe7e5;
  --blue: #2c59d1;
  --blue-bg: #e6ecfb;
  --violet: #6a47d4;
  --violet-bg: #eeeafb;
  --amber: #9a5b00;
  --amber-bg: #fdf1d8;
  --gray-bg: #e6e8e4;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 22px;
  --tap: 48px;
  --shadow-sheet: 0 -12px 40px rgba(20, 24, 32, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --graphite: #f1f2ef;
    --graphite-2: #d6d9d3;
    --concrete: #14171c;
    --paper: #1d2128;
    --line: #2f3540;
    --muted: #a3aab4;
    --faint: #7d8590;
    --ok: #4cc27f; --ok-bg: #173323;
    --bad: #ff7a6e; --bad-bg: #3a1d1b;
    --blue: #86a6ff; --blue-bg: #1c2747;
    --violet: #b6a1ff; --violet-bg: #2a2348;
    --amber: #f2b55a; --amber-bg: #3a2c12;
    --gray-bg: #2a2f37;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--graphite);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tape-deep); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Ogrodje ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  background: var(--concrete); /* rezerva za starejše brskalnike */
  background: color-mix(in srgb, var(--concrete) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 19px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .save-state { font-size: 12px; color: var(--faint); white-space: nowrap; flex: none; }
.page-title { padding: 6px 20px 2px; }
.page-title h2 { font-size: 32px; line-height: 1.1; margin: 0; font-weight: 800; letter-spacing: -0.025em; }
.page-title p { margin: 4px 0 0; color: var(--muted); }
.content { flex: 1; padding: 8px 16px calc(120px + var(--safe-b)); }

.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: grid; place-items: center; border: 0; background: transparent; cursor: pointer;
}
.icon-btn:active { background: var(--gray-bg); }
.icon { width: 24px; height: 24px; display: inline-block; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* Spodnja navigacija */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1fr; align-items: end; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 8px; font-size: 12px; font-weight: 600; color: var(--faint); text-decoration: none;
}
.tab[aria-current="page"] { color: var(--graphite); }
.tab { min-width: 0; }
.tab-label { max-width: 100%; padding: 0 2px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-new {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; font-size: 12px; font-weight: 700; padding-bottom: 8px; transform: translateY(-14px);
}
.tab-new .bubble {
  width: 60px; height: 60px; border-radius: 20px; background: var(--tape); color: #1c222d;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(232, 169, 0, 0.45);
}
.tab-new .bubble .icon { width: 30px; height: 30px; }

/* ---------- Gumbi ---------- */
.btn {
  min-height: var(--tap); padding: 0 20px; border-radius: var(--radius-m); border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, background-color .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--tape); color: #1c222d; }
.btn-primary:hover { background: #ffd04f; }
.btn-dark { background: var(--graphite); color: var(--concrete); }
.btn-ghost { background: var(--gray-bg); color: var(--graphite); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-text { background: transparent; color: var(--graphite); padding: 0 8px; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 18px; border-radius: 16px; }
.btn-sm { min-height: 38px; font-size: 15px; padding: 0 14px; border-radius: var(--radius-s); }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + var(--safe-b));
}
.bottom-bar-inner { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bottom-bar .total { flex: 1; line-height: 1.15; }
.bottom-bar .total b { font-size: 22px; display: block; letter-spacing: -0.01em; }

/* ---------- Obrazci ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-m); background: var(--paper);
  font-size: 17px; outline: none; transition: border-color .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--graphite); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.hint { font-size: 14px; color: var(--muted); margin: -6px 2px 14px; }
.error-text { color: var(--bad); font-weight: 600; font-size: 15px; margin: 4px 2px 12px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-m); margin-bottom: 14px; cursor: pointer; }
.switch input { appearance: none; width: 52px; height: 32px; border-radius: 32px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- Seznami (združeni, brez posameznih kartic) ---------- */
.section-label { font-size: 15px; font-weight: 700; margin: 22px 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-label .muted { font-weight: 500; }
.group { background: var(--paper); border-radius: var(--radius-l); overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; min-height: 64px; background: transparent; border: 0; text-align: left; cursor: pointer; text-decoration: none; color: inherit;
}
.item:active { background: var(--gray-bg); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.item.warn .title::after { content: ""; }
.add-row { display: flex; gap: 8px; padding: 10px 12px; }
.add-row .btn { flex: 1; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-draft { background: var(--gray-bg); color: var(--muted); }
.pill-sent { background: var(--blue-bg); color: var(--blue); }
.pill-viewed { background: var(--violet-bg); color: var(--violet); }
.pill-accepted { background: var(--ok-bg); color: var(--ok); }
.pill-declined { background: var(--bad-bg); color: var(--bad); }
.pill-expired { background: var(--amber-bg); color: var(--amber); }
.pill-review { background: var(--amber-bg); color: var(--amber); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 650; font-size: 15px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--graphite); color: var(--concrete); border-color: var(--graphite); }
.chip .count { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Domov: povzetek ---------- */
.summary { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin: 14px 0 6px; }
.summary .open { grid-row: span 2; background: var(--graphite); color: var(--concrete); border-radius: var(--radius-l); padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; position: relative; overflow: hidden; }
.summary .open::after { /* oznake merilnega traku */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background: repeating-linear-gradient(90deg, var(--tape) 0 2px, transparent 2px 12px), var(--tape-deep);
  background-size: 12px 8px, 100% 100%; background-repeat: repeat-x, no-repeat; background-position: 0 0, 0 0;
  opacity: .95;
}
.summary .open .label { font-size: 14px; opacity: .75; font-weight: 600; }
.summary .open .big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.summary .open .meta { font-size: 14px; opacity: .75; margin-bottom: 12px; }
.summary .stat { background: var(--paper); border-radius: var(--radius-m); padding: 12px 14px; }
.summary .stat .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.summary .stat .val { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Prazna stanja ---------- */
.empty { text-align: center; padding: 36px 20px 20px; }
.empty .art { width: 120px; height: 120px; margin: 0 auto 14px; color: var(--graphite); }
.empty h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.01em; }
.empty p { margin: 0 auto 18px; color: var(--muted); max-width: 32ch; }

/* ---------- Nova ponudba: snemanje ---------- */
.recorder { display: flex; flex-direction: column; align-items: center; padding: 18px 0 8px; }
.mic {
  position: relative; width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tape); color: #1c222d; display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(232, 169, 0, 0.35);
}
.mic .icon { width: 44px; height: 44px; }
.mic::before { /* obroč z oznakami kot na merilnem traku */
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  background: repeating-conic-gradient(var(--graphite) 0 1.2deg, transparent 1.2deg 7.5deg);
  -webkit-mask: radial-gradient(circle, transparent 69px, #000 70px, #000 76px, transparent 77px);
          mask: radial-gradient(circle, transparent 69px, #000 70px, #000 76px, transparent 77px);
  opacity: .5; transition: opacity .2s;
}
.mic.live { background: var(--bad); color: #fff; box-shadow: 0 10px 28px rgba(194, 53, 43, 0.4); }
.mic.live::before { opacity: 1; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.recorder .state { margin-top: 18px; font-weight: 700; font-size: 18px; }
.recorder .state + .muted { text-align: center; max-width: 34ch; font-size: 15px; margin-top: 2px; }
.interim { color: var(--faint); font-style: italic; min-height: 1.4em; margin: 6px 4px 0; font-size: 15px; }

.client-pick { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--paper); border: 1.5px dashed var(--line); border-radius: var(--radius-l); padding: 14px 16px; min-height: 64px; cursor: pointer; text-align: left; }
.client-pick.set { border-style: solid; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--gray-bg); display: grid; place-items: center; font-weight: 800; flex: none; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--radius-m); overflow: hidden; background: var(--gray-bg); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .rm { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(20,24,32,.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo .rm .icon { width: 18px; height: 18px; }
.photo-add { aspect-ratio: 1; border-radius: var(--radius-m); border: 1.5px dashed var(--line); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }

/* ---------- Urejanje ponudbe ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-l); margin: 4px 0 14px; }
.banner .icon { margin-top: 1px; }
.banner b { display: block; }
.banner p { margin: 2px 0 0; font-size: 15px; }
.banner .btn { margin-top: 10px; }
.banner-draft { background: var(--gray-bg); }
.banner-sent { background: var(--blue-bg); color: var(--blue); }
.banner-viewed { background: var(--violet-bg); color: var(--violet); }
.banner-accepted { background: var(--ok-bg); color: var(--ok); }
.banner-declined { background: var(--bad-bg); color: var(--bad); }
.banner-expired { background: var(--amber-bg); color: var(--amber); }
.banner p, .banner b { color: inherit; }

.title-input { width: 100%; border: 0; background: transparent; resize: none; overflow: hidden; line-height: 1.15; display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; padding: 4px 4px; border-radius: 8px; outline: none; }
.title-input:focus { background: var(--paper); }
.title-input::placeholder { color: var(--faint); }

.line-item .title { white-space: normal; }
.line-item .sub { white-space: normal; }
.totals { background: var(--paper); border-radius: var(--radius-l); padding: 14px 16px; margin-top: 14px; }
.totals .tr { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--graphite); margin-top: 8px; padding-top: 10px; font-size: 22px; font-weight: 800; }
details.transcript { background: var(--paper); border-radius: var(--radius-l); padding: 14px 16px; margin-top: 14px; }
details.transcript summary { font-weight: 650; cursor: pointer; }
details.transcript p { white-space: pre-wrap; color: var(--muted); margin: 10px 0 0; }

/* ---------- Spodnji list (sheet) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 18, 24, 0.45); opacity: 0; transition: opacity .2s; }
.backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 560px; margin: 0 auto;
  background: var(--concrete); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-sheet);
  max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.sheet.open { transform: translateY(0); }
.sheet .grabber { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 6px 8px 4px 20px; }
.sheet header h3 { flex: 1; margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.sheet .sheet-body { padding: 8px 20px 12px; overflow-y: auto; overscroll-behavior: contain; }
.sheet .sheet-foot { padding: 10px 20px calc(14px + var(--safe-b)); display: flex; gap: 10px; border-top: 1px solid var(--line); background: var(--concrete); }
.sheet .sheet-foot .btn { flex: 1; }
@media (min-width: 600px) {
  .sheet { bottom: auto; top: 50%; border-radius: 24px; transform: translateY(-40%); opacity: 0; transition: transform .2s, opacity .2s; max-height: 86vh; max-height: 86dvh; width: 520px; }
  .sheet.open { transform: translateY(-50%); opacity: 1; }
  .sheet .grabber { display: none; }
}

.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.share-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--radius-m); background: var(--paper); border: 0; cursor: pointer; font-weight: 650; font-size: 14px; text-decoration: none; color: inherit; }
.share-opt .dot { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.share-link { display: flex; gap: 8px; align-items: center; background: var(--paper); border-radius: var(--radius-m); padding: 10px 12px; margin: 14px 0 4px; font-size: 14px; color: var(--muted); word-break: break-all; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(104px + var(--safe-b)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
body.has-sheet .toasts { bottom: auto; top: calc(12px + var(--safe-t)); }
.toast { background: var(--graphite); color: var(--concrete); padding: 12px 18px; border-radius: 14px; font-weight: 650; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 520px; animation: toast-in .2s ease-out; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Nalaganje ---------- */
.loading-screen { position: fixed; inset: 0; z-index: 60; background: var(--concrete); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.loading-screen h3 { margin: 0; font-size: 22px; }
.tape-loader { width: 220px; height: 28px; border-radius: 6px; background: var(--tape); position: relative; overflow: hidden; box-shadow: inset 0 -3px 0 var(--tape-deep); }
.tape-loader::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #1c222d 0 2px, transparent 2px 11px); -webkit-mask: linear-gradient(#000 0 45%, transparent 45%); mask: linear-gradient(#000 0 45%, transparent 45%); animation: tape 1.1s linear infinite; }
@keyframes tape { to { transform: translateX(-11px); } }
.skeleton { background: linear-gradient(90deg, var(--gray-bg), var(--paper), var(--gray-bg)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-l); height: 72px; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Prijava in uvajanje ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand .mark { width: 52px; height: 52px; }
.brand b { font-size: 28px; font-weight: 850; letter-spacing: -0.03em; }
.auth h1 { font-size: 34px; line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 850; }
.auth .lead { color: var(--muted); margin: 0 0 26px; font-size: 18px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--gray-bg); border-radius: var(--radius-m); padding: 4px; margin-bottom: 18px; }
.segmented button { border: 0; background: transparent; min-height: 42px; border-radius: 11px; font-weight: 700; cursor: pointer; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--paper); color: var(--graphite); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps i { height: 6px; flex: 1; border-radius: 6px; background: var(--line); }
.steps i.on { background: var(--graphite); }
.trades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.trade { min-height: 72px; border-radius: var(--radius-m); border: 1.5px solid var(--line); background: var(--paper); font-weight: 700; cursor: pointer; padding: 10px; }
.trade[aria-pressed="true"] { border-color: var(--graphite); box-shadow: inset 0 0 0 1.5px var(--graphite); }
.logo-pick { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.logo-pick .logo-box { width: 64px; height: 64px; border-radius: 16px; background: var(--paper); border: 1.5px dashed var(--line); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.logo-pick .logo-box img { width: 100%; height: 100%; object-fit: contain; }
.price-edit { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.price-edit .main { flex: 1; min-width: 0; }
.price-edit .input { width: 112px; text-align: right; min-height: 44px; padding: 8px 12px; }

.search { position: relative; margin: 10px 0 12px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 20px; height: 20px; }
.search .input { padding-left: 42px; }

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

/* ---------- Izbira jezika ---------- */
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.auth-top .brand { margin-bottom: 0; }
.lang-switch { display: inline-flex; background: var(--gray-bg); border-radius: 12px; padding: 3px; }
.lang-switch button { border: 0; background: transparent; min-width: 44px; min-height: 36px; border-radius: 9px; font-weight: 750; font-size: 14px; color: var(--muted); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--paper); color: var(--graphite); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.doc-top { display: flex; justify-content: flex-end; margin-bottom: 10px; }

/* Popust in DDV na ponudbi */
.adjust { background: var(--paper); border-radius: var(--radius-l); padding: 4px 16px 12px; }
.adjust-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.adjust-row .main { flex: 1; min-width: 0; }
.adjust-row .select { width: auto; min-width: 150px; max-width: 60%; }
.adjust-sub { padding: 0 0 4px; }
.adjust-sub:not(:last-child) { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.pct-field { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pct-field[hidden] { display: none; }
.adjust-sub .pct-field { margin-top: 8px; }
.pct-input { width: 84px; text-align: right; }
.totals .discount { color: var(--ok); font-weight: 650; }

/* Podrobnosti stranke */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.quick-actions .btn { padding: 0 8px; gap: 6px; }

/* Namigi za obrtnika pri ponudbah, ki čakajo */
.nudge { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 650; }
.nudge .icon { width: 16px; height: 16px; }
.nudge-call { color: var(--ok); }
.nudge-warn { color: #9a5b00; }
@media (prefers-color-scheme: dark) { .nudge-warn { color: var(--tape); } }
.attention { display: flex; align-items: center; gap: 12px; width: 100%; margin: 12px 0 0; padding: 14px 16px; border: 0; border-radius: var(--radius-l);
  background: var(--ok-bg); color: var(--ok); text-align: left; font: inherit; cursor: pointer; }
.attention > div { flex: 1; min-width: 0; }
.attention b { display: block; font-size: 16px; }
.attention .small { opacity: .85; }

/* Količina z gumboma − / + */
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; align-items: center; }
.stepper .input { text-align: center; min-width: 0; }
.step { height: 48px; border-radius: var(--radius-s); border: 1.5px solid var(--line); background: var(--paper); color: inherit; font-size: 24px; font-weight: 700; cursor: pointer; }
.move-row { display: flex; align-items: center; gap: 8px; margin: 4px 2px 10px; }
.move-row .muted { flex: 1; }

/* Ni povezave */
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 80; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) 16px 8px; background: #9a5b00; color: #fff; font-weight: 650; font-size: 14px; text-align: center; }
.offline-bar[hidden] { display: none; }
.offline-bar .icon { width: 18px; height: 18px; }
.item .sub.wrap { white-space: normal; overflow: visible; }

/* Predloge na strani Nova ponudba */
.link-btn { background: none; border: 0; padding: 4px 2px; color: inherit; font: inherit; font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tpl-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.tpl-chips::-webkit-scrollbar { display: none; }
.tpl-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--paper); color: inherit; font: inherit; font-weight: 650; cursor: pointer; }
.tpl-chip .icon { width: 20px; height: 20px; color: var(--faint); }
.tpl-chip .count { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* Podobne pretekle ponudbe */
.similar { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-l); background: var(--paper); border: 1.5px dashed var(--tape); }
.similar-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.similar-head .icon { width: 20px; height: 20px; color: #b88600; }
.similar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.similar-row + .similar-row { border-top: 1px solid var(--line); }
.similar-row .main { flex: 1; min-width: 0; }

/* E-pošta iz aplikacije */
.email-send { display: grid; gap: 10px; margin-bottom: 14px; }
.email-send .or { text-align: center; color: var(--faint); font-size: 13px; margin-top: 4px; }
.email-send .btn { white-space: normal; height: auto; min-height: 52px; padding: 10px 14px; line-height: 1.25; overflow-wrap: anywhere; }
.share-link span { user-select: all; -webkit-user-select: all; }
.chip:disabled, .client-pick:disabled { opacity: .55; cursor: default; }

/* Gumb »Nazaj« (podstrani, uvajanje, predogled) */
.back-btn { display: inline-flex; align-items: center; gap: 2px; flex: none; height: 40px; padding: 0 12px 0 6px; border: 0; border-radius: 999px;
  background: var(--paper); color: inherit; font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06); -webkit-tap-highlight-color: transparent; }
.back-btn .icon { width: 22px; height: 22px; }
.back-btn:active { transform: scale(.96); background: var(--gray-bg); }
.topbar .back-btn + h1 { margin-left: 4px; }
.auth > .back-btn { align-self: flex-start; }
/* Okno med potegom navzdol sledi prstu */
.sheet { touch-action: pan-y; }
/* Postavke po želji (pri obrtniku) */
.pill-optional { background: var(--blue-bg); color: var(--blue); }
.optional-amount { color: var(--muted); }
.totals .optional-line { color: var(--blue); font-weight: 650; font-size: 15px; }

/* Navigacija do naslova stranke */
.maps-link { display: inline-flex; align-items: center; gap: 6px; margin: 8px 4px 0; font-size: 14px; font-weight: 650; color: var(--blue); text-decoration: none; max-width: 100%; }
.maps-link { display: flex; }
.maps-link .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maps-link .icon { width: 18px; height: 18px; flex: none; }

/* ---------- Finančni pregled ---------- */
:root { --chart-bar: #2a78d6; }
@media (prefers-color-scheme: dark) { :root { --chart-bar: #3987e5; } }
.summary a.stat { color: inherit; text-decoration: none; }
.stats-link { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-m);
  background: var(--paper); color: inherit; text-decoration: none; font-weight: 700; }
.stats-link .txt { flex: 1; text-align: left; }
.stats-link .icon:first-child { color: var(--chart-bar); }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.year-nav { display: flex; align-items: center; gap: 4px; font-size: 20px; }
.year-nav .flip .icon { transform: scaleX(-1); }
.year-nav a { color: inherit; }
.small-seg { margin: 0; }
.small-seg button { min-height: 36px; padding: 0 12px; font-size: 14px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--paper); border-radius: var(--radius-m); padding: 12px 14px; min-width: 0; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.kpi.main { grid-column: 1 / -1; background: var(--graphite); color: var(--concrete); }
.kpi.main .label, .kpi.main .sub { color: inherit; opacity: .75; }
.kpi.main .val { font-size: 30px; }
.chart-card { background: var(--paper); border-radius: var(--radius-l); padding: 12px 10px 14px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .axis { stroke: var(--line); stroke-width: 1.5; }
.chart .tick { font-size: 10px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .mlabel { font-size: 11px; fill: var(--muted); font-weight: 600; }
.chart .mlabel.on { fill: var(--graphite); font-weight: 800; }
.chart .bar { fill: var(--chart-bar); opacity: .55; transition: opacity .15s; }
.chart .col.sel .bar { opacity: 1; }
.chart .col .hit { fill: transparent; cursor: pointer; }
.chart .col.sel .hit { fill: var(--gray-bg); opacity: .6; }
.chart .col.future .hit { cursor: default; }
.chart .col.future .mlabel { opacity: .4; }
.chart .col:focus { outline: none; }
.chart .col:focus-visible .hit { stroke: var(--chart-bar); stroke-width: 2; }
.chart .val { font-size: 12px; font-weight: 800; fill: var(--graphite); font-variant-numeric: tabular-nums; }
.month-detail { border-top: 1px solid var(--line); margin-top: 10px; padding: 12px 6px 0; }
.md-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; text-transform: capitalize; }
.md-head .muted { text-transform: none; }
.md-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.md-grid > div { background: var(--concrete); border-radius: var(--radius-s); padding: 8px 10px; display: grid; }
.md-grid span { font-size: 12px; color: var(--muted); font-weight: 600; }
.md-grid b { font-size: 20px; font-variant-numeric: tabular-nums; }
.md-grid small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-detail .group { background: var(--concrete); }
.insight { display: flex; gap: 10px; align-items: center; margin: 14px 2px 0; color: var(--muted); font-size: 15px; }
.insight .icon { color: var(--chart-bar); }
.table-wrap { background: var(--paper); border-radius: var(--radius-l); overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 10px 12px; text-align: left; white-space: nowrap; }
.stats-table th { font-size: 12px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.stats-table .r { text-align: right; }
.stats-table tbody tr { cursor: pointer; }
.stats-table tbody tr + tr td { border-top: 1px solid var(--line); }
.stats-table tr.on td { background: var(--gray-bg); font-weight: 700; }
.stats-table tfoot td { border-top: 2px solid var(--graphite); font-weight: 800; }
.banner-link { display: block; margin-top: 6px; font-size: 14px; color: inherit; padding: 4px 0; }
.banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; }
.banner-actions .banner-link { margin-top: 0; }
.check-row input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: #e8a900; }
.small-seg button { white-space: nowrap; }
.chart .mlabel { text-transform: uppercase; }
.adjust[hidden], .section-label[hidden] { display: none; }
.photos[hidden], .textarea[hidden] { display: none; }
.chart-empty { margin: 4px 6px 8px; font-size: 14px; color: var(--muted); }
.year-nav button.icon-btn { color: inherit; }

/* Dolga besedila (e-naslovi, naslovi, imena) se prelomijo in nikoli ne raztegnejo zaslona */
.shell { overflow-x: hidden; overflow-x: clip; } /* hidden = rezerva za starejši Safari */
.content, .sheet-body, .banner, .client-pick .small, .md-head, .kpi .val, .similar-row .main { overflow-wrap: anywhere; }
.client-pick > div { min-width: 0; }
/* Gumbi v vrsti se na ozkih telefonih prelomijo, namesto da bi štrleli čez rob */
.add-row .btn, .row > .btn, .quick-actions .btn { min-width: 0; white-space: normal; line-height: 1.2; text-align: center; padding-left: 10px; padding-right: 10px; }
@media (max-width: 360px) {
  .add-row .btn .icon, .row > .btn .icon { display: none; }
  .btn-lg { padding-left: 14px; padding-right: 14px; }
}

/* Napis »moj Ponudko«: »moj« na koščku rumenega merilnega traku (rahlo poševno), zlito s krepkim »Ponudko« */
.brand .wordmark { display: inline-flex; align-items: center; font-size: 32px; line-height: 1; white-space: nowrap; padding: 4px 0; }
.brand .wordmark .moj { display: inline-block; background: #ffc72c; color: #1c222d; font-weight: 750; letter-spacing: -0.02em;
  padding: .06em .2em .1em; margin-right: .06em; border-radius: .14em; transform: rotate(-3deg) translateY(-.04em); }
.brand .wordmark b { font-weight: 850; letter-spacing: -0.035em; }
.brand .mark { border-radius: 14px; }
@media (prefers-color-scheme: dark) { .brand .mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); } }
/* Ozki telefoni: manjši napis, preklop jezika se po potrebi prestavi v novo vrsto */
.auth-top { flex-wrap: wrap; row-gap: 12px; }
@media (max-width: 360px) {
  .brand .wordmark { font-size: 28px; }
}

/* Prijava in ponastavitev gesla: ikona na sredini, pod njo napis (kot pozdravni zaslon) */
.auth-top-end { justify-content: flex-end; margin-bottom: 4px; }
.auth-hero { display: grid; justify-items: center; gap: 14px; margin: 8px 0 26px; }
.auth-hero .mark { width: 80px; height: 80px; border-radius: 22px; box-shadow: 0 12px 28px rgba(28, 34, 45, .26); }
.auth-hero .wordmark { display: inline-flex; align-items: center; font-size: 30px; line-height: 1; white-space: nowrap; }
.auth-hero .wordmark .moj { display: inline-block; background: #ffc72c; color: #1c222d; font-weight: 750; letter-spacing: -0.02em;
  padding: .06em .2em .1em; margin-right: .06em; border-radius: .14em; transform: rotate(-3deg) translateY(-.04em); }
.auth-hero .wordmark b { font-weight: 850; letter-spacing: -0.035em; }
.auth-centered > h1, .auth-centered > .lead { text-align: center; }
@media (prefers-color-scheme: dark) { .auth-hero .mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 12px 28px rgba(0, 0, 0, .45); } }
@media (max-height: 700px) { .auth-hero { margin-bottom: 16px; } .auth-hero .mark { width: 64px; height: 64px; border-radius: 18px; } }
