:root {
  --bg: #0f1419;
  --panel: #171d24;
  --border: #2a3441;
  --text: #e7ecf3;
  --muted: #93a1b3;
  --primary: #10a37f;
  --primary-hover: #0d8a6a;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --header-h: 56px;
}

* { box-sizing: border-box; }

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #0b1015 0%, #121820 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  line-height: 1.5;
}

body::-webkit-scrollbar {
  display: none;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.container-plain { padding-top: 40px; }

.container-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 48px;
}

.container-narrow { max-width: 420px; }

.page-hero {
  text-align: center;
  margin-bottom: 24px;
}

.page-hero h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.page-hero-compact {
  text-align: left;
  margin-bottom: 20px;
}

.page-hero-compact h1 {
  font-size: 1.35rem;
}

.muted { color: var(--muted); }

/* Admin shell */
.admin-shell {
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 16, 21, 0.92);
  backdrop-filter: blur(10px);
}

.admin-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.admin-brand:hover {
  color: var(--text);
  text-decoration: none;
}

.admin-nav {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.admin-nav-link.active {
  background: rgba(16, 163, 127, 0.18);
  color: #9ef0d7;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-content {
  padding-top: 28px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-page-head h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.admin-page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
  align-items: start;
}

.grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-compact h3,
.panel-table h3,
.panel-head h3 {
  font-size: 1rem;
  margin-bottom: 0;
}

.panel-desc {
  font-size: 0.875rem;
  margin: 6px 0 16px;
}

.docs-page .panel-desc {
  margin-bottom: 8px;
}

.docs-inline {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  color: #c9d4e3;
}

.docs-endpoint {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.docs-endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.92rem;
}

.docs-method {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 163, 127, 0.18);
  color: #9ef0d7;
  font-size: 0.75rem;
  font-weight: 600;
}

