:root {
  --bg: #f4f6fb;
  --glow: rgba(99, 102, 241, 0.14);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-2: #0ea5e9;
  --brand-soft: #eef2ff;
  --success: #047857;
  --success-bg: #ecfdf5;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --topbar: rgba(255, 255, 255, 0.82);
  --code-bg: #0b1220;
  --code-text: #d7e3ff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 48px -30px rgba(15, 23, 42, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080d18;
    --glow: rgba(99, 102, 241, 0.2);
    --surface: #101827;
    --surface-2: #0d1422;
    --surface-3: #172033;
    --text: #e8edf7;
    --text-soft: #c7d2e5;
    --muted: #93a3ba;
    --line: #1e293b;
    --line-strong: #334155;
    --brand: #818cf8;
    --brand-hover: #a5b4fc;
    --brand-2: #38bdf8;
    --brand-soft: #1e1b4b;
    --success: #6ee7b7;
    --success-bg: #052e23;
    --danger: #fca5a5;
    --danger-bg: #3b1215;
    --warn: #fcd34d;
    --warn-bg: #3a2a08;
    --topbar: rgba(8, 13, 24, 0.82);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 48px -30px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 8% -12%, var(--glow), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, rgba(14, 165, 233, 0.08), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { margin: 0; line-height: 1.22; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.05rem); }
h2 { font-size: 1.06rem; }
p { margin: 0; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08rem 0.34rem;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

.muted { color: var(--muted); }
.break-all { overflow-wrap: anywhere; word-break: break-word; }
.inline-form { display: inline-flex; margin: 0; }
.optional {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.42rem;
  margin-left: 0.25rem;
  vertical-align: 0.08em;
}

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, 0.9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 0.94rem; letter-spacing: -0.01em; }
.brand-text span { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.06em; }
.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.42rem 0.8rem;
  border-radius: 9px;
}
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-name {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- layout ---- */
.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  flex: 1;
  padding: 34px 0 56px;
}
.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.78rem;
}
.page-public { padding-top: 0; }

/* ---- headings ---- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.page-head.compact { align-items: flex-start; }
.page-head h1 { margin-bottom: 6px; }
.eyebrow {
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.lead { color: var(--muted); max-width: 720px; font-size: 0.94rem; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span:last-child { color: var(--text-soft); }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.2;
  padding: 0.58rem 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--muted); color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.8);
}
.btn-primary:hover { color: #fff; filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { color: #fff; filter: brightness(1.06); border-color: var(--danger); }
.btn-danger-text { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-text:hover { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.btn-sm { padding: 0.38rem 0.66rem; font-size: 0.8rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---- cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.card-head:last-child { margin-bottom: 0; }
.card-head h2 { padding-top: 2px; }
.card-hint { color: var(--muted); font-size: 0.8rem; }
.card > form > .card-head:first-child { margin-top: 0; }

/* ---- forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 0.85rem; font-weight: 650; color: var(--text-soft); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.62rem 0.75rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field textarea {
  resize: vertical;
  min-height: 74px;
  line-height: 1.55;
  font-family: var(--mono);
  font-size: 0.84rem;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
}
.field small, .field-hint { color: var(--muted); font-size: 0.78rem; }
.field-hint { grid-column: span 2; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}
.check input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--brand);
}
.check span { display: flex; flex-direction: column; gap: 2px; }
.check strong { font-size: 0.87rem; font-weight: 650; }
.check small { color: var(--muted); font-size: 0.78rem; }
.check:hover { border-color: var(--line-strong); }
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-layout > .form-actions { border-top: 0; padding-top: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack .field { gap: 7px; }

/* ---- alerts ---- */
.alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  margin-bottom: 20px;
  font-size: 0.87rem;
  background: var(--surface);
}
.alert-success { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 26%, transparent); }
.alert-error { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.alert-warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.alert-close {
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 2px;
}
.alert-close:hover { opacity: 1; }
.alert-fading { opacity: 0; transition: opacity 0.3s ease; }
.copy-helper {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---- stats ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.stat strong { font-size: 1.55rem; letter-spacing: -0.03em; line-height: 1.15; }
.stat-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.stat-danger strong { color: var(--danger); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}
.table th {
  text-align: left;
  padding: 12px 18px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 38%, transparent); }
.table-compact td { padding: 12px 14px; }
.table-compact th { padding: 10px 14px; }
.row-title { display: block; font-weight: 650; color: var(--text); }
.row-title:hover { color: var(--brand); text-decoration: none; }
.row-sub { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 1px; }
.actions-col { text-align: right; }
.table td.actions-col { white-space: nowrap; }
.table td.actions-col .btn { margin-left: 4px; }

/* ---- badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.18rem 0.56rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.badge-danger { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge-warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badge-muted { color: var(--muted); background: var(--surface-3); }

/* ---- dashboard extras ---- */
.empty-state { text-align: center; padding: 58px 24px; }
.empty-state h2 { margin: 10px 0 8px; }
.empty-state .btn { margin-top: 20px; }
.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 700;
}
.empty-inline {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.86rem;
  background: var(--surface-2);
}
.hint-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-soft) 60%, var(--surface)), var(--surface));
}
.hint-card strong { display: block; margin-bottom: 3px; }
.hint-card p { color: var(--muted); font-size: 0.85rem; max-width: 760px; }

