@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #101010;
  --panel-2: #151515;
  --line: #2a2a2a;
  --text: #f4f2ee;
  --muted: #8e8e8e;
  --soft: #c4c1bb;
  --white: #f4f2ee;
  --black: #080808;
  --danger: #e8a29a;
  --success: #9ec6aa;
  font-family: 'DM Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
[hidden] { display: none !important; }
a { color: inherit; }
.public-page { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.public-shell { width: 100%; max-width: 480px; }
.brand-lockup { display: flex; gap: 14px; align-items: center; margin-bottom: 48px; }
.brand-mark { display: block; width: 34px; height: 34px; border: 1px solid #d8d5ce; border-radius: 50%; position: relative; flex: 0 0 auto; }
.brand-mark::before { content: ''; position: absolute; left: 8px; right: 8px; top: 8px; bottom: 8px; border: 1px solid #d8d5ce; border-radius: 50%; }
.brand-mark::after { content: ''; position: absolute; width: 4px; height: 4px; background: var(--white); border-radius: 50%; left: 14px; top: 14px; }
.brand-lockup h1 { font-size: 14px; letter-spacing: .19em; margin: 3px 0 0; font-weight: 600; }
.eyebrow { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .17em; color: var(--muted); margin: 0 0 9px; }
.public-panel { border: 1px solid var(--line); background: linear-gradient(145deg, #111 0%, #0b0b0b 100%); padding: clamp(24px, 6vw, 38px); min-height: 300px; }
.step-indicator { display: flex; align-items: center; gap: 9px; color: #9c9a94; font: 10px 'DM Mono', monospace; letter-spacing: .17em; margin-bottom: 35px; }
.step-dot { width: 6px; height: 6px; background: #e6e2d9; border-radius: 50%; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.field-hint { color: var(--muted); font-size: 12px; margin: -2px 0 17px; }
input, textarea, select { width: 100%; color: var(--text); background: #090909; border: 1px solid #353535; border-radius: 2px; padding: 14px 15px; outline: none; transition: border-color .16s ease, background .16s ease; }
input:focus, textarea:focus, select:focus { border-color: #bcb8ae; background: #0d0d0d; }
#code { font-family: 'DM Mono', monospace; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; }
input::placeholder, textarea::placeholder { color: #5e5e5e; }
.button { border: 1px solid transparent; border-radius: 2px; padding: 13px 16px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 18px; transition: opacity .15s, background .15s; }
.button-light { background: var(--white); color: var(--black); }
.button-light:hover { background: #d9d6cf; }
#verify-button, #submit-button { width: 100%; margin-top: 20px; }
.error-message { color: var(--danger); font-size: 12px; line-height: 1.5; margin: 12px 0 0; }
.public-panel h2 { font-size: clamp(24px, 5vw, 31px); letter-spacing: -.045em; line-height: 1.2; font-weight: 500; margin: 4px 0 25px; }
textarea { resize: vertical; min-height: 130px; line-height: 1.6; font-size: 14px; }
.field-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: #777; font-size: 10px; }
.success-state { padding: 24px 0 18px; }
.success-symbol { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #656d63; border-radius: 50%; color: var(--success); margin-bottom: 24px; }
.success-state h2 { margin: 0 0 10px; }
.success-state p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.public-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; color: #5f5f5f; font: 9px 'DM Mono', monospace; letter-spacing: .11em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Admin */
.admin-page { background: #090909; }
.admin-wrap { max-width: 1160px; padding: 28px 24px 36px; margin: 0 auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.admin-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.admin-brand .brand-mark { width: 28px; height: 28px; }
.admin-brand .brand-mark::before { left: 6px; right: 6px; top: 6px; bottom: 6px; }
.admin-brand .brand-mark::after { left: 11px; top: 11px; }
.admin-brand small { color: var(--muted); font: 10px 'DM Mono', monospace; letter-spacing: .12em; margin-left: 8px; }
.button-quiet, .button-outline { background: transparent; border-color: #3a3a3a; color: var(--soft); }
.button-quiet:hover, .button-outline:hover { background: #1b1b1b; }
.login-card { width: 100%; max-width: 420px; margin: 80px auto 100px; padding: 30px; border: 1px solid var(--line); background: var(--panel); }
.login-card h1, .dashboard-heading h1 { font-size: 27px; font-weight: 500; letter-spacing: -.04em; margin: 0 0 12px; }
.muted { color: var(--muted); }
.login-card > p:not(.eyebrow) { font-size: 13px; line-height: 1.6; margin-bottom: 28px; }
.login-card label { margin-top: 17px; }
.login-card .button { margin-top: 22px; }
.full-width { width: 100%; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 34px 0 23px; }
.dashboard-heading h1 { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card, .admin-card { background: var(--panel); border: 1px solid var(--line); }
.stat-card { padding: 19px 20px; }
.stat-card span { color: var(--muted); display: block; font-size: 11px; margin-bottom: 12px; }
.stat-card strong { font-size: 28px; font-weight: 500; letter-spacing: -.04em; }
.admin-card { padding: 24px; margin-bottom: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.section-heading h2, .section-heading h3 { font-size: 18px; font-weight: 500; margin: 0; letter-spacing: -.025em; }
.section-heading .eyebrow { margin-bottom: 6px; }
.fixed-setting { border: 1px solid #383838; padding: 8px 10px; color: #c3c0b9; font: 10px 'DM Mono', monospace; }
.generate-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 14px; }
.generate-form label { font-size: 11px; color: #b7b4ad; }
.generate-form input { padding: 12px; }
.small { font-size: 11px; line-height: 1.55; }
.generated-result { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.generated-result pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; background: #080808; border: 1px solid var(--line); padding: 15px; color: #d8d5ce; font: 12px/1.8 'DM Mono', monospace; }
.filter-row { display: flex; gap: 10px; margin-bottom: 16px; }
.filter-row input { max-width: 360px; }
.filter-row select { width: auto; min-width: 155px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { color: #888; font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
th, td { padding: 14px 12px; border-bottom: 1px solid #262626; vertical-align: top; }
td { color: #d5d2cb; }
td code { font: 11px 'DM Mono', monospace; letter-spacing: .03em; }
.status-pill { display: inline-block; border: 1px solid #414141; color: #c9c6bf; padding: 4px 7px; font-size: 10px; white-space: nowrap; }
.status-pill.available, .status-pill.sent { color: var(--success); border-color: #3d5744; }
.status-pill.disabled, .status-pill.failed { color: var(--danger); border-color: #63413e; }
.status-pill.exhausted { color: #d4c69a; border-color: #5c5237; }
.table-action { background: transparent; color: #d9d5cc; border: 1px solid #424242; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.table-action:hover { background: #242424; }
.answer-cell { min-width: 180px; max-width: 320px; overflow-wrap: anywhere; white-space: pre-wrap; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #efede6; color: #111; padding: 13px 18px; box-shadow: 0 8px 30px #0008; font-size: 12px; }
.admin-footer { color: #5f5f5f; text-align: center; font: 9px 'DM Mono', monospace; letter-spacing: .12em; padding-top: 16px; }
@media (max-width: 720px) {
  .admin-wrap { padding: 18px 14px 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-card { padding: 17px 13px; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .generate-form { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .filter-row { flex-direction: column; }
  .filter-row input, .filter-row select { max-width: none; width: 100%; }
  .login-card { margin: 48px auto 70px; padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
