/* Fotboll – "Matchday": ljust, redaktionellt sport-tema. Mobile-first.
   Varmt papper, kraftig ink-typografi, hårfina linjer, flytande spelplans-hubb. */

:root {
  --paper: #f4f1ea;
  --paper-2: #ece7db;
  --card: #ffffff;
  --ink: #17191e;
  --ink-soft: #3b3f47;
  --muted: #757a83;
  --line: #e7e1d3;
  --accent: #16181d;        /* aktiv/ink-accent */
  --brand: #e4502b;         /* signalfärg (flourish) */
  --live: #e23b2e;
  --comp: #c8a24a;          /* tävlingsaccent, sätts inline */
  --gold: #c79a3a;
  --silver: #9aa0a8;
  --radius: 16px;
  --header-h: 54px;
  --maxw: 680px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 1px 2px rgba(24,22,18,.04), 0 6px 22px rgba(24,22,18,.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; padding: 0; }
img { display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.grow { flex: 1; }

/* ----- Skal ----- */
#app { height: 100dvh; }
.app-shell { display: flex; flex-direction: column; height: 100dvh; max-width: var(--maxw); margin: 0 auto; position: relative; background: var(--paper); }

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-header.ghost { min-height: var(--safe-top); height: var(--safe-top); padding: 0; border-bottom: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hbtn { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); font-size: 14px; font-weight: 600; padding: 9px 4px; }
.hbtn .chev-back { display: inline-flex; }
.hbtn-spacer { width: 1px; }
.head-mid { display: flex; flex-direction: column; align-items: center; margin: 0 auto; line-height: 1.15; max-width: 60%; }
.head-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.app-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 16px calc(80px + var(--safe-bottom)); }
.section-large { font-size: 34px; font-weight: 850; letter-spacing: -0.03em; margin: 10px 0 14px; }
.section-large::after { content: ""; display: block; width: 34px; height: 4px; border-radius: 3px; background: var(--brand); margin-top: 8px; }

/* ----- Flytande spelplans-hubb ----- */
.hub { position: fixed; left: 50%; margin-left: -32px; bottom: calc(20px + var(--safe-bottom)); width: 64px; height: 64px; z-index: 60; }
.hub-scrim { position: fixed; inset: 0; background: rgba(20,18,14,.20); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: -1; }
.hub.open .hub-scrim { opacity: 1; pointer-events: auto; }
.hub-toggle {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 10px 26px rgba(24,20,12,.30); transition: transform .3s cubic-bezier(.2,1.2,.4,1); z-index: 2;
}
.hub-toggle:active { transform: scale(.93); }
.hub.open .hub-toggle { transform: rotate(-22deg); }
.hub-ball { width: 64px; height: 64px; display: block; }
.hub-ball svg { width: 100%; height: 100%; display: block; }
.hub-arc { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 3; }
.hub-item {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px 7px 8px; box-shadow: 0 6px 20px rgba(24,20,12,.16);
  transform: translate(-50%, -50%) scale(.3); opacity: 0; pointer-events: none;
  transition: transform .34s cubic-bezier(.2,1.35,.4,1), opacity .22s;
}
.hub.open .hub-item {
  transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1);
  opacity: 1; pointer-events: auto; transition-delay: var(--d);
}
.hub-item .hub-ic { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--paper-2); color: var(--ink); flex: none; }
.hub-item .hub-ic svg { width: 18px; height: 18px; }
.hub-item .hub-lbl { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.hub-item.active { background: var(--ink); border-color: var(--ink); }
.hub-item.active .hub-ic { background: rgba(255,255,255,.16); color: var(--paper); }
.hub-item.active .hub-lbl { color: var(--paper); }

/* ----- Emblem/crest ----- */
.crest { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(20,18,14,.08); }
.crest img { width: 100%; height: 100%; object-fit: contain; }
.crest-fallback { font-weight: 800; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); font-size: 11px; }
.crest.flag img { object-fit: cover; }