.docs-method-get {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.docs-endpoint p {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 12px;
  line-height: 1.6;
}

.docs-block {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0f1419;
}

.docs-block-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.docs-pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.docs-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.docs-meta div {
  background: #0f1419;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.docs-meta dt {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.docs-meta dd {
  margin: 0;
  font-size: 0.9rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-filter-label {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-select-wrap {
  position: relative;
  display: inline-flex;
}

.admin-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.admin-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 152px;
  height: 40px;
  padding: 0 36px 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 38px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.admin-select:hover {
  border-color: rgba(16, 163, 127, 0.35);
  background: #121820;
}

.admin-select:focus {
  outline: none;
  border-color: rgba(16, 163, 127, 0.6);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.form > label .admin-select-wrap {
  display: block;
  width: 100%;
}

.form > label .admin-select,
.form select {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 36px 0 12px;
  line-height: 42px;
  font-size: 0.95rem;
}

.panel-table .table-wrap {
  margin: 0 -4px;
}

.panel-notes .admin-notes {
  margin-top: 8px;
}

.panel-auth {
  padding: 28px 24px;
}

.admin-notes {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.admin-notes strong {
  color: var(--text);
  font-weight: 600;
}

.form { display: grid; gap: 14px; }

.form > label {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}

.form input:not([type="checkbox"]):not([type="radio"]),
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form input:focus:not([type="checkbox"]):not([type="radio"]),
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: rgba(16, 163, 127, 0.6);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.12);
}

.form textarea {
  resize: vertical;
  min-height: 96px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-all;
  scrollbar-width: thin;
  scrollbar-color: #3a4a5c #0b1015;
}

.form textarea::-webkit-scrollbar,
.session-modal-body::-webkit-scrollbar,
.docs-pre::-webkit-scrollbar,
.log-modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.form textarea::-webkit-scrollbar-track,
.session-modal-body::-webkit-scrollbar-track,
.docs-pre::-webkit-scrollbar-track,
.log-modal-body::-webkit-scrollbar-track {
  background: #0b1015;
  border-radius: 8px;
}

.form textarea::-webkit-scrollbar-thumb,
.session-modal-body::-webkit-scrollbar-thumb,
.docs-pre::-webkit-scrollbar-thumb,
.log-modal-body::-webkit-scrollbar-thumb {
  background: #3a4a5c;
  border-radius: 8px;
  border: 2px solid #0b1015;
}

.session-field {
  gap: 8px !important;
}

.session-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.session-field-meta {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.session-field-input {
  min-height: 220px;
  max-height: min(52vh, 420px);
  padding: 12px 10px 12px 14px;
  border-radius: 10px;
  background: #0a0e12;
  font-size: 0.8rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.form-hint {
  font-size: 0.8rem;
  margin: -6px 0 0;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  cursor: pointer;
}

.field-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
}

.field-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--primary);
}

.form label.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row input,
.form label.checkbox-row input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}

.form-hint-ok { color: #7dffc8; }
.form-hint-error { color: #ffb4b4; }

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions .btn-primary {
  flex: 1;
  min-width: 140px;
}

.form-actions .btn-ghost {
  min-width: 120px;
}

.container-redeem-shell {
  max-width: 520px;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 20px 56px;
}

.container-redeem-shell .form-hint {
  font-size: 0.875rem;
}

/* ── Redeem page: soft cloud light theme ── */
body.page-redeem {
  background: #eef2ff;
  color: #1e293b;
}

.redeem-page {
  --rp-bg: #eef2ff;
  --rp-surface: #ffffff;
  --rp-ink: #0f172a;
  --rp-muted: #64748b;
  --rp-border: #e2e8f0;
  --rp-violet: #6366f1;
  --rp-violet-dark: #4f46e5;
  --rp-violet-soft: #eef2ff;
  --rp-success: #10b981;
  --rp-error: #ef4444;
  --rp-radius: 20px;
  --rp-font: "Noto Sans SC", "PingFang SC", sans-serif;
  --rp-mono: "JetBrains Mono", "Consolas", monospace;
  position: relative;
  font-family: var(--rp-font);
}

.redeem-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 40%, #fdf4ff 100%);
}

.redeem-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(99, 102, 241, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.5;
}

.redeem-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: redeem-float 18s ease-in-out infinite;
}

.redeem-blob--violet {
  width: 420px;
  height: 420px;
  background: #c7d2fe;
  top: -120px;
  right: -80px;
}

.redeem-blob--sky {
  width: 360px;
  height: 360px;
  background: #bae6fd;
  bottom: -100px;
  left: -60px;
  animation-delay: -6s;
}

.redeem-blob--pink {
  width: 280px;
  height: 280px;
  background: #fbcfe8;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.35;
  animation-name: redeem-float-center;
  animation-delay: -12s;
}

.redeem-deco {
  position: absolute;
  pointer-events: none;
}

.redeem-deco--ring {
  width: 120px;
  height: 120px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 50%;
  top: 12%;
  left: 8%;
  animation: redeem-float 14s ease-in-out infinite reverse;
}

.redeem-deco--plus {
  width: 20px;
  height: 20px;
  top: 22%;
  right: 14%;
  opacity: 0.25;
}

.redeem-deco--plus::before,
.redeem-deco--plus::after {
  content: "";
  position: absolute;
  background: var(--rp-violet);
  border-radius: 1px;
}

.redeem-deco--plus::before {
  width: 20px;
  height: 2px;
  top: 9px;
  left: 0;
}

.redeem-deco--plus::after {
  width: 2px;
  height: 20px;
  top: 0;
  left: 9px;
}

.redeem-deco--dot-cluster {
  width: 48px;
  height: 48px;
  bottom: 18%;
  right: 10%;
  background:
    radial-gradient(circle, rgba(16, 163, 127, 0.35) 2px, transparent 2px) 0 0 / 16px 16px,
    radial-gradient(circle, rgba(99, 102, 241, 0.25) 2px, transparent 2px) 8px 8px / 16px 16px;
  opacity: 0.6;
  animation: redeem-float 20s ease-in-out infinite;
  animation-delay: -4s;
}

@keyframes redeem-float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-12px) translateX(6px); }
}

@keyframes redeem-float-center {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(calc(-50% + 6px)) translateY(-10px); }
}

.redeem-card {
  position: relative;
  background: var(--rp-surface);
  border-radius: var(--rp-radius);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(99, 102, 241, 0.08),
    0 24px 48px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.redeem-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.redeem-header {
  text-align: center;
  padding: 36px 32px 12px;
  position: relative;
}

.redeem-mark-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
}

.redeem-mark-glow {
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(16, 163, 127, 0.2) 0%, transparent 70%);
  animation: redeem-pulse 3s ease-in-out infinite;
}

