/* ============================================================================
   Inlava — app chrome.

   Register: a gothic armoury panel. Dark stone ground, brass framing, deep
   recessed wells for anything you read or type into, and inscriptional caps on
   headings so making a character feels like commissioning one. The molten
   accent from culture.md is the forge light — rationed to whatever is live,
   selected, or primary, never used as decoration.

   Two conventions do the structural work, both of them generic UI vocabulary
   rather than anything borrowed:

   1. Directional bevel. A lit edge on top+left and a shadowed edge on
      bottom+right reads as raised; swapping them reads as recessed, and
      swapping on :active makes a control feel physically pressed. This is the
      standard 3D control idiom (Windows 95 / OS/2 / Motif, early 90s).
   2. Framed wells. Content sits *inside* a metal frame rather than on floating
      cards — which is what stops the layout reading as a stack of boxes.
   ============================================================================ */

@font-face {
  font-family: 'Cinzel';
  src: url("fonts/cinzel-var.7a5ca9201524.woff2") format('woff2-variations');
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url("fonts/archivo-var.92895abae7c5.woff2") format('woff2-variations');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url("fonts/ibm-plex-mono-500.6708425c446b.woff2") format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* stone — warm near-black, from culture.md's ground, no green cast */
  --ground:     #100e0c;
  --panel:      #1b1815;
  --panel-dk:   #16130f;
  --well:       #0b0a09;   /* inside inputs, lists, logs */

  /* oxidised iron — the frame metal. Rust rather than brass, so the whole
     chrome sits in the same ember family as the forge accent. */
  --brass:      #7a3d28;
  --brass-hi:   #b5613f;   /* lit edge */
  --brass-lo:   #2a161044; /* shadow edge (translucent so it sits on any panel) */
  --brass-dk:   #2b1a13;
  --gold:       #d4633f;   /* ember — labels, links, ornament (dimmer than the accent) */

  --text:       #ece8e0;
  --text-dim:   #9a9188;
  --text-off:   #6b645c;

  --accent:     #ff4b1f;   /* forge light */
  --accent-dk:  #a83410;
  --ok:         #86b46a;
  --danger:     #c9524d;

  --display: 'Cinzel', Georgia, 'Times New Roman', serif;
  --body:    'Archivo', system-ui, sans-serif;
  --mono:    'Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--ground);
  /* Grain, plus a low forge glow from beneath — the page should feel lit from
     somewhere, not flood-filled. */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
    radial-gradient(120% 60% at 50% 118%, rgba(255,75,31,.13) 0%, transparent 62%);
  background-attachment: scroll, fixed;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--text-off); }
.hidden { display: none !important; }

h1, h2 {
  font-family: var(--display); font-weight: 700; color: var(--text);
  letter-spacing: .02em; margin-top: 0;
}
h1 { font-size: 1.75rem; line-height: 1.2; }
h3 { font-family: var(--body); font-weight: 700; color: var(--text); }

/* --- the frame ----------------------------------------------------------- */
.site-header {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 11px 18px;
  background:
    linear-gradient(180deg, #2b1d17 0%, #1b1310 55%, #120d0b 100%);
  border-bottom: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.28), 0 2px 10px rgba(0,0,0,.5);
}
/* brass hairline under the header — the frame edge */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass) 12%, var(--gold) 50%, var(--brass) 88%, transparent);
  opacity: .5;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 28px; width: auto; display: block; }

.container {
  position: relative;
  width: 100%; max-width: 900px; margin: 24px auto; padding: 26px 28px; flex: 1;
  background-color: var(--panel);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  border: 1px solid var(--brass-dk);
  box-shadow:
    inset 0 1px 0 rgba(181,97,63,.22),
    inset 0 0 0 1px rgba(0,0,0,.5),
    0 8px 30px rgba(0,0,0,.45);
}
/* corner studs — the ornament that makes it a frame instead of a div */
.container::before, .container::after {
  content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--brass-hi), var(--brass-dk));
  box-shadow: 0 0 0 1px rgba(0,0,0,.55);
}
.container::before { top: 7px; left: 7px; }
.container::after  { top: 7px; right: 7px; }

.site-footer {
  text-align: center; padding: 16px; color: var(--text-off); font-size: 11.5px;
  border-top: 1px solid var(--brass-dk);
}
.footer-links { margin: 6px 0 0; }
.footer-links a { color: var(--text-off); }
.footer-links a:hover { color: var(--gold); }

