:root {
  --bg: #eef1f6; --card: rgba(255,255,255,.86); --line: #e3e7ee; --tx: #101828; --mu: #6b7588;
  --green: #10b981; --greenDeep: #059669; --blue: #3b82f6; --amber: #f5a524; --red: #ef4444;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 32px rgba(30,50,90,.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--tx); font: 14px/1.45 "SF Pro Text", Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 15% -10%, #dff5ec 0%, transparent 60%), radial-gradient(1000px 600px at 100% 0%, #e2ebfb 0%, transparent 55%), var(--bg);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
.app { max-width: 1560px; margin: 0 auto; padding: 18px 22px 28px; display: grid; gap: 16px; }
h2, h3, p { margin: 0; }
h2 { font-size: 22px; letter-spacing: -.02em; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
small, .hint { color: var(--mu); font-size: 12px; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #10b981, #3b82f6); box-shadow: inset 0 0 0 6px rgba(255,255,255,.28); }
.right { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { padding: 8px 16px; border-radius: 999px; color: var(--mu); font-weight: 550; }
.seg button.on { background: var(--tx); color: #fff; }
.seg.small button { padding: 5px 12px; font-size: 13px; }
.badge { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #92600a; background: #fff3d6; border: 1px solid #f7dfa5; }
.ghost { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.7); font-weight: 550; }
.dark { padding: 8px 14px; border-radius: 999px; background: var(--tx); color: #fff; font-weight: 600; font-size: 13px; }

.card { background: var(--card); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); min-width: 0; }
.cardHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--mu); font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.legend i.ln { height: 3px; width: 14px; border-radius: 2px; vertical-align: middle; }

.row1 { display: grid; grid-template-columns: 300px minmax(0, 1fr) 390px; gap: 16px; align-items: stretch; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; }
.row3 { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }

.reco { background: linear-gradient(160deg, #b9f3d9 0%, #7fe3bd 55%, #53d3a4 100%); border-color: rgba(255,255,255,.6); display: flex; flex-direction: column; gap: 12px; }
.reco .eyebrow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: #065f46; }
.reco h2 { font-size: 21px; line-height: 1.2; }
.reco .why { background: rgba(255,255,255,.55); border-radius: 16px; padding: 12px 14px; font-size: 13px; }
.reco .why b { display: block; margin-bottom: 4px; font-size: 12px; }
.reco .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reco .nums small { color: #065f46; display: block; }
.reco .nums b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.reco .dark { margin-top: auto; padding: 11px 14px; font-size: 14px; }
.reco .on2 { font-size: 13px; color: #065f46; }

.hero { display: flex; flex-direction: column; padding-bottom: 14px; }
.heroHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.heroHead p { color: var(--mu); margin-top: 2px; }
.stage { position: relative; flex: 1; min-height: 400px; }
#iso { position: absolute; inset: 0; width: 100%; height: 100%; }
#callouts > div { position: absolute; transform: translate(-50%, -100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px;
  box-shadow: 0 8px 20px rgba(30,50,90,.12); font-size: 12px; white-space: nowrap; color: var(--mu); pointer-events: none; }
#callouts > div b { display: block; color: var(--tx); font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#callouts > div.warn b { color: var(--red); }
#callouts > div::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 1px; height: 14px; background: #b6bfcc; }
.player { display: flex; align-items: center; gap: 12px; }
.player b { font-size: 20px; font-variant-numeric: tabular-nums; min-width: 58px; letter-spacing: -.02em; }
.player input { flex: 1; accent-color: var(--tx); }
.round { width: 34px; height: 34px; border-radius: 50%; background: var(--tx); color: #fff; font-size: 11px; }

.side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.side .card { padding: 14px 16px; border-radius: 18px; }
.kpi b, .save b { display: block; font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi i { font-style: normal; font-size: 12px; font-weight: 600; }
.up { color: var(--red); } .dn { color: var(--greenDeep); } .eq { color: var(--mu); font-weight: 500 !important; }
.save { background: linear-gradient(150deg, #a7f0d0, #5fd9ac); border-color: rgba(255,255,255,.6); }
.save small { color: #065f46; font-weight: 600; } .save span { font-size: 12px; color: #065f46; }

.chart { width: 100%; height: 190px; display: block; }
.m { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 0; border-top: 1px solid var(--line); align-items: center; }
.m:first-child { border-top: 0; padding-top: 0; }
.m b { font-weight: 600; } .m p { color: var(--mu); font-size: 12px; }
.chips { grid-column: 1 / 3; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #e7f8f0; color: var(--greenDeep); font-variant-numeric: tabular-nums; }
.chip.zero { background: #f1f3f7; color: var(--mu); font-weight: 500; } .chip.bad { background: #fdecec; color: #b42318; }
.sw { width: 42px; height: 24px; border-radius: 999px; background: #d5dae3; position: relative; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.sw.on { background: var(--green); } .sw.on::after { left: 21px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form.two { grid-template-columns: 1fr; margin: 12px 0; }
.form label { display: grid; gap: 5px; font-size: 12px; color: var(--mu); font-weight: 550; }
.form output { color: var(--tx); font-weight: 650; float: right; }
select, input[type=number] { font: inherit; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--tx); width: 100%; }
input[type=range] { accent-color: var(--tx); width: 100%; }
#evHint { margin-top: 10px; }
.notice #advice p { font-weight: 650; margin-bottom: 8px; }
.notice ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
th, td { text-align: right; padding: 8px 4px; border-top: 1px solid var(--line); } th:first-child, td:first-child { text-align: left; }
th { color: var(--mu); font-weight: 550; border-top: 0; font-size: 12px; }
footer { color: var(--mu); font-size: 12px; text-align: center; }

dialog { border: 0; border-radius: 22px; padding: 22px 24px; width: min(560px, 92vw); box-shadow: 0 30px 80px rgba(16,24,40,.3); color: var(--tx); }
dialog::backdrop { background: rgba(16,24,40,.35); backdrop-filter: blur(3px); }
dialog ul { padding-left: 18px; color: var(--mu); font-size: 13px; display: grid; gap: 4px; max-height: 240px; overflow: auto; }

@media (max-width: 1250px) { .row1 { grid-template-columns: 1fr; } .side { grid-template-columns: repeat(4, 1fr); } .row2, .row3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .side { grid-template-columns: 1fr 1fr; } .app { padding: 14px 16px; } .form { grid-template-columns: 1fr; } }

/* ---------- dotjerivanje izgleda ---------- */
:root { --disp: "Outfit", "SF Pro Display", Inter, system-ui, sans-serif; }
h2, h3, .brand b, .kpi b, .save b, .reco .nums b, .player b, #callouts b, .seg button { font-family: var(--disp); }
.top { background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.9); border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.logo { display: grid; place-items: center; box-shadow: 0 6px 16px rgba(16,185,129,.35); } .logo svg { width: 20px; height: 20px; }
.seg button { transition: background .15s, color .15s; } .seg button:not(.on):hover { background: rgba(16,24,40,.06); color: var(--tx); }
.card { transition: box-shadow .2s; }

.stage { border-radius: 18px; margin: 8px 0 10px;
  background: radial-gradient(60% 55% at 55% 45%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%), radial-gradient(circle, rgba(120,135,160,.22) 1px, transparent 1.4px) 0 0 / 18px 18px, linear-gradient(180deg, #f3f6fb, #e9eef6); min-height: 430px; overflow: hidden; }
#callouts > div { border-radius: 14px; padding: 7px 12px 7px 24px; border-color: rgba(255,255,255,.9); backdrop-filter: blur(8px); background: rgba(255,255,255,.92); }
#callouts > div::before { content: ""; position: absolute; left: 10px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
#callouts > div.warn::before { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
#callouts > div b { font-size: 16px; font-weight: 600; }

.side .card { position: relative; overflow: hidden; }
.ic { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #eef2f8; color: #475467; }
.ic svg { width: 18px; height: 18px; }
.kpi small, .save small { display: block; padding-right: 38px; min-height: 30px; }
.kpi b { font-size: 28px; font-weight: 600; } .save b { font-size: 32px; font-weight: 600; }
.kpi .bar { height: 5px; border-radius: 99px; background: #edf0f5; margin-top: 10px; overflow: hidden; }
.kpi .bar span { display: block; height: 100%; border-radius: 99px; background: var(--blue); transition: width .35s ease; }
.kpi.blue .ic { background: #e6effe; color: #2563eb; } .kpi.violet .ic { background: #efeafe; color: #6d4bd8; } .kpi.violet .bar span { background: #8b6cf0; }
.kpi.green .ic { background: #dcf7ea; color: #059669; } .kpi.green .bar span { background: var(--green); }
.kpi.red .ic { background: #fde8e7; color: #dc2626; } .kpi.red .bar span { background: var(--red); }
.kpi.amber .ic { background: #fef0d2; color: #b7791f; } .kpi.amber .bar span { background: var(--amber); }
.kpi.slate .ic { background: #e9edf3; color: #475467; } .kpi.slate .bar span { background: #64748b; }
.save { background: linear-gradient(150deg, #c9f7e2 0%, #7fe4bd 60%, #4fd3a2 100%); }
.save .ic { background: rgba(255,255,255,.6); color: #047857; }
.save::after, .reco::after { content: ""; position: absolute; right: -40px; bottom: -50px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 70%); pointer-events: none; }

.reco { position: relative; overflow: hidden; background: linear-gradient(165deg, #cdf8e4 0%, #86e6c1 55%, #4fd3a2 100%); padding: 20px; }
.reco .eyebrow { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: rgba(255,255,255,.6); padding: 5px 10px; border-radius: 999px; letter-spacing: .04em; }
.reco .eyebrow svg { width: 13px; height: 13px; fill: #059669; }
.reco h2 { font-size: 24px; font-weight: 600; }
.reco > p { color: #065f46; }
.reco .why { background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.7); backdrop-filter: blur(6px); line-height: 1.5; }
.reco .nums b { font-size: 26px; font-weight: 600; }
.reco .dark { position: relative; z-index: 1; box-shadow: 0 10px 24px rgba(16,24,40,.25); transition: transform .12s; } .reco .dark:hover { transform: translateY(-1px); }

.chart { height: 205px; }
.rk { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; background: #101828; color: #fff; font-size: 11px; margin-right: 8px; font-family: var(--disp); vertical-align: 1px; }
.m { padding: 13px 0; } .chip { padding: 4px 9px; }
.round { box-shadow: 0 6px 14px rgba(16,24,40,.22); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: #dfe4ec; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #101828; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(16,24,40,.3); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #101828; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(16,24,40,.3); cursor: pointer; }
select:focus, input:focus, button:focus-visible { outline: 2px solid rgba(59,130,246,.5); outline-offset: 2px; }
.notice { background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,248,235,.9)); }

/* ---------- cijeli dan i okolne prometnice ---------- */
.rowRoads { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.rd { display: grid; grid-template-columns: 1.5fr .8fr 1fr 1fr 1.6fr 1.3fr; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rd.head { border-top: 0; padding-top: 0; color: var(--mu); font-size: 12px; font-weight: 550; }
.rd b { font-weight: 600; } .rd small { display: block; } .rd span:last-child small { display: inline; }
.rd .hot { color: #b42318; font-weight: 650; } .rd em { font-style: normal; font-weight: 650; }
.track { position: relative; height: 22px; border-radius: 8px; background: repeating-linear-gradient(90deg, #f1f4f8 0 calc(25% - 1px), #e3e8ef calc(25% - 1px) 25%); }
.track i { position: absolute; border-radius: 99px; }
.track .am { top: 4px; height: 6px; background: var(--blue); } .track .pm { bottom: 4px; height: 6px; background: #ef6a5d; }
.track .free { top: 1px; bottom: 1px; width: 2px; background: #101828; margin-left: -1px; }
#roadsSrc { margin-top: 10px; }
.tripGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-bottom: 12px; }
.tripGrid > div { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.6); }
.tripGrid b { display: block; font-family: var(--disp); font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tripGrid span, .tripGrid i { font-size: 12px; color: var(--mu); font-style: normal; } .tripGrid i { font-weight: 600; }
.tripGrid small { display: block; min-height: 30px; }
.player { flex-wrap: wrap; }
@media (max-width: 1250px) { .rowRoads { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .rd { grid-template-columns: 1.4fr 1fr 1fr; } .rd span:nth-child(2), .rd .track, .rd.head span:nth-child(5) { display: none; } }

/* ---------- gužva po satima ---------- */
.hr { display: grid; grid-template-columns: 190px repeat(15, minmax(0, 1fr)); gap: 4px; align-items: center; margin-bottom: 4px; }
.hr > span:first-child b { display: block; font-weight: 600; font-size: 13px; } .hr > span:first-child small { display: block; }
.hc { text-align: center; padding: 9px 0; border-radius: 9px; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 550; color: #1f2937; transition: box-shadow .15s; }
.hr.head .hc { padding: 2px 0; color: var(--mu); font-weight: 500; font-size: 12px; }
.hr.veh { margin-top: 10px; } .hr.veh .hc { min-height: 36px; }
.hc.now { box-shadow: inset 0 0 0 2px #101828; } .hr.head .hc.now { box-shadow: none; color: var(--tx); font-weight: 700; }
#heatTips { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 5px; color: #344054; font-size: 13px; }
@media (max-width: 900px) { .hr { grid-template-columns: 110px repeat(15, minmax(0, 1fr)); gap: 2px; } .hc { font-size: 10px; padding: 7px 0; } }