@keyframes redeem-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.redeem-mark {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.redeem-mark-img {
  display: block;
  width: 32px;
  height: 32px;
}

.redeem-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--rp-ink);
  letter-spacing: 0.02em;
}

.redeem-sub {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--rp-muted);
}

.redeem-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.redeem-tags li {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--rp-violet-dark);
  padding: 4px 10px;
  border-radius: 99px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.redeem-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 24px 20px;
  font-size: 0.75rem;
  color: var(--rp-muted);
  border-top: 1px solid var(--rp-border);
  background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.redeem-footer svg {
  flex-shrink: 0;
  color: #94a3b8;
}

.step-bar {
  position: relative;
  padding: 28px 32px 24px;
}

.step-track {
  position: absolute;
  top: 44px;
  left: calc(32px + (100% - 64px) * 0.125);
  width: calc((100% - 64px) * 0.75);
  height: 3px;
  background: var(--rp-border);
  border-radius: 99px;
}

.step-track-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--rp-violet) 0%, #818cf8 100%);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  color: var(--rp-muted);
}

.step-num {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  border: 2px solid var(--rp-border);
  transition: all 0.3s ease;
}

.step-name {
  font-size: 0.75rem;
  font-weight: 500;
}

.step-dot.active {
  color: var(--rp-violet-dark);
}

.step-dot.active .step-num {
  background: var(--rp-violet);
  border-color: var(--rp-violet);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.step-dot.done {
  color: var(--rp-ink);
}

.step-dot.done .step-num {
  background: #ecfdf5;
  border-color: var(--rp-success);
  color: var(--rp-success);
}

.redeem-body {
  padding: 0 32px 24px;
}

.redeem-body .wizard-panel {
  animation: redeem-fade 0.35s ease both;
  min-height: 0;
}

.redeem-body .wizard-panel.hidden {
  animation: none;
}

@keyframes redeem-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-panel { animation: none; }
  .step-track-fill { transition: none; }
  .status-spinner { animation: none; }
  .redeem-blob,
  .redeem-deco,
  .redeem-mark-glow { animation: none; }
}

.panel-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rp-ink);
}

.panel-desc {
  margin: 0 0 20px;
  font-size: 0.875rem;
  color: var(--rp-muted);
}

.session-tutorial-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--rp-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rp-violet-dark);
  cursor: pointer;
  transition: color 0.15s, opacity 0.15s;
}

.session-tutorial-link:hover {
  color: var(--rp-violet);
  opacity: 0.9;
}

.session-tutorial-link:focus-visible {
  outline: 2px solid var(--rp-violet);
  outline-offset: 2px;
  border-radius: 4px;
}

.session-tutorial-link svg {
  flex-shrink: 0;
  color: var(--rp-violet);
}

.session-tutorial-modal .modal-backdrop {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
}

.page-redeem .session-tutorial-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--rp-border);
  border-radius: 16px;
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 20px 40px rgba(99, 102, 241, 0.12);
}

.session-tutorial-accent {
  height: 3px;
  background: linear-gradient(90deg, #10a37f 0%, #6366f1 100%);
}

.page-redeem .session-tutorial-panel .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  margin: 0;
  border-bottom: 1px solid var(--rp-border);
}

.session-tutorial-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.session-tutorial-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #ecfdf5 100%);
  color: var(--rp-violet-dark);
}

.page-redeem .session-tutorial-panel .modal-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--rp-ink);
}

.session-tutorial-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--rp-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.session-tutorial-close:hover {
  background: #e2e8f0;
  color: var(--rp-ink);
}

.session-tutorial-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-step {
  padding: 12px 14px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--rp-border);
}

.tutorial-step--1 {
  border-color: rgba(99, 102, 241, 0.28);
  background: linear-gradient(180deg, #f5f3ff 0%, #f8fafc 100%);
}

.tutorial-step--2 {
  border-color: rgba(16, 163, 127, 0.28);
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 100%);
}

.tutorial-step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rp-ink);
}

.tutorial-step-mark {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #10a37f;
}

