@font-face {
  font-family: 'Tusker';
  src: url('/assets/fonts/TuskerGrotesk-6700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #07024b;
  --navy: #1a1246;
  --ink: #1a1246;
  --red: #e42313;
  --red-dark: #c21b0d;
  --peach: #fac7b1;
  --peach-soft: #fde9e0;
  --lav: #c0bdd4;
  --muted: #6e6a8f;
  --line: #e7e5f0;
  --field: #f4f3f9;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-line: rgba(255, 255, 255, 0.12);
  --ok: #2fbf71;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(10, 5, 60, 0.18), 0 12px 32px rgba(3, 0, 40, 0.28);
  --font: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --display: 'Tusker', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: #fff;
  background: var(--bg) url('/assets/bg.jpg') center bottom / cover fixed no-repeat;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Chrome sets Tusker caps 0.12em below the line-box centre (tall win ascent). */
.brand-title, .card-head h3, .pv-head h3, .ko-col > h4, .view-head h2, .login h1, .modal h3,
.tnum, .mno, .colon, .stand td.rk, .gchip.ko .lbl { position: relative; top: -0.12em; }

.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- header -- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(7, 2, 75, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--glass-line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-title { font-family: var(--display); font-size: 26px; letter-spacing: 0.01em; }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lav); margin-top: 4px; }

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  margin-left: 12px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.tab.active { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(228, 35, 19, 0.45); }

.spacer { flex: 1; }
.status { display: flex; align-items: center; gap: 10px; }
.chip-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lav); flex: none; }
.chip-status[data-s='live'] .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 191, 113, 0.18); }
.chip-status[data-s='connecting'] .dot { background: #f5b83d; }
.chip-status[data-s='offline'] .dot { background: var(--red); }
.chip-status[data-s='saving'] .dot { background: #f5b83d; animation: pulse 1s infinite; }
.chip-status[data-s='error'] .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.3; } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ layout -- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 31vw, 620px);
  gap: 24px;
  padding: 24px;
  align-items: start;
  max-width: 2200px;
  margin: 0 auto;
}
.main { min-width: 0; }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.view-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.view-head .sub { margin: 6px 0 0; color: var(--lav); max-width: 62ch; line-height: 1.45; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); box-shadow: 0 6px 18px rgba(228, 35, 19, 0.35); }
.btn.primary:hover { background: var(--red-dark); }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light:hover { background: #f1f0f7; }
.btn.quiet { background: var(--field); color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { background: #ebe9f4; }
.btn.danger { background: #fff1ef; color: var(--red-dark); border-color: #ffd3cd; }
.btn.danger:hover { background: #ffe3de; }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  min-height: 32px;
}
.card-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.card-head .grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ------------------------------------------------------------------ fields -- */
.field {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--field);
  color: var(--ink);
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field::placeholder { color: #a8a4c2; font-weight: 400; }
.field:hover { background: #eeedf6; }
.field:focus { background: #fff; border-color: var(--red); box-shadow: 0 0 0 4px rgba(228, 35, 19, 0.12); }

/* ------------------------------------------------------------------- teams -- */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.gletter {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
  padding-bottom: 0.24em;
}
.count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--field);
  padding: 4px 9px;
  border-radius: 999px;
}
.count.full { background: var(--peach-soft); color: var(--red-dark); }
.team-rows { display: grid; gap: 8px; }
.team-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 82px; gap: 8px; align-items: center; }
.tnum { font-family: var(--display); font-size: 18px; line-height: 1; color: var(--lav); text-align: center; }
.field-short { text-align: center; font-size: 13px; padding: 0 6px; }

/* ---------------------------------------------------------------- results -- */
.subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.gchip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 8px;
  border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: #fff;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.gchip:hover { background: rgba(255, 255, 255, 0.14); }
.gchip .gl {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
  padding-bottom: 0.24em;
}
.gchip .prog { font-size: 12px; color: var(--lav); font-weight: 600; }
.gchip.done .gl { background: var(--ok); }
.gchip.active { background: #fff; color: var(--ink); border-color: #fff; }
.gchip.active .gl { background: var(--red); color: #fff; }
.gchip.active.done .gl { background: var(--ok); }
.gchip.active .prog { color: var(--muted); }
.gchip.ko { padding: 0 16px; font-family: var(--display); font-size: 20px; letter-spacing: 0.02em; text-transform: uppercase; }
.gchip.ko .ico { width: 18px; height: 18px; }
.subnav .sep { width: 1px; background: var(--glass-line); margin: 6px 4px; }

.res-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.mlist { display: grid; gap: 8px; }
.mrow {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 54px 10px 54px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 8px;
  border-radius: 14px;
  background: var(--field);
  transition: background 0.2s;
}
.mrow.played { background: var(--peach-soft); }
.mrow.off { opacity: 0.45; }
.mno { font-family: var(--display); font-size: 16px; line-height: 1; color: var(--muted); text-align: center; }
.mteam { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mteam.home { text-align: right; }
.mteam.win { color: var(--red-dark); }
.colon { text-align: center; font-family: var(--display); font-size: 22px; line-height: 1; color: var(--muted); }
.score {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: center;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  padding: 0 0 0.24em;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.score:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(228, 35, 19, 0.14); }
.score:disabled { background: transparent; border-style: dashed; }
.clear {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.mrow:hover .clear, .ko-card:hover .clear, .clear:focus-visible { opacity: 1; }
.clear:hover { background: rgba(26, 18, 70, 0.08); color: var(--red); }
.clear .ico { width: 16px; height: 16px; }

.stand { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.stand th {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 4px 8px;
}
.stand th.l, .stand td.l { text-align: left; }
.stand td { text-align: center; padding: 9px 4px; border-top: 1px solid var(--line); font-weight: 500; }
.stand td.rk { font-family: var(--display); font-size: 20px; line-height: 1; color: var(--red); width: 34px; }
.stand td.nm { font-weight: 600; max-width: 1px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stand td.pts { font-weight: 700; }
.stand tr.first td { background: linear-gradient(90deg, rgba(250, 199, 177, 0.45), rgba(250, 199, 177, 0)); }
.stand .mv { display: inline-flex; gap: 2px; }
.stand .mv button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.stand .mv button:hover:not(:disabled) { background: var(--field); color: var(--ink); }
.stand .mv button:disabled { opacity: 0.25; cursor: default; }
.stand .mv .ico { width: 15px; height: 15px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--peach-soft);
  color: var(--red-dark);
}
.note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--field);
  color: var(--muted);
  line-height: 1.45;
}
.note b { color: var(--ink); }
.note.go { background: var(--peach-soft); color: var(--ink); }
.empty-hint { text-align: center; padding: 28px 12px; color: var(--muted); }

/* --------------------------------------------------------------- play-off -- */
.ko-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ko-col { display: grid; gap: 12px; }
.ko-col > h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ko-col > h4:not(:first-child) { margin-top: 10px; }
.ko-card { padding: 14px; }
.ko-card.final { background: var(--red); color: #fff; }
.ko-card .card-head { margin-bottom: 10px; }
.ko-card .card-head h3 { font-size: 20px; }
.ko-card .clear { width: 28px; height: 28px; margin: -4px -4px -4px 0; }
.ko-card.final .clear { color: #fff; }
.ko-card.final .clear:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.ko-state { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ko-card.final .ko-state { color: rgba(255, 255, 255, 0.8); }
.ko-rows { display: grid; gap: 6px; }
.ko-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  padding: 5px;
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  transition: background 0.2s, opacity 0.2s;
}
.ko-row.win { background: var(--peach-soft); }
.ko-row.win .ko-name { color: var(--red-dark); }
.ko-row.lose { opacity: 0.55; }
.ko-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ko-name.ph { color: #9d99b8; font-weight: 500; font-style: italic; }
.ko-name select {
  width: 100%;
  height: 36px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  padding: 0 8px;
  outline: none;
  text-overflow: ellipsis;
}
.ko-name select:focus { border-color: var(--red); }
.ko-name select.ov { background: #fff7d6; }
.pick {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pick .ico { width: 16px; height: 16px; }
.pick:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.pick.on { background: var(--red); border-color: var(--red); color: #fff; }
.pick:disabled { opacity: 0.35; cursor: default; }
.ko-row .score { height: 40px; font-size: 22px; }
.ko-hint { margin: 8px 2px 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.ko-card.final .ko-hint { color: rgba(255, 255, 255, 0.85); }

/* ---------------------------------------------------------------- preview -- */
.preview { position: sticky; top: 88px; display: grid; gap: 16px; }
.pv {
  background: rgba(10, 5, 70, 0.55);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pv-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}
.pv-head .live { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: #fff; background: var(--red); padding: 3px 6px; border-radius: 6px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); gap: 2px; }
.seg button { border: 0; background: transparent; color: rgba(255, 255, 255, 0.75); padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.seg button.on { background: #fff; color: var(--ink); }
.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #120c40;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.frame iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.url {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font: 500 12px/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color: var(--lav);
  word-break: break-all;
}

/* ----------------------------------------------------------------- modals -- */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 1, 40, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  color: var(--ink);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 24px;
  animation: pop 0.18s ease-out;
}
.modal.wide { width: min(1500px, 100%); background: #0d0748; color: #fff; padding: 16px; }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
.modal h3 { margin: 0 0 6px; font-family: var(--display); font-size: 30px; text-transform: uppercase; line-height: 1; }
.modal p { color: var(--muted); line-height: 1.5; margin: 6px 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--field);
  padding: 12px;
  color: var(--ink);
  font: 500 13px/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  outline: none;
}
.modal textarea:focus { border-color: var(--red); background: #fff; }
.bulk-sum { margin-top: 10px; font-size: 13px; color: var(--muted); min-height: 20px; }

.set-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.set-sec:first-of-type { border-top: 0; padding-top: 8px; }
.set-sec h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; }
.toggle span { font-weight: 500; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: #d9d6e6; position: relative; cursor: pointer; transition: background 0.15s; flex: none; margin: 0; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.toggle input:checked { background: var(--red); }
.toggle input:checked::after { transform: translateX(18px); }
.toggle small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.choice { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.choice button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.choice button:hover { color: var(--ink); }
.choice button.on { background: var(--red); color: #fff; }
.pts-row { display: flex; gap: 12px; }
.pts-row label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pts-row .field { width: 90px; text-align: center; font-weight: 700; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ login -- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login .card { width: min(380px, 100%); text-align: center; padding: 32px 28px; }
.login img { height: 110px; margin: -6px auto 8px; display: block; }
.login h1 { margin: 0; font-family: var(--display); font-size: 40px; text-transform: uppercase; line-height: 1; }
.login p { color: var(--muted); margin: 8px 0 20px; }
.pin {
  width: 100%;
  height: 64px;
  text-align: center;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0.5em;
  padding: 0 0 0.24em 0.5em;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--field);
  color: var(--ink);
  outline: none;
}
.pin:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 4px rgba(228, 35, 19, 0.12); }
.login .btn { width: 100%; margin-top: 14px; height: 48px; font-size: 15px; }
.login .err { color: var(--red); font-weight: 600; min-height: 20px; margin-top: 10px; font-size: 13px; }
.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ------------------------------------------------------------------ toast -- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; }
.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  animation: pop 0.18s ease-out;
}
.toast.err { background: var(--red); color: #fff; }

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 1380px) {
  .res-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .preview { position: static; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .ko-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand img { height: 36px; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tab { flex: 1; justify-content: center; }
  .layout { padding: 14px; gap: 16px; }
  .view-head h2 { font-size: 32px; }
  .ko-grid { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: 0 minmax(0, 1fr) 46px 8px 46px minmax(0, 1fr) 28px; gap: 6px; }
  .mno { visibility: hidden; }
  .mteam { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; font-size: 13px; }
  .chip-status .lbl { display: none; }
}
