/* ===== Belegg · designsystem ===================================================== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/vendor/inter/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #F4F3EE; --surface: #FFFFFF; --surface-2: #F8F7F3; --surface-3: #EFEEE8;
  --line: #E4E2DA; --line-strong: #CBC8BE;
  --ink: #1A2420; --ink-2: #46504A; --ink-3: #66706A; --ink-4: #8A938D;
  --brand: #FFFFFF; --brand-2: #F4F3EE;
  --ours: #1D8A4F; --ours-ink: #136637; --ours-soft: #E1F2E7; --ours-mid: #8FCBA7;
  --comp: #8C918C; --comp-ink: #5A615C; --comp-soft: #ECEEEB;
  --amber: #A66A12; --amber-soft: #FBF0DA; --red: #B23F37; --red-soft: #F9E4E1; --blue: #2F6FB3; --blue-soft: #E3ECF7;
  --focus: #2F6FB3;
  --r-card: 14px; --r-ctl: 9px;
  --shadow: 0 1px 2px rgba(26,36,32,.05), 0 10px 30px -22px rgba(26,36,32,.35);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tabbar-h: 56px;
  --ctl-h: 32px; --seg-track: rgba(26,36,32,.06);
}
* { 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: 15px; line-height: 1.5; font-feature-settings: "cv11", "ss01"; }
a { color: var(--ours-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.5rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h2 { font-size: 1.0625rem; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
h3 { font-size: 0.9375rem; font-weight: 600; margin: 0; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 0.8125rem; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ===== topp: logo, meny, bruker ================================================== */
.topbar { background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; height: 56px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 40px; }
/* logo: SVG-merke, alle mål i em – endre font-size for å skalere hele logoen */
.brand { display: flex; align-items: center; gap: .5em; flex: none; font-size: 1.125rem; color: var(--ink); border-radius: 6px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: calc(4em / 3); height: calc(4em / 3); flex: none; color: var(--ours); }
.brand-title { font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
/* menyen er faner: aktiv side markeres med en grønn strek som ligger på linjen under */
.nav { display: flex; align-self: stretch; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; padding: 0 12px; color: var(--ink-3); font-size: 0.875rem; font-weight: 500; transition: color .15s ease; }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; transition: background-color .15s ease; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a:hover::after { background: var(--line-strong); }
.nav a.on { color: var(--ink); }
.nav a.on::after { background: var(--ours); }
.nav a:focus-visible { outline: none; }
.nav a:focus-visible::before { content: ""; position: absolute; inset: 12px 2px; border-radius: 8px; box-shadow: 0 0 0 2px var(--focus); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; }
.userbox a { color: var(--ink-2); font-weight: 500; }
.userbox a:hover { color: var(--ink); text-decoration: none; }
.tabbar { display: none; }

/* ===== filterlinje: følger med når du ruller ======================================== */
.toolbar { position: sticky; top: 0; z-index: 20; background: rgba(244,243,238,.86); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.toolbar:has(> .controls:empty) { display: none; }
.controls { max-width: 1240px; min-height: 52px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.controls:empty { display: none; }
.controls .push { margin-left: auto; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* segmentvelger (skift, periode, i går / i dag) */
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--seg-track); border-radius: 9px; }
.seg button { flex: 1 0 auto; height: calc(var(--ctl-h) - 4px); padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(26,36,32,.1), 0 0 0 .5px rgba(26,36,32,.1); }
.seg button:focus-visible { outline-offset: 0; }

/* felt: dato med piler, fra–til, verktøyknapp */
.field { display: inline-flex; align-items: stretch; gap: 2px; height: var(--ctl-h); padding: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 1px 2px rgba(26,36,32,.04); }
.step { flex: none; width: calc(var(--ctl-h) - 6px); display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.step:hover { background: var(--surface-3); color: var(--ink); }
.step:disabled { color: var(--ink-4); background: transparent; opacity: .5; cursor: default; }
.step:focus-visible { outline-offset: 0; }
.date-pick { position: relative; flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 9px; border-radius: 6px; color: var(--ink); font-size: 0.8125rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; transition: background-color .15s ease; }
.date-pick:hover { background: var(--surface-3); }
.date-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 0; }
.date-pick .ico { width: 15px; height: 15px; color: var(--ink-3); }
/* den ekte datovelgeren ligger usynlig over teksten: et klikk eller trykk åpner nettleserens egen kalender */
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; font-size: 16px; cursor: pointer; }
.date-pick input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; cursor: pointer; }
.field .sep { align-self: center; color: var(--ink-4); }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; height: var(--ctl-h); padding: 0 12px 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 1px 2px rgba(26,36,32,.04); color: var(--ink); font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: background-color .15s ease; }
.tool-btn:hover { background: var(--surface-2); }
.tool-btn .ico { color: var(--ink-2); }
.tool-btn.busy { cursor: progress; }
.tool-btn.busy .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool-note { font-size: 0.8125rem; color: var(--ink-3); }
@media (prefers-reduced-motion: no-preference) {
  .seg button:active, .step:active:not(:disabled), .tool-btn:active { transform: scale(.97); }
}

