:root {
  --bg: #0c0f16;
  --bg-soft: #11151f;
  --surface: #151a26;
  --surface-2: #1c2333;
  --line: #283246;
  --line-soft: #1e2534;
  --ink: #e9eefb;
  --ink-dim: #9aa6be;
  --ink-faint: #67728c;
  --accent: #3c82f6;
  --accent-bright: #5b9bff;
  --accent-deep: #2867d6;
  --accent-2: #22d3ee;
  --win: #2fce84;
  --lose: #ef5350;
  --coin: #7fb2ff;
  --r: 16px;
  --shadow: 0 20px 55px -24px rgba(0, 0, 0, 0.85);
  --display: "Chakra Petch", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  background:
    radial-gradient(820px 520px at 85% -10%, rgba(60, 130, 246, 0.14), transparent 60%),
    radial-gradient(680px 480px at -8% 110%, rgba(34, 211, 238, 0.08), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
.app { width: 100%; min-width: 0; }
body.menu-open { overflow: hidden; }

.hidden { display: none !important; }

/* ---- Brand ---- */
.logo { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); position: relative; display: inline-block; flex: none; }
.logo::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg); }
.logo-text { font-family: var(--display); font-weight: 600; letter-spacing: 2px; font-size: 18px; }
.logo-text b { color: var(--accent-bright); font-weight: 700; }

/* ---- Auth ---- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 18px;
  background: linear-gradient(180deg, rgba(6, 8, 13, 0.7), rgba(6, 8, 13, 0.95)); }
.auth__panel { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 32px 28px; box-shadow: var(--shadow); }
.auth__brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.auth__brand .logo { width: 28px; height: 28px; }
.auth__brand .logo-text { font-size: 22px; }
.auth__tagline { text-align: center; color: var(--ink-dim); font-size: 13px; margin: 12px 0 24px; line-height: 1.5; }
.auth__hint { text-align: center; color: var(--ink-faint); font-size: 12px; margin-top: 16px; }
.lang--auth { justify-content: center; margin-top: 18px; }

/* ---- Segmented ---- */
.seg { display: flex; gap: 4px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.seg__btn { flex: 1; border: 0; background: transparent; color: var(--ink-dim); padding: 9px; border-radius: 7px;
  font-family: var(--display); font-weight: 600; letter-spacing: 0.5px; cursor: pointer; transition: 0.15s; font-size: 14px; }
.seg__btn.is-on { background: var(--accent); color: #fff; }

/* ---- Fields ---- */
.fld { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.fld > span { font-size: 12px; color: var(--ink-dim); font-weight: 600; letter-spacing: 0.3px; }
.fld__row { display: flex; align-items: center; justify-content: space-between; }
input { background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink); min-width: 0;
  padding: 12px 14px; border-radius: 10px; font-size: 15px; font-family: inherit; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(60, 130, 246, 0.2); }
.err { color: var(--lose); font-size: 13px; min-height: 18px; margin: 4px 0 0; }

/* ---- Buttons ---- */
.btn { border: 1px solid transparent; border-radius: 11px; padding: 11px 18px; cursor: pointer;
  font-family: var(--display); font-weight: 600; letter-spacing: 0.5px; font-size: 15px;
  transition: transform 0.06s, filter 0.15s, background 0.15s, border-color 0.15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px rgba(60, 130, 246, 0.9); }
.btn--primary:hover { background: var(--accent-bright); }
.btn--primary:disabled { background: var(--accent-deep); opacity: 0.55; cursor: not-allowed; }
.btn--ghost { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--wide { width: 100%; }
.btn--big { padding: 15px; font-size: 17px; margin-top: 6px; }

/* ---- Top bar ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 22px; border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 15, 22, 0.82); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.bar__brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bar__right { display: flex; align-items: center; gap: 14px; }
.wallet { display: flex; flex-direction: column; align-items: flex-end; }
.wallet__label { font-size: 9px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1.4px; }
.wallet__amount { font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.coin { color: var(--coin); }

/* Hamburger */
.burger { width: 42px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; flex: none; }
.burger span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.2s; }
.burger:hover { border-color: var(--accent); }
.burger:hover span { background: var(--accent-bright); }

/* ---- Language ---- */
.lang { display: flex; gap: 4px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 9px; padding: 4px; }
.lang__btn { flex: 1; border: 0; background: transparent; color: var(--ink-faint); font-size: 13px; font-weight: 700; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-family: var(--body); }
.lang__btn.is-on { background: var(--surface-2); color: var(--accent-bright); }

/* ---- Layout ---- */
.grid { display: grid; grid-template-columns: 320px minmax(0, 1fr) 320px; gap: 18px; padding: 22px; width: 100%; max-width: 1320px; margin: 0 auto; align-items: start; }
.grid > * { min-width: 0; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card__h { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.5px; margin: 0 0 16px; }

/* ---- Controls ---- */
.amount { display: flex; flex-direction: column; gap: 8px; }
.amount__quick, .presets { display: flex; gap: 6px; }
.presets { margin-top: 10px; }
.mini { flex: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 8px; padding: 8px 4px; font-weight: 700; font-size: 12px; cursor: pointer; font-family: var(--body); }
.mini:hover { border-color: var(--accent); color: var(--ink); }
.mini.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }

.chance-badge { display: inline-flex; align-items: center; gap: 2px; font-family: var(--display); font-weight: 700; color: var(--accent-bright); }
.chance-badge input { width: 60px; padding: 5px 6px; text-align: right; font-family: var(--display); font-weight: 700; color: var(--accent-bright); font-size: 15px; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 6px; padding: 0; border: 0;
  background: linear-gradient(90deg, var(--win) 0 var(--fill, 50%), var(--surface-2) var(--fill, 50%) 100%); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); cursor: pointer; }

.odds { display: flex; gap: 10px; margin: 20px 0 16px; }
.odds__cell { flex: 1; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; text-align: center; }
.odds__k { display: block; font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.odds__v { font-family: var(--display); font-weight: 700; font-size: 20px; }

/* ---- Toggle ---- */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 4px 0 6px; user-select: none; }
.toggle input { display: none; }
.toggle__track { width: 42px; height: 24px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; position: relative; transition: 0.18s; flex: none; }
.toggle__thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-faint); transition: 0.18s; }
.toggle input:checked + .toggle__track { background: rgba(60, 130, 246, 0.28); border-color: var(--accent); }
.toggle input:checked + .toggle__track .toggle__thumb { left: 20px; background: var(--accent-bright); }
.toggle__label { font-size: 13px; color: var(--ink-dim); font-weight: 600; }