/* ---- detail ---- */
.detail-head { align-items: flex-start; }
.detail-head .lead code { font-size: 0.82rem; }
.temp-card { border-color: color-mix(in srgb, var(--warn) 26%, var(--line)); }
.temp-card .card-head { margin-bottom: 16px; }
.temp-card .card-head h2 { margin-bottom: 3px; }
.temp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.temp-main { min-width: 0; }
.temp-expiry { margin-top: 10px; color: var(--muted); font-size: 0.84rem; }
.countdown {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--warn);
  font-size: 0.95rem;
}
.temp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.qr-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  line-height: 0;
}
.qr-box { max-width: 100%; }
.qr-box img { display: block; width: 240px; max-width: 100%; height: auto; }
.qr-box p { width: 240px; max-width: 100%; margin: 0; color: #475569; font-size: 0.8rem; line-height: 1.5; text-align: center; }
.temp-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}
.temp-empty strong { display: block; margin-bottom: 4px; }
.temp-empty p { color: var(--muted); font-size: 0.84rem; }
.temp-empty form { flex: none; }
.temp-card.is-expired .copy-row,
.temp-card.is-expired .qr-box { opacity: 0.35; pointer-events: none; }
.temp-card.is-expired .temp-expiry,
.temp-card.is-expired .countdown { color: var(--danger); }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.62rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
}
.url-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.78rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}
.detail-main { min-width: 0; }
.detail-side { position: sticky; top: 84px; }
.side-card { padding: 20px; }
.side-card h2 { font-size: 0.95rem; margin-bottom: 13px; }
.side-card .alert { margin: 14px 0 0; font-size: 0.78rem; }
.side-error { max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.meta-list { display: flex; flex-direction: column; gap: 9px; margin: 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.meta-list dt { color: var(--muted); font-size: 0.8rem; }
.meta-list dd { margin: 0; font-weight: 650; font-size: 0.86rem; text-align: right; overflow-wrap: anywhere; }
.side-note { color: var(--muted); font-size: 0.76rem; margin-top: 14px; }
.warning-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.8rem; }
.warning-list li::marker { color: var(--warn); }
.danger-card { border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.danger-card .card-head { margin-bottom: 0; align-items: center; }

/* ---- preview ---- */
.preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  margin: -6px 0 20px;
}
.preview-meta a { overflow-wrap: anywhere; }
.code-card { padding-bottom: 18px; }
.yaml-preview {
  margin: 0;
  padding: 20px;
  max-height: 70vh;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.62;
  tab-size: 2;
  white-space: pre;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

/* ---- settings ---- */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.settings-grid > .card { margin-bottom: 0; }

/* ---- auth ---- */
.auth-page { justify-content: center; }
.auth-page .footer { margin-top: auto; }
.auth-page .page-public { display: flex; align-items: center; justify-content: center; }
.auth-page .page {
  width: min(1180px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 56px 0;
}
.auth-page .page > .alert { width: min(500px, 100%); margin-bottom: 0; }
.auth-wrap { width: 100%; display: flex; justify-content: center; }
.auth-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 38px;
}
.auth-card-wide { width: min(500px, 100%); }
.auth-logo { margin-bottom: 20px; }
.auth-logo .brand-mark { width: 46px; height: 46px; border-radius: 13px; font-size: 0.95rem; }
.auth-card h1 { margin: 5px 0 7px; }
.auth-card > .muted { font-size: 0.88rem; margin-bottom: 24px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 0.8rem; }
.auth-card .form-actions { border-top: 0; padding-top: 0; margin-top: 18px; }

/* ---- errors ---- */
.error-wrap { width: 100%; display: flex; justify-content: center; padding: 60px 0; }
.error-card {
  max-width: 560px;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 46px 36px;
}
.error-code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  margin-bottom: 16px;
  font-weight: 700;
}
.error-card .form-actions { justify-content: center; border-top: 0; padding-top: 0; }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid, .stat-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar-inner { width: calc(100% - 28px); gap: 12px; flex-wrap: wrap; padding: 10px 0; }
  .nav { margin-left: 0; order: 3; width: 100%; }
  .userbox { margin-left: auto; }
  .page { width: calc(100% - 28px); padding: 24px 0 40px; }
  .footer { width: calc(100% - 28px); flex-direction: column; gap: 4px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-head > .btn, .page-head > .action-row { width: 100%; }
  .page-head > .btn { justify-content: center; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2, .field-hint { grid-column: auto; }
  .stat-grid, .stat-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 18px; border-radius: 14px; }
  .card-flush { padding: 0; }
  .auth-card { padding: 28px 22px; }
  .copy-row { flex-direction: column; }
  .temp-grid { grid-template-columns: minmax(0, 1fr); }
  .temp-empty { flex-direction: column; align-items: flex-start; }
  .qr-box { justify-self: start; }
  .url-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hint-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .detail-head .action-row { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .detail-head .action-row > * { width: 100%; }
  .detail-head .action-row .btn { width: 100%; }
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 420px) {
  .stat-grid, .stat-grid-5 { grid-template-columns: minmax(0, 1fr); }
  .auth-card { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