/* knapper i innholdet */
.btn { font-size: 0.875rem; font-weight: 500; padding: 7px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: #fff; color: var(--ink); cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s ease, background .15s ease; }
.btn:hover { border-color: var(--ours); background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--ours); color: #fff; border-color: var(--ours); }
.btn.primary:hover { background: var(--ours-ink); }

/* ===== innhold ==================================================================== */
.view { max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; }
.page-head { margin-bottom: 18px; }
.page-head .line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; color: var(--ink-3); font-size: 0.875rem; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--ours-soft); color: var(--ours-ink); white-space: nowrap; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.neutral { background: var(--surface-3); color: var(--ink-2); }
.badge.comp { background: var(--comp-soft); color: var(--comp-ink); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.main { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head .sub { font-size: 0.8125rem; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 14px 18px 18px; }
.card-body.flush { padding: 8px 0 6px; }
.card-foot { padding: 0 18px 14px; font-size: 0.8125rem; color: var(--ink-3); }

/* nøkkeltall */
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 16px 18px 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tile.ours { background: linear-gradient(180deg, #F3FAF5 0%, #FFFFFF 70%); border-color: var(--ours-mid); }
.tile .label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.tile .value { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 2px; white-space: nowrap; }
.tile.ours .value { color: var(--ours-ink); }
.tile .sub { font-size: 0.8125rem; color: var(--ink-3); }
.delta { font-size: 0.8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--ours-ink); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--ink-3); font-weight: 500; }

/* innsikt */
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.insights li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; line-height: 1.45; }
.insights li > span { flex: 1; min-width: 0; }
.insights li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ours); margin-top: 8px; flex: none; }
.insights li.warn::before { background: var(--amber); }
.insights li.bad::before { background: var(--red); }
.insights li.neutral::before { background: var(--comp); }
.insights b { font-weight: 600; }

/* rangering */
.rank { list-style: none; margin: 0; padding: 0 6px; }
.rank li { display: grid; grid-template-columns: 26px minmax(0, 2.4fr) minmax(90px, 1.6fr) 64px 78px; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; font-size: 0.9375rem; }
.rank li.ours { background: var(--ours-soft); }
.rank .pos { color: var(--ink-3); font-weight: 600; font-size: 0.8125rem; text-align: right; }
.rank .name { min-width: 0; display: flex; flex-direction: column; }
.rank .name a { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .name .meta { font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank .extra { text-align: right; font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank .extra:empty { display: none; }
.rank .nodata { grid-column: 3 / -1; color: var(--ink-4); font-size: 0.8125rem; }
.bar { position: relative; height: 10px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--comp); border-radius: 5px; }
.bar.ours > i { background: var(--ours); }
.bar > s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); opacity: .6; }

