/* Livetikka – Oberfläche v0.3
   Dunkel wie Apple Sports, kompakte Spielliste, Spieldetail als Karte von unten.
   Schrift: Systemschrift (auf dem iPhone SF Pro) – nichts wird von fremden Servern geladen. */

:root {
  --bg: #0B0A0D;
  --bg-2: #141216;
  --fg: #F5F6F8;
  --fg-2: rgba(255,255,255,.72);
  --fg-3: rgba(255,255,255,.58);
  --glass: rgba(255,255,255,.055);
  --glass-2: rgba(255,255,255,.085);
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.065);
  --live: #FF453A;
  --live-fg: #FF6B61;
  --win: #30D158;
  --draw: #8E8E93;
  --home: #FDB912;
  --away: #5B8CFF;
  --glow-a: rgba(0,0,0,0);
  --glow-b: rgba(0,0,0,0);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .9, .25, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #000; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
body {
  margin: 0; min-height: 100vh; background: #000; color: var(--fg);
  font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #9DB8FF; outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Grundgerüst ---------- */
.shell {
  position: relative; z-index: 1; min-height: 100vh; background: var(--bg);
  transform-origin: 50% 0; transition: transform .45s var(--ease), border-radius .45s var(--ease), filter .45s var(--ease);
}
.ambient { position: absolute; inset: 0 0 auto 0; height: 520px; pointer-events: none; overflow: hidden; z-index: 0; }
.ambient::before, .ambient::after { content: ''; position: absolute; width: 520px; height: 460px; border-radius: 50%; transition: background .6s ease; }
.ambient::before { top: -220px; left: -180px; background: radial-gradient(closest-side, var(--glow-a), transparent); }
.ambient::after { top: -200px; right: -200px; background: radial-gradient(closest-side, var(--glow-b), transparent); }
.topbar { display: none; }
.layout { position: relative; z-index: 1; padding: calc(10px + var(--safe-t)) 12px calc(96px + var(--safe-b)); max-width: 680px; margin: 0 auto; }
.col-main, .col-detail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-nav { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px 12px calc(6px + var(--safe-b));
  background: rgba(16,14,18,.78); border-top: 1px solid var(--line-2);
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%);
}
.tabbar a { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.55); }
.tabbar a[aria-current="page"] { color: var(--fg); }
.tabbar svg { width: 24px; height: 24px; }

/* ---------- Kopf ---------- */
.head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 24px; width: auto; display: block; }
.head-r { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.demo-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(255,214,10,.14); color: #FFD60A; font-size: 11px; font-weight: 700; white-space: nowrap; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; flex: none; padding: 0; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); color: var(--fg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.sub { font-size: 13px; font-weight: 600; color: var(--fg-3); }

/* Datumsleiste */
.days { display: flex; gap: 2px; margin: 0 -12px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; min-width: 62px; height: 46px; border-radius: 14px; padding: 0 8px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--fg-3); position: relative;
}
.day span { font-size: 11px; font-weight: 600; }
.day b { font-size: 14px; font-weight: 700; color: var(--fg-2); }
.day[aria-current="date"] { background: rgba(255,255,255,.1); }
.day[aria-current="date"] span { color: var(--fg); }
.day[aria-current="date"] b { color: var(--fg); font-weight: 800; }
.day[aria-current="date"]::after { content: ''; position: absolute; bottom: 4px; width: 18px; height: 3px; border-radius: 2px; background: var(--fg); }

/* Filter */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); font-size: 13px; font-weight: 600; }
.chip em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--live-fg); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: transparent; font-weight: 700; }
.chip[aria-pressed="true"] em { color: #C2281F; }

/* ---------- Karten ---------- */
.card { border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); }
.card-pad { padding: 14px 16px; }
.card h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.link-more { min-height: 36px; display: inline-flex; align-items: center; gap: 1px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.link-more svg { width: 15px; height: 15px; }

/* Wappen: echtes Logo oder Kreis in Vereinsfarben */
.crest {
  --s: 20px; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--c1); color: var(--tc); box-shadow: inset 0 0 0 calc(var(--s) / 16) var(--c2);
  font-size: calc(var(--s) * .3); font-weight: 900; letter-spacing: -.02em; line-height: 1;
}
.crest.has-logo { background: transparent; box-shadow: none; border-radius: 0; }
.crest img { width: 100%; height: 100%; object-fit: contain; display: block; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); flex: none; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,69,58,.7); } 100% { box-shadow: 0 0 0 6px rgba(255,69,58,0); } }