/* ---- Stage / dial ---- */
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 440px; gap: 22px; }
.dial { position: relative; width: clamp(230px, 72vw, 320px); max-width: 100%; aspect-ratio: 1 / 1; }
.dial__mark { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--ink-faint); }
.dial__mark--top { top: -22px; }
.dial__mark--bottom { bottom: -22px; }
/* Red (lose) fills the top; green (win) is a wedge centred on the bottom whose
   half-width --h grows with the chosen chance. 0% is the bottom, 100% the top. */
.dial__ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(
    var(--lose) 0deg,
    var(--lose) calc(180deg - var(--h, 90deg)),
    var(--win) calc(180deg - var(--h, 90deg)),
    var(--win) calc(180deg + var(--h, 90deg)),
    var(--lose) calc(180deg + var(--h, 90deg)),
    var(--lose) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 24px), #000 calc(100% - 23px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 24px), #000 calc(100% - 23px)); }
/* Small pointer that orbits the rim; rotate(0) sits at the bottom (0%). */
.dial__pointer { position: absolute; inset: 0; transform-origin: 50% 50%; transform: translateZ(0) rotateZ(0deg); z-index: 2;
  will-change: transform; backface-visibility: hidden; }
.dial__pointer::after { content: ""; position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 18px solid var(--ink);
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.6)); }
.dial__core { position: absolute; inset: 19%; border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, var(--surface-2), var(--bg-soft));
  border: 1px solid var(--line); display: grid; place-content: center; text-align: center; z-index: 1;
  box-shadow: inset 0 0 26px rgba(0,0,0,0.55); }
.dial__chance { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 11vw, 46px); color: var(--accent-bright); line-height: 1; }
.dial__cap { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1.6px; margin-top: 6px; }