/* ----- Kort & sektioner ----- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: var(--ink); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 9px; }
.data-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.data-row:last-child { border-bottom: none; }
.dr-label { color: var(--muted); }
.dr-value { font-weight: 650; text-align: right; }

/* ----- Tävlingsväljare ----- */
.intro { margin: -4px 2px 14px; font-size: 14px; }
.region-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 22px 2px 9px; }
.comp-grid { display: flex; flex-direction: column; gap: 10px; }
.comp-card {
  display: flex; align-items: stretch; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.comp-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); z-index: 1; }
.comp-card.coming { box-shadow: none; background: transparent; border-style: dashed; }
.comp-card.coming::before { background: var(--line); }
.comp-card-main { flex: 1; display: flex; align-items: center; gap: 13px; text-align: left; padding: 14px; min-width: 0; }
.comp-card-main:active { background: var(--paper); }
.comp-emblem { display: flex; margin-left: 4px; }
.comp-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.comp-name { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.comp-card.coming .comp-name { color: var(--ink-soft); }
.comp-sub { color: var(--muted); font-size: 12.5px; }
.soon-tag { font-size: 10.5px; font-weight: 800; color: var(--muted); background: var(--paper-2); border-radius: 999px; padding: 4px 10px; text-transform: uppercase; letter-spacing: .04em; }
.chev { color: var(--muted); font-size: 24px; line-height: 1; font-weight: 300; }

/* ----- Verktygsrad / segment ----- */
.toolbar { display: flex; justify-content: center; position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 2px 0 14px; }
.segmented { display: inline-flex; background: var(--paper-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg { padding: 7px 16px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .15s; }
.seg.active { background: var(--ink); color: var(--paper); }

/* ----- Matchlista ----- */
.match-list { display: flex; flex-direction: column; }
.day-header { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--ink); margin: 18px 2px 4px; }
.day-hint { font-weight: 700; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.live-dot-title { color: var(--live); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(226,59,46,.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(226,59,46,.5);} 70% { box-shadow: 0 0 0 7px rgba(226,59,46,0);} 100% { box-shadow: 0 0 0 0 rgba(226,59,46,0);} }

.mlist-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 6px; }
.mlist-card.live { border-color: color-mix(in srgb, var(--live) 35%, var(--line)); }
.match-row {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.match-row:last-child { border-bottom: none; }
.match-row:active { background: var(--paper); }
.match-row.is-live { background: color-mix(in srgb, var(--live) 5%, transparent); }
.mr-status { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.mr-status.live { color: var(--live); font-weight: 800; }
.mr-min { font-weight: 800; }
.mr-time { font-weight: 700; color: var(--ink); font-size: 14px; }
.mr-ft { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.mr-teams { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.mr-side { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 9px; min-width: 0; }
.mr-team { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.mr-side.win .mr-team { color: var(--ink); font-weight: 800; }
.mr-side.tbd .mr-team, .sb-team.tbd .sb-name { color: var(--muted); font-style: italic; font-weight: 600; }
.mr-score { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 14px; text-align: right; color: var(--ink); font-size: 16px; }
.mr-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.mr-note { font-size: 10px; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.mr-stage { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ----- Tabell ----- */
.table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl-row { display: grid; grid-template-columns: 30px 1fr 26px 26px 26px 26px 34px 32px; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl-row:last-child { border-bottom: none; }
.tbl-head { color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tbl-row.tappable:active { background: var(--paper); }
.c-pos { display: flex; }
.c-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tbl-team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.c-num { text-align: center; font-size: 13px; color: var(--ink-soft); }
.c-num.strong { color: var(--ink); font-weight: 850; }
.pos-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; font-size: 12px; font-weight: 800; color: var(--ink); }
.group-card.tappable { cursor: pointer; transition: background .12s, border-color .12s; }
.group-card.tappable:active { background: var(--paper); border-color: color-mix(in srgb, var(--comp) 45%, var(--line)); }
.group-card .section-title { margin: 6px 2px 8px; }
.group-cta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--comp); text-transform: uppercase; letter-spacing: .04em; }
.group-cta .chev-back.open { display: inline-flex; }
.group-lead { margin: 2px 2px 14px; }
.legend { margin: 12px 4px 0; }
@media (max-width: 380px) { .hide-narrow { display: none; } .tbl-row { grid-template-columns: 28px 1fr 26px 34px 32px; } }

/* ----- Skytteligan ----- */
.scorers { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.scorers .section-title { padding: 12px 14px 0; margin: 0; }
.scorer-row { display: grid; grid-template-columns: 26px 28px 1fr auto; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.scorer-row:last-child { border-bottom: none; }
.scorer-row.tappable:active { background: var(--paper); }
.sc-rank { color: var(--muted); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.sc-info { display: flex; flex-direction: column; min-width: 0; }
.sc-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-goals { display: flex; align-items: baseline; gap: 5px; }
.sc-goals strong { font-size: 20px; font-weight: 850; }

/* ----- Resultattavla ----- */
.scoreboard { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 14px 16px; text-align: center; margin-bottom: 14px; box-shadow: var(--shadow); position: relative; }
.scoreboard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; border-radius: 20px 20px 0 0; background: var(--comp); }
.scoreboard.live::before { background: var(--live); }
.sb-stage { font-size: 11.5px; font-weight: 800; color: var(--comp); text-transform: uppercase; letter-spacing: .06em; min-height: 14px; margin-top: 4px; }
.sb-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 14px 0 10px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.sb-name { font-weight: 800; font-size: 14px; }
.sb-score { display: inline-flex; align-items: center; gap: 12px; font-size: 44px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.sb-dash { color: var(--muted); font-weight: 300; }
.sb-score.sb-vs { font-size: 22px; color: var(--muted); font-weight: 700; }
.sb-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.sb-status.live { color: var(--live); }

.meta-card { padding: 2px 14px; }
.meta-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.meta-item:last-child { border-bottom: none; }
.meta-ic { width: 19px; height: 19px; color: var(--muted); flex: none; }
.meta-ic svg { width: 100%; height: 100%; }

/* ----- Domare ----- */
.ref-row { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ref-row:last-child { border-bottom: none; }
.ref-ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.ref-ic svg { width: 100%; height: 100%; }
.ref-info { display: flex; flex-direction: column; }
.ref-name { font-weight: 700; }
.ref-role { text-transform: uppercase; letter-spacing: .04em; }

/* ----- Matchsektioner ----- */
.match-section { margin: 20px 0; }
.ms-title { font-size: 12.5px; font-weight: 800; color: var(--ink); text-transform: uppercase; letter-spacing: .05em; margin: 0 2px 10px; }
.ms-body { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* ----- Tidslinje ----- */
.timeline { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 14px 6px 0; }
.timeline::before { content: ""; position: absolute; left: 64px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.tl-row { position: relative; display: grid; grid-template-columns: 50px 16px 1fr auto; align-items: center; gap: 8px; padding: 9px 0; }
.tl-time { text-align: right; font-size: 11.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; justify-self: center; background: var(--paper); border: 2px solid var(--muted); z-index: 1; }
.tl-dot.goal { background: var(--ink); border-color: var(--ink); width: 13px; height: 13px; }
.tl-dot.card-yellow { background: #f2c200; border-color: #f2c200; }
.tl-dot.card-red, .tl-dot.card-yellowred { background: var(--live); border-color: var(--live); }
.tl-dot.sub { background: var(--brand); border-color: var(--brand); }
.tl-label { font-weight: 700; }
.tl-note { margin-left: 8px; font-variant-numeric: tabular-nums; font-weight: 850; color: var(--ink); }
.tl-phase .tl-dot { background: var(--ink); border-color: var(--ink); }
.tl-phase .tl-label { text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; }
.tl-live .tl-dot { background: var(--live); border-color: var(--live); animation: pulse 1.6s infinite; }
.tl-live .tl-label { color: var(--live); }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-main { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.tl-sub { margin-top: 1px; }
.tl-score { font-variant-numeric: tabular-nums; font-weight: 850; }

/* ----- Startelvor ----- */
.lineups { display: grid; grid-template-columns: 1fr 1fr; }
.lineup-col { padding: 12px; }
.lineup-col:first-child { border-right: 1px solid var(--line); }
.lineup-team { display: flex; align-items: center; gap: 8px; font-weight: 800; width: 100%; margin-bottom: 4px; }
.formation { display: block; margin-bottom: 8px; }
.bench-label { display: block; margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.player-line { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.shirt { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; font-size: 11px; font-weight: 800; color: var(--ink-soft); background: var(--paper-2); border-radius: 6px; }
.pl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }

/* ----- Statistik ----- */
.stat-row { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: none; }
.stat-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.stat-h { font-weight: 850; font-variant-numeric: tabular-nums; }
.stat-a { font-weight: 850; text-align: right; font-variant-numeric: tabular-nums; }
.stat-label { text-align: center; }
.stat-track { display: flex; gap: 4px; margin-top: 7px; height: 6px; }
.stat-fill { border-radius: 3px; height: 100%; }
.stat-fill.h { background: var(--ink); } .stat-fill.a { background: var(--paper-2); }

/* ----- Lagvy ----- */
.team-header { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0 20px; }
.team-name { margin: 0; font-size: 24px; font-weight: 850; text-align: center; letter-spacing: -0.02em; }
.team-tla { font-weight: 800; letter-spacing: .1em; }
.squad-group { margin-bottom: 6px; }
.player-row { display: flex; align-items: center; gap: 13px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.pr-info { display: flex; flex-direction: column; }
.pr-name { font-weight: 700; }

/* ----- Tillstånd / spinner / toast / modal ----- */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 52px 24px; color: var(--muted); }
.state-icon { font-size: 32px; }
.state h3 { margin: 0; color: var(--ink); }
.spinner-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20,18,14,.18); z-index: 100; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 120; pointer-events: none; padding: 0 16px; }
.toast { max-width: var(--maxw); background: var(--ink); border: none; color: var(--paper); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(20,18,14,.30); opacity: 0; transform: translateY(10px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--live); }

.modal-backdrop { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(20,18,14,.40); z-index: 130; padding: 16px; }
.modal-card { width: 100%; max-width: var(--maxw); background: var(--card); border-radius: 20px; padding: 18px; margin-bottom: calc(var(--safe-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.modal-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.btn { padding: 13px; border-radius: 12px; font-weight: 700; text-align: center; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { background: var(--paper-2); color: var(--ink); }
.btn-danger { background: var(--live); color: #fff; }

/* ===== Kickstat: varumärke ===== */
.brand { display: flex; align-items: center; gap: 12px; padding: 14px 2px 18px; }
.brand-mark { width: 44px; height: 44px; flex: none; filter: drop-shadow(0 4px 10px rgba(20,18,14,.18)); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: .92; }
.brand-1 { font-size: 30px; font-weight: 900; letter-spacing: -0.035em;
  background: linear-gradient(95deg, var(--ink), #3a4250); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-2 { font-size: 15px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; color: var(--brand); margin-left: 2px; }

.home-h2 { font-size: 19px; font-weight: 850; letter-spacing: -0.02em; margin: 18px 2px 8px; }
.home-empty { text-align: center; padding: 36px 20px; }
.home-empty .state-icon { font-size: 34px; }
.comp-row-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 2px 6px; }

/* Dag-för-dag-navigering på Hem */
.day-nav { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 8px 0 10px; margin-top: 4px; }
.day-nav-label { flex: 1; text-align: center; font-size: 19px; font-weight: 850; letter-spacing: -0.02em; }
.day-arrow { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
.day-arrow:disabled { opacity: .35; box-shadow: none; }
.day-arrow:not(:disabled):active { background: var(--paper-2); }
.day-arrow svg { display: block; }

/* ===== Favoriter ===== */
.fav-section { margin-bottom: 6px; }
.fav-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
.fav-chip { display: inline-flex; align-items: center; gap: 8px; flex: none; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 999px; padding: 7px 14px 7px 7px; font-weight: 700; font-size: 14px; }
.fav-chip:active { background: var(--paper-2); }
.fav-star { display: inline-flex; align-items: center; justify-content: center; width: 38px; flex: none; color: var(--muted); }
.fav-star svg { width: 21px; height: 21px; }
.fav-star.on { color: var(--gold); }

/* ===== Liga-header (CompetitionView) ===== */
.comp-head { position: sticky; top: 0; z-index: 6; background: var(--paper); padding-top: 6px; margin-bottom: 6px; }
.comp-head-id { display: flex; align-items: center; gap: 12px; padding: 4px 2px 12px; }
.comp-head-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.comp-head-name { font-size: 24px; font-weight: 850; letter-spacing: -0.02em; }
.comp-head-sub { margin-top: 1px; }
.comp-head .fav-star { color: var(--muted); }
.comp-seg { display: flex; }
.comp-seg .segmented { width: 100%; }
.comp-seg .seg { flex: 1; }

/* ===== Lag: genvägar ===== */
.team-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.team-link { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 13px 14px; font-weight: 700; text-align: left; }
.team-link:active { background: var(--paper-2); }
.squad-pos { text-transform: uppercase; letter-spacing: .05em; font-weight: 800; margin: 12px 2px 4px; }
.team-header .fav-star { width: 44px; }
.team-header .fav-star svg { width: 26px; height: 26px; }

/* ===== Inställningar ===== */
.set-region { margin-bottom: 8px; }
.set-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-name { flex: 1; font-weight: 700; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); position: relative; flex: none; transition: background .18s; }
.switch.on { background: var(--ink); border-color: var(--ink); }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch.on .switch-knob { transform: translateX(18px); }

/* ===== Bottenrad (hus + menytrigger) ===== */
.menu-bar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 4px; padding: 7px 10px;
  background: var(--ink); color: var(--paper); border-radius: 999px; box-shadow: 0 10px 28px rgba(20,18,14,.32);
}
.menu-home { width: 42px; height: 42px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--paper); }
.menu-home:active { background: rgba(255,255,255,.14); }
.menu-home svg { width: 22px; height: 22px; }
.menu-sep { width: 1px; height: 24px; background: rgba(255,255,255,.22); margin: 0 4px; }
.menu-open { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 20px 8px 12px; color: var(--paper); border-radius: 999px; }
.menu-open:active { background: rgba(255,255,255,.10); }
.menu-grab { position: absolute; top: 1px; left: 50%; transform: translateX(-50%); width: 30px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.4); }
.menu-ball { width: 28px; height: 28px; display: inline-flex; }
.menu-ball svg { width: 100%; height: 100%; }
.menu-label { font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.menu-caret { display: inline-flex; opacity: .85; }

/* ===== Uppdragbar panel ===== */
.panel-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20,18,14,0); transition: background .25s; display: flex; align-items: flex-end; }
.panel-backdrop.open { background: rgba(20,18,14,.45); }
.panel-sheet {
  width: 100%; max-width: var(--maxw); margin: 0 auto; max-height: 86vh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.25);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.9,.3,1);
  padding: 0 16px calc(20px + var(--safe-bottom));
}
.panel-backdrop.open .panel-sheet { transform: translateY(0); }
.panel-head { position: sticky; top: 0; background: var(--paper); display: flex; align-items: center; gap: 10px; padding: 14px 2px 10px; z-index: 2; }
.panel-grabber { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 3px; background: var(--line); }
.panel-title { flex: 1; display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.panel-title .pt-1 { font-size: 19px; font-weight: 900; letter-spacing: -0.03em; }
.panel-title .pt-2 { font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); }
.panel-gear { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.panel-gear svg { width: 20px; height: 20px; }
.panel-h { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 2px 8px; }
.panel-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 13px; padding: 14px; font-weight: 800; font-size: 16px; margin-top: 4px; }
.panel-item:active { background: var(--paper-2); }
.pi-ic { width: 24px; height: 24px; color: var(--ink); display: inline-flex; }
.pi-ic svg { width: 100%; height: 100%; }
.panel-item .chev { margin-left: auto; }

.team-search { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 15px; color: var(--ink); }
.team-search:focus { outline: none; border-color: var(--ink); }
.team-results { display: flex; flex-direction: column; }
.team-result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.team-result:last-child { border-bottom: none; }
.tr-name { flex: 1; font-weight: 700; }

@media (min-width: 700px) {
  .app-shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
