/* OneAxiom theme — "Midnight Navy Glass": black→deep-navy gradient with
   translucent navy cards and an azure accent. Dark by default. */
:root {
  color-scheme: dark;
  --brand: #3f7fd1;
  --brand-hi: #6fa4e0;
  --on-brand: #ffffff;
  --bg: #030a14;
  --page-bg:
    radial-gradient(1100px 450px at 95% 0%, rgba(40, 90, 180, .22), transparent 65%),
    linear-gradient(165deg, #000205 0%, #071426 55%, #030a14 100%);
  --surface: rgba(20, 40, 75, .32);
  --field: rgba(0, 5, 15, .50);
  --text: #e7edf5;
  --muted: #8fa0b5;
  --text-soft: #b9c5d6;
  --border: rgba(160, 190, 230, .14);
  --ok: #43ba85;
  --warn: #e5a54b;
  --danger: #e5645c;
  --glass: blur(16px) saturate(1.2);
  --shadow: 0 10px 34px rgba(0, 0, 0, .55);
  --radius: 10px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --brand: #2d6ca3;
  --brand-hi: #24587f;
  --on-brand: #ffffff;
  --bg: #e7ecf0;
  --page-bg: #e7ecf0;
  --surface: #f2f5f7;
  --field: #e0e7ec;
  --text: #22303c;
  --muted: #5d6f7d;
  --text-soft: #44565f;
  --border: #c8d4dc;
  --ok: #1d7a3d;
  --warn: #a15c00;
  --danger: #b3261e;
  --glass: none;
  --shadow: none;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--page-bg); background-attachment: fixed; color: var(--text);
  font: 16px/1.5 system-ui, "Segoe UI", sans-serif;
  min-height: 100vh;
}
header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--border);
  backdrop-filter: var(--glass);
}
header .logo {
  display: flex; text-decoration: none; align-self: flex-end;
  font-weight: 800; font-size: 26px; letter-spacing: -0.5px; color: var(--text);
  line-height: 1;
}
#theme-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 14px; line-height: 1;
}
#theme-btn:hover { border-color: var(--brand); }
header .tag { color: var(--muted); font-size: 17px; align-self: flex-end; line-height: 1; padding-bottom: 1px; }
header .spacer { flex: 1; }
header .who { color: var(--muted); font-size: 14px; margin-left: 6px; }
header a.btn-link { color: var(--brand); text-decoration: none; font-size: 14px; }
#help-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 50%; width: 30px; height: 30px; font-weight: 700; cursor: pointer;
}
#help-btn:hover { color: var(--brand); border-color: var(--brand); }

main { max-width: 720px; margin: 32px auto; padding: 0 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 32px; margin-bottom: 18px;
  backdrop-filter: var(--glass); box-shadow: var(--shadow);
}
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 18px; }
p.lead { color: var(--muted); margin-top: 0; }

/* wizard stepper */
.stepper { display: flex; align-items: center; gap: 10px; margin: 0 0 38px; font-size: 16px; }
.stepper .step { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.stepper .dot {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
  border: 2px solid var(--border); color: var(--muted); background: var(--surface);
}
.stepper .step.active .dot { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.stepper .step.active { color: var(--text); font-weight: 600; }
.stepper .step.done .dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.stepper .bar { flex: 1; height: 2px; background: var(--border); min-width: 24px; }

textarea, input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--field); color: var(--text); font: inherit;
}
textarea { min-height: 150px; resize: vertical; margin-top: 6px; }
label.opt { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 15px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.row > label { font-size: 14px; color: var(--muted); }

button.primary {
  background: var(--brand); color: var(--on-brand); border: 0; border-radius: 8px;
  padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: 0.5; cursor: default; }
button.secondary {
  background: transparent; color: var(--brand-hi); border: 1px solid var(--brand);
  border-radius: 8px; padding: 10px 18px; font: inherit; cursor: pointer;
}
.actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }

.linkbox {
  display: flex; gap: 8px; align-items: center; background: var(--field);
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 18px 0;
}
.linkbox code { flex: 1; overflow-wrap: anywhere; font-size: 13px; }

.notice { border-radius: 8px; padding: 12px 14px; margin: 20px 0; font-size: 14px; }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.notice.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.notice.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.notice.info { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }

