/* "Din risiko", the customer home (spec 2026-11-29-customer-home section 2 and 5, customer-first.md).
   Tiles are white sheets with the neutral rule on the canvas (B609); colour sits on the marks only, never on an
   edge (B837). The tenant header is shared with the lane pages (B828, B882). */

/* The tenant header */
.tenant { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 0; }
.tenant p { margin: 0; }
.tenant-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 28px; font-size: var(--fs-body); }
.tenant-name { font-weight: 700; color: var(--ink); }
.tenant-dom { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tenant-domain { color: var(--ink-3); }
.tenant-check { display: inline-flex; color: var(--c-ok); }
.tenant-more { font-size: var(--fs-meta); color: var(--ink-3); }
.tenant-add { display: inline-flex; align-items: center; min-height: var(--touch); margin: -8px 0; color: var(--accent); font-size: var(--fs-meta); }
.tenant-date { font-size: var(--fs-meta); color: var(--ink-3); }
/* On a lane page's sheet the header is the first line, above the kicker */
.shell .main > :is(.risk-page, .stack-page, .org-page, .surface-page, .req) > .tenant { padding: 18px 0 14px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }

/* The page */
.home-page { max-width: 1280px; }
.home-page > .tenant { margin-top: 16px; }
.home-title { margin: 6px 0 20px; }
.home-guide { margin: 0 0 20px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1240px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .home-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* A tile */
.home-tile { display: flex; flex-direction: column; min-width: 0; padding: 6px 22px 10px; background: var(--card); border: 1px solid var(--card-rule); border-radius: 12px; }
.home-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--touch); margin: 0 -8px; padding: 4px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.home-tile-head h2 { margin: 0; font-size: var(--fs-list-head); font-weight: 700; letter-spacing: -.005em; }
.home-tile-go { font-size: 20px; line-height: 1; color: var(--ink-3); }
.home-tile-head:hover, .home-tile-head:focus-visible { background: var(--hover); }
.home-tile-head:hover .home-tile-go { color: var(--accent); }
.home-tile-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 168px; }
.home-loading { margin: 0; padding-top: 12px; font-size: var(--fs-meta); color: var(--ink-3); }

/* One headline number (customer-first.md section 2): 34 px, 700, ink */
.home-number { margin: 6px 0 0; font-size: var(--fs-title); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.home-means { margin: 4px 0 0; font-size: var(--fs-meta); line-height: 1.45; color: var(--ink-2); }

/* At most three rows */
.home-rows { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.home-rows li { border-bottom: 1px solid var(--rule); }
.home-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--touch); margin: 0 -8px; padding: 7px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.home-row:hover, .home-row:focus-visible { background: var(--hover); }
.home-row-main { display: flex; flex-direction: column; min-width: 0; }
.home-row-label { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: var(--fs-table); line-height: 1.35; }
.home-row-label.is-mono { font-family: var(--mono); font-size: var(--fs-meta); }
.home-row-sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--fs-label); color: var(--ink-3); }
.home-row-side { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 48%; text-align: right; }
.home-row-meta { font-size: var(--fs-label); color: var(--ink-3); white-space: nowrap; }
.home-more { font-size: var(--fs-label); color: var(--ink-3); }

/* A mark (B270): the text in its tone and an 8 px square; no fill, no pill */
.home-mark { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); line-height: 1.3; color: var(--ink-3); }
.home-mark::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: .85; }
.home-mark.is-bad { color: var(--c-bad); }
.home-mark.is-warn { color: var(--c-warn); }
.home-mark.is-ok { color: var(--c-ok); }
.home-mark.is-info { color: var(--chip-theme-fg); }
.home-mark.is-neutral::before { opacity: .45; }

/* Empty, down and notes */
.home-empty, .home-down { margin: 0; padding-top: 10px; font-size: var(--fs-body); line-height: 1.5; color: var(--ink-2); }
.home-note { margin: 10px 0 0; font-size: var(--fs-label); line-height: 1.45; color: var(--ink-3); }
.home-link-row { margin: auto 0 0; padding-top: 8px; }
.home-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); font-size: var(--fs-meta); font-weight: 600; color: var(--accent); text-decoration: none; }
.home-link:hover, .home-link:focus-visible { text-decoration: underline; }

/* Tile 6, "Karakter og tab" (Dis D-6, B924, customer-first.md section 3): the grade (44 px) with its number in its
   tone left, the loss right; colour on the circle and the number only */