/* --- nav ----------------------------------------------------------------- */
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  color: var(--text-dim); font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  padding: 6px 11px; border: 1px solid transparent;
}
.nav-link:hover { color: var(--gold); border-color: var(--brass-dk); background: rgba(181,97,63,.07); }
.nav-logout { margin: 0; display: inline; }
.as-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.nav-link.as-link {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; padding: 6px 11px;
}
.nav-id {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text);
  background: var(--well); padding: 5px 11px; max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.7);
}
.nav-id-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }

/* --- controls: raised brass, pressing inverts the light ------------------ */
.btn {
  display: inline-block; cursor: pointer; position: relative;
  padding: 8px 18px; font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text);
  background: linear-gradient(180deg, #33211a 0%, #241511 100%);
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.3), inset 0 -1px 0 rgba(0,0,0,.55);
}
.btn:hover { color: var(--gold); border-color: var(--brass); }
.btn:active {
  box-shadow: inset 0 2px 5px rgba(0,0,0,.6);
  padding: 9px 17px 7px 19px;
}
.btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-sm { padding: 5px 12px; font-size: 10px; }
.btn-sm:active { padding: 6px 11px 4px 13px; }
.btn-lg { padding: 12px 28px; font-size: 12px; }
.btn-lg:active { padding: 13px 27px 11px 29px; }