.secretbox {
  background: var(--field); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, monospace;
}
.bigchoice { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.bigchoice button {
  padding: 28px 18px; font-size: 17px; font-weight: 600; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.bigchoice button:hover { border-color: var(--brand); color: var(--brand); }
.bigchoice small { display: block; font-weight: 400; color: var(--muted); margin-top: 6px; }

.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.presets button {
  border: 1px solid var(--border); background: var(--field); color: var(--text);
  border-radius: 20px; padding: 7px 14px; font-size: 14px; cursor: pointer;
}
.presets button:hover { border-color: var(--brand); color: var(--brand); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chips .chip {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 3px 10px; font-size: 13px;
}
.chips .chip button { border: 0; background: none; color: var(--muted); cursor: pointer; }

dialog {
  border: 1px solid var(--border); border-radius: var(--radius); width: min(780px, 94vw);
  background: var(--surface); color: var(--text); padding: 0;
  backdrop-filter: var(--glass); box-shadow: var(--shadow);
}
:root:not([data-theme="light"]) dialog { background: rgba(8, 18, 36, .85); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .dlg-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
dialog .dlg-body { padding: 8px 20px 20px; height: 70vh; overflow-y: auto; font-size: 15px;
  color: var(--text-soft); }
dialog .dlg-body h3 { color: var(--brand); }
dialog .dlg-body ol li, dialog .dlg-body ul li { margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

[hidden] { display: none !important; }

details { border: 1px solid var(--border); border-radius: 8px; margin: 10px 0; padding: 0 14px; }
details summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--brand); }
details[open] summary { border-bottom: 1px solid var(--border); }

textarea:focus, input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* deliver step: A-or-B radio choice */
.deliver-nokey { margin-bottom: 30px; }
.radio-choice { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px;
  margin: 12px 0; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.radio-choice.sel { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.radio-choice input[type="radio"] { margin-top: 5px; }
.radio-choice .body { flex: 1; }
.radio-choice .body > b { display: block; margin-bottom: 8px; }
.radio-choice .controls { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.radio-choice .controls.dim { opacity: 0.45; }
.chip { border: 1px solid var(--border); background: var(--field); color: var(--text);
  border-radius: 20px; padding: 8px 16px; font: inherit; font-size: 14px; cursor: pointer; }
.chip:hover, .chip.sel { border-color: var(--brand); color: var(--brand-hi); }

/* grouped-section form layout (compose/request) */
.sect-head { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-hi); margin: 0 0 12px; }
.hr { height: 1px; background: var(--border); margin: 28px 0; border: 0; }
.optrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; }
.optrow .lbl b { display: block; font-size: 15px; font-weight: 600; }
.optrow .lbl .muted { display: block; }
.optrow select, .optrow input[type="text"] { width: auto; }
.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { display: none; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: color-mix(in srgb, var(--muted) 35%, transparent); transition: .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #cfd8e3; transition: .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }
.switch input:disabled + span { opacity: .5; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 8px 18px;
  font: inherit; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--on-brand); }

/* get-link hero layout */
.bigcopy { display: flex; gap: 12px; align-items: stretch; }
.bigcopy .linkbox { flex: 1; margin: 0; }
.bigcopy .primary { min-width: 130px; font-size: 16px; }
.ok-inline { color: var(--ok); }
details.rcpt { margin-top: 20px; }
details.rcpt summary { cursor: pointer; color: var(--brand-hi); font-size: 14px; list-style: none; }
details.rcpt summary::before { content: "\25B8  "; }
details.rcpt[open] summary::before { content: "\25BE  "; }

.btn-stack { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.btn-stack small { font-size: 11px; opacity: .75; font-weight: 400; }

footer a { color: var(--brand-hi); text-decoration: none; }
footer { line-height: 2; }

/* dashed "Optional" subgroup */
.optional-group { position: relative; border: 1px dashed var(--border); border-radius: 10px;
  padding: 22px 18px 16px; margin: 18px 0 4px; }
.optional-group .opt-tag { position: absolute; top: -10px; left: 14px; background: var(--surface);
  padding: 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }

/* ---- admin view ---- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.admin-table th, .admin-table td {
  padding: 6px 10px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}
.admin-table th { opacity: 0.7; font-weight: 600; }
