.ewv {
  --ink: #14263a;
  --court: #2c5f7c;
  --line: #f7f8f5;
  --ball: #d4e157;
  --champagne: #c9b78e;
  --bg: #f3f5f2;
  --card: #ffffff;
  --muted: #5d6b78;
  --yes: #2f9e5f;
  --open: #e9b62f;
  --no: #d64545;
  --grau: #8e9a94;
  --radius: 10px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 48px;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  box-sizing: border-box;
}
.ewv *, .ewv *::before, .ewv *::after { box-sizing: border-box; }
.ewv h1, .ewv h2, .ewv h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  margin: 0;
  color: inherit;
  line-height: 1.2;
}
.ewv button, .ewv input, .ewv select { font: inherit; color: inherit; }
.ewv button { cursor: pointer; }
.ewv :focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
.ewv-loading { padding: 24px 16px; color: var(--muted); }

/* Kopf */
.ewv-head {
  background: var(--court) var(--ewv-court, none) center / cover no-repeat;
  color: var(--line);
  padding: 22px 16px 18px;
  border-bottom: 4px solid var(--champagne);
}
.ewv-head h1 { font-size: 1.6rem; }
.ewv-club { margin: 4px 0 0; opacity: .9; }
.ewv-standing { margin: 10px 0 0; font-weight: 600; }
.ewv-headrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ewv-mgrbtn {
  background: transparent; color: var(--line); border: 1px solid rgba(247,248,245,.6);
  border-radius: 999px; padding: 6px 12px; font-size: .85rem; white-space: nowrap;
}
.ewv-mgrbtn[aria-pressed="true"] { background: var(--ball); color: var(--ink); border-color: var(--ball); }

.ewv-me { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--ink); color: var(--line); }
.ewv-me label { font-weight: 600; }
.ewv-me select { flex: 1; min-width: 0; padding: 8px; border-radius: 6px; border: 0; background: var(--line); color: var(--ink); }

/* Tabs */
.ewv-tabs { display: flex; gap: 0; border-bottom: 1px solid #d7ddd8; background: var(--card); position: sticky; top: 0; z-index: 2; }
.ewv-tab {
  flex: 1; padding: 13px 8px; background: none; border: 0; border-bottom: 3px solid transparent;
  font-weight: 600; color: var(--muted);
}
.ewv-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--court); }