/* the forge: reserved for the single primary action on a page */
.btn-primary {
  color: #170d07;
  background: linear-gradient(180deg, #ff7a45 0%, var(--accent) 45%, var(--accent-dk) 100%);
  border-color: #6d2409;
  box-shadow: inset 0 1px 0 rgba(255,220,190,.5), 0 0 16px rgba(255,75,31,.25);
}
.btn-primary:hover { color: #170d07; background: linear-gradient(180deg, #ff9166 0%, #ff5a2e 45%, #c03d12 100%); }
.btn-outline { background: linear-gradient(180deg, #221e19 0%, #191510 100%); color: var(--text-dim); }
.btn-danger { background: linear-gradient(180deg, #3d1f1d 0%, #2a1513 100%); color: #e8a5a2; border-color: #5a2b28; }
.btn-danger:hover { color: #ffc9c6; border-color: var(--danger); }

/* --- wells: anything you read or type into is recessed ------------------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--gold);
}
.field input, .field textarea, .field select,
.describe-row input, .gate-row input {
  width: 100%; padding: 9px 11px; color: var(--text);
  background: var(--well); font-family: var(--body); font-size: 13.5px; resize: vertical;
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.65);
}
.field input:focus, .field textarea:focus, .field select:focus,
.describe-row input:focus, .gate-row input:focus {
  outline: none; border-color: var(--brass);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.65), 0 0 0 1px rgba(181,97,63,.28);
}
.help { color: var(--text-off); font-size: 11.5px; }
.err { color: var(--danger); font-size: 11.5px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-size: 11.5px; }

/* --- section headers: an engraved rule, not a filled bar ----------------- */
.section-title {
  display: flex; align-items: center; gap: 12px;
  margin: 28px 0 14px; padding: 0;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
}
.section-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--brass), transparent);
  opacity: .55;
}

/* --- hero ---------------------------------------------------------------- */
.hero { text-align: center; padding: 26px 0 22px; }
.hero h1 { font-size: 2.1rem; margin: 0 0 12px; }
.lead { color: var(--text-dim); font-size: 14px; max-width: 520px; margin: 0 auto 22px; }

/* --- character tiles: portrait plates in the frame ----------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.grid-list { grid-template-columns: 1fr; }
.grid-list .char-card { flex-wrap: wrap; }
.char-card {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  background: linear-gradient(180deg, var(--panel-dk) 0%, #100e0b 100%);
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.13);
}
.char-card:hover { border-color: var(--brass); box-shadow: inset 0 1px 0 rgba(181,97,63,.3), 0 0 14px rgba(255,75,31,.10); }
.char-meta { flex: 1; min-width: 0; }
.char-avatar {
  flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--gold);
  background: linear-gradient(180deg, #2e1d15 0%, #18100c 100%);
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.28);
}
.char-avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }
.char-name { font-family: var(--display); font-weight: 700; color: var(--text); font-size: 1.02rem; }
.char-blurb { color: var(--text-off); font-size: 12px; }

/* --- status: struck plates ----------------------------------------------- */
.status-badge {
  display: inline-block; padding: 3px 9px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase;
  border: 1px solid var(--brass-dk); box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
.status-off { background: var(--well); color: var(--text-off); }
.status-starting { background: #3d2115; color: var(--gold); }
.status-online { background: #1d2916; color: var(--ok); }
.status-error { background: #331715; color: #e8a5a2; }
#cc-elapsed { margin-left: 8px; font-size: 11.5px; }
#cc-detail:empty { display: none; }
#cc-detail { margin: 7px 0; font-size: 12px; }
#cc-where:empty { display: none; }
#cc-where { margin: 5px 0 2px; font-size: 12px; }

/* --- discord command center ---------------------------------------------- */
.cc-panel, .describe, .voice-extra, .talk, .gate {
  background: linear-gradient(180deg, var(--panel-dk) 0%, #100e0b 100%);
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.13);
}
.cc-panel { padding: 16px; margin: 16px 0; }
.bot-list { display: flex; flex-direction: column; gap: 7px; }
.bot-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 10px 12px; background: var(--well);
  border: 1px solid var(--brass-dk); box-shadow: inset 0 1px 4px rgba(0,0,0,.55);
}
.bot-row.selected { border-color: var(--accent); box-shadow: inset 0 1px 4px rgba(0,0,0,.55), 0 0 12px rgba(255,75,31,.16); }
.bot-meta { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bot-row-actions { display: flex; align-items: center; gap: 8px; }
.cc-status { margin-bottom: 11px; }
.cc-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.cc-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.cc-steps a { color: var(--gold); text-decoration: underline; }

.cc-steps-row { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 0; margin: 12px 0 14px; }
.cc-step {
  display: flex; align-items: center; gap: 8px; padding: 5px 11px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-off); background: var(--well);
  border: 1px solid var(--brass-dk); box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
.cc-step .cc-dot { width: 7px; height: 7px; border-radius: 50%; background: #35302a; flex: 0 0 auto; }
.cc-step.done { color: var(--text); }
.cc-step.done .cc-dot { background: var(--ok); }
.cc-step.active { color: var(--gold); border-color: var(--brass); }
.cc-step.active .cc-dot {
  background: transparent; border: 2px solid rgba(255,75,31,.3);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; width: 10px; height: 10px;
}
.cc-step.err { color: #e8a5a2; border-color: var(--danger); }
.cc-step.err .cc-dot { background: var(--danger); }

/* --- forms / describe ---------------------------------------------------- */
.form-wrap h1 { margin-bottom: 6px; }
.char-form { margin-top: 20px; display: grid; gap: 16px; }
.describe { padding: 16px; margin: 16px 0 24px; }
.describe label {
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.describe-row { display: flex; gap: 9px; }
.describe-row input { flex: 1; }
.describe-row .btn { white-space: nowrap; }
@media (max-width: 520px) { .describe-row { flex-direction: column; } }

/* --- voice picker -------------------------------------------------------- */
.voice-picker { margin-top: 7px; }
.voice-selected {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; color: var(--text-off);
  margin-bottom: 9px; padding: 5px 11px; background: var(--well);
  border: 1px solid var(--brass-dk); box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
}
.voice-selected.set { color: var(--gold); border-color: var(--brass); }
.voice-selected.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { color: var(--ok); border-color: var(--ok); } 100% {} }
.voice-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 7px; max-height: 300px; overflow-y: auto; padding: 8px;
  background: var(--well); border: 1px solid var(--brass-dk);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65);
}
.voice-card {
  position: relative; text-align: left; cursor: pointer; padding: 9px 11px;
  color: var(--text-dim); display: flex; flex-direction: column; gap: 2px;
  font-family: var(--body); font-size: 12.5px;
  background: linear-gradient(180deg, #2b1d17 0%, #1a1210 100%);
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.16);
}
.voice-card:hover { color: var(--text); border-color: var(--brass); }
.voice-card.selected {
  color: var(--text); border-color: var(--accent);
  background: linear-gradient(180deg, #4a2314 0%, #2a1409 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 0 12px rgba(255,75,31,.18);
}
.voice-card-name { font-family: var(--display); font-weight: 700; color: var(--text); }
.voice-card-blurb { font-size: 11px; opacity: .8; }
.voice-play { position: absolute; top: 9px; right: 11px; font-size: 10px; color: var(--gold); }
.voice-card.loading .voice-play { visibility: hidden; }
.voice-card.loading::after {
  content: ""; position: absolute; top: 10px; right: 11px; width: 10px; height: 10px;
  border: 2px solid rgba(212,99,63,.25); border-top-color: var(--gold); border-radius: 50%;
  animation: spin .8s linear infinite;
}
.voice-extra { margin-top: 14px; padding: 10px 13px; }
.voice-extra summary { cursor: pointer; font-family: var(--display); font-weight: 700; color: var(--text); font-size: 13px; }
.voice-extra-body { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.voice-previews { display: flex; flex-direction: column; gap: 8px; }
.preview-row { display: flex; gap: 8px; }
.preview-row .use { background: linear-gradient(180deg, #2b3a22 0%, #1b2615 100%); border-color: #3d5230; }

/* --- character detail + talk --------------------------------------------- */
.char-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.char-head h1 { margin: 0 0 3px; }
.sample { margin-top: 9px; height: 32px; }
.char-head-actions { margin-top: 12px; }

.talk { padding: 26px; text-align: center; }
/* the sigil — the one round element, and the only thing that glows */
.ptt {
  width: 138px; height: 138px; border-radius: 50%; cursor: pointer;
  color: #170d07; font-family: var(--display); font-size: 13px; font-weight: 700;
  letter-spacing: .06em; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 38% 30%, #ffb27f 0%, var(--accent) 42%, #8f2c0c 100%);
  border: 3px solid var(--brass-dk);
  box-shadow: inset 0 2px 0 rgba(255,220,190,.4), 0 0 26px rgba(255,75,31,.3);
}
.ptt:active { box-shadow: inset 0 3px 10px rgba(0,0,0,.55), 0 0 18px rgba(255,75,31,.24); }
.ptt.recording { animation: pulse 1.1s infinite; }
@keyframes pulse {
  0%   { box-shadow: inset 0 2px 0 rgba(255,220,190,.4), 0 0 0 0 rgba(255,75,31,.55); }
  70%  { box-shadow: inset 0 2px 0 rgba(255,220,190,.4), 0 0 0 20px rgba(255,75,31,0); }
  100% { box-shadow: inset 0 2px 0 rgba(255,220,190,.4), 0 0 0 0 rgba(255,75,31,0); }
}
.status { color: var(--text-off); margin: 14px 0 0; min-height: 1.2em; font-size: 12px; }

.log {
  margin-top: 18px; text-align: left; display: flex; flex-direction: column; gap: 7px;
  max-height: 340px; overflow-y: auto; padding: 11px;
  background: var(--well); border: 1px solid var(--brass-dk);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65);
}
.turn { padding: 7px 11px; max-width: 88%; font-size: 12.5px; }
.turn .who {
  display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--text-off); margin-bottom: 3px;
}
.turn.user { background: #1d1a15; align-self: flex-end; color: var(--text-dim); border: 1px solid #2a251e; }
.turn.bot {
  background: linear-gradient(180deg, #2e1c11 0%, #1f1309 100%);
  align-self: flex-start; color: var(--text); border-left: 2px solid var(--accent);
}

/* --- email gate ---------------------------------------------------------- */
.gate { margin-top: 18px; padding: 18px; }
.gate-msg { margin: 0 0 12px; }
.gate-row { display: flex; gap: 9px; }
.gate-row input { flex: 1; }
.gate-done { font-weight: 700; color: var(--ok); }
.gate-cta { text-align: center; }
.gate-cta .btn { margin: 6px 0 4px; }
.gate-or { font-size: 12px; margin: 6px 0 0; }
.gate-or a { color: var(--gold); text-decoration: underline; }
.gate-email { margin-top: 14px; }
.gate-email summary { cursor: pointer; color: var(--text-off); font-size: 12px; text-align: center; }
.gate-email .gate-form { margin-top: 12px; }

.share { margin-top: 20px; font-size: 12px; word-break: break-all; }
.share code {
  background: var(--well); padding: 3px 7px; font-family: var(--mono); font-size: 11px;
  border: 1px solid var(--brass-dk);
}
.disclosure { font-size: 11.5px; margin-top: 7px; }

/* --- auth ---------------------------------------------------------------- */
.auth-card {
  position: relative; text-align: center;
  max-width: 410px; margin: 22px auto; padding: 30px 28px 26px;
  background: linear-gradient(180deg, var(--panel-dk) 0%, #100e0b 100%);
  border: 1px solid var(--brass-dk);
  box-shadow: inset 0 1px 0 rgba(181,97,63,.18), 0 8px 26px rgba(0,0,0,.45);
}
/* same corner studs as the main frame, so the auth plate belongs to it */
.auth-card::before, .auth-card::after {
  content: ""; position: absolute; top: 7px; width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--brass-hi), var(--brass-dk));
  box-shadow: 0 0 0 1px rgba(0,0,0,.55);
}
.auth-card::before { left: 7px; }
.auth-card::after  { right: 7px; }
.auth-mark { display: block; width: 150px; height: auto; margin: 2px auto 18px; opacity: .92; }
.auth-eyebrow {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 7px;
}
.auth-card h1 { margin: 0 0 7px; font-size: 1.42rem; }
.auth-sub { color: var(--text-off); font-size: 12.5px; margin: 0; }
/* the form itself reads left-aligned even though the header is centred */
.auth-form { text-align: left; }
.auth-form { display: grid; gap: 14px; margin-top: 18px; }
.auth-form .btn { width: 100%; text-align: center; }
.auth-alt { margin-top: 18px; font-size: 12.5px; text-align: center; }
.auth-alt a { color: var(--gold); text-decoration: underline; }
.auth-sep { display: flex; align-items: center; gap: 11px; margin: 18px 0; color: var(--text-off); font-size: 11px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--brass-dk); }
.social-auth { display: grid; gap: 8px; }
.social-discord:hover { border-color: #5865f2; color: #aab4ff; }
.social-google:hover { border-color: #9aa0a6; color: #e8eaed; }

/* --- messages ------------------------------------------------------------ */
.messages { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 7px; }
.msg {
  padding: 9px 13px; font-size: 12.5px;
  background: linear-gradient(180deg, var(--panel-dk) 0%, #100e0b 100%);
  border: 1px solid var(--brass-dk); border-left: 3px solid var(--brass);
}
.msg.error { color: #e8a5a2; border-left-color: var(--danger); }
.msg.success { color: var(--ok); border-left-color: var(--ok); }

/* --- dashboard / legal --------------------------------------------------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dash-empty { text-align: center; padding: 36px 0; color: var(--text-off); }
.card-actions { margin-left: auto; display: flex; gap: 7px; }

.legal { max-width: 700px; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 1.05rem; margin: 24px 0 7px; }
.legal ul { padding-left: 19px; }
.legal li { margin: 4px 0; }
.consent { text-align: center; margin-top: 4px; }
.consent a { color: var(--gold); text-decoration: underline; }

/* --- form page intro / rules --------------------------------------------- */
/* .lead centres itself for the hero; a form page's intro sits under a
   left-aligned heading, so it needs its own left-aligned variant */
.form-intro { color: var(--text-dim); font-size: 14px; max-width: 58ch; margin: 0 0 18px; }
.rule {
  border: 0; height: 1px; margin: 22px 0;
  background: linear-gradient(90deg, var(--brass), transparent);
  opacity: .45;
}
.section-note { margin: -6px 0 14px; max-width: 68ch; }

/* nested disclosure inside another one — indented and hairlined so it reads as
   a sub-option of its parent rather than a sibling */
.voice-sub {
  margin-top: 12px; padding: 8px 0 0 12px;
  border-left: 1px solid var(--brass-dk);
}
.voice-sub summary {
  cursor: pointer; font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-off);
}
.voice-sub summary:hover { color: var(--gold); }

/* a disclosure styled as a button, for inline row tools (edit) */
.row-tool { position: relative; }
.row-tool > summary { list-style: none; display: inline-block; }
.row-tool > summary::-webkit-details-marker { display: none; }
.row-tool-body {
  margin-top: 8px; padding: 12px; background: var(--well);
  border: 1px solid var(--brass-dk); box-shadow: inset 0 2px 6px rgba(0,0,0,.6);
}
.bot-swap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  width: 100%; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--brass-dk);
}
.bot-swap label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--gold);
}
.bot-swap select {
  flex: 1; min-width: 150px; padding: 6px 9px; color: var(--text);
  background: var(--well); font-family: var(--body); font-size: 13px;
  border: 1px solid var(--brass-dk); box-shadow: inset 0 2px 5px rgba(0,0,0,.65);
}
.bot-swap select:focus { outline: none; border-color: var(--brass); }

/* --- icons --------------------------------------------------------------- */
.sprite { display: none; }
/* sized in em so an icon always matches the text it labels, and inheriting
   currentColor so it picks up hover/danger states for free */
.icon {
  width: 1.15em; height: 1.15em; vertical-align: -.22em;
  margin-right: .12em; flex: none;
}
.btn .icon { margin-right: .35em; }

/* --- misc ---------------------------------------------------------------- */
.spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 8px;
  border: 2px solid rgba(212,99,63,.28); border-top-color: var(--gold); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .container { margin: 0; border-left: 0; border-right: 0; padding: 20px 16px; }
  .hero h1 { font-size: 1.6rem; }
  .char-head { flex-direction: column; text-align: center; }
}