/* ---------- Kompakte Spielliste ---------- */
.league { border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); overflow: hidden; }
.league-head { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; height: 40px; background: rgba(255,255,255,.05); border-bottom: 1px solid var(--line-2); }
.league-head .code { height: 20px; min-width: 28px; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.1); font-size: 10px; font-weight: 800; letter-spacing: .04em; display: inline-flex; align-items: center; justify-content: center; }
.league-head h2 { margin: 0; flex: 1; min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-head h2 span { color: var(--fg-3); font-weight: 600; }
.row {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 54px minmax(0, 1fr) 34px;
  align-items: center; gap: 6px; min-height: 48px; padding: 0 4px 0 10px;
}
.row + .row { border-top: 1px solid var(--line-2); }
.row:active { background: rgba(255,255,255,.05); }
.row[aria-current="true"] { background: rgba(255,255,255,.08); }
.row .cover { position: absolute; inset: 0; z-index: 1; }
.row .st { font-size: 12.5px; font-weight: 600; color: var(--fg-3); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.row .st.live { color: var(--live-fg); font-weight: 800; }
.row .tm { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; font-weight: 600; }
.row .tm.h { justify-content: flex-end; text-align: right; }
.row .tm .n { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tm.lose { color: var(--fg-3); }
.row .tm.win { font-weight: 750; }
.row .sc { justify-self: center; min-width: 46px; height: 26px; padding: 0 6px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 14.5px; font-weight: 800; background: rgba(255,255,255,.07); }
.row .sc.live { color: #FF8A82; background: rgba(255,69,58,.14); }
.row .sc.ns { font-weight: 600; color: var(--fg-3); background: transparent; }
.row .sc.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 35% { background: rgba(48,209,88,.45); color: #fff; transform: scale(1.12); } 100% { transform: none; } }
.bell { position: relative; z-index: 2; width: 34px; height: 44px; border: 0; background: transparent; color: rgba(255,255,255,.45); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.bell svg { width: 17px; height: 17px; }
.bell[aria-pressed="true"] { color: #FFD60A; }

@media (max-width: 419px) {
  .layout { padding-left: 8px; padding-right: 8px; }
  .days { margin: 0 -8px; padding: 0 8px; }
  .row { grid-template-columns: 38px minmax(0, 1fr) 46px minmax(0, 1fr) 28px; gap: 5px; padding: 0 2px 0 8px; }
  .row .tm { font-size: 13.5px; gap: 6px; }
  .row .sc { min-width: 42px; font-size: 14px; padding: 0 4px; }
  .row .st { font-size: 12px; }
  .bell { width: 28px; }
}

/* Hervorgehobenes Spiel (Meine Teams) */
.feature {
  position: relative; display: flex; flex-direction: column; gap: 10px; border-radius: 24px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--fa) 0%, rgba(40,20,50,.5) 55%, var(--fb) 100%);
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 18px 36px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.1);
}
.feature .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.82); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,69,58,.22); color: #FF9A93; font-size: 12px; font-weight: 800; white-space: nowrap; }
.pill-muted { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.25); font-size: 12px; font-weight: 700; color: rgba(255,255,255,.88); }
.vs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; }
.vs .side { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.vs .side .n { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.vs .side .f { font-size: 12px; font-weight: 600; color: var(--fg-2); }
.vs .score { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vs .score b { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.vs .score small { font-size: 12px; font-weight: 600; color: var(--fg-2); }

/* ---------- Spieldetail ---------- */
.hero {
  border-radius: 26px; padding: 18px 14px 16px; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(160deg, var(--fa) 0%, rgba(40,18,48,.55) 55%, var(--fb) 100%);
  border: 1px solid rgba(255,255,255,.12);
}
.hero .lg { text-align: center; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); }
.hero .vs .score b { font-size: 50px; }
.hero .vs { align-items: start; }
.hero .vs .score { padding-top: 14px; }
.scorers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.85); }
.scorers div { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; }
.follow { align-self: center; height: 42px; padding: 0 20px; border-radius: 999px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.12); }
.follow svg { width: 17px; height: 17px; }
.follow[aria-pressed="true"] { background: rgba(255,255,255,.92); color: var(--bg); border-color: transparent; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.seg button { height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--fg-2); font-size: 13.5px; font-weight: 600; }
.seg button[aria-selected="true"] { background: rgba(255,255,255,.92); color: var(--bg); font-weight: 700; }

