/* ============================================================
   RC Turnuva — stil
   ============================================================ */
:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #faf8f2;
  --ink: #17201c;
  --muted: #66726c;
  --line: #e3ddcf;
  --line-strong: #cfc7b4;
  --accent: #14532d;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0e7;
  --accent-line: #b7d8c3;
  --gold: #a85d06;
  --gold-soft: #fcefd3;
  --danger: #b42318;
  --danger-soft: #fdebe8;
  --info: #1d4ed8;
  --info-soft: #e7eeff;
  --felt-1: #0e3b28;
  --felt-2: #14532d;
  --shadow: 0 1px 2px rgba(23, 32, 28, .06), 0 10px 28px -14px rgba(23, 32, 28, .22);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1310; --surface: #131c18; --surface-2: #18231e; --ink: #e9f0ea; --muted: #8fa097;
    --line: #243229; --line-strong: #33463b; --accent: #4cc47f; --accent-ink: #06150d; --accent-soft: #14301f;
    --accent-line: #245238; --gold: #f0b45a; --gold-soft: #33260f; --danger: #f87171; --danger-soft: #3a1717;
    --info: #8fb0ff; --info-soft: #172544; --felt-1: #0a2a1c; --felt-2: #10432a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1310; --surface: #131c18; --surface-2: #18231e; --ink: #e9f0ea; --muted: #8fa097;
  --line: #243229; --line-strong: #33463b; --accent: #4cc47f; --accent-ink: #06150d; --accent-soft: #14301f;
  --accent-line: #245238; --gold: #f0b45a; --gold-soft: #33260f; --danger: #f87171; --danger-soft: #3a1717;
  --info: #8fb0ff; --info-soft: #172544; --felt-1: #0a2a1c; --felt-2: #10432a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- üst bar ---------- */