/* tabeller */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tbl th { text-align: left; font-weight: 600; font-size: 0.75rem; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: .02em; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.ours td { background: var(--ours-soft); }
.tbl tr.total td { font-weight: 600; background: var(--surface-2); }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (hover: hover) {
  .tbl tr.link:hover td { background: var(--surface-2); cursor: pointer; }
  .tbl tr.ours.link:hover td { background: #D5EBDC; }
  .rank li.link:hover { background: var(--surface-2); }
  .rank li.ours.link:hover { background: #D5EBDC; }
}
.tbl tr.link { cursor: pointer; }
.tbl td.name { white-space: nowrap; font-weight: 500; }
.tbl td.name a { color: var(--ink); }
.tbl .pct { font-weight: 600; }
.tbl .sub { display: block; font-size: 0.75rem; color: var(--ink-3); font-weight: 400; }

/* heat */
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat { display: grid; gap: 3px; font-size: 0.75rem; align-items: center; min-width: 620px; }
.heat .hl { position: sticky; left: 0; background: var(--surface); padding-right: 10px; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.heat .hl a { color: var(--ink); }
.heat .hl.ours { font-weight: 600; color: var(--ours-ink); }
.heat .hl.ours a { color: var(--ours-ink); }
.heat .hl.total { font-weight: 600; }
.heat .hh { text-align: center; color: var(--ink-2); font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.heat .hc { height: 28px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; font-weight: 500; }
.heat .hc.none { background: repeating-linear-gradient(45deg, #F3F4F0 0 4px, #E9EBE6 4px 8px); color: transparent; }
.heat .hc.total { box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--ink-2); margin-top: 12px; align-items: center; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.scale { display: inline-block; width: 110px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #EEF3EF, #1D8A4F); vertical-align: middle; margin: 0 6px; }

/* nå */
.live { display: grid; gap: 2px; font-size: 0.75rem; min-width: 820px; align-items: center; }
.live .lh { font-size: 0.6875rem; color: var(--ink-3); text-align: center; font-variant-numeric: tabular-nums; }
.live .lh.now { color: var(--ours-ink); font-weight: 700; }
.live .ll { position: sticky; left: 0; background: var(--surface); font-size: 0.8125rem; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.live .lv { font-weight: 600; padding: 12px 0 4px; grid-column: 1 / -1; border-top: 1px solid var(--line); position: sticky; left: 0; }
.live .lv.ours { color: var(--ours-ink); }
.live .lc { height: 22px; border-radius: 4px; background: var(--surface-3); }
.live .lc.available { background: #D9EEDF; }
.live .lc.booked { background: var(--ours); }
.live .lc.event { background: var(--blue); }
.live .lc.blocked { background: repeating-linear-gradient(45deg, #DAD9D3 0 4px, #C9C8C1 4px 8px); }
.live .lc.other { background: var(--amber-soft); }
.live .lc.none { background: transparent; }
.live .lc.nowcol { outline: 2px solid var(--ours-ink); outline-offset: -2px; }

/* diagram */
.chart { position: relative; height: 260px; }
.chart.tall { height: 300px; }
.chart.short { height: 190px; }
.spark { display: inline-block; vertical-align: middle; }

/* tilstander */
.notes { margin: 0 0 16px; padding: 12px 16px; background: var(--amber-soft); border-radius: 12px; color: #6B4607; font-size: 0.875rem; display: grid; gap: 4px; }
.error { padding: 14px 16px; background: var(--red-soft); color: var(--red); border-radius: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-2); }
.empty h2 { margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto; }
.skeleton-page { display: grid; gap: 16px; }
.sk { background: linear-gradient(90deg, #ECEBE5 25%, #F4F3EE 50%, #ECEBE5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 12px; }
.sk-title { height: 30px; width: 46%; }
.sk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sk-tile { height: 112px; }
.sk-block { height: 320px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--ours-ink); font-weight: 500; font-size: 0.875rem; padding: 4px 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; font-size: 0.75rem; transition: transform .15s ease; }
details.fold[open] > summary::before { transform: rotate(90deg); }
.foot { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.6; }
.defs dt { font-weight: 600; margin-top: 10px; }
.defs dd { margin: 2px 0 0; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 0.875rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* innlogging */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--bg); margin: 0; padding: 20px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 32px; width: min(400px, 100%); box-shadow: 0 24px 50px -28px rgba(26,36,32,.35); }
.login-card .brand { font-size: 1.3125rem; margin-bottom: 22px; }
.login-card label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
.login-card input { width: 100%; font-size: 1rem; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; }
.login-card button { width: 100%; margin-top: 20px; font-size: 1rem; font-weight: 600; padding: 12px; border: 0; border-radius: 10px; background: var(--ours); color: #fff; cursor: pointer; }
.login-card button:hover { background: var(--ours-ink); }
.login-card .error { margin: 14px 0 0; }

/* ===== mobil ===================================================================== */
@media (max-width: 960px) {
  .grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two, .grid.main { grid-template-columns: 1fr; }
  .topbar-in { gap: 24px; }
  .userbox .name { display: none; }
  .controls .push { margin-left: 0; }
}
@media (max-width: 720px) {
  :root { --ctl-h: 38px; }
  body { font-size: 14px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topbar-in { height: 52px; padding: 0 16px; }
  .nav { display: none; }
  .toolbar { position: static; }
  .controls { padding: 12px 16px; gap: 8px; }
  .controls > * { flex: 1 1 auto; }
  .controls > .tool-btn { flex: none; }
  .tool-note { flex-basis: 180px; }
  .seg button { flex: 1 1 0; padding: 0 10px; }
  .date-from { justify-content: flex-end; }
  .date-to { justify-content: flex-start; }
  .hide-m { display: none !important; }
  .tbl th, .tbl td { padding: 9px 8px; }
  .tbl th:first-child, .tbl td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  .tbl tr.ours td:first-child { background: var(--ours-soft); }
  .tbl tr.total td:first-child { background: var(--surface-2); }
  .tbl td.name { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .tbl td.sim { max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tbl td.name .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .heat .hl, .live .ll { background: var(--surface); }
  .view { padding: 18px 16px 32px; }
  h1 { font-size: 1.25rem; }
  .tile { padding: 13px 14px 12px; }
  .tile .value { font-size: 1.625rem; }
  .card-head { padding: 14px 14px 0; }
  .card-body { padding: 12px 14px 14px; }
  .rank li { grid-template-columns: 22px minmax(0, 1fr) 64px; grid-template-areas: "pos name pct" ". bar bar" ". extra extra"; gap: 4px 8px; padding: 10px 8px; }
  .rank .pos { grid-area: pos; }
  .rank .name { grid-area: name; }
  .rank .bar { grid-area: bar; }
  .rank .pct { grid-area: pct; }
  .rank .extra { grid-area: extra; text-align: left; }
  .rank .nodata { grid-area: bar; }
  .chart { height: 220px; }
  .chart.tall { height: 250px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: rgba(250,250,247,.9); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 0.6875rem; font-weight: 500; -webkit-tap-highlight-color: transparent; transition: color .15s ease; }
  .tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--ours-ink); }
  .tabbar a.on svg { stroke-width: 2; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a:focus-visible { outline-offset: -4px; border-radius: 12px; }
  .foot { padding: 0 16px 24px; }
  .sk-grid { grid-template-columns: repeat(2, 1fr); }
  .userbox { font-size: 0.75rem; }
}