.tutorial-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: var(--rp-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.tutorial-list li {
  position: relative;
  padding-left: 14px;
}

.tutorial-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.tutorial-list li + li {
  margin-top: 4px;
}

.tutorial-list strong {
  color: var(--rp-ink);
  font-weight: 600;
}

.tutorial-link {
  color: var(--rp-violet-dark);
  font-weight: 500;
}

.tutorial-link:hover {
  text-decoration: underline;
}

.tutorial-url {
  display: block;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px dashed rgba(99, 102, 241, 0.35);
  font-family: var(--rp-mono);
  font-size: 0.72rem;
  color: var(--rp-violet-dark);
  word-break: break-all;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.tutorial-url:hover {
  border-color: var(--rp-violet);
  background: #eef2ff;
}

.tutorial-lead {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: var(--rp-muted);
}

.tutorial-note {
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.06);
  font-size: 0.75rem;
  color: var(--rp-violet-dark);
  line-height: 1.5;
}

.tutorial-code {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  border: none;
  font-family: var(--rp-mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
}

.redeem-form {
  gap: 16px;
}

.redeem-form .field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rp-ink);
  margin-bottom: 6px;
}

.redeem-form .input-mono,
.page-redeem .redeem-form .input-mono,
.page-redeem .redeem-form input:not([type="checkbox"]):not([type="radio"]),
.page-redeem .redeem-form textarea {
  font-family: var(--rp-mono);
  font-size: 0.9rem;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--rp-ink);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.redeem-form textarea {
  min-height: 128px;
  max-height: 240px;
  resize: vertical;
  line-height: 1.55;
}

.redeem-form .input-mono:focus,
.page-redeem .redeem-form .input-mono:focus,
.page-redeem .redeem-form input:not([type="checkbox"]):not([type="radio"]):focus,
.page-redeem .redeem-form textarea:focus {
  outline: none;
  border-color: var(--rp-violet);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), 0 2px 8px rgba(99, 102, 241, 0.08);
}

.redeem-form .input-mono::placeholder,
.page-redeem .redeem-form .input-mono::placeholder,
.page-redeem .redeem-form input::placeholder,
.page-redeem .redeem-form textarea::placeholder {
  color: #94a3b8;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--rp-violet-soft);
  font-size: 0.875rem;
}

.plan-badge span {
  color: var(--rp-muted);
}

.plan-badge strong {
  color: var(--rp-violet-dark);
  font-weight: 600;
}

.redeem-form .form-hint-ok { color: var(--rp-success); }
.redeem-form .form-hint-error { color: var(--rp-error); }

.btn-redeem {
  background: linear-gradient(135deg, var(--rp-violet) 0%, var(--rp-violet-dark) 100%);
  border: none;
  color: #fff;
  font-family: var(--rp-font);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 13px 24px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-redeem:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-redeem:active {
  transform: translateY(1px);
}

.btn-redeem:focus-visible {
  outline: 2px solid var(--rp-violet);
  outline-offset: 2px;
}

.btn-redeem-outline {
  background: #fff;
  border: 1.5px solid var(--rp-border);
  color: var(--rp-ink);
  font-family: var(--rp-font);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-redeem-outline:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-redeem-outline:focus-visible {
  outline: 2px solid var(--rp-violet);
  outline-offset: 2px;
}

.btn-redeem.btn-block {
  width: 100%;
}

.redeem-form .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.redeem-form .form-actions .btn-redeem {
  flex: 1.5;
}

.redeem-form .form-actions--single .btn-redeem {
  flex: 1;
  width: 100%;
}

.info-list {
  margin: 0 0 24px;
  padding: 0;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--rp-border);
  overflow: hidden;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rp-border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item dt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--rp-muted);
  flex-shrink: 0;
}

.info-item dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rp-ink);
  text-align: right;
  word-break: break-all;
}

.info-list--compact {
  margin-top: 20px;
  margin-bottom: 0;
}

.status-card {
  text-align: center;
  padding: 28px 20px 20px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--rp-border);
}

.status-card[data-status="success"] {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-card[data-status="failed"] {
  background: #fef2f2;
  border-color: #fecaca;
}

.status-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--rp-violet);
  border-radius: 50%;
  animation: job-spin 0.8s linear infinite;
}

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
}

.status-icon.is-success {
  background: #d1fae5;
}

.status-icon.is-success::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 22px;
  width: 9px;
  height: 16px;
  border: solid var(--rp-success);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.status-icon.is-failed {
  background: #fee2e2;
}

.status-icon.is-failed::before,
.status-icon.is-failed::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2px;
  background: var(--rp-error);
  margin: -1px 0 0 -10px;
}

.status-icon.is-failed::before { transform: rotate(45deg); }
.status-icon.is-failed::after { transform: rotate(-45deg); }