.top {
  background: linear-gradient(135deg, var(--felt-1), var(--felt-2)); color: #f3faf5; position: sticky; top: 0; z-index: 30;
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, .55);
}
.top::after {
  content: ""; display: block; height: 12px; position: absolute; left: 0; right: 0; bottom: -12px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12'%3E%3Cpolygon points='0,0 24,0 12,12' fill='%2314532d' fill-opacity='.95'/%3E%3Cpolygon points='24,0 48,0 36,12' fill='%23b8873b' fill-opacity='.9'/%3E%3C/svg%3E");
  background-size: 48px 12px; background-repeat: repeat-x; opacity: .85;
}
.bar { display: flex; align-items: center; gap: 18px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; font-size: 17px; }
.die { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .14); font-size: 18px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 8px 10px; border-radius: 9px; text-decoration: none; color: rgba(243, 250, 245, .78); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .18); color: #fff; }
.tools { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 650;
  background: rgba(255, 255, 255, .14); color: #f3faf5; white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: #7ee2a8; display: inline-block; }
.pill.live i { animation: pulse 1.8s infinite; }
.pill.err i { background: #ff9b8f; }
.pill.warn i { background: #ffd27a; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
.icon-btn {
  border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { background: rgba(255, 255, 255, .22); }
.icon-btn:disabled { opacity: .35; cursor: default; }

main.wrap { padding-top: 34px; padding-bottom: 60px; min-height: 60vh; }
#banners:empty { display: none; }
#banners { padding-top: 26px; margin-bottom: -14px; display: grid; gap: 8px; }

/* ---------- genel bileşenler ---------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flat { box-shadow: none; }
.card h2 + .sub { margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 650; font-size: 14px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge.warn { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.badge.bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, var(--line)); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.banner.warn { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.banner.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, var(--line)); }
.banner .grow { min-width: 0; }
.banner b { font-weight: 700; }

input[type=text], input[type=number], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 11px; min-height: 38px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; font-weight: 650; }
.field > small { color: var(--muted); font-size: 12.5px; }
.search { position: relative; width: min(320px, 100%); }
.search input { padding-left: 34px; }
.search::before { content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 18px; pointer-events: none; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tab {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 99px; cursor: pointer; font-weight: 650; font-size: 14px;
  text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { border-color: var(--ink); }
.tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab small { opacity: .75; font-weight: 600; }
.progress { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

/* ---------- tablolar ---------- */
.tblwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700;
  padding: 11px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl tbody tr.prow { cursor: pointer; }
.tbl tbody tr.prow:hover td { background: var(--surface-2); }
.st .rk { width: 52px; font-weight: 750; color: var(--muted); white-space: nowrap; }
.st tr.q .rk { color: var(--accent); }
.st tr.q td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.st .nm { font-weight: 650; min-width: 170px; }
.st .nm .cls { color: var(--muted); font-weight: 500; font-size: 12.5px; margin-left: 6px; }
.st tr.out td { opacity: .55; }
.st .strong { font-weight: 750; }
.st .pos { color: var(--accent); } .st .neg { color: var(--danger); }
.cutrow td { padding: 0 !important; border: 0 !important; background: none !important; }
.cutrow div {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px; font-size: 11.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-top: 2px dashed var(--accent); border-bottom: 1px solid var(--accent-line);
}
.form { display: flex; gap: 3px; flex-wrap: nowrap; }
.f {
  width: 21px; height: 21px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.f.w { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.f.l { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.f.b { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, var(--line)); }
.f.d { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }
.f { position: relative; }
.f.star::after { content: "*"; position: absolute; top: -2px; right: 2px; font-size: 11px; line-height: 1; }
.tb-in { width: 62px !important; min-height: 30px !important; padding: 3px 8px !important; text-align: right; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- maç kartları ---------- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.mc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 14px; display: grid; gap: 10px; align-content: start; }
.mc.done { background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft)); }
.mc.bye { background: color-mix(in srgb, var(--surface) 94%, var(--info-soft)); }
.mc.bad { border-color: var(--danger); }
.mc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.mno { font-weight: 800; font-size: 13px; background: var(--ink); color: var(--bg); border-radius: 7px; padding: 1px 8px; }
.pl {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; border: 1px solid transparent; min-height: 40px;
}
.pl .chip { flex: 1; text-align: left; }
.pl.win { background: var(--accent-soft); border-color: var(--accent-line); }
.pl.win .chip { font-weight: 800; }
.pl.lose .chip { color: var(--muted); }
.chip {
  border: 1px dashed transparent; background: transparent; padding: 4px 8px; margin: -4px -8px; border-radius: 8px; cursor: pointer; font-weight: 650; text-align: left;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface); }
.chip.sel { border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold); }
.chip.static { cursor: default; }
.chip.static:hover { border-color: transparent; background: transparent; }
.rec { font-size: 12px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.sc { font-weight: 800; font-size: 14px; white-space: nowrap; }
/* Challonge tarzı skor kutusu */
.scb { min-width: 34px; height: 30px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: 16px; line-height: 1; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); font-variant-numeric: tabular-nums; }
.scb.empty { border-style: dashed; background: transparent; color: var(--line-strong); font-weight: 600; }
.win > .scb { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lose > .scb { color: var(--ink); }
.pls { display: grid; gap: 4px; }
.scchip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px; padding: 3px 4px 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.scchip i { font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 999px; }
.scchip.win { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.scchip.win i { background: var(--accent); color: var(--accent-ink); }
.scchip.lose { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.scchip.lose i { background: var(--danger); color: #fff; }
.entry-h { font-size: 12.5px; font-weight: 700; margin: 0; }
.entry-h small { font-weight: 500; color: var(--muted); }
.entry .erow .who, .bkfoot .erow .who { width: 100px; min-width: 0; max-width: none; flex: none; }
.erow.manual input { width: 58px; min-height: 32px; padding: 4px 6px; text-align: center; font-weight: 800; font-size: 15px; border-radius: 8px; }
.erow .dash { color: var(--muted); font-weight: 800; }
.vs { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .14em; margin: 3px 0; line-height: 1; }
.entry { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.erow { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.erow .who { font-size: 12.5px; font-weight: 700; min-width: 76px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.btn.score { padding: 5px 0; min-width: 44px; font-weight: 800; border-radius: 8px; font-size: 13px; }
.btn.score:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13.5px; }
.mfoot { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.mfoot select, .mfoot input { min-height: 32px; padding: 4px 9px; font-size: 13px; border-radius: 8px; }
.pool { display: flex; gap: 6px; flex-wrap: wrap; }
.pool .chip { margin: 0; border: 1px solid var(--line-strong); background: var(--surface); padding: 5px 10px; }
.pool .chip.sel { border-color: var(--gold); background: var(--gold-soft); }

/* herkese açık eşleşme listesi */
.dayhead { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.dayhead h2 { font-size: 15px; }
.dayhead::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.pmc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pmc.hl { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.pmh { display: flex; align-items: center; gap: 8px; padding: 8px 12px 6px; min-height: 36px; }
.pmh .meta { color: var(--muted); font-size: 12.5px; }
.pmr { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); min-height: 46px; }
.pmr .n { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.pmr.win { background: var(--accent-soft); }
.pmr.win .n { font-weight: 800; }
.pmr.lose .n { color: var(--muted); }
.plist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

/* ---------- playoff ---------- */
.bkwrap { overflow-x: auto; padding-bottom: 10px; }
.bk { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 26px; min-width: min-content; align-items: stretch; }
.bkcol { display: grid; align-content: space-around; gap: 14px; }
.bkcol > h3 { text-align: center; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; }
.bkm { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.bkp { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-weight: 650; }
.bkp + .bkp { border-top: 1px solid var(--line); }
.bkp .sd { font-size: 11px; color: var(--muted); font-weight: 800; width: 18px; }
.bkp .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bkp .s { font-weight: 800; }
.bkp.win { background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.bkp.lose { color: var(--muted); }
.bkp.tbd { color: var(--muted); font-weight: 500; font-style: italic; }
.bkfoot { border-top: 1px solid var(--line); padding: 8px 10px; background: var(--surface-2); display: flex; gap: 6px; flex-wrap: wrap; }
.champ { text-align: center; padding: 26px; background: linear-gradient(135deg, var(--felt-1), var(--felt-2)); color: #fff; border-radius: var(--radius); margin-bottom: 18px; }
.champ small { opacity: .8; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; font-size: 11.5px; }
.champ b { display: block; font-size: 30px; margin-top: 4px; letter-spacing: -.02em; }

/* ---------- çekmece / modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 11, .5); z-index: 60; backdrop-filter: blur(2px); animation: fade .15s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 61; box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }
.drawer header { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer .body { padding: 18px 20px 28px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.drawer .x { margin-left: auto; }
.hist { display: grid; gap: 6px; }
.hist .h { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.hist .h b { color: var(--muted); font-size: 12px; }
.mbline { display: flex; gap: 5px; flex-wrap: wrap; }
.mbline span { padding: 3px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 750; }
.mbline span.drop { text-decoration: line-through; opacity: .5; }
.modal {
  position: fixed; z-index: 62; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 40px);
  overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); border: 1px solid var(--line);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translate(-50%, -48%) scale(.98); opacity: 0 } to { transform: translate(-50%, -50%); opacity: 1 } }
.modal.wide { width: min(1080px, calc(100vw - 28px)); }
.shgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.shfig { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.shsvg svg { display: block; width: 100%; height: auto; }
.shfig figcaption { display: flex; gap: 6px; align-items: center; padding: 8px 10px; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--surface); }
.modal .mh { padding: 18px 20px 4px; }
.modal .mb { padding: 8px 20px 4px; display: grid; gap: 12px; }
.modal .mf { padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toast {
  position: fixed; z-index: 70; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow); max-width: min(520px, calc(100vw - 28px)); animation: pop2 .2s;
}
.toast.bad { background: var(--danger); color: #fff; }
@keyframes pop2 { from { transform: translate(-50%, 8px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }

.login { max-width: 400px; margin: 40px auto; }
.hint { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 13.5px; }
.hint code, code.k { background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.steps { display: grid; gap: 10px; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 13px;
}
footer.foot { color: var(--muted); font-size: 12.5px; text-align: center; padding: 26px 16px 40px; }
footer.foot a { color: inherit; }
.printonly { display: none; }

/* ---------- mobil ---------- */
@media (max-width: 820px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr; }
  .bar { gap: 8px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 6px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand { font-size: 15.5px; }
  h1 { font-size: 21px; }
}
@media (max-width: 640px) {
  .g2 { grid-template-columns: 1fr; }
  .mgrid, .plist { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .tbl td, .tbl th { padding: 9px 8px; }
  .st .nm { min-width: 120px; }
  .modal { top: auto; bottom: 0; left: 0; transform: none; width: 100%; border-radius: 18px 18px 0 0; animation: up .2s ease-out; }
  @keyframes up { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
  .drawer { width: 100vw; top: 12vh; border-radius: 18px 18px 0 0; animation: up .2s ease-out; }
  main.wrap { padding-top: 24px; }
  .pill.hide-xs { display: none; }
}
@media print {
  body { background: #fff; color: #000; }
  .top, .nav, .tools, footer.foot, .noprint, #banners, .toast { display: none !important; }
  .printonly { display: block !important; }
  .printonly h1 { margin-bottom: 4px; }
  .printonly table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
  .printonly th, .printonly td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
  main.wrap { padding: 0; max-width: none; }
}
