/* Veðr – vedr.is. Litir og letur úr hönnunarkerfinu „Vedr“. */
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-VF.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --raised: #F2F4F6;
  --line: #E3E6EA;
  --ink: #0B0B0C;
  --muted: #4B5159;
  --accent: #0F7A52;
  --aurora: #2FC48D;
  --avg: #3F78D9;
  --land: #FBFBFC;
  --land-line: #AEB8C2;
  --sea: #E2EBF1;
  --src-yr: #E3784A;
  --src-vedur: #5DB38F;
  --src-blika: #E5A333;
  --src-om: #D97FA9;
  --warn-bg: #FFF7C2;
  --warn-ink: #291F00;
  --radius: 14px;
  --gap: clamp(16px, 2.4vw, 28px);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0B0C;
    --raised: #17191C;
    --line: #2A2E33;
    --ink: #F4F5F6;
    --muted: #A9AFB7;
    --accent: #3DDC97;
    --aurora: #3DDC97;
    --avg: #6E9BEA;
    --land: #24292E;
    --land-line: #4A525B;
    --sea: #101519;
  }
  .light-only { display: none; }
}
@media (prefers-color-scheme: light) {
  .dark-only { display: none; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: 'tnum' 0;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(1240px, 100% - 2 * var(--gap)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.num, .rows, table, .tlabel, .lead b { font-variant-numeric: tabular-nums; }
.cap { font-size: 13px; color: var(--muted); }

/* Haus */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: block; line-height: 0; }
.logo img { height: 34px; width: auto; }
.top-right { display: flex; align-items: center; gap: 14px; }
.select-sm { padding: 6px 30px 6px 10px; font-size: 14px; border-radius: 999px; background-position: right 10px center; }
.updated { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Flipar */
.tabs-bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 14px 14px 12px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--aurora); }
[hidden] { display: none !important; }

/* Sól, norðurljós og sjávarföll */
.card > h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.panel-head { margin-bottom: 16px; }
.sun-today, .sf-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; margin-bottom: 20px; }
.sun-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sun-val { font-size: clamp(30px, 3.6vw, 44px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.daybar { height: 28px; border-radius: 8px; overflow: hidden; }
.daybar svg { display: block; width: 100%; height: 28px; }
.daybar-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.nl-hours table { font-size: 14px; }
.nl-hours th, .nl-hours td { padding: 5px 8px; }
.panel h3 + .scroll table, #sol-14 { font-size: 14px; }
#sol-14 th, #sol-14 td { padding: 6px 8px; }
#sol-allir tbody tr:hover td, #sf-allir tbody tr:hover td { background: var(--raised); }

/* Sjóveður */
.sj-map { position: relative; }
.sj-map canvas { display: block; }
.sj-map svg.sj-over { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.sj-arrows path { stroke: rgba(11, 11, 12, .5); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.sj-place { fill: var(--ink); opacity: .55; pointer-events: none; }
.sj-pick { fill: none; stroke: var(--ink); stroke-width: 3; pointer-events: none; }
.sj-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-top: 14px; }
.sj-cells .sun-val { font-size: 30px; }
.sj-cells h3, .sj-cells .chart { grid-column: 1 / -1; }
.sj-cells h3 { margin-bottom: 0; }

/* Fyrirsögn */
.hero { padding: clamp(24px, 5vw, 48px) 0 8px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 12px; }
.lead { font-size: clamp(16px, 1.6vw, 19px); max-width: 68ch; margin: 0 0 var(--gap); color: var(--muted); }
.lead b { color: var(--ink); font-weight: 700; }

/* Viðvaranir */
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 16px 20px; margin-bottom: var(--gap); }
.warn h2 { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.warn ul { list-style: none; margin: 0; padding: 0; }
.warn li { border-left: 5px solid #E8C420; padding: 2px 0 2px 12px; margin: 10px 0; }
.warn li.l2 { border-left-color: #FA9E38; }
.warn li.l3 { border-left-color: #C62828; }
.warn li b { font-weight: 700; }
.warn .when { font-size: 13px; opacity: .8; }
.warn .cap, .warn a { color: var(--warn-ink); }

/* Stýringar */
.seg { display: inline-flex; background: var(--raised); border-radius: 999px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-sm button { padding: 4px 10px; font-size: 13px; }
.btn { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[aria-pressed="true"] .p1, .btn[aria-pressed="false"] .p2 { display: none; }
.select { appearance: none; background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7280' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 36px 8px 12px; font-weight: 600; max-width: 100%; }

/* Kort og spjald */
.top-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--gap); align-items: start; }
.top-grid > * { min-width: 0; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(14px, 2vw, 22px); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tlabel { margin-left: auto; font-weight: 700; font-size: 15px; }
.slider { width: 100%; margin: 14px 0 2px; accent-color: var(--accent); cursor: pointer; }
.days { position: relative; height: 18px; margin: 0 8px; font-size: 12px; color: var(--muted); }
.days span { position: absolute; top: 0; padding-left: 4px; border-left: 1px solid var(--line); line-height: 16px; white-space: nowrap; }
.map { position: relative; margin-top: 8px; background: var(--sea); border-radius: 10px; overflow: hidden; }
.map svg { display: block; width: 100%; height: auto; }
.map .land { fill: var(--land); stroke: var(--land-line); stroke-width: 1.2; }
.map .st { cursor: pointer; outline: none; }
.map .st:focus-visible .ring { stroke: var(--accent); stroke-width: 4; }
.map .v { text-anchor: middle; dominant-baseline: central; font-weight: 800; font-variant-numeric: tabular-nums; pointer-events: none; }
.map .nm { fill: var(--ink); paint-order: stroke; stroke: var(--sea); stroke-width: 4px; stroke-linejoin: round; font-weight: 600; pointer-events: none; }
.map .nm.sel { font-weight: 800; }
.map .sub { fill: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.scale { margin-top: 10px; min-height: 30px; }
.scale svg text { fill: var(--muted); font-size: 12px; }

.panel h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 0; line-height: 1.15; }
.panel .col { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 6px; }
.panel h3, .sec h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.big { font-size: 56px; font-weight: 300; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.line { font-variant-numeric: tabular-nums; }
.rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 0; }
.rows .avg { font-weight: 700; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* Kaflar */
.sec { margin-top: clamp(36px, 6vw, 64px); }
.sec h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 6px; }
.legend .avg { color: var(--ink); font-weight: 700; }
.legend .avg::before { height: 4px; }
.charts { display: grid; gap: 8px; }
.chart-fig { margin: 0; }
.chart-fig figcaption { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.chart { position: relative; min-height: 260px; }
.chart-sm { min-height: 200px; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line); }
.tip { position: absolute; pointer-events: none; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 8px 24px rgb(0 0 0 / .12); border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; z-index: 2; }
.tip b { font-weight: 700; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
td.avg { font-weight: 800; }
tr.sel td { background: color-mix(in srgb, var(--aurora) 12%, transparent); }
.yf { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: var(--gap); margin-top: 12px; }
.yf .card { padding: 14px 16px; }
.yf h3 { margin-top: 0; }
.yf th, .yf td { padding: 6px 8px; font-size: 14px; }
.yf tbody tr { cursor: pointer; }
.yf tbody tr:hover td { background: var(--raised); }
.yf tbody tr:last-child td { border-bottom: 0; }

/* Fótur */
.foot { margin-top: clamp(48px, 8vw, 96px); border-top: 1px solid var(--line); padding: 32px 0 40px; background: var(--raised); }
.foot-in { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-brand p { margin: 0; max-width: 42ch; color: var(--muted); }
.foot-brand b { color: var(--ink); }
.foot-mark { flex: none; }
.foot h2 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.foot ul { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.foot li { margin: 4px 0; }
.foot-legal { margin-top: 24px; }

@media (max-width: 900px) {
  .top-grid { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; }
  .tlabel { margin-left: 0; width: 100%; }
}
@media (max-width: 520px) {
  .updated { display: none; }
  .seg button { padding: 6px 11px; }
  .big { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Birtukort á sólarflipa */
.sun-map { margin-top: 22px; }
.sun-map canvas { display: block; width: 100%; border-radius: 12px; background: var(--raised); }
.sm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sm-head h3 { margin: 0; margin-right: auto; }
.sm-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; }
.btn-sm { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.btn-sm.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.sm-legend { margin-top: 8px; }

/* Landshlutar */
.chips { display: flex; gap: 6px; overflow-x: auto; flex-wrap: nowrap; margin: 14px 0 4px; padding-bottom: 4px; scrollbar-width: thin; }
.chips button { flex: none; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; white-space: nowrap; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips button:focus-visible { outline: 2px solid var(--aurora); outline-offset: 2px; }
.reg-lead { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.reg-lead b { color: var(--ink); }
@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; } }
.map .leaders { pointer-events: none; }
.sj-ice { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: 16px; vertical-align: top; margin-top: 2px; }
.sj-ice::before { content: ''; width: 18px; height: 12px; border-radius: 3px; border: 1px solid var(--line); background: repeating-linear-gradient(-45deg, var(--raised) 0 3px, color-mix(in srgb, var(--muted) 45%, var(--raised)) 3px 4.5px); }
.foot-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sk-map { cursor: pointer; }
.sk-map canvas { display: block; }
.sj-cells .wide { grid-column: 1 / -1; }
.sk-legend { margin-top: 6px; }
.sk-strips svg text { font-size: 11px; fill: var(--muted); }
.sk-strips svg text.lbl { font-size: 12px; fill: var(--ink); font-weight: 600; }
.sk-strips { margin-top: 4px; }
.seg button { white-space: nowrap; }
.chart.sk-strips { min-height: 0; }
.at-map canvas { display: block; }
.sn-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.sn-keys span::before { content: ''; display: inline-block; width: 14px; height: 14px; border-radius: 5px; background: var(--c); border: 1px solid rgba(0,0,0,.2); vertical-align: -2px; margin-right: 6px; }
.sn-table { max-height: 640px; overflow: auto; }
.sn-table td .cap { margin: 0; font-size: 12px; }
.sun-when { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; margin-top: 4px; }
#sol-dagar { margin-bottom: 18px; }
#sol-dagar .slider { margin-top: 8px; }
#sol-dagar .days span.on { color: var(--ink); font-weight: 700; }
/* Færð */
.fd-map .fd-hit, .fd-map .fd-pt { cursor: pointer; outline: none; }
.fd-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.fd-row span { color: var(--muted); }
.fd-cond { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; margin: 6px 0 10px; }
.fd-cond::before { content: ''; width: 14px; height: 14px; border-radius: 4px; background: var(--c); }
.fd-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 10px 0 16px; }
.fd-counts div { display: flex; align-items: baseline; gap: 8px; border-left: 4px solid var(--c); padding-left: 8px; font-size: 13px; color: var(--muted); }
.fd-counts b { font-size: 20px; color: var(--ink); }
.fd-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.fd-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-left: 4px solid var(--c); margin-bottom: 6px; background: var(--raised); border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px; }
.fd-list li span { color: var(--muted); font-size: 13px; }
.legend span.circ::before { height: 10px; width: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); }
#fd-panel .btn-sm { margin-bottom: 8px; }
.legend span.dash::before { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
/* Vefmyndavélar */
.fd-cams-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fd-cams-head h2 { margin: 0; }
.fd-search { margin-left: auto; min-width: 260px; padding: 10px 14px; font: inherit; font-size: 15px; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; }
.fd-search:focus { outline: 2px solid var(--aurora); outline-offset: 1px; }
.fd-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.fd-cams.near { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fd-cam { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); color: var(--ink); cursor: zoom-in; font: inherit; }
.fd-cam img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--raised); }
.fd-cam.broken img { visibility: hidden; }
.fd-cam-cap { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; font-size: 14px; }
.fd-cam-cap span { color: var(--muted); font-size: 12.5px; }
.fd-cam.sm .fd-cam-cap { padding: 6px 8px; font-size: 12.5px; }
.fd-cam.sm .fd-cam-cap span { display: none; }
.fd-cam:hover { border-color: var(--ink); }
#fd-fleiri { margin-top: 16px; }
.fd-dialog { padding: 0; border: 0; border-radius: 14px; max-width: min(96vw, 1100px); background: var(--bg); color: var(--ink); }
.fd-dialog::backdrop { background: rgba(0,0,0,.7); }
.fd-dialog img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.fd-dialog-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; font-size: 14px; }
@media (max-width: 600px) { .fd-search { min-width: 0; width: 100%; margin-left: 0; } .fd-cams { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
/* Inni í appinu: enginn haus, flipar eða fótur; minna bil */
.in-app header.top, .in-app .tabs-bar, .in-app footer.foot { display: none !important; }
.in-app .hero { padding-top: 14px; }
.in-app .hero h1 { font-size: clamp(26px, 6vw, 40px); }
.in-app body { -webkit-tap-highlight-color: transparent; }
/* Samþykki fyrir vafrakökum */
.kokur { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 520px; margin-left: auto; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.18); padding: 14px 16px; font-size: 14px; }
.kokur p { margin: 0 0 10px; line-height: 1.45; }
.kokur-btns { display: flex; gap: 8px; justify-content: flex-end; }
.linklike { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