.status-icon.is-cancelled {
  background: #f1f5f9;
}

.status-icon.is-cancelled::after {
  content: "—";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--rp-muted);
}

.status-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rp-ink);
}

.status-card[data-status="success"] .status-title { color: #047857; }
.status-card[data-status="failed"] .status-title { color: #b91c1c; }

.status-msg {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--rp-muted);
}

.status-hint {
  text-align: center;
  margin: 16px 0 10px;
  font-size: 0.8125rem;
  color: var(--rp-muted);
}

.status-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.status-actions.hidden {
  display: none;
}

body.page-redeem .toast {
  background: var(--rp-ink);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

@media (max-width: 520px) {
  .container-redeem-shell {
    padding: 24px 16px 40px;
  }

  .redeem-header {
    padding: 28px 24px 8px;
  }

  .redeem-deco--ring,
  .redeem-deco--plus,
  .redeem-deco--dot-cluster {
    display: none;
  }

  .redeem-tags li {
    font-size: 0.68rem;
  }

  .redeem-footer {
    padding: 12px 20px 16px;
    font-size: 0.7rem;
  }

  .step-bar {
    padding: 24px 20px 20px;
  }

  .step-track {
    left: calc(20px + (100% - 40px) * 0.125);
    width: calc((100% - 40px) * 0.75);
  }

  .step-name {
    font-size: 0.68rem;
  }

  .redeem-body {
    padding: 0 24px 28px;
  }

  .info-item {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .info-item dd {
    text-align: left;
  }
}

/* legacy aliases kept for other pages */
.container-redeem {
  max-width: 760px;
  width: 100%;
}

.page-hero-redeem {
  margin-bottom: 28px;
}

.page-hero-redeem h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.redeem-wizard {
  width: 100%;
  padding: 32px 36px;
}

.redeem-wizard .form {
  gap: 20px;
}

.redeem-wizard .form input,
.redeem-wizard .form textarea {
  padding: 14px 16px;
  font-size: 1rem;
}

.redeem-wizard .form textarea {
  min-height: 120px;
  max-height: 240px;
}

.redeem-wizard .btn {
  padding: 12px 24px;
  font-size: 1rem;
}

.redeem-wizard .btn-block {
  margin-top: 4px;
}

.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  flex-wrap: nowrap;
  position: relative;
  padding: 0 4px;
}

.wizard-step {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 10px 8px;
  border-radius: 0;
  border: none;
  border-bottom: 3px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  background: transparent;
  transition: color 0.2s, border-color 0.2s;
}

.wizard-step.active {
  border-bottom-color: var(--primary);
  color: #9ef0d7;
  font-weight: 600;
}

.wizard-step.done {
  color: var(--text);
  border-bottom-color: rgba(16, 163, 127, 0.35);
}

.wizard-panel {
  min-height: 200px;
}

.wizard-meta {
  margin: 0 0 16px;
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.wizard-meta strong {
  color: var(--text);
}

.confirm-kv {
  margin-bottom: 0;
  grid-template-columns: 100px 1fr;
  gap: 12px 16px;
  font-size: 0.95rem;
}

.confirm-card {
  padding: 20px 22px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(16, 163, 127, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(16, 163, 127, 0.18);
  margin-bottom: 24px;
}

.confirm-card-title {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.confirm-kv dd {
  font-size: 1rem;
  word-break: break-all;
  color: var(--text);
}

.job-result-card {
  text-align: center;
  padding: 32px 28px 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #121820 0%, #0d1117 100%);
  margin-bottom: 16px;
}

.job-result-card[data-status="pending"],
.job-result-card[data-status="running"] {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08), 0 12px 40px rgba(59, 130, 246, 0.08);
}

.job-result-card[data-status="success"] {
  border-color: rgba(16, 163, 127, 0.4);
  box-shadow: 0 0 0 1px rgba(16, 163, 127, 0.1), 0 12px 40px rgba(16, 163, 127, 0.1);
}

.job-result-card[data-status="failed"] {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08), 0 12px 40px rgba(239, 68, 68, 0.08);
}

.job-result-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.job-result-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(59, 130, 246, 0.15);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: job-spin 0.85s linear infinite;
}

@keyframes job-spin {
  to { transform: rotate(360deg); }
}

.job-result-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.job-result-card[data-status="success"] .job-result-icon {
  background: rgba(16, 163, 127, 0.18);
  color: #7dffc8;
  box-shadow: 0 0 24px rgba(16, 163, 127, 0.25);
}

.job-result-card[data-status="failed"] .job-result-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ffb4b4;
}

.job-result-card[data-status="cancelled"] .job-result-icon {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.job-result-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.job-result-card[data-status="pending"] .job-result-title,
.job-result-card[data-status="running"] .job-result-title {
  color: #93c5fd;
}

.job-result-card[data-status="success"] .job-result-title {
  color: #7dffc8;
}

.job-result-card[data-status="failed"] .job-result-title {
  color: #ffb4b4;
}

.job-result-message {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.job-result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
}

.job-meta-item {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.job-meta-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.job-meta-value {
  display: block;
  font-size: 1rem;
  color: var(--text);
  word-break: break-all;
}

.job-result-hint {
  text-align: center;
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.job-refresh-btn {
  display: block;
  margin: 0 auto;
}

.redeem-wizard .form-actions {
  margin-top: 8px;
}

.redeem-wizard .form-actions .btn-primary {
  flex: 1.5;
  min-width: 160px;
}

.redeem-wizard .kv {
  grid-template-columns: 120px 1fr;
  gap: 12px 20px;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .redeem-wizard {
    padding: 24px 20px;
  }

  .page-hero-redeem h1 {
    font-size: 1.6rem;
  }

  .wizard-step {
    font-size: 0.78rem;
    padding: 8px 4px;
  }

  .job-result-meta {
    grid-template-columns: 1fr;
  }

  .job-result-card {
    padding: 24px 18px 20px;
  }
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #222b36;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.08); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-danger-text { color: #ffb4b4; }
.btn-danger-text:hover { color: #fecaca; background: rgba(239, 68, 68, 0.1); }

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

th, td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px !important;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85rem;
}

.card-col-pan {
  min-width: 160px;
  white-space: nowrap;
}

.card-col-exp,
.card-col-cvc {
  min-width: 72px;
  white-space: nowrap;
}

.table-empty-inline {
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #243041;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-active { background: rgba(16, 163, 127, 0.2); color: #7dffc8; }
.badge-in_use,
.badge-running,
.badge-pending { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.badge-exhausted,
.badge-disabled,
.badge-expired { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.badge-success { background: rgba(16, 163, 127, 0.2); color: #7dffc8; }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: #ffb4b4; }

.kv {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 16px;
  font-size: 0.9rem;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

.key-result {
  margin-top: 20px;
}

.key-result-card {
  border: 1px solid rgba(16, 163, 127, 0.28);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(16, 163, 127, 0.1) 0%, rgba(15, 20, 25, 0.98) 42%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  animation: keyResultIn 0.32s ease-out;
}

@keyframes keyResultIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .key-result-card {
    animation: none;
  }
}

.key-result-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(42, 52, 65, 0.5);
  background: rgba(0, 0, 0, 0.12);
}

.key-result-textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  max-height: 360px;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 0;
  background: #0a0e12;
  color: #d8e2ed;
  font-size: 0.9rem;
  line-height: 1.65;
  letter-spacing: 0.04em;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: #3d4f63 transparent;
}

.key-result-textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(16, 163, 127, 0.35);
}

.key-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon.copied {
  color: var(--primary);
  background: rgba(16, 163, 127, 0.15);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.key-result pre {
  background: #0f1419;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.85rem;
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-panel-wide {
  max-width: 860px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-head h3 {
  font-size: 1rem;
}

.btn-link.session-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-link.session-preview:hover {
  text-decoration: underline;
}

.session-modal-body {
  background: #0a0e12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  max-height: min(70vh, 640px);
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: #3a4a5c #0a0e12;
}

.log-modal-body {
  min-height: 240px;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #1f2937;
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 360px;
  z-index: 100;
}

.toast.error { border-color: var(--danger); color: #fecaca; }

@media (max-width: 860px) {
  .admin-split {
    grid-template-columns: 1fr;
  }

  .admin-topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .admin-nav {
    order: 3;
    flex-basis: 100%;
    padding-bottom: 4px;
  }
}

@media (max-width: 640px) {
  .container,
  .admin-topbar-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .row { grid-template-columns: 1fr; }

  .admin-page-head-row {
    flex-direction: column;
  }

  .truncate { max-width: 140px; }
}
