:root {
  --bg: #0b0d12;
  --bg-elev: #11141b;
  --panel: #161a22;
  --panel-2: #1c212c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #e8edf5;
  --muted: #8b95a8;
  --faint: #5d6778;
  --accent: #6d7cff;
  --accent-2: #8b93ff;
  --accent-soft: rgba(109, 124, 255, 0.14);
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.12);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --side: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(109, 124, 255, 0.16), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(52, 211, 153, 0.06), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #c7ccff; }

.layout {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #141822 0%, #10141c 100%);
  border-right: 1px solid var(--line-2);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 8px 14px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #8b93ff, #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.03em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 99px; }
.nav-item,
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: #c3cadb;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 550;
  border: 1px solid transparent;
}
.nav-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  flex: 0 0 auto;
}
.nav-ico svg { width: 15px; height: 15px; opacity: 0.8; }
.nav-item:hover,
.nav a:hover {
  background: rgba(255,255,255,0.045);
  color: #fff;
  text-decoration: none;
}
.nav-item.active,
.nav a.active {
  background: linear-gradient(90deg, rgba(109, 124, 255, 0.2), rgba(109, 124, 255, 0.07));
  color: #fff;
  border-color: rgba(139, 147, 255, 0.16);
}
.nav-item.active .nav-ico,
.nav a.active .nav-ico {
  background: rgba(139, 147, 255, 0.2);
  box-shadow: none;
}
.nav-item.active .nav-ico svg,
.nav a.active .nav-ico svg { opacity: 1; }
.nav-item.off {
  opacity: 0.36;
  cursor: not-allowed;
  color: #8b95a8;
}
.nav-item.off:hover { background: transparent; color: #8b95a8; }
.nav-hint {
  margin: 6px 8px 2px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.4;
}
.nav .group {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  margin: 16px 8px 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.nav-acc-ava {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 auto;
}
.nav-pick { position: relative; margin: 2px 0 8px; }
.nav-pick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #161a22;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.nav-pick-btn:hover { border-color: rgba(139, 147, 255, 0.35); }
.nav-pick.open .nav-pick-btn { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.nav-pick-name {
  flex: 1;
  text-align: left;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-pick-chev { width: 16px; height: 16px; opacity: 0.45; flex: 0 0 auto; }
.nav-pick.open .nav-pick-chev { transform: rotate(180deg); }
.nav-pick-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 12px;
  background: #1a1f2b;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.nav-pick-menu[hidden] { display: none; }
.nav-pick-menu a {
  border-left: 0;
  padding: 7px 8px;
  border-radius: 8px;
}
.nav-pick-menu a.active { background: var(--accent-soft); color: #fff; }
.side-foot {
  margin-top: auto;
  padding: 12px 4px 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.side-btn { width: 100%; }
.side-out {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 4px;
}
.side-out:hover { color: var(--text); }
.app { min-width: 0; }
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 19, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-weight: 700; letter-spacing: -0.03em; }
.topbar-acc { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
}
.side-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 25;
}
.main { padding: 28px 36px 72px; max-width: 1240px; }
.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.page-hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.page-hero .muted { margin: 0; max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; }
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--panel);
  color: inherit;
  text-decoration: none;
}
a.tile:hover { border-color: var(--line-2); color: inherit; text-decoration: none; }
.tile-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tile-title { font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.tile-price { font-size: 18px; font-weight: 750; color: #ffc24b; white-space: nowrap; }
.tile-meta { color: var(--muted); font-size: 12px; line-height: 1.4; }
.tile-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: 16px;
  background: rgba(255,255,255,0.015);
}
.line-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.line-card + .line-card { margin-top: 8px; }
.line-main { min-width: 0; }
.line-side { flex: 0 0 auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.main > h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.main > .muted:first-of-type { margin: 0 0 22px; max-width: 68ch; }

h1, h2, h3 { margin: 0 0 12px; font-weight: 650; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 28%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset;
}
.card h3 { font-size: 15px; margin-bottom: 12px; }
.card-acc {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  transition: border-color .15s, transform .15s;
}
.card-acc:hover { border-color: var(--line-2); }
.card-acc .acc-top { display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 700;
  flex: 0 0 auto;
}
.acc-meta h3 { margin: 0 0 4px; }
.acc-actions { margin-top: auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.85;
}
.badge.ok { color: var(--good); background: var(--good-soft); border-color: transparent; }
.badge.off { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.guide-used { color: var(--warn); margin-top: 6px; max-width: 36ch; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  width: fit-content;
  max-width: 100%;
}
.tabs a,
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 0;
  color: #b8c0d4;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.tabs a:hover,
.tabs button:hover { background: rgba(255,255,255,0.04); color: #fff; }
.tabs a.active,
.tabs button.on {
  color: #fff;
  background: var(--accent-soft);
}
.file-preview {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 12px;
  background: #0d1016;
}
.file-preview.frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
}
.file-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  max-height: 72vh;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: #0d1016;
  border: 1px solid var(--line);
}

input, textarea, select {
  width: 100%;
  background: #0d1016;
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #818cff, #5b67f0);
  color: #fff;
  border: 0;
  border-radius: 11px;
  padding: 9px 14px;
  font-weight: 650;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(91, 103, 240, 0.25);
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn.danger { background: #e11d48; box-shadow: none; color: #fff; }
.btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  padding: 10px 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: rgba(255,255,255,0.015); }
.status {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  background: var(--panel-2);
  color: var(--muted);
}
.status.refund { color: var(--bad); background: var(--bad-soft); }
.status.closed { color: var(--good); background: var(--good-soft); }
.status.paid { color: var(--accent-2); background: var(--accent-soft); }
.status.pending { color: var(--warn); background: var(--warn-soft); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(720px 380px at 50% -8%, rgba(109, 124, 255, 0.22), transparent 55%),
    radial-gradient(640px 280px at 90% 110%, rgba(52, 211, 153, 0.08), transparent 50%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
  border-color: var(--line-2);
}
.login-card h1 { font-size: 24px; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.check input { width: auto; }
.card ol { margin: 0 0 12px 18px; padding: 0; }
.card ol li { margin: 6px 0; }
.guide-create { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.guide-create input { width: 88px; margin: 0; }
.guide-create label.check { width: auto; display: inline-flex; margin: 0; white-space: nowrap; }
.acc-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.22), rgba(52, 211, 153, 0.1));
  border: 1px solid rgba(109, 124, 255, 0.35);
  box-shadow: var(--shadow);
}
.acc-hero-mark {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.acc-hero-name { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; }
.acc-hero-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.flash {
  background: var(--good-soft);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.error {
  background: var(--bad-soft);
  border: 1px solid rgba(251, 113, 133, 0.25);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
}
pre.copy {
  white-space: pre-wrap;
  background: #0d1016;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.small { font-size: 12px; color: var(--muted); }
.event-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.event-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
}
.period { margin: 8px 0 18px; }
.period-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.period-head h2 { margin: 0; font-size: 18px; }
.stats-grid { grid-template-columns: repeat(4, 1fr); }
.stat .stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat .stat-num { font-size: 26px; font-weight: 720; margin: 8px 0 4px; letter-spacing: -0.04em; }
.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 160px;
  padding-top: 8px;
}
.chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.chart-bar {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, #9aa3ff, #5b67f0);
  border-radius: 4px 4px 0 0;
}
.chart-col span { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.star-row { display: grid; grid-template-columns: 28px 1fr 28px; gap: 8px; align-items: center; margin: 6px 0; }
.star-track { height: 8px; background: #0d1016; border-radius: 99px; overflow: hidden; }
.star-fill { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: #c7ccff; }

#wait-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.62);
  backdrop-filter: blur(10px);
}
#wait-screen[hidden] { display: none; }
.wait-card {
  width: min(380px, calc(100vw - 32px));
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1a1e28, #141821);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  text-align: center;
}
.wait-spin {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border-radius: 99px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: #9aa3ff;
  animation: wait-spin .8s linear infinite;
}
.wait-title { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.wait-sub { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
@keyframes wait-spin { to { transform: rotate(360deg); } }

.refund-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 22px;
  padding: 8px 2px 4px;
}
.refund-hero h1 { margin-bottom: 4px; }
.refund-hero .muted { margin: 0; max-width: 46ch; }
.refund-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.refund-chip {
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}
.refund-chip span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.refund-chip strong { font-size: 15px; letter-spacing: -0.03em; }
.refund-chip.is-warm { background: var(--warn-soft); border-color: transparent; }
.refund-sec { margin: 8px 0 22px; }
.refund-sec-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.refund-sec-head h2 { margin: 0 0 4px; font-size: 18px; }
.refund-sec-head .small { margin: 0; max-width: 56ch; }
.refund-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ticket {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 168px;
}
.ticket-wait { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.08); }
.ticket-fail { box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.08); }
.ticket-top { display: flex; justify-content: space-between; align-items: center; }
.ticket-buyer { font-weight: 650; letter-spacing: -0.02em; }
.ticket-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.ticket-sum { color: var(--text); font-weight: 700; }
.ticket-reason {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bad-soft);
  color: #fecdd3;
  font-size: 13px;
  line-height: 1.4;
}
.ticket-actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.ticket-actions .btn { padding: 8px 12px; }
.refund-empty {
  padding: 22px 16px;
  border-radius: 16px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  text-align: center;
  background: rgba(255,255,255,0.015);
}
.refund-history { display: flex; flex-direction: column; gap: 6px; }
.hist-row {
  display: grid;
  grid-template-columns: 110px 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
}
.hist-name { font-weight: 600; }
.cozy-log { max-height: 280px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hist-row { grid-template-columns: 100px 1fr auto; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .stats-grid { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--side), 86vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .side { transform: none; }
  body.nav-open { overflow: hidden; }
  .topbar { display: flex; }
  .main { padding: 20px 16px 48px; }
  .main > h1:first-child { display: none; }
  .page-hero { margin-bottom: 16px; align-items: flex-start; }
  .page-hero h1 { display: none; }
  .tile-grid { grid-template-columns: 1fr; }
  .line-card { flex-direction: column; }
  .lot-row, .lot-head { grid-template-columns: 72px minmax(0, 1fr) 84px; }
  .lot-go { display: none; }
  .guide-row-head > :nth-child(2),
  .guide-row-head > :nth-child(3),
  .guide-table th:nth-child(2),
  .guide-table th:nth-child(3),
  .guide-row > :nth-child(2),
  .guide-table td:nth-child(2) { display: none; }
  .guide-col-cat, .guide-col-status { width: 0; }
  .guide-col-act { width: 100%; }
  .guide-table,
  .guide-table tbody,
  .guide-table tr { display: block; width: 100%; }
  .guide-table thead { display: none; }
  .guide-table td { display: block; border-top: 0; padding: 6px 16px; }
  .guide-table td.lot-desc { padding-top: 12px; }
  .guide-act { grid-column: 1 / -1; justify-content: flex-start; padding-bottom: 12px; }
  .guide-side-table .lot-row,
  .guide-side-table .lot-head { grid-template-columns: minmax(0, 1fr) auto; }
  .refund-hero { flex-direction: column; align-items: flex-start; }
  .refund-chips { justify-content: flex-start; }
  .hist-row { grid-template-columns: 1fr 1fr; }
  .lot-preview-grid { grid-template-columns: 1fr; }
}

.lot-preview-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  align-items: start;
}
.fp-lot {
  border-radius: 16px;
  overflow: hidden;
  background: #171b24;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.fp-lot-top {
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, #222836, #171b24);
}
.fp-lot-cat { font-size: 12px; color: var(--muted); }
.fp-lot-title { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; margin: 8px 0 12px; line-height: 1.25; }
.fp-lot-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fp-lot-price b { font-size: 28px; color: #ffc24b; }
.fp-lot-bolt {
  font-size: 12px;
  font-weight: 700;
  color: #9ae6b4;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
}
.fp-lot-seller { margin-top: 10px; font-size: 13px; color: var(--muted); }
.fp-lot-switch { display: flex; gap: 6px; padding: 0 18px; }
.fp-lang {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.fp-lang.on { color: #fff; border-color: var(--accent); background: var(--accent-soft); }
.fp-lot-body {
  padding: 14px 18px 18px;
  white-space: pre-wrap;
  line-height: 1.5;
  color: #d5dbe8;
  font-size: 14px;
}
.fp-extra {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.fp-extra > label { margin-top: 0; }
.fp-extra-modes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 8px; }
.fp-extra .fp-extra-value { margin: 0; }
@media (max-width: 900px) {
  .lot-preview-grid { grid-template-columns: 1fr; }
}

.sup-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}
.sup-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.sup-step.done { border-color: rgba(52, 211, 153, 0.35); background: var(--good-soft); }
.sup-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 800;
  flex: 0 0 auto;
}
.sup-step.done .sup-num { background: var(--good-soft); color: var(--good); }
.sup-step-title { font-weight: 700; }
.sup-step-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.key-card { margin-bottom: 16px; }
.key-form input[type="password"] {
  font-size: 16px;
  letter-spacing: 0.04em;
  min-height: 48px;
}
.how-key { margin-top: 8px; }
.key-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.lot-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
}
.lot-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.lot-group-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.lot-table { display: flex; flex-direction: column; }
.lot-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 110px 72px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  color: inherit;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.lot-row:first-child { border-top: 0; }
.lot-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 10px;
  padding-bottom: 10px;
}
a.lot-row:hover { background: rgba(255,255,255,0.03); color: inherit; text-decoration: none; }
.lot-plat { font-weight: 650; color: #d5dbe8; }
.lot-desc { min-width: 0; }
.lot-title {
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.lot-price { font-weight: 750; color: #ffc24b; white-space: nowrap; }
.lot-go { color: var(--accent-2); font-size: 13px; text-align: right; }
.lot-desc .tile-tags { margin-top: 6px; }

.sup-pane { margin-top: 8px; }
.rev-sec { margin: 0 0 22px; }
.rev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.rev-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 42%), var(--panel);
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rev-stars { letter-spacing: 2px; font-size: 16px; line-height: 1; color: #3d4453; }
.rev-stars .on { color: #fbbf24; }
.rev-card.stars-5 { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.12); }
.rev-card.stars-1, .rev-card.stars-2, .rev-card.stars-3, .rev-card.stars-4 {
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.12);
}
.rev-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.rev-buyer { font-size: 18px; font-weight: 750; letter-spacing: -0.03em; }
.rev-lot {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rev-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.rev-facts span {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 3px 8px;
}
.rev-facts .is-ok { color: var(--good); background: var(--good-soft); }
.rev-facts .is-bad { color: var(--bad); background: var(--bad-soft); }
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.tpl-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.tpl-new { border-style: dashed; }
.tpl-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.tpl-preview {
  padding: 12px 14px;
  border-radius: 12px;
  background: #12161f;
  border: 1px solid var(--line);
  line-height: 1.55;
  font-size: 14px;
  color: #dce3f0;
}
.tpl-var {
  display: inline;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: #c7ccff;
  font-weight: 700;
  font-size: 12px;
}
.tpl-card textarea { min-height: 88px; margin: 0; }
.tpl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .sup-steps { grid-template-columns: 1fr; }
  .rev-grid, .tpl-grid { grid-template-columns: 1fr; }
}

.guide-fails { display: flex; flex-direction: column; gap: 10px; }
.guide-fail { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.guide-cat-game { margin: 16px 0 8px; }
.guide-cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-title-line { display: flex; gap: 10px; align-items: flex-start; }
.guide-pick { width: 16px; height: 16px; margin: 3px 0 0; flex: 0 0 auto; }
.guide-bulk { margin: 0 0 14px; }
.guide-bulk summary {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}
.guide-bulk summary::-webkit-details-marker { display: none; }
.guide-bulk-form {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.guide-bulk-form input[name="price"] { width: 88px; margin: 0; }
.guide-bulk-form input[name="gap_min"] { width: 72px; margin: 0; }
.guide-run { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.guide-run form { margin: 0; }
.guide-bulk-accs { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0 12px; }
.dash-sec { margin: 0 0 22px; }
.dash-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.guide-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
}
.guide-toolbar input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
  margin: 0;
}
.guide-toolbar .tabs { margin: 0; }
.guide-acc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 50%), var(--panel);
}
.guide-acc-name { font-size: 18px; font-weight: 750; letter-spacing: -0.03em; }
.guide-acc-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.guide-col-title { width: auto; }
.guide-col-cat { width: 18%; }
.guide-col-status { width: 118px; }
.guide-col-act { width: 278px; }
.guide-table th,
.guide-table td {
  padding: 12px 14px;
  vertical-align: middle;
  text-align: left;
  min-width: 0;
}
.guide-table thead th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.guide-table tbody td { border-top: 1px solid var(--line); }
.guide-table .lot-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.guide-table .lot-plat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-table .badge { white-space: nowrap; }
.guide-act {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.guide-act .btn { padding: 8px 12px; flex-shrink: 0; }
.guide-create {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  width: 100%;
  flex-wrap: nowrap;
}
.guide-create input { width: 56px; flex: 0 0 56px; margin: 0; }
.guide-create .check { margin: 0; white-space: nowrap; flex-shrink: 0; }
.guide-side-table .lot-row,
.guide-side-table .lot-head {
  grid-template-columns: minmax(0, 1fr) 140px 90px;
}
.ov-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.ov-metric {
  min-width: 0;
  padding: 14px 16px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.ov-metric span {
  display: block;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
}
.ov-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
}
.ov-metric em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.ov-metric.is-ok strong { color: var(--good); }
.ov-metric.is-warn strong { color: var(--warn); }
.ov-metric.is-bad strong { color: var(--bad); }
.ov-panel {
  min-width: 0;
  margin: 0;
  padding: 4px 16px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.ov-panel + .ov-panel,
.ov-metrics + .ov-panel { margin-top: 0; }
.ov-panel { margin-bottom: 16px; }
.ov-cols { margin-bottom: 0; }
.ov-cols .ov-panel { margin-bottom: 0; }
.ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.ov-head h2 { margin: 0; font-size: 15px; }
.ov-shop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 340px);
  gap: 10px 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.ov-shop-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ov-shop-id { min-width: 0; }
.ov-shop-name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.ov-shop-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.ov-shop-state { display: flex; flex-wrap: wrap; gap: 6px; }
.ov-shop-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ov-shop-links .btn { padding: 7px 10px; }
.ov-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}
.ov-cols > * { min-width: 0; }
.ov-row {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr) 84px minmax(72px, auto);
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.ov-row > * { min-width: 0; overflow-wrap: anywhere; }
a.ov-row:hover { color: inherit; background: rgba(255,255,255,0.02); }
.ov-row-head {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ov-buyer { font-weight: 700; letter-spacing: -0.02em; }
.ov-buyer small {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}
.ov-lot { color: #c5ccd9; font-size: 13px; line-height: 1.35; }
.ov-sum { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ov-status { text-align: right; }
.ov-status .badge { white-space: normal; }
.ov-log {
  max-height: 640px;
  overflow-x: hidden;
  overflow-y: auto;
}
.ov-log::-webkit-scrollbar { width: 6px; }
.ov-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 99px; }
.ov-ev {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.ov-ev time {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ov-ev-body { min-width: 0; }
.ov-ev-acc { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.ov-ev-text { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ov-ev-warning .ov-ev-text { color: #f6d48a; }
.ov-ev-error .ov-ev-text { color: #ffb4c0; }
@media (max-width: 1100px) {
  .ov-metrics { grid-template-columns: 1fr 1fr; }
  .ov-cols { grid-template-columns: minmax(0, 1fr); }
  .ov-shop { grid-template-columns: minmax(0, 1fr); }
  .ov-shop-links { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .ov-row-head { display: none; }
  .ov-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-lot { grid-column: 1 / -1; }
  .ov-sum, .ov-status { text-align: left; }
}