.home-gl { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 28px; }
.home-grade { flex: none; padding-top: 6px; }
.home-grade p { margin: 0; }
.home-grade-head { display: flex; align-items: center; gap: 10px; }
.home-grade-head .ch-grade { width: 44px; height: 44px; }
.home-grade-num { white-space: nowrap; }
.home-grade-score { font-size: var(--fs-title); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.home-grade-score.is-ok { color: var(--c-ok); }
.home-grade-score.is-warn { color: var(--c-warn); }
.home-grade-score.is-bad { color: var(--c-bad); }
.home-grade-of { font-size: var(--fs-body); color: var(--ink-3); }
.home-grade-why a { display: inline-flex; align-items: center; min-height: var(--touch); font-size: var(--fs-meta); color: var(--accent); }
.home-gl-loss { flex: 1 1 180px; min-width: 0; }
.home-links { display: flex; flex-wrap: wrap; gap: 0 20px; }

@media (max-width: 900px) {
  .home-tile { padding: 4px 16px 8px; }
  .home-tile-body { min-height: 0; }
  .home-row-side { max-width: 42%; }
}

/* "Siden i går" (Dis D-7, B924): a strip between the tenant header and the tiles. A white sheet with the neutral
   rule like a tile; colour only on the signed change and its triangle (findings.css, customer-first.md section 7). */
.home-changes { margin: 0 0 16px; padding: 6px 22px 8px; background: var(--card); border: 1px solid var(--card-rule); border-radius: 12px; }
.home-changes-head { display: flex; align-items: center; min-height: var(--touch); margin: 0; font-size: var(--fs-list-head); font-weight: 700; letter-spacing: -.005em; color: var(--ink); }
.home-changes .changes-rows { margin-top: 2px; }
.home-changes .home-link-row { padding-top: 4px; }
@media (max-width: 900px) { .home-changes { padding: 4px 16px 6px; } }

/* Dug U-8 (B1320 to B1325): the brief's "Til jer i dag" and "Verden i dag". A story is a card on the page's own
   white with a neutral grey rule between stories; colour sits on the delta, the tolerance mark and the step's
   kroner, never on an edge. The kroner is the largest number on the card. */
.dstories { margin-bottom: 4px; }
.dstory-loss { margin: 6px 0 0; font-size: var(--fs-table); color: var(--ink-2); }
.dstory-prov { color: var(--ink-3); font-size: var(--fs-meta); }
.dstory { border-top: 1px solid var(--rule); padding: 18px 0 14px; }
.dstory:first-of-type { margin-top: 10px; }
.dstory-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.dstory-pattern { color: var(--chip-theme-fg); }
.dstory-state { font-size: var(--fs-label); color: var(--ink-3); }
.dstory-state.is-new { color: var(--c-warn); }
.dstory-state.is-resolved { color: var(--c-ok); }
.dstory-title { margin: 4px 0 0; font-size: var(--fs-list-head); line-height: 1.35; }
.dstory-title-link { display: inline-flex; align-items: center; min-height: var(--touch); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.dstory-title-link:hover, .dstory-title-link:focus-visible { color: var(--accent); text-decoration: underline; }
.dstory-hit { margin: 2px 0 0; font-size: var(--fs-table); line-height: 1.5; }
.dstory-hit-label { color: var(--ink-3); }
.dstory-hit-value { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.dstory-summary { margin: 6px 0 0; font-size: var(--fs-table); line-height: 1.55; color: var(--ink-2); }
.dstory-kroner { margin: 12px 0 0; }
.dstory-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0; }
.dstory-amount { font-size: 28px; line-height: 1.1; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.dstory-delta { font-size: var(--fs-table); font-weight: 600; font-variant-numeric: tabular-nums; }
.dstory-delta.is-bad, .dstory-tol.is-bad { color: var(--c-bad); }
.dstory-kroner-line { margin: 4px 0 0; font-size: var(--fs-meta); line-height: 1.5; color: var(--ink-2); }
.dstory-steps-head { margin: 14px 0 0; font-size: var(--fs-label); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.dstory-steps { margin: 4px 0 0; padding: 0 0 0 22px; }
.dstory-step { border-top: 1px solid var(--rule); }
.dstory-step:first-child { border-top: 0; }
.dstory-step-link { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: var(--touch); padding: 8px 0; color: var(--ink); text-decoration: none; }
a.dstory-step-link:hover .dstory-step-text, a.dstory-step-link:focus-visible .dstory-step-text { color: var(--accent); text-decoration: underline; }
.dstory-step-text { font-size: var(--fs-table); line-height: 1.5; overflow-wrap: anywhere; }
.dstory-step-meta { font-size: var(--fs-meta); line-height: 1.45; color: var(--ink-3); }
.dstory-step-kr { color: var(--c-ok); font-weight: 600; font-variant-numeric: tabular-nums; }
.dstory-step.is-done .dstory-step-text { color: var(--ink-3); text-decoration: line-through; }
.dstory-step-kr.is-zero { color: var(--ink-3); font-weight: 400; } /* B1364: nothing measurable, no colour */
.dstory-step-state.is-done { color: var(--c-ok); font-weight: 600; } /* B1363: "klaret" */
.dworld { margin-top: 18px; }
@media (max-width: 600px) { .dstory-amount { font-size: 24px; } }
