/* ---------- Startside ---------- */
/* Logoen oppe til venstre er knappen hjem. */
button.brand { background: none; border: 0; padding: 4px 6px 4px 0; cursor: pointer; border-radius: 8px; }
button.brand:hover span, button.brand[aria-current="page"] span { color: var(--accent); }
button.brand:hover::before { box-shadow: 0 0 22px var(--accent); }

.home {
  max-width: 1320px; margin: 0 auto; padding-bottom: 12px;
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start;
}
.home h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.1; }
.home .muted { color: var(--muted); font-size: 13.5px; }
.home-hello { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-top: 2px; }
.home-hello h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 38px; line-height: 1; }
.home-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.home section { background: var(--surface); border-radius: 14px; padding: 16px 18px 18px; min-width: 0; }

/* Neste innlegg: resultattavla. Det eneste som lyser på siden. */
.home .home-next {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: inset 0 3px 0 var(--accent), 0 -10px 40px -24px var(--accent-glow);
}
.home .home-next.is-empty { grid-template-columns: 1fr; }
.hn-poster { border: 0; padding: 0; cursor: pointer; border-radius: 10px; background: var(--deep); aspect-ratio: 9 / 16; overflow: hidden; box-shadow: 0 0 0 2px var(--acc, var(--line)); }
.hn-poster:hover { box-shadow: 0 0 0 2px var(--accent); }
.hn-img { display: block; width: 100%; height: 100%; }
.hn-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hn-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hn-k { color: var(--muted); font-weight: 600; font-size: 14px; }
.hn-count {
  font-family: var(--display); font-weight: 800; font-size: clamp(44px, 6vw, 76px); line-height: .95;
  color: var(--accent); text-shadow: 0 0 28px var(--accent-glow); font-variant-numeric: tabular-nums;
}
.home-next.is-empty .hn-count { color: var(--ink); text-shadow: none; font-size: clamp(36px, 4.5vw, 54px); }
.hn-when { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.hn-title { margin: 4px 0 0; font-size: 16px; font-weight: 600; max-width: 60ch; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.home-next.is-empty .hn-title { color: var(--muted); font-weight: 500; }
.hn-targets { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13.5px; }
.hn-targets li { display: flex; align-items: center; gap: 7px; }
.hn-targets .stat-icon { width: 18px; height: 18px; }
.hn-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Status */
.home .home-status { display: flex; flex-direction: column; gap: 12px; align-self: stretch; }
.hs-due { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hs-due button, .hr-main {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  background: var(--due-bg); border: 0; border-radius: 9px; padding: 6px 10px 6px 6px; min-width: 0;
}
.hs-due button.is-failed { box-shadow: inset 3px 0 0 var(--danger); }
.hs-due button:hover { filter: brightness(1.15); }
.hs-due button > span:last-child, .hr-main > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.hs-due strong, .hr-main strong { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-due small { color: var(--due); font-size: 12.5px; font-weight: 600; }
.hs-due button.is-failed small { color: var(--danger); }
.hs-thumb { width: 30px; aspect-ratio: 9 / 16; border-radius: 4px; background: var(--surface-3); overflow: hidden; flex: none; }
.hs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hs-ok { margin: 0; display: flex; align-items: center; gap: 9px; font-weight: 600; }
.ok-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); flex: none; }
.hs-line { margin: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); align-items: flex-start; }
.hs-line strong { font-weight: 600; }
.hs-line small { color: var(--muted); font-size: 13px; }
.hs-note { margin: auto 0 0; color: var(--muted); font-size: 12.5px; }

/* De neste 7 dagene */
.home .home-week { grid-column: 1 / -1; }
.hw-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.hw-day {
  background: var(--canvas); border-radius: 10px; padding: 8px; min-height: 150px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.hw-day:hover { background: var(--deep); }
.hw-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.hw-head { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.hw-head .num { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; color: var(--ink); }
.hw-day.today .hw-head .num { color: var(--accent); }
.hw-post {
  display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 4px; align-items: center;
  background: var(--surface-2); border: 0; border-radius: 8px; padding: 5px; cursor: pointer; text-align: left; min-width: 0;
}
.hw-post:hover { background: var(--surface-3); }
.hw-post .hw-thumb { grid-row: 1 / 3; width: 26px; aspect-ratio: 9 / 16; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.hw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-post .time { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1; font-variant-numeric: tabular-nums; }
.hw-add {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  border: 1px dashed var(--surface-3); border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px;
}
.hw-add small { font-weight: 500; font-size: 11.5px; opacity: 0; transition: opacity .15s; }
.hw-day:hover .hw-add { border-color: var(--accent); color: var(--ink); }
.hw-day:hover .hw-add small { opacity: 1; }

/* Kontoene */
.ha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ha-card {
  background: var(--canvas); border: 0; border-radius: 10px; padding: 10px 12px 12px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.ha-card:hover { background: var(--deep); }
.ha-top { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 4px; }
.ha-top strong { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-top .stat-icon { width: 20px; height: 20px; }
.ha-num { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.ha-k { color: var(--muted); font-size: 12.5px; }
.ha-k .delta.up { color: var(--ok); }
.ha-k .delta.down { color: var(--danger); }

/* Sist lagt ut */
.hr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hr-list li { display: flex; align-items: center; gap: 8px; }
.hr-main { background: var(--canvas); flex: 1; }
.hr-main:hover { background: var(--deep); }
.hr-main small { color: var(--muted); font-size: 12.5px; }
.hr-links { display: flex; gap: 6px; flex: none; }
.hr-links a, .hr-links span { width: 22px; height: 22px; display: block; border-radius: 6px; }
.hr-links span { opacity: .35; }
.hr-links a:hover { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
  .home { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  button.brand { display: flex; margin-right: 6px; }
  button.brand span { display: none; }
  .home-hello h1 { font-size: 30px; }
  .home .home-next { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .hn-when { font-size: 18px; }
  .hw-days { grid-template-columns: repeat(7, minmax(92px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .home section { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .hw-add small { transition: none; } }