/* Matchcast */
.pitch { position: relative; height: 196px; border-radius: 14px; overflow: hidden; background: repeating-linear-gradient(90deg, #12392A 0 32px, #154231 32px 64px); }
.pitch .ln { position: absolute; border: 1.5px solid rgba(255,255,255,.35); }
.pitch .ball { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.22), 0 0 18px rgba(255,255,255,.8); transition: left 1.2s ease, top 1.2s ease; }
.pitch .trail { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: rgba(255,255,255,.35); }
.pitch .tag { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(10,11,15,.62); font-size: 11.5px; font-weight: 700; }

/* Statistik */
.stat { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.stat .v { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat .v b { font-size: 15px; font-weight: 800; min-width: 44px; }
.stat .v b:last-child { text-align: right; }
.stat .v span { font-size: 12.5px; font-weight: 600; color: var(--fg-2); text-align: center; }
.bars { display: flex; gap: 4px; height: 5px; }
.bars div { flex: 1; display: flex; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; }
.bars div:first-child { justify-content: flex-end; }
.bars i { display: block; height: 100%; border-radius: 3px; transition: width .6s ease; }
.bars div:first-child i { background: var(--home); }
.bars div:last-child i { background: var(--away); }
.legend { display: flex; gap: 10px; font-size: 11.5px; font-weight: 700; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }

/* Ticker */
.ev { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.ev .m { width: 42px; flex: none; font-size: 13px; font-weight: 800; color: rgba(255,255,255,.85); padding-top: 6px; }
.ev .ic { width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.ev .ic svg { width: 16px; height: 16px; }
.ev .ic.goal { background: rgba(48,209,88,.18); color: #4CE07A; }
.ev .ic i { width: 10px; height: 14px; border-radius: 2px; background: #FFD60A; }
.ev .ic.yellow { background: rgba(255,214,10,.14); }
.ev .ic.red { background: rgba(255,69,58,.16); }
.ev .ic.red i { background: var(--live); }
.ev .ic.yellowred i { background: linear-gradient(135deg, #FFD60A 50%, var(--live) 50%); }
.ev .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.ev .tx b { font-size: 14px; font-weight: 700; }
.ev .tx span { font-size: 12.5px; color: rgba(255,255,255,.68); line-height: 1.4; }
.ev .crest { --s: 20px; margin-top: 5px; }
.empty { padding: 12px 0 8px; border-top: 1px solid var(--line-2); font-size: 13.5px; color: rgba(255,255,255,.68); }

/* Tabellen */
.tbl-head, .tbl-row { display: flex; align-items: center; gap: 7px; padding: 0 6px; }
.tbl-head { padding: 9px 6px 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: rgba(255,255,255,.55); text-transform: uppercase; }
.tbl-row { min-height: 40px; border-radius: 10px; }
.tbl-row.hl { background: rgba(255,255,255,.09); }
.tbl-row.hl .tn { font-weight: 800; }
.pos { width: 22px; height: 22px; border-radius: 7px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--fg-2); }
.pos.up { background: #30D158; color: var(--bg); }
.pos.uppo { background: rgba(48,209,88,.35); color: var(--fg); }
.pos.cl { background: #5B8CFF; color: var(--bg); }
.pos.clq { background: rgba(91,140,255,.35); color: var(--fg); }
.pos.el { background: #FF9F0A; color: var(--bg); }
.pos.ecl { background: rgba(255,159,10,.35); color: var(--fg); }
.pos.relpo { background: rgba(255,69,58,.35); color: var(--fg); }
.pos.rel { background: var(--live); color: var(--bg); }
.tteam { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.tn { min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-sp, .c-td { text-align: right; font-size: 13px; font-weight: 600; color: var(--fg-2); flex: none; }
.c-sp { width: 20px; } .c-td { width: 30px; }
.c-x { display: none; width: 24px; text-align: right; font-size: 13px; font-weight: 600; color: var(--fg-2); flex: none; }
.c-pkt { width: 28px; text-align: right; font-size: 14px; font-weight: 800; flex: none; }
.c-form { width: 50px; display: flex; justify-content: flex-end; gap: 3px; flex: none; }
.c-form i { width: 7px; height: 7px; border-radius: 50%; }
.f-W { background: var(--win); } .f-D { background: var(--draw); } .f-L { background: var(--live); }
.tbl-legend { display: flex; flex-direction: column; gap: 9px; padding: 4px 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.tbl-legend span { display: inline-flex; align-items: center; gap: 10px; }
.tbl-legend i { width: 13px; height: 13px; border-radius: 4px; }
.tbl-legend .forms { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.tbl-legend .forms i { width: 8px; height: 8px; border-radius: 50%; }

/* Zustände */
.skel { border-radius: var(--radius); background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.09), rgba(255,255,255,.05)); background-size: 200% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.notice { padding: 22px 18px; text-align: center; color: var(--fg-2); font-size: 14.5px; line-height: 1.5; }
.notice b { display: block; color: var(--fg); font-size: 16px; margin-bottom: 4px; }
.btn { height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); font-size: 14.5px; font-weight: 700; margin-top: 12px; }
.foot { text-align: center; font-size: 11.5px; color: rgba(255,255,255,.45); padding: 4px 0; }

/* ---------- Karte von unten (Spieldetail auf Handy und Tablet) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
.sheet-date { position: fixed; z-index: 31; left: 0; right: 0; top: calc(var(--safe-t) + 10px); text-align: center; font-size: 15px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); }
.sheet {
  position: fixed; z-index: 32; left: 6px; right: 6px; top: calc(var(--safe-t) + 42px); bottom: 0;
  border-radius: 28px 28px 0 0; background: var(--bg-2); overflow: hidden;
  transform: translateY(105%); visibility: hidden;
  transition: transform .5s var(--ease), top .38s var(--ease), left .38s var(--ease), right .38s var(--ease), border-radius .38s var(--ease), visibility 0s linear .5s;
  box-shadow: 0 -10px 40px rgba(0,0,0,.5);
}
.sheet::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 520px; pointer-events: none; background: linear-gradient(180deg, var(--sa, rgba(120,20,40,.6)) 0%, rgba(20,18,22,0) 100%); opacity: .9; }
.sheet-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 10px calc(28px + var(--safe-b)); }
.sheet-scroll .col-detail { position: relative; gap: 12px; }
.grab { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; height: 46px; margin: 0 -10px; padding: 0 10px; }
.grab::before { content: ''; position: absolute; left: 50%; top: 7px; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: rgba(255,255,255,.35); transition: opacity .25s; }
.grab .mini { position: absolute; left: 56px; right: 56px; top: 0; height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; font-size: 15px; font-weight: 800; }
.grab .mini small { font-size: 11px; font-weight: 700; color: var(--live-fg); }
.grab .icon-btn { width: 34px; height: 34px; position: relative; z-index: 2; }
.grab .icon-btn svg { width: 16px; height: 16px; }
.grab-bg { position: absolute; inset: 0; background: rgba(20,18,22,.82); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border-bottom: 1px solid var(--line-2); opacity: 0; transition: opacity .25s; }

html.sheet-open .sheet { transform: translateY(0); visibility: visible; transition: transform .5s var(--ease), top .38s var(--ease), left .38s var(--ease), right .38s var(--ease), border-radius .38s var(--ease), visibility 0s; }
html.sheet-open .sheet-bg { opacity: 1; pointer-events: auto; }
html.sheet-open .sheet-date { opacity: 1; }
html.sheet-open .shell { transform: scale(.94); border-radius: 22px; filter: brightness(.55); overflow: hidden; }
html.sheet-full .sheet { top: 0; left: 0; right: 0; border-radius: 0; }
html.sheet-full .sheet-date { opacity: 0; }
html.sheet-full .grab { padding-top: var(--safe-t); height: calc(46px + var(--safe-t)); }
html.sheet-full .grab::before { opacity: 0; }
html.sheet-full .grab .mini { opacity: 1; transform: none; top: var(--safe-t); }
html.sheet-full .grab-bg { opacity: 1; }
.sheet.dragging { transition: none !important; }
.hero.swipe-l { animation: swipeL .3s var(--ease); }
.hero.swipe-r { animation: swipeR .3s var(--ease); }
@keyframes swipeL { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes swipeR { from { transform: translateX(-40px); opacity: .3; } to { transform: none; opacity: 1; } }

/* Tor-Meldung */
.toasts { position: fixed; top: calc(10px + var(--safe-t)); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; width: min(420px, 100%); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: rgba(30,28,34,.9); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toastIn .35s var(--ease); }
.toast .ic { width: 34px; height: 34px; border-radius: 50%; background: rgba(48,209,88,.18); color: #4CE07A; display: flex; align-items: center; justify-content: center; flex: none; }
.toast .ic svg { width: 19px; height: 19px; }
.toast b { display: block; font-size: 14.5px; }
.toast span { font-size: 12.5px; color: var(--fg-2); }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  .sheet, .shell, .sheet-bg { transition-duration: .01s !important; }
}

/* ---------- Tablet ---------- */
@media (min-width: 720px) {
  .tabbar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; align-items: center; gap: 10px 22px;
    padding: calc(12px + var(--safe-t)) clamp(16px, 3vw, 40px) 12px;
    background: rgba(16,14,18,.7); border-bottom: 1px solid var(--line-2); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  }
  .topbar .logo img { height: 26px; }
  .topbar nav { display: flex; gap: 4px; }
  .topbar nav a { min-height: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 14.5px; font-weight: 600; color: var(--fg-2); }
  .topbar nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: var(--fg); font-weight: 700; }
  .topbar .spacer { flex: 1; }
  .layout { padding: 20px clamp(16px, 3vw, 40px) 48px; max-width: 820px; }
  .m-only { display: none !important; }
  .c-x { display: block; }
  .sheet { left: max(6px, calc(50% - 360px)); right: max(6px, calc(50% - 360px)); top: calc(var(--safe-t) + 52px); }
  html.sheet-full .sheet { left: max(0px, calc(50% - 400px)); right: max(0px, calc(50% - 400px)); }
  .row { grid-template-columns: 56px minmax(0, 1fr) 60px minmax(0, 1fr) 40px; min-height: 50px; padding-left: 14px; }
  .row .tm { font-size: 15px; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1100px) {
  .layout { max-width: 1440px; display: grid; gap: 20px; align-items: start; grid-template-columns: 220px minmax(0, 1fr) minmax(360px, 420px); }
  .layout.no-detail { grid-template-columns: 220px minmax(0, 1fr); max-width: 1180px; }
  .col-nav { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 88px; }
  .col-nav h2 { margin: 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.55); }
  .col-nav .card { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
  .col-nav a { min-height: 42px; padding: 0 10px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
  .col-nav a:hover { background: rgba(255,255,255,.05); }
  .col-nav a[aria-current="page"] { background: rgba(255,255,255,.08); }
  .col-nav a em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--live-fg); }
  .col-nav .code { height: 20px; min-width: 28px; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.1); font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
  .layout > .col-detail { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 24px; }
  .row:hover { background: rgba(255,255,255,.04); }
  .sheet, .sheet-bg, .sheet-date { display: none; }
}
