@font-face {
  font-family: Allo;
  src: url("./fonts/AlloVariableFriendly.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #111410;
  --panel: #191d17;
  --surface: #1e231b;
  --line: #30372c;
  --text: #f0f2e9;
  --muted: #a3ac9b;
  --accent: #d4ee91;
  --purple: #c2aff5;
  --blue: #a2cce9;
  --red: #ffaaa0;
  --space: .75rem;
  font-family: Allo, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; font-size: 1rem; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; top: -4rem; left: 1rem; z-index: 5; padding: .7rem 1rem; background: var(--accent); color: #141a10; }
.skip:focus { top: .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.subtle { color: var(--muted); }
time, .day-weather { font-variant-numeric: tabular-nums; }

.brand { display: inline-flex; gap: .63rem; align-items: center; text-decoration: none; font-size: 1.6rem; font-weight: 780; letter-spacing: -.07em; line-height: 1; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: var(--accent); color: #1b2510; }
.brand-mark svg { stroke-width: 2.65; }
.brand-period { color: var(--accent); }
.icon-button { display: grid; place-items: center; width: 37px; height: 37px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); }
.icon-button:hover { border-color: #6e8052; background: #293223; }

.page { container-type: inline-size; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space); margin-inline: auto; width: calc(100% - 2 * var(--space)); padding-block: var(--space); }
h1 { margin: 0; font-size: clamp(2.5rem, 5.7vw, 5.4rem); letter-spacing: -.065em; line-height: .98; font-weight: 720; }
.today-button, .secondary-button { padding: .6rem .85rem; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; white-space: nowrap; font-size: .88rem; }
.today-button:hover, .secondary-button:hover { background: #293223; border-color: #6e8052; }
.panel { min-width: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); scroll-margin-top: 1rem; }
h2 { margin: 0; font-size: 1.2rem; font-weight: 690; letter-spacing: -.035em; }
.calendar-view { --week-columns: repeat(7, minmax(0, 1fr)); display: grid; gap: var(--space); min-width: 0; }
.week-grid, .series-grid { display: grid; grid-template-columns: var(--week-columns); }
.week-grid { min-height: 190px; }
.day { container-type: inline-size; padding: var(--space); min-width: 0; }
.day + .day { border-left: 1px solid var(--line); }
.day.today { background: #232c1d; box-shadow: inset 0 2px 0 var(--accent); }
.series-grid { gap: var(--space); }
.day-series { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space); min-width: 0; }
.day-series-empty { align-content: stretch; }
.add-series {
  display: grid;
  place-items: center;
  min-height: 2.25rem;
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  opacity: 0;
}
.add-series:hover, .add-series:focus-visible { opacity: 1; }
.add-series:focus-visible { outline-offset: -3px; }
.add-series span {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  font-size: 1.4rem;
  line-height: 1;
}
.day-series-date { display: none; }
.series-stack { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); gap: var(--space); aspect-ratio: 210 / 295; min-height: 0; }
.series-stack:has(> .series-card + .series-card) { grid-auto-rows: minmax(2.25rem, 1fr); overflow: auto; }
.day-heading { display: flex; justify-content: space-between; align-items: start; gap: var(--space); margin: 0 0 var(--space); }
.day-label { margin: 0; font-size: .85rem; font-weight: 560; color: var(--muted); }
.day-label time { display: block; margin-top: .17rem; color: var(--text); font-weight: 670; font-size: 1.65rem; line-height: 1.15; letter-spacing: -.07em; }
.today .day-label, .today .day-label time { color: var(--accent); }
.day-weather { display: flex; justify-content: end; align-items: start; gap: .25rem; min-width: 0; text-align: right; line-height: 1.15; }
.day-weather svg { flex: none; width: 1.35rem; height: 1.35rem; }
.day-weather div { display: grid; gap: .12rem; }
.day-weather strong { color: var(--text); font-size: .9rem; }
.day-weather span { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.day-weather .day-rain { color: var(--blue); }
@container (max-width: 9rem) {
  .day-weather { display: grid; justify-items: end; gap: .1rem; }
  .day-weather svg { width: 1.1rem; height: 1.1rem; }
}
.weather-symbol { color: var(--blue); }
.weather-symbol.clear { color: #edd387; }
.day-empty { display: block; color: #69765f; }
.event { display: flex; flex-direction: column; gap: .26rem; padding: var(--space); border-left: 2px solid var(--purple); background: #292435; border-radius: 4px; margin-top: var(--space); text-decoration: none; overflow-wrap: anywhere; }
.event.cs2-match { border-left-color: #f1c84b; background: #302b20; }
.event.dog-show { border-left-color: var(--accent); background: #243021; }
.event.dog-show span { color: var(--accent); }
.dog-show-breed { display: grid; gap: .1rem; margin-top: .2rem; }
.event.dog-show .dog-show-breed strong { font-weight: 750; }
.event strong, .series-card strong { color: var(--text); font-size: .86rem; font-weight: 650; line-height: 1.3; }
.event span { color: var(--purple); font-size: .73rem; line-height: 1.3; }
.cs2-match-card { display: grid; gap: .35rem; min-width: 0; }
.cs2-match-header { display: flex; align-items: baseline; justify-content: space-between; gap: .2rem .45rem; flex-wrap: wrap; }
.event.cs2-match .cs2-competition { color: var(--muted); font-size: .62rem; font-weight: 650; line-height: 1.2; }
.event.cs2-match .cs2-match-meta { color: #e6c776; font-size: .62rem; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.cs2-team { display: flex; align-items: center; gap: .35rem; min-width: 0; min-height: 1.35rem; }
.cs2-team-logo { flex: none; width: 1.25rem; height: 1.25rem; object-fit: contain; }
.event.cs2-match .cs2-team-acronym { min-width: 0; overflow: hidden; color: var(--text); font-size: .74rem; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.event.cs2-match .cs2-team-score { margin-left: auto; color: #f1c84b; font-size: .78rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.series-card {
  --episode-accent: #c1c9ea;
  --episode-surface: #2a2d3a;
  --episode-border: #464b61;
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space);
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: var(--space);
  border: 1px solid var(--episode-border);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--episode-surface), #20241f 80%);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.series-card.tv4-play { --episode-accent: #ffb7af; --episode-surface: #3b2326; --episode-border: #63383d; }
.series-card.svt-play { --episode-accent: #b4e7b0; --episode-surface: #22382b; --episode-border: #3e5b45; }
.series-card.prime-video { --episode-accent: #aae0ff; --episode-surface: #1c3445; --episode-border: #365767; }
.series-card.netflix { --episode-accent: #ffb7bd; --episode-surface: #352327; --episode-border: #593137; }
a.series-card:hover { border-color: var(--episode-accent); }
a.series-card:focus-visible { outline-offset: -3px; }
.episode-backdrop, .article-backdrop { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.series-card:has(.episode-backdrop:not([hidden]))::before,
.article:has(.article-backdrop:not([hidden]))::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: var(--artwork-shade, linear-gradient(180deg, #0b0d0bd9, #0b0d0b24 33%, #0b0d0b66 52%, #0b0d0bf5));
}
.episode-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .3rem; min-width: 0; margin: .25rem; }
.episode-top img { width: auto; height: 20px; max-width: 43px; min-width: 0; object-fit: contain; object-position: left center; filter: brightness(0) invert(1); }
.tv4-play .episode-top img { height: 24px; }
.prime-video .episode-top img { max-width: 57px; }
.episode-copy { display: grid; min-width: 0; gap: .21rem; }
.series-card strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: clamp(.75rem, 18cqi, .86rem); }
.episode-title { overflow: hidden; color: var(--text); font-size: .74rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.episode-time, .episode-detail { color: var(--episode-accent); font-size: .72rem; line-height: 1.2; }
.episode-time { margin-left: auto; white-space: nowrap; }
.series-stack:has(> .series-card + .series-card) > .series-card { container: episode / size; }
.series-stack:has(> .series-card + .series-card) .episode-top { position: absolute; top: var(--space); left: var(--space); flex-wrap: nowrap; }
.series-stack:has(> .series-card + .series-card) .episode-top img { height: 14px; }
.series-stack:has(> .series-card + .series-card) .episode-copy { margin-top: auto; gap: .12rem; }
.series-stack:has(> .series-card + .series-card) .episode-copy > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (min-width: 1000px) and (min-height: 700px) {
  .series-card strong { font-size: clamp(.86rem, 7cqi, 1.1rem); }
  .episode-title { font-size: clamp(.74rem, 6cqi, .94rem); }
  .episode-time, .episode-detail { font-size: clamp(.72rem, 5.5cqi, .88rem); }
}
@container episode (max-height: 4.5rem) {
  .series-stack:has(> .series-card + .series-card) .episode-copy strong { padding-inline-start: 2.2rem; }
}
@container episode (max-height: 2.45rem) {
  .series-stack:has(> .series-card + .series-card) .episode-top img { height: 10px; max-width: 2rem; }
  .episode-time { display: none; }
  .episode-copy strong, .episode-copy .episode-detail { font-size: .69rem; line-height: 1.1; }
}
.settings-nav button { padding: .42rem .63rem; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: transparent; font-size: .83rem; }
.settings-nav button:hover { color: var(--text); border-color: #65755a; }

.transport-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 22%); gap: var(--space); }
.bus-widget { display: grid; gap: var(--space); padding: var(--space); background: #262626; border-color: #4c4c4c; }
.bus-departures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space); min-width: 0; }
.bus-route { display: grid; align-content: start; gap: .4rem; min-width: 0; }
.bus-route + .bus-route { border-left: 1px solid #4c4c4c; padding-left: var(--space); }
.bus-route h3 { margin: 0 0 .2rem; color: #fff; font-size: clamp(.95rem, 1.05vw, 1.05rem); line-height: 1.25; }
.bus-route h3 span { color: #f1c800; }
.bus-departure { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.bus-line { display: grid; place-items: center; flex: none; min-width: 2rem; padding: .25rem; border-radius: 4px; background: #f1c800; color: #262626; font-size: .78rem; font-weight: 700; }
.bus-time { display: grid; min-width: 0; gap: .1rem; color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.bus-time small { overflow: hidden; color: #c7c7c7; font-size: .65rem; font-weight: 400; text-overflow: ellipsis; }
.bus-countdown { display: grid; gap: .1rem; margin-left: auto; white-space: nowrap; color: #f1c800; font-size: .72rem; text-align: right; }
.bus-countdown small { color: #c7c7c7; font-size: .65rem; font-weight: 400; }
.bus-empty { margin: 0; color: #c7c7c7; font-size: .75rem; line-height: 1.35; }
.volvo-widget {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(6.5rem, 1fr) auto;
  min-width: 0;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
}
.volvo-widget::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: url("volvo-v90-black.webp") center no-repeat;
  background-size: contain;
  opacity: .55;
  pointer-events: none;
}
.volvo-readings { display: flex; flex-wrap: wrap; align-self: start; gap: .45rem .9rem; margin: 0; padding: var(--space); }
.volvo-widget dt { color: #e0e5dc; font-size: .65rem; }
.volvo-widget dd { margin: .1rem 0 0; color: #fff; font-size: 1.1rem; font-weight: 740; font-variant-numeric: tabular-nums; }
.volvo-actions { display: grid; grid-template-columns: minmax(4.5rem, 1fr) minmax(0, auto); align-items: end; gap: .4rem .65rem; padding: .4rem var(--space); }
.volvo-fill { grid-column: 1; grid-row: 1; margin: 0; }
#volvo-heater { grid-column: 2; grid-row: 1; justify-self: end; padding: .35rem .55rem; font-size: .74rem; white-space: normal; }
.volvo-actions button:disabled { opacity: .55; cursor: default; }
.volvo-actions p { grid-column: 1 / -1; grid-row: 2; margin: 0; color: var(--muted); font-size: .7rem; text-align: right; }
.volvo-actions p:empty { display: none; }
#volvo-vehicle-form { margin-top: var(--space); }
@media (min-width: 1000px) and (max-width: 1450px) {
  .transport-row .bus-departures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 999px) {
  .transport-row { grid-template-columns: minmax(0, 1fr); }
}

#news { min-width: 0; scroll-margin-top: 1rem; }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(14rem, (100% - 4 * var(--space)) / 5)), 1fr)); gap: var(--space); list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; min-width: 0; }
.article {
  --artwork-shade: linear-gradient(180deg, #0d100de0, #0d100d4d 26%, #0d100daf 48%, #0d100df5 86%, #0d100d);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space);
  padding: var(--space);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #2d2820, var(--surface) 78%);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.article.feber { background: linear-gradient(145deg, #293534, var(--surface) 78%); }
.article:has(.article-backdrop:not([hidden])) { min-height: 12.5rem; }
.article:hover { border-color: var(--accent); }
.article:focus-visible { outline-offset: -3px; }
.article-meta { display: flex; justify-content: space-between; align-items: center; gap: .45rem; color: #e4e8de; font-size: .75rem; }
.article-logo { width: auto; height: .86rem; max-width: 6.25rem; min-width: 0; object-fit: contain; }
.article.skk .article-logo { height: 2rem; }
.article-copy { display: grid; min-width: 0; gap: .31rem; }
.article-title { font-weight: 680; font-size: .97rem; line-height: 1.27; }
.article-description { color: #d4d9cf; font-size: .83rem; line-height: 1.42; }
.empty-message { grid-column: 1 / -1; margin: 0; padding: 1.08rem 1.12rem; color: var(--muted); }

dialog { color: var(--text); background: var(--panel); width: min(100% - 2rem, 510px); max-height: calc(100% - 2rem); border: 1px solid var(--line); border-radius: 14px; padding: 0; overflow: auto; }
dialog::backdrop { background: #070907c7; }
.dialog-header, .dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-footer { border-top: 1px solid var(--line); }
.settings-credit { margin: 0; padding: .75rem 1rem; color: var(--muted); font-size: .75rem; }
.settings-nav { display: flex; flex-wrap: wrap; gap: .32rem; padding: .9rem 1rem 0; }
.settings-nav button[aria-pressed="true"] { background: #30352a; color: var(--text); border-color: #46523c; }
.settings-content { padding: .75rem 1rem 1rem; }
.settings-content p { margin: 0; line-height: 1.45; font-size: .9rem; }
#settings-cs2 form { margin-top: var(--space); }
#dog-breed-form { margin-top: var(--space); }
#dog-breed-list { max-height: min(36vh, 18rem); overflow: auto; }
form { display: grid; gap: .8rem; }
label { display: grid; gap: .4rem; font-size: .91rem; }
label > .subtle { display: inline; }
input, select { width: 100%; background: #121611; color: var(--text); border: 1px solid #414b39; border-radius: 7px; padding: .63rem .65rem; }
.form-link { color: var(--blue); font-size: .86rem; }
.action-button { justify-self: start; border: 1px solid transparent; background: var(--accent); color: #17200f; padding: .62rem .88rem; border-radius: 8px; font-size: .9rem; font-weight: 680; }
.action-button:hover { background: #e4f8b4; }
.form-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
#search-shows { justify-self: start; }
#show-results:empty { display: none; }
.show-choice { display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; text-align: left; margin-top: .26rem; }
.show-choice small { color: var(--muted); }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: .65rem; }
legend { font-size: .88rem; color: var(--muted); }
fieldset label { display: flex; gap: .5rem; padding: .3rem; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.show-covers, .show-cover-field { display: grid; gap: .55rem; }
.show-cover-preview { display: block; width: 4rem; aspect-ratio: 4 / 5.5; object-fit: cover; border-radius: .35rem; margin-bottom: .4rem; }
[data-cover-field="landscapeCover"] .show-cover-preview { width: 7rem; aspect-ratio: 16 / 9; }
.watchlist { list-style: none; padding: 0; margin: 0 0 .9rem; }
.watchlist:empty { display: none; }
.watchlist li { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .46rem 0; border-bottom: 1px solid var(--line); }
.watchlist span { font-size: .85rem; }
#settings-feedback { color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
#settings-feedback.error, .form-error { color: var(--red); }
.login-page { display: grid; min-height: 100svh; place-items: center; padding: 1rem; }
.login-panel { width: min(100%, 420px); padding: 1.5rem; }
.login-panel h1 { font-size: 3.1rem; margin: 1.5rem 0 1.2rem; }
.form-error { margin: 0; font-size: .9rem; }

@media (min-width: 1000px) and (min-height: 700px) {
  .page { height: 100dvh; grid-template-rows: auto minmax(0, 1fr); }
  #news { overflow: hidden; }
  #news-body { height: 100%; display: flex; flex-direction: column; }
  .news-list { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
  .article:has(.article-backdrop:not([hidden])) { min-height: 0; }
  .article { height: 100%; }
  .article-description { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (min-width: 1000px) and (max-width: 1300px) {
  .bus-route h3 { min-height: 2.5em; }
}
@media (max-width: 999px) {
  .bus-departures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bus-route + .bus-route { border-left: 0; padding-left: 0; }
}
@media (max-width: 620px) {
  .week-grid { grid-template-columns: 1fr; }
  .day { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--space); }
  .day + .day { border-left: 0; border-top: 1px solid var(--line); }
  .series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day-series-date { display: block; margin-inline: .15rem; color: var(--muted); font-size: .82rem; }
  .day.today { box-shadow: inset 2px 0 0 var(--accent); }
  .day-heading { margin: 0; }
  .day-label time { font-size: 1.2rem; margin: 0; }
  .day-empty { align-self: center; }
  .event { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
