/* Kaderblick — ruhiges, natives Design. System-Schrift (SF Pro auf Apple),
   Tiefe über Blur und weiche Schatten statt Rahmen, ein grüner Akzent. */

/* Markenakzent ist bewusst neutral (Graphit): Gruen und Rot bleiben allein
   der Richtung vorbehalten — steigt / faellt. */
:root {
  --ground: #f2f3f2;
  --surface: #ffffff;
  --surface-2: #f7f8f7;
  --ink: #101512;
  --ink-soft: rgba(16, 21, 18, 0.62);
  --ink-faint: rgba(16, 21, 18, 0.38);
  --hairline: rgba(16, 21, 18, 0.08);
  --accent: #2f3b35;
  --on-accent: #ffffff;
  --accent-tint: rgba(47, 59, 53, 0.08);
  --up: #0a8a54;
  --down: #d9382c;
  --warn: #b07b16;
  --track: rgba(16, 21, 18, 0.07);
  --glass: rgba(248, 249, 248, 0.82);
  --seg-bg: rgba(16, 21, 18, 0.055);
  --seg-active: #ffffff;
  --shadow-card: 0 1px 1px rgba(16, 21, 18, 0.03), 0 8px 28px rgba(16, 21, 18, 0.06);
  --shadow-pill: 0 1px 3px rgba(16, 21, 18, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0c0e0d;
    --surface: #181b19;
    --surface-2: #212522;
    --ink: #f2f4f2;
    --ink-soft: rgba(242, 244, 242, 0.6);
    --ink-faint: rgba(242, 244, 242, 0.36);
    --hairline: rgba(242, 244, 242, 0.09);
    --accent: #d8ded9;
    --on-accent: #101512;
    --accent-tint: rgba(216, 222, 217, 0.11);
    --up: #3ecf8e;
    --down: #ff6b5e;
    --warn: #e0b35a;
    --track: rgba(242, 244, 242, 0.09);
    --glass: rgba(18, 20, 19, 0.78);
    --seg-bg: rgba(242, 244, 242, 0.08);
    --seg-active: #2e332f;
    --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.2);
    --shadow-pill: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button {
  touch-action: manipulation;
  font-family: inherit;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}
button:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Login -------------------------------------------------- */
.login {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ground);
  z-index: 10;
  padding: 24px;
}
.login-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(320px, 100%);
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  border-radius: 15px;
  box-shadow: var(--shadow-card);
  margin-bottom: 6px;
}
.login-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }
.login-card input {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink);
  font-size: 16px;
  text-align: center;
}
.login-card input:focus { box-shadow: inset 0 0 0 2px var(--accent); outline: none; }
.login-card button {
  width: 100%;
  padding: 13px;
  min-height: 48px;
  margin-top: 4px;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 12px;
  font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.login-error { color: var(--down); font-size: 13px; }

/* ---- Topbar ------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; }
.brand img { border-radius: 7px; display: block; }
.brand strong { font-weight: 700; letter-spacing: -0.02em; }

/* Tabs als Segmented Control */
.tabs {
  display: flex; gap: 2px;
  background: var(--seg-bg);
  border-radius: 10px;
  padding: 2px;
}
.tabs .tab {
  border: none; background: transparent;
  color: var(--ink-soft);
  padding: 7px 18px;
  min-height: 34px;
  font-size: 13.5px; font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
.tabs .tab.active {
  background: var(--seg-active);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.updated { font-size: 12px; color: var(--ink-faint); }
.icon-btn {
  border: none;
  background: var(--seg-bg);
  color: var(--ink-soft);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:disabled { opacity: 0.4; }

main { max-width: 940px; margin: 0 auto; padding: 20px 16px 64px; }

/* Pull-to-Refresh */
.ptr {
  height: 0;
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  transition: height 0.15s ease-out;
}
.ptr span { padding-bottom: 8px; }
.ptr.ready { color: var(--accent); font-weight: 600; }

.demo-banner {
  display: inline-block;
  background: var(--accent-tint);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 16px;
  font-size: 12.5px; font-weight: 600;
}

/* ---- KPIs --------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 14px 18px 15px;
}
.kpi .label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.kpi .value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 2px;
}
.kpi .value.neg, .kpi .value.t-down { color: var(--down); }
.kpi .value.pos { color: var(--ink); }
.kpi .value.t-up { color: var(--up); }
.kpi .value.t-flat { color: var(--ink); }

/* ---- Cards -------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 6px;
}
.card-head h2 { margin: 0; }

/* ---- Liga: Manager-Liste ------------------------------------ */
.manager-list { display: flex; flex-direction: column; }
.manager-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.manager-row:last-child { border-bottom: none; padding-bottom: 4px; }
.manager-row .rank {
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}
.m-main { min-width: 0; }
.m-meta {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-numbers { text-align: right; }
.m-delta { font-size: 12.5px; font-weight: 600; margin-top: 1px; }
.kpi-lead .value { font-size: 30px; }
.kpi-sub { font-size: 12.5px; font-weight: 600; margin-top: 2px; color: var(--ink-faint); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.manager-row .m-name {
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.m-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manager-row .m-name .me-tag { margin-left: 0; flex-shrink: 0; }
.manager-row .m-name .me-tag { background: var(--seg-bg); color: var(--ink-soft); }
.manager-row .m-name .me-tag {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-tint);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: 2px;
}
.manager-row .bar-wrap {
  grid-column: 2 / 5;
  height: 5px;
  background: var(--track);
  border-radius: 3px;
  overflow: hidden;
}
.manager-row .bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  opacity: 0.85;
}
.manager-row .m-tv { text-align: right; font-size: 15px; font-weight: 600; }
.manager-row .m-pts { text-align: right; font-size: 12.5px; color: var(--ink-faint); }

.sparkline { display: block; margin-top: 6px; }

/* ---- Filter als Segmented Control --------------------------- */
.filters {
  display: flex; gap: 2px;
  background: var(--seg-bg);
  border-radius: 10px;
  padding: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; flex-shrink: 0; }
.chip {
  border: none; background: transparent;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 6px 13px;
  min-height: 32px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.chip.active {
  background: var(--seg-active);
  color: var(--ink);
  box-shadow: var(--shadow-pill);
}

/* ---- Kader: Spieler-Liste ----------------------------------- */
.player-list { display: flex; flex-direction: column; }
.player-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 4px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: center;
}
.player-row:last-child { border-bottom: none; padding-bottom: 6px; }
.pos-badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--track); color: var(--ink-soft);
}
.pos-TW  { background: rgba(64, 116, 187, 0.13); color: #4074bb; }
.pos-ABW { background: var(--accent-tint); color: var(--accent); }
.pos-MF  { background: rgba(176, 123, 22, 0.13); color: var(--warn); }
.pos-ST  { background: rgba(217, 56, 44, 0.11); color: var(--down); }
@media (prefers-color-scheme: dark) {
  .pos-TW { background: rgba(122, 168, 229, 0.16); color: #7aa8e5; }
}
.p-main { min-width: 0; }
.p-name {
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.p-name-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-short { display: none; }
.p-name .badge { flex-shrink: 0; }
.p-sub {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 1px;
}
.badge {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 2px 9px;
}
.badge.starter { background: var(--accent-tint); color: var(--accent); }
.badge.news-badge { background: var(--seg-bg); color: var(--ink-soft); }
/* Aufstellung vs. Bank — der wichtigste Unterschied beim Verkaufen */
.badge.in-lineup { background: rgba(64, 116, 187, 0.14); color: #4074bb; }
.badge.bench { background: var(--seg-bg); color: var(--ink-faint); }
@media (prefers-color-scheme: dark) {
  .badge.in-lineup { background: rgba(122, 168, 229, 0.16); color: #7aa8e5; }
}
.sim-row.selected .badge.in-lineup { background: rgba(217, 56, 44, 0.14); color: var(--down); }
.badge.status-1 { background: rgba(217, 56, 44, 0.11); color: var(--down); }
.badge.status-2 { background: rgba(176, 123, 22, 0.13); color: var(--warn); }
.badge.status-other { background: var(--track); color: var(--ink-soft); }
.p-numbers { text-align: right; }
.p-mv { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.p-trends {
  font-size: 12px;
  font-weight: 500;
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 1px;
}
.t-up { color: var(--up); }
.t-down { color: var(--down); }
.t-flat { color: var(--ink-faint); }

/* ---- Verkaufs-Simulator ------------------------------------- */
.card-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 46em;
}
.sim-actions { display: flex; gap: 8px; }
.pill-btn {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 36px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.pill-btn.subtle {
  background: var(--seg-bg);
  color: var(--ink-soft);
}
.sim-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 4px 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: center;
  cursor: pointer;
  border-radius: 10px;
}
.sim-row:last-child { border-bottom: none; }
.sim-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}
.sim-row.selected .p-name { color: var(--accent); }
.kpi .value.ok, .kpi .value .ok-text, .ok-text { color: var(--up); }
.kpi.sim-ok .value { font-size: 20px; }

/* ---- Co-Trainer --------------------------------------------- */
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-btn.quick {
  background: var(--accent-tint);
  color: var(--accent);
}
.coach-messages {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
.coach-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.coach-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 5px;
}
.coach-msg.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  border-bottom-left-radius: 5px;
}
.coach-msg.pending { color: var(--ink-faint); }
.coach-form { display: flex; gap: 8px; }
.coach-form input {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
}
.coach-form input:focus { box-shadow: inset 0 0 0 2px var(--accent); outline: none; }
.send-btn {
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.icon-btn.on { background: var(--accent-tint); color: var(--ink); }

/* Kopfzeile klappt beim Scrollen ein und gibt Platz frei */
.topbar { transition: padding 0.2s ease; }
.topbar.slim { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
.topbar.slim .brand strong { display: none; }

/* ---- Avatare ------------------------------------------------- */
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: var(--track);
}
.player-row.clickable { cursor: pointer; }
.player-row.clickable:active { opacity: 0.7; }

/* ---- Spieler-Detail-Sheet ------------------------------------ */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.sheet {
  position: relative;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px 26px;
}
.sheet-close { position: absolute; top: 14px; right: 14px; font-size: 13px; }
.sheet h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.sheet h3 {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sheet-head { display: flex; gap: 14px; align-items: center; padding-right: 40px; }
.sheet-mv { margin-left: auto; text-align: right; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 18px;
}
.stat-grid > div {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex; flex-direction: column;
}
.stat-grid span { font-size: 11px; color: var(--ink-faint); }
.stat-grid strong { font-size: 15px; }
.big-chart { width: 100%; height: 140px; display: block; }
.chart-range {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--ink-faint);
  margin-top: 2px;
}
.form-bars {
  display: flex; gap: 6px; align-items: flex-end;
  overflow-x: auto;
  padding-bottom: 4px;
}
.form-bar-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; color: var(--ink-faint);
  min-width: 20px;
}
.form-bar {
  width: 16px;
  border-radius: 4px 4px 2px 2px;
  background: var(--accent);
  opacity: 0.85;
}
.form-bar.off { background: var(--track); }
.next-games { display: flex; flex-wrap: wrap; gap: 8px; }
.next-game {
  display: flex; flex-direction: column;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--surface-2);
  border-left: 3px solid var(--ink-faint);
}
.next-game .ng-md, .next-game .ng-pos { font-size: 10.5px; color: var(--ink-faint); }
.next-game.diff-easy { border-left-color: var(--up); }
.next-game.diff-mid { border-left-color: var(--warn); }
.next-game.diff-hard { border-left-color: var(--down); }

/* Tages-Aenderung (prominent unter dem Marktwert) */
.p-day { font-size: 13px; font-weight: 600; margin-top: 1px; }
.p-day .pct { opacity: 0.75; font-size: 11.5px; }

.sort-row { margin-bottom: 12px; align-self: flex-start; }
.manager-row.clickable { cursor: pointer; }
.manager-row.clickable:active { opacity: 0.7; }
.manager-row .m-meta { font-size: 11.5px; color: var(--ink-faint); grid-column: 2; }
.manager-row .m-delta { font-size: 12px; text-align: right; grid-column: 3 / 5; }

.daily-list { display: flex; flex-direction: column; gap: 1px; }
.daily-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13.5px;
}
.daily-row span { color: var(--ink-soft); }

.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 8px;
}
.cmp-table td { padding: 7px 8px; border-top: 1px solid var(--hairline); }
.cmp-table small { display: block; font-size: 10.5px; color: var(--ink-faint); }
.tbl-scroll { overflow-x: auto; }
.full-width { width: 100%; margin-top: 12px; }
.player-list.compact .player-row { padding: 8px 0; }
.sheet .me-tag {
  font-size: 10px; font-weight: 700;
  color: var(--accent); background: var(--accent-tint);
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: 3px;
}

.team-chip { display: inline-flex; align-items: center; gap: 4px; }
.team-logo {
  width: 15px; height: 15px;
  object-fit: contain;
  vertical-align: -2px;
}
.next-game .team-logo { width: 17px; height: 17px; margin-right: 4px; vertical-align: -3px; }

.market-row { grid-template-columns: 44px 1fr 38px auto; }
.watch-btn {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 19px;
  line-height: 1;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.watch-btn.on { color: var(--warn); }

.act-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.act-row:last-child { border-bottom: none; }
.bar-goals { font-size: 9px; line-height: 1; height: 10px; }

.ext-links { margin-top: 14px; }
.ext-link {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--accent-tint);
  color: var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  text-decoration: none;
  font-size: 14.5px; font-weight: 600;
}
.ext-link small { color: var(--ink-soft); font-weight: 400; font-size: 11.5px; }
.ext-link:active { opacity: 0.7; }

.news-list { display: flex; flex-direction: column; gap: 8px; }
.news-item {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}
.news-item:active { opacity: 0.7; }
.news-item small { color: var(--ink-faint); font-size: 11px; }

@media (max-width: 560px) {
  /* Kopf des Detail-Sheets untereinander statt gequetscht nebeneinander */
  .sheet-head { flex-wrap: wrap; padding-right: 46px; }
  .sheet-mv { margin-left: 0; width: 100%; text-align: left; margin-top: 8px; }
  .sheet-mv .p-trends { justify-content: flex-start; }
  .sheet h2 { font-size: 19px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }

  .sheet-backdrop { padding: 0; align-items: flex-end; }
  .sheet {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
  }
}

.empty-state {
  color: var(--ink-soft);
  text-align: center;
  padding: 32px 10px;
  font-size: 14px;
}

/* ---- Bottom-Navigation (mobil) ------------------------------ */
.bottomnav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--hairline);
  padding: 4px 12px calc(4px + env(safe-area-inset-bottom));
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: transparent;
  color: var(--ink-faint);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.01em;
  padding: 7px 0 5px;
  min-height: 52px;
  cursor: pointer;
}
.bn-item svg { width: 25px; height: 25px; }
.bn-item.active { color: var(--accent); }

.control-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---- Suche, Statuszeile, Ladebalken -------------------------- */
.search-input {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  margin-bottom: 10px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
}
.search-input:focus { box-shadow: inset 0 0 0 2px var(--accent); outline: none; }

.status-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.updated-inline { font-size: 11.5px; color: var(--ink-faint); margin-left: auto; }
.demo-banner { margin-bottom: 0; }

.loading-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 30;
  background: linear-gradient(90deg, transparent, var(--up), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: loading-slide 1s linear infinite;
}
@keyframes loading-slide {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* ---- Spielfeld ----------------------------------------------- */
.pitch {
  display: flex; flex-direction: column; gap: 14px;
  background:
    linear-gradient(180deg, rgba(10, 138, 84, 0.10), rgba(10, 138, 84, 0.03)),
    var(--surface-2);
  border-radius: 14px;
  padding: 18px 12px;
  margin-top: 4px;
}
.pitch-line { display: flex; justify-content: space-evenly; gap: 6px; }
.pitch-player {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
  min-width: 0;
}
.pp-name {
  font-size: 11px; font-weight: 600;
  max-width: 68px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-pts { font-size: 10.5px; color: var(--ink-faint); }
/* Angeschlagene und verletzte Spieler im Vorschlag sichtbar markieren */
.pitch-player.hurt .avatar-wrap::after,
.pitch-player.doubt .avatar-wrap::after {
  content: "";
  position: absolute; right: -1px; top: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}
.pitch-player.hurt .avatar-wrap::after { background: var(--down); }
.pitch-player.doubt .avatar-wrap::after { background: var(--warn); }
.pitch-player.hurt .pp-name { color: var(--down); }
.diff-easy { color: var(--up); }
.diff-hard { color: var(--down); }
.diff-mid { color: var(--warn); }

/* ---- Responsive --------------------------------------------- */
/* Mobil: kein Kartenrahmen, sondern durchgehende Listen wie in iOS —
   das spart die Doppel-Polsterung und bringt mehr Zeilen aufs Bild. */
@media (max-width: 700px) {
  .topbar .tabs { display: none; }
  .topbar { padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .bottomnav { display: flex; }
  main { padding: 12px 16px calc(86px + env(safe-area-inset-bottom)); }

  .card {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 26px;
  }
  .card h2 { font-size: 16px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
  .card-sub { display: none; }
  .card-head { margin-bottom: 8px; }
  .manager-row .m-tv { font-size: 16px; }
  .updated-inline { font-size: 11px; }
  .demo-banner { font-size: 11px; padding: 3px 10px; margin-bottom: 10px; }

  .kpis { gap: 8px; margin-bottom: 16px; grid-template-columns: 1fr 1fr; }
  .kpi { padding: 11px 14px 12px; border-radius: 13px; }
  .kpi .value { font-size: 21px; }
  .kpi-lead .value { font-size: 25px; }
  .kpi .label, .kpi-sub { font-size: 11.5px; }

  /* Beide Chip-Gruppen in einer wischbaren Reihe statt untereinander */
  .control-row {
    gap: 6px; margin-bottom: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .control-row::-webkit-scrollbar { display: none; }
  .control-row .filters { overflow: visible; flex-shrink: 0; }
  .chip { padding: 5px 12px; min-height: 30px; font-size: 12.5px; }

  .player-row { grid-template-columns: 36px 1fr auto; gap: 2px 10px; padding: 10px 0; }
  .market-row { grid-template-columns: 36px 1fr 34px auto; }
  .pos-badge { width: 34px; height: 34px; font-size: 10px; }
  .p-name { font-size: 14.5px; gap: 6px; }
  .p-sub {
    font-size: 11.5px; gap: 7px;
    flex-wrap: nowrap; overflow: hidden; white-space: nowrap;
  }
  .desktop-only, .team-name, .unit, .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .p-mv { font-size: 15px; }
  .p-day { font-size: 12.5px; }
  .p-trends { flex-direction: row; gap: 8px; font-size: 10.5px; }
  .sparkline { width: 84px; height: 22px; margin-top: 3px; }
  .watch-btn { width: 34px; height: 34px; font-size: 17px; }

  .manager-row { padding: 10px 0; }

  /* Chat wie in einer Messenger-App: Eingabe unten, Verlauf fuellt den Rest */
  #view-coach .card {
    display: flex; flex-direction: column;
    min-height: calc(100vh - 210px);
  }
  #view-coach .coach-messages { flex: 1; }
  #view-coach .coach-form {
    position: sticky;
    bottom: calc(84px + env(safe-area-inset-bottom));
    background: var(--ground);
    padding: 8px 0 4px;
  }
}

#coach-messages:empty::before {
  content: "Frag nach Aufstellung, Verkaufskandidaten oder Kaufempfehlungen — die Antworten rechnen mit deinen echten Ligadaten.";
  display: block;
  color: var(--ink-faint);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 0 4px;
  max-width: 34em;
}
@media (max-width: 560px) {
  .topbar { gap: 8px; padding-left: 16px; padding-right: 16px; }
  .updated { display: none; }
  .manager-row { grid-template-columns: 26px 1fr 90px 56px; }
}

/* Notiz ueber dem Spielfeld: Formation, Punkte, Differenz zum Vorschlag */
.pitch-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 2px 0 8px;
}
#ai-lineup { margin-top: 12px; }

/* ---- Restprogramm-Matrix ------------------------------------- */
.sched-table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.sched-table th, .sched-table td { padding: 6px 8px; text-align: center; white-space: nowrap; }
.sched-table tr > th:first-child {
  text-align: left; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 5px; min-width: 110px;
}
.sched-table tr:first-child th { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.sched-table tr.mine > th:first-child { color: var(--ink); }
.sched-table tr.mine { background: var(--surface-2); }
td.sched { border-radius: 5px; font-variant-numeric: tabular-nums; }
td.sched.diff-easy { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
td.sched.diff-mid { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
td.sched.diff-hard { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
td.sched.empty, td.sched.diff-unknown { color: var(--ink-faint); }

/* ---- Kurzmeldungen ------------------------------------------- */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(0,0,0,.28), inset 0 0 0 1px var(--hairline);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px;
  line-height: 1.4;
}
.toast.error { box-shadow: 0 8px 30px rgba(0,0,0,.28), inset 0 0 0 1px var(--down); }
.icon-btn.unavailable { opacity: 0.45; }
@media (min-width: 701px) { .toast { bottom: 24px; } }

/* ---- Wochenbericht ------------------------------------------- */
.rp-alert {
  background: color-mix(in srgb, var(--down) 12%, transparent);
  color: var(--down);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px; font-weight: 600;
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: 14px;
}
.rp-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.rp-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 3px;
}
.rp-big { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.rp-big small { font-size: 14px; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.rp-sub { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 0; }
.rp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 6px; }
.rp-stat {
  background: var(--surface-2); border-radius: 10px; padding: 8px 12px;
  display: flex; flex-direction: column;
}
.rp-stat span { font-size: 11px; color: var(--ink-faint); }
.rp-stat strong { font-size: 15px; }
.rp-h {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 20px 0 8px;
}
.rp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rp-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.rp-list li:last-child { border-bottom: none; }
.rp-list li.mine { font-weight: 600; }
.rp-rank { color: var(--ink-faint); font-size: 12px; min-width: 14px; }
.rp-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-name small { font-size: 11.5px; color: var(--ink-faint); font-weight: 400; }
.rp-empty { font-size: 13px; color: var(--ink-faint); margin: 4px 0 0; }
.rp-cols, .rp-todo { display: grid; gap: 16px; }
.rp-cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.rp-todo { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rp-block { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.rp-block .rp-list li { border-color: var(--hairline); }
.rp-summary {
  font-size: 14.5px; line-height: 1.55; color: var(--ink);
  background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin: 0;
}
.rp-foot { font-size: 11.5px; color: var(--ink-faint); margin: 16px 0 0; }
@media (max-width: 700px) {
  .report-card { background: var(--surface); box-shadow: var(--shadow-card); border-radius: 16px; padding: 15px 16px; }
  .rp-big { font-size: 26px; }
}
.rp-pairings { margin-top: 10px; }
.rp-label-spaced { margin-top: 14px; }
.rp-name .team-logo { margin-right: 5px; vertical-align: -2px; }
.rp-tough { margin-top: 10px; }
.rp-tough li.leader .rp-name { font-weight: 600; }
.rp-tough li.leader { background: color-mix(in srgb, var(--down) 8%, transparent); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
