/* Sikt – grundlayout för skalet. Komponenter för Nu/Timmar/Dygn byggs i egna PR:er. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain; /* egen pull-to-refresh senare, ingen webbläsarreload */
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Toppfält */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px;
  padding: env(safe-area-inset-top) var(--gutter) 0;
}
.place {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  min-height: var(--tap);
  font-size: var(--fs-title); font-weight: 600;
}
.place svg { flex: none; }
.topbar-end { display: flex; align-items: center; }
.source {
  font-family: var(--font-mono); font-size: var(--fs-label); color: var(--text-3);
}
.icon-btn {
  width: var(--tap); height: var(--tap); margin-right: -10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}

/* Innehåll */
main {
  padding: 0 var(--gutter) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
.panel { display: flex; flex-direction: column; gap: var(--gap); }
.panel[hidden] { display: none; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.label {
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--text-3);
}
.muted { color: var(--text-2); }

/* Skelett: statiska platshållare i rätt form, ingen animation */
.sk { background: var(--skeleton); border-radius: var(--radius-sm); }
.sk-now { display: flex; justify-content: space-between; align-items: center; height: 96px; }
.sk-temp { width: 120px; height: 72px; }
.sk-cond { width: 110px; height: 44px; }
.sk-line { height: 14px; }
.sk-line.w80 { width: 80%; }
.sk-line.w55 { width: 55%; }
.sk-card { height: 110px; border-radius: var(--radius); }
.sk-card.short { height: 84px; }

.placeholder {
  min-height: 40dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-align: center; color: var(--text-2);
}

/* Flikfält */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  background: var(--surface-bar);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--text-3);
  font-size: var(--fs-label);
}
.tab[aria-current="page"] { color: var(--text); font-weight: 600; }

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

/* Ikonfärger via klass (CSP tillåter inga style-attribut) */
.ic-accent { fill: var(--accent); }
.ic-muted { stroke: var(--text-3); }

.sk-lines { display: flex; flex-direction: column; gap: 8px; }
.sk-card.h160 { height: 160px; }
.sk-card.h320 { height: 320px; }
.sk-card.h480 { height: 480px; }
.noscript { padding: var(--gutter); }