.outcome { font-family: var(--display); font-weight: 700; font-size: 22px; min-height: 30px; text-align: center; letter-spacing: 0.5px; }
.outcome--win { color: var(--win); }
.outcome--lose { color: var(--lose); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.outcome.show { animation: rise 0.35s ease; }

/* ---- History ---- */
.side { align-self: stretch; }
.side__tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab { flex: 1; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 9px; padding: 8px 10px; color: var(--ink-faint); font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.4px; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.tab.is-on { color: var(--ink); border-color: var(--accent); }
.feed__row .f-rank { color: var(--ink-faint); font-family: var(--display); font-weight: 700; font-size: 12px; min-width: 26px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.feed__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.feed__row .f-mid { color: var(--ink-faint); font-weight: 600; font-size: 12px; }
.feed__row .f-amt { font-family: var(--display); font-weight: 700; }
.feed__row.win .f-amt { color: var(--win); }
.feed__row.lose .f-amt { color: var(--lose); }
.feed__empty { color: var(--ink-faint); font-size: 13px; text-align: center; padding: 20px 0; }

/* ---- Footer ---- */
.foot { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 24px; }

/* ---- Drawer / menu ---- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(6, 8, 13, 0.62); backdrop-filter: blur(4px); animation: fade 0.2s ease; }
.drawer__panel { position: absolute; top: 0; right: 0; height: 100%; width: min(360px, 88vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); padding: 24px 22px 30px;
  display: flex; flex-direction: column; gap: 20px; animation: slide 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer__x { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: var(--ink-faint); font-size: 28px; cursor: pointer; line-height: 1; }
.drawer__x:hover { color: var(--ink); }
.drawer__block { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.drawer__h { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.5px; margin: 0 0 12px; color: var(--ink-dim); }
.drawer__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.me { display: flex; align-items: center; gap: 14px; padding-right: 26px; }
.me__avatar { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex: none; border: 1px solid var(--line); }
.me__avatar svg { display: block; width: 100%; height: 100%; }
.me__name { font-family: var(--display); font-weight: 700; font-size: 19px; }
.me__meta { color: var(--ink-faint); font-size: 12px; margin-top: 3px; }
.me__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pstat { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px 13px; }
.pstat__k { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; }
.pstat__v { font-family: var(--display); font-weight: 700; font-size: 18px; margin-top: 4px; }
.pstat__v.pos { color: var(--win); } .pstat__v.neg { color: var(--lose); }

.promo { display: flex; gap: 8px; }
.promo input { text-transform: uppercase; }
.promo .btn { flex: none; }
.promo__msg { font-size: 12px; margin: 8px 0 0; min-height: 16px; }
.promo__msg.ok { color: var(--win); } .promo__msg.bad { color: var(--lose); }

/* ---- Admin (reused on /admin) ---- */
.admin-wrap { max-width: 1320px; margin: 0 auto; padding: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; display: flex; flex-direction: column; gap: 6px; }
.stat__label { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; }
.stat__value { font-family: var(--display); font-weight: 700; font-size: 20px; }
.admin-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.admin-grid > .card:first-child, .admin-grid > .panel:first-child { grid-column: 1 / -1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.panel__title { font-family: var(--display); font-weight: 600; font-size: 15px; margin: 0 0 16px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.search { max-width: 240px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.tbl .mono { font-family: ui-monospace, monospace; }
.row-banned { opacity: 0.55; }
.adjust { display: flex; gap: 6px; align-items: center; }
.adjust__input { width: 90px; }
.row-actions { display: flex; gap: 6px; }
.row-actions .mini, .adjust .mini, .row-actions .chip, .adjust .chip { flex: none; padding: 6px 10px; }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-faint); }
.tag--admin { background: rgba(34, 211, 238, 0.18); color: var(--accent-2); border-color: transparent; }
.tag--banned { background: rgba(239, 83, 80, 0.18); color: var(--lose); border-color: transparent; }
.admin-link { color: var(--accent-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.who { color: var(--ink-dim); font-size: 14px; font-weight: 600; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); background: rgba(12,15,22,0.82); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; gap: 12px; flex-wrap: wrap; }
.topbar__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand__mark { color: var(--accent-bright); font-size: 20px; }
.brand__name { font-family: var(--display); font-weight: 600; letter-spacing: 1.5px; }
.brand__accent { color: var(--accent-bright); }
.brand--big { font-size: 24px; justify-content: center; }
.auth-overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(6,8,13,0.92); z-index: 60; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 32px 28px; box-shadow: var(--shadow); }
.auth-sub { text-align: center; color: var(--ink-dim); margin: 8px 0 22px; font-size: 14px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); border-radius: 8px; padding: 7px 10px; font-weight: 700; cursor: pointer; font-size: 12px; font-family: var(--body); }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.history__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.history__item { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px; font-size: 13px; }
.history__item .h-mult { color: var(--ink-faint); font-weight: 600; }
.history__item .h-amount { font-family: var(--display); font-weight: 700; }
.history__item.win .h-amount { color: var(--win); }
.history__item.lose .h-amount { color: var(--lose); }
.promo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; }

@media (max-width: 1024px) {
  .grid { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
  .stage { order: -1; min-height: auto; padding-top: 30px; padding-bottom: 8px; }
  .side { max-height: none; }
  .feed { max-height: 260px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  input, select, textarea { font-size: 16px; } /* prevents iOS focus zoom */
  .bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .bar__brand { overflow: hidden; }
  .logo { width: 20px; height: 20px; }
  .logo-text { min-width: 0; font-size: 14px; letter-spacing: 1.2px; white-space: nowrap; }
  .bar__right { gap: 8px; min-width: 0; }
  .wallet { min-width: 88px; }
  .wallet__amount { font-size: 15px; white-space: nowrap; }
  .burger { width: 38px; height: 36px; }

  .grid { gap: 10px; padding: 10px; }
  .card { padding: 15px; border-radius: 13px; }
  .stage { padding: 28px 12px 10px; overflow: hidden; }
  .dial { width: min(76vw, 280px); }
  .dial__mark--top { top: -18px; }
  .dial__mark--bottom { bottom: -18px; }
  .dial__chance { font-size: clamp(32px, 12vw, 42px); }
  .controls .fld { margin-bottom: 15px; }
  .presets, .amount__quick { gap: 5px; }
  .mini { min-width: 0; padding-inline: 3px; font-size: 11px; }
  .odds { gap: 7px; margin-top: 16px; }
  .odds__cell { min-width: 0; padding: 10px 6px; }
  .odds__v { font-size: 18px; overflow-wrap: anywhere; }
  .toggle__label { line-height: 1.35; }
  .side__tabs { min-width: 0; }
  .tab { min-width: 0; padding-inline: 5px; font-size: 12px; }

  .drawer__panel { width: 100%; max-width: 360px; padding: 22px 16px 24px; }
  .promo { flex-direction: column; }
  .promo .btn { width: 100%; }
  .me__stats { gap: 6px; }
  .pstat { min-width: 0; padding: 9px 10px; }
  .pstat__v { font-size: 16px; overflow-wrap: anywhere; }
}

/* Admin phone layout: tables become readable cards instead of overflowing. */
@media (max-width: 680px) {
  .topbar { padding: 11px 12px; align-items: flex-start; }
  .topbar .brand { width: 100%; }
  .topbar__right { width: 100%; gap: 7px; }
  .topbar__right .who { flex: 1; min-width: 100px; font-size: 12px; }
  .topbar__right .btn { padding: 8px 10px; font-size: 12px; }
  .brand__name { font-size: 14px; letter-spacing: 1px; }

  .admin-wrap { padding: 12px 10px 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .stat { padding: 11px 12px; min-width: 0; }
  .stat__label { font-size: 8px; letter-spacing: 0.7px; }
  .stat__value { font-size: 16px; overflow-wrap: anywhere; }
  .admin-grid { gap: 12px; }
  .panel { padding: 14px 12px; border-radius: 12px; min-width: 0; }
  .panel__title { margin-bottom: 12px; }
  .panel__head { align-items: stretch; }
  .panel__head .panel__title { margin-bottom: 0; }
  .search { max-width: none; width: 100%; }
  .promo-form { grid-template-columns: 1fr; }
  .promo-form .btn { width: 100%; }

  .table-wrap { overflow: visible; }
  .tbl, .tbl tbody { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody { display: grid; gap: 9px; }
  .tbl tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 10px;
    padding: 11px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
  }
  .tbl td {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .tbl td::before {
    content: attr(data-label);
    color: var(--ink-faint);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
  }
  .tbl td[data-label="Adjust"],
  .tbl td[data-label="Actions"],
  .tbl td[data-label="Action"] { grid-column: 1 / -1; }
  .adjust { min-width: 0; }
  .adjust__input { width: auto; min-width: 0; flex: 1; }
  .row-actions {
    display: grid;
    grid-template-columns: 72px repeat(2, minmax(0, 1fr));
  }
  .row-actions .chip { width: 100%; padding-inline: 5px; }

  .history__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .history__item .h-mult {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-wrap: anywhere;
  }
  .history__item .h-amount { grid-column: 2; grid-row: 1; white-space: nowrap; }
  .auth-sub { font-size: 12px; line-height: 1.5; }
  .footer { padding: 14px 10px; text-align: center; font-size: 11px; }
}