.ewv-body { padding: 14px 12px 0; }
.ewv-notice { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius); background: #fdf3d0; }
.ewv-notice.err { background: #f9dcdc; }
.ewv-empty { padding: 18px 4px; color: var(--muted); }

/* Werkzeugleiste Mannschaftsführer */
.ewv-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ewv-btn {
  border: 1px solid var(--ink); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 9px 14px; font-weight: 600;
}
.ewv-btn.primary { background: var(--ink); color: var(--ball); }
.ewv-btn.small { padding: 6px 10px; font-size: .9rem; }
.ewv-btn.danger { border-color: var(--no); color: var(--no); }
.ewv-btn[disabled] { opacity: .5; cursor: default; }

/* Spielkarte */
.ewv-game { background: var(--card); border-radius: var(--radius); margin: 0 0 12px; border: 1px solid #dfe4df; overflow: hidden; }
.ewv-game.own-past { opacity: .85; }
.ewv-gamehead { width: 100%; text-align: left; background: none; border: 0; padding: 14px 14px 10px; display: block; }
.ewv-when { font-weight: 700; }
.ewv-teams { margin: 2px 0 0; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.15rem; }
.ewv-teams b { font-weight: 700; }
.ewv-loc { color: var(--muted); font-size: .9rem; }
.ewv-result { display: inline-block; margin-top: 4px; font-weight: 700; }

/* Aufstellungsleiste: ein Feld je Kaderspieler */
.ewv-bar { display: flex; gap: 3px; margin: 10px 0 6px; }
.ewv-seg { flex: 1; height: 12px; border-radius: 3px; background: #ccd3cd; }
.ewv-seg.yes { background: var(--yes); }
.ewv-seg.open { background: #ccd3cd; }
.ewv-seg.no { background: var(--no); }
.ewv-seg.maybe { background: var(--open); }
.ewv-count { font-size: .92rem; color: var(--muted); }
.ewv-count strong { color: var(--ink); }
.ewv-ok { color: var(--yes); font-weight: 700; }
.ewv-low { color: var(--no); font-weight: 700; }

.ewv-panel { padding: 4px 14px 14px; border-top: 1px solid #eef1ee; }
.ewv-row { padding: 10px 0; border-bottom: 1px solid #eef1ee; }
.ewv-row:last-child { border-bottom: 0; }
.ewv-rowtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ewv-name { font-weight: 600; }
.ewv-name.me { text-decoration: underline; text-decoration-color: var(--ball); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.ewv-st { display: flex; gap: 6px; }
.ewv-stbtn {
  min-width: 74px; padding: 7px 8px; border-radius: 8px; border: 2px solid #ccd3cd; background: var(--card); font-size: .9rem; font-weight: 600;
}
.ewv-stbtn[disabled] { cursor: default; opacity: .55; }
.ewv-stbtn.yes { border-color: var(--yes); background: #eaf6ee; color: #1c6a3e; }
.ewv-stbtn.maybe { border-color: var(--open); background: #fdf4dd; color: #7a5a00; }
.ewv-stbtn.no { border-color: var(--no); background: #fbeaea; color: #8f2626; }
.ewv-stbtn.open { border-color: var(--grau); background: #eef1ef; color: #4f5a55; }
.ewv-stbtn.yes[aria-pressed="true"] { background: var(--yes); border-color: var(--yes); color: #fff; }
.ewv-stbtn.maybe[aria-pressed="true"] { background: var(--open); border-color: var(--open); color: var(--ink); }
.ewv-stbtn.no[aria-pressed="true"] { background: var(--no); border-color: var(--no); color: #fff; }
.ewv-stbtn.open[aria-pressed="true"] { background: var(--grau); border-color: var(--grau); color: #fff; }
.ewv-badge { padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.ewv-badge.yes { background: #d9f0e2; color: #1c6a3e; }
.ewv-badge.open { background: #e9edea; color: #4f5a55; }
.ewv-badge.no { background: #f6d5d5; color: #8f2626; }
.ewv-badge.maybe { background: #fbecc0; color: #7a5a00; }
.ewv-overview { margin-top: 12px; border: 1px solid #d7ded8; border-radius: 10px; background: #fff; padding: 8px 12px; }
.ewv-overview > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.ewv-overview h4 { margin: 10px 0 4px; font-size: .95rem; }
.ewv-ovrow { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 3px 0; border-bottom: 1px solid #eef2ee; }
.ewv-ovrow:last-child { border-bottom: 0; }
.ewv-badge.expired { background: #e3e6e3; color: #5d6b78; }
.ewv-comment { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid #ccd3cd; border-radius: 8px; background: #fbfcfb; }
.ewv-note { margin: 6px 0 0; font-size: .92rem; color: var(--muted); font-style: italic; }

.ewv-sub { margin: 14px 0 6px; font-size: 1.02rem; }
.ewv-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tabellen */
.ewv-tablewrap { overflow-x: auto; background: var(--card); border: 1px solid #dfe4df; border-radius: var(--radius); }
.ewv table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.ewv th, .ewv td { padding: 9px 8px; text-align: right; border-bottom: 1px solid #eef1ee; white-space: nowrap; }
.ewv th:nth-child(2), .ewv td:nth-child(2), .ewv th:first-child, .ewv td:first-child { text-align: left; }
.ewv th { font-weight: 700; background: #f8faf8; }
.ewv tr.own td { background: #f5f8d4; font-weight: 700; }

.ewv-day { margin: 16px 0 6px; font-size: 1rem; }
.ewv-match { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 9px 12px; background: var(--card); border: 1px solid #dfe4df; border-radius: 8px; margin: 0 0 6px; }
.ewv-match.own { border-color: var(--court); background: #f5f8d4; }
.ewv-match small { color: var(--muted); }
.ewv-match a { color: var(--court); }

/* Formulare */
.ewv-form { background: var(--card); border: 1px solid #dfe4df; border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
.ewv-form label { display: block; font-weight: 600; margin: 10px 0 4px; }
.ewv-form input[type="text"], .ewv-form input[type="password"], .ewv-form input[type="date"], .ewv-form input[type="time"], .ewv-form input[type="tel"], .ewv-form input[type="search"] {
  width: 100%; padding: 9px 10px; border: 1px solid #ccd3cd; border-radius: 8px; background: #fbfcfb;
}
.ewv-check { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1ee; }
.ewv-check input[type="checkbox"] { width: 20px; height: 20px; flex: none; }
.ewv-check .ewv-phone { flex: 1; min-width: 0; padding: 7px 8px; border: 1px solid #ccd3cd; border-radius: 6px; }
.ewv-link { font-weight: 700; color: var(--court); }

/* Einladung */
.ewv-invite { padding: 24px 16px; }
.ewv-invite h2 { font-size: 1.5rem; margin: 0 0 10px; }
.ewv-bigrow { display: flex; gap: 10px; margin: 18px 0 0; }
.ewv-big { flex: 1; padding: 16px 10px; border-radius: 10px; border: 0; font-size: 1.1rem; font-weight: 700; }
.ewv-big.yes { background: var(--yes); color: #fff; }
.ewv-big.no { background: var(--no); color: #fff; }

@media (max-width: 420px) {
  .ewv-stbtn { min-width: 64px; padding: 7px 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .ewv-seg { transition: background-color .15s; }
}

/* Verein: Kopf mit Logo, Mannschaftskarten */
.ewv-brandrow { display: flex; align-items: center; gap: 12px; }
.ewv-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,.9); padding: 3px; flex: none; }
.ewv-clublink { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.ewv-teamcard { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--card); border: 1px solid #dfe4df; border-radius: var(--radius); margin: 0 0 8px; }
.ewv-teamcard a.ewv-btn { text-decoration: none; }
.ewv-head .ewv-brandrow + * { margin-top: 0; }

/* Übersicht: Nächstes Spiel groß, Kompakttabelle, Umschalter */
.ewv-sec { font-size: 1.05rem; margin: 18px 0 8px; }
.ewv-body > .ewv-sec:first-child { margin-top: 4px; }
.ewv-hero { border: 2px solid var(--court); }
.ewv-herotop { padding: 14px 14px 4px; }
.ewv-hero .ewv-when { font-size: 1.05rem; }
.ewv-hero .ewv-teams { font-size: 1.3rem; margin: 4px 0; }
.ewv-compact td:nth-child(2) { white-space: normal; text-align: left; }
.ewv-compact td:last-child { font-weight: 700; }
.ewv-compact th:first-child, .ewv-compact td:first-child { width: 28px; }
.ewv-toggle { display: flex; gap: 0; margin: 0 0 12px; border: 1px solid var(--court); border-radius: 8px; overflow: hidden; }
.ewv-toggle button { flex: 1; padding: 10px 8px; background: var(--card); border: 0; font-weight: 600; }
.ewv-toggle button[aria-pressed="true"] { background: var(--court); color: var(--line); }
.ewv-matchbtn { width: 100%; text-align: left; background: var(--card); cursor: pointer; font: inherit; color: inherit; }

/* Meldeliste nach Spielstärke */
.ewv-lineup { padding: 0 14px 10px; }
.ewv-lineup .ewv-sub { margin: 6px 0 6px; }
.ewv-lu { border: 1px solid #dfe4df; border-radius: 8px; overflow: hidden; background: var(--card); }
.ewv-lu-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid #eef1ee; }
.ewv-lu-row:first-child { border-top: 0; }
.ewv-lu-pos { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--court); color: var(--line); font-weight: 700; font-size: .85rem; flex: none; }
.ewv-lu-name { flex: 1; font-weight: 600; min-width: 0; }
.ewv-lu-lk { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.ewv-lu-row.empty .ewv-lu-pos { background: transparent; color: var(--muted); border: 1px dashed var(--muted); }
.ewv-lu-row.empty .ewv-lu-name { color: var(--muted); font-style: italic; font-weight: 400; }
.ewv-lu-row.extra .ewv-lu-pos { background: #ccd3cd; color: var(--ink); }
.ewv-lu-div { padding: 6px 10px; background: #f8faf8; font-size: .85rem; color: var(--muted); border-top: 1px solid #eef1ee; }
.ewv-check { flex-wrap: wrap; }
.ewv-check .ewv-lkin { width: 72px; flex: none; padding: 7px 8px; border: 1px solid #ccd3cd; border-radius: 6px; }

/* Sportwart-Dashboard */
.ewv a.ewv-btn { display: inline-block; text-decoration: none; }
.ewv-seasonbar { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.ewv-seasonbar button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--court); background: var(--card); font-weight: 600; white-space: nowrap; }
.ewv-seasonbar button[aria-pressed="true"] { background: var(--court); color: var(--line); }
.ewv-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.ewv-metric { background: var(--card); border: 1px solid #dfe4df; border-radius: var(--radius); padding: 10px 12px; }
.ewv-metric-n { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.ewv-dteam { background: var(--card); border: 1px solid #dfe4df; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 8px; }
.ewv-dtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ewv-dnext { margin: 8px 0 0; padding: 8px 10px; background: #f5f8d4; border-radius: 8px; font-size: .92rem; }
.ewv span.ewv-mgrbtn { display: inline-block; }

/* Dashboard: Handy = Karten, PC (Querformat) = Seitenleiste und Tabelle */
.ewv-dash-tools { display: flex; gap: 8px; margin: 0 0 12px; }
.ewv-dash-tools input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #ccd3cd; border-radius: 8px; background: var(--card); }
.ewv-dash-tools select { padding: 10px 8px; border: 1px solid #ccd3cd; border-radius: 8px; background: var(--card); }
.ewv-dash-table { display: none; }
@media (min-width: 900px) {
  .ewv.ewv-wide { max-width: 1360px; margin-left: auto; margin-right: auto; }
  .ewv-fullbleed { width: 100%; }
  .ewv-wide .ewv-head { padding: 22px 24px 18px; }
  .ewv-wide .ewv-body { padding: 20px 24px 0; }
  .ewv-dash-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
  .ewv-dash-side { position: sticky; top: 16px; }
  .ewv-dash-side .ewv-seasonbar { flex-direction: column; overflow: visible; }
  .ewv-dash-side .ewv-seasonbar button { text-align: left; border-radius: 8px; }
  .ewv-dash-cards { display: none; }
  .ewv-dash-table { display: block; background: var(--card); border: 1px solid #dfe4df; border-radius: var(--radius); overflow-x: auto; }
  .ewv .ewv-dt { width: 100%; font-size: .92rem; }
  .ewv .ewv-dt th, .ewv .ewv-dt td { text-align: left; white-space: normal; vertical-align: top; padding: 10px 12px; }
  .ewv .ewv-dt th { position: sticky; top: 0; background: #f8faf8; }
  .ewv .ewv-dt tr.ewv-dt-group td { background: var(--court); color: var(--line); font-weight: 700; padding: 8px 12px; }
  .ewv .ewv-dt .ewv-inline { flex-wrap: wrap; }
  .ewv .ewv-dt .ewv-badge { white-space: nowrap; }
  .ewv .ewv-dt th:nth-child(7), .ewv .ewv-dt td:nth-child(7) { min-width: 130px; }
  .ewv .ewv-dt th:nth-child(8), .ewv .ewv-dt td:nth-child(8) { min-width: 250px; }
}

.ewv-pickscroll { max-height: 320px; overflow-y: auto; margin: 8px 0; border: 1px solid #dfe4df; border-radius: 8px; background: var(--card); padding: 0 8px; }
.ewv-pickscroll .ewv-check:last-child { border-bottom: 0; }

/* Spielbericht */
.ewv-report { margin: 8px 0 4px; }
.ewv-rephead { font-weight: 700; margin: 4px 0 6px; }
.ewv-rephead .ours, .ewv-reppl.ours { background: #f5f8d4; }
.ewv-repsec { margin: 12px 0 6px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1rem; }
.ewv-repmatch { border: 1px solid #dfe4df; border-radius: 8px; background: var(--card); margin: 0 0 6px; overflow: hidden; }
.ewv-reppl { padding: 7px 10px; }
.ewv-reppl.win { font-weight: 700; }
.ewv-repscore { padding: 5px 10px; background: #f8faf8; border-top: 1px solid #eef1ee; border-bottom: 1px solid #eef1ee; }
