/* DeskAgent AI design system — UI.md §1 tokens (compiled hand-set, Tailwind-free core).
   Warm-paper editorial "command center / dossier" language; inbound-teal accent. */

:root {
  --paper: #F4EEE3;
  --paper-2: #FBF7EE;
  --ink: #1C2440;
  --ink-soft: #5A617A;
  --accent: #0E8A7B;
  --accent-soft: #0E8A7B22;
  --coral: #E8503A;
  --line: #D9D0BE;
  --ok: #2F9E63;
  --warn: #C98A1B;
  --err: #C2452D;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.serif { font-family: Georgia, 'Times New Roman', serif; }
.mono {
  font-family: 'SF Mono', 'Courier New', monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ink-soft);
}
em.acc, .acc { font-style: italic; color: var(--accent); }
h1.display { font-size: 40px; font-weight: 400; line-height: 1.08; }

/* ---- chrome ---- */
.topnav {
  display: flex; align-items: center; gap: 22px;
  padding: 14px 26px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.logo .badge {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.logo small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 9px; letter-spacing: .18em; }
.navlinks { display: flex; gap: 18px; margin-left: 14px; flex: 1; flex-wrap: wrap; }
.navlinks a {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft); padding-bottom: 4px;
}
.navlinks a.on { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--accent); }
[x-cloak] { display: none !important; }
.lf-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  border-radius: 50%; vertical-align: -2px;
  animation: lf-spin .7s linear infinite;
}
.lf-spinner-lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes lf-spin { to { transform: rotate(360deg); } }

/* ---- N°03b · Lead Finder — the hunting room ---------------------------- */
/* The search console is the app's single inverse-color moment: an ink-dark
   instrument panel on warm paper. Everything else stays in the dossier
   language: mono coordinates, serif italics, stamped verdicts. */

.lf-console {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, #212a4b 0%, var(--ink) 55%, #171e36 100%);
  border-radius: 16px;
  padding: 24px 28px 26px;
  margin-bottom: 14px;
  box-shadow: 0 22px 48px rgba(28, 36, 64, .22);
}
.lf-console::before { /* survey-map dot grid */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(244, 238, 227, .09) 1px, transparent 1px);
  background-size: 20px 20px;
}
.lf-console::after { /* inbound-teal beacon, top-right */
  content: ''; position: absolute; pointer-events: none;
  width: 380px; height: 380px; right: -130px; top: -190px;
  background: radial-gradient(closest-side, rgba(14, 138, 123, .38), transparent 70%);
}
.lf-console .mono { color: rgba(244, 238, 227, .5); }
.lf-console-head {
  position: relative; display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px;
}
.lf-console-head .rule { flex: 1; border-top: 1px dashed rgba(244, 238, 227, .18); }
.lf-fields { position: relative; display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-end; }
.lf-field { flex: 1; min-width: 210px; }
.lf-input {
  width: 100%; background: transparent; border: 0;
  border-bottom: 2px solid rgba(244, 238, 227, .22);
  color: var(--paper-2);
  font: italic 400 21px Georgia, 'Times New Roman', serif;
  padding: 5px 2px 9px; outline: none;
  caret-color: #38C7B3;
  transition: border-color .25s;
}
.lf-input::placeholder { color: rgba(244, 238, 227, .30); }
.lf-input:focus { border-bottom-color: #38C7B3; }
.lf-go {
  position: relative; border: 0; cursor: pointer; border-radius: 10px;
  background: var(--accent); color: #fff;
  font: 700 12px/1 'SF Mono', 'Courier New', monospace;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 16px 26px;
  box-shadow: 0 12px 28px rgba(14, 138, 123, .45);
  transition: transform .15s, background .2s, box-shadow .2s;
}
.lf-go:hover:not(:disabled) { background: #0FA08E; transform: translateY(-1px); box-shadow: 0 16px 32px rgba(14, 138, 123, .5); }
.lf-go:active:not(:disabled) { transform: translateY(0); }
.lf-go:disabled { opacity: .55; cursor: wait; }
.lf-console-foot { position: relative; margin-top: 14px; font-size: 11px; color: rgba(244, 238, 227, .42); }

/* Three-beat method strip under the headline */
.lf-steps { display: flex; gap: 18px; flex-wrap: wrap; margin: 2px 0 16px; }
.lf-steps span { font: 600 10px 'SF Mono', 'Courier New', monospace; letter-spacing: .16em; color: var(--ink-soft); }
.lf-steps b { color: var(--accent); font-weight: 700; margin-right: 5px; }

/* Radar loader */
.lf-radar {
  position: relative; width: 84px; height: 84px; margin: 0 auto; border-radius: 50%;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, transparent 34%, rgba(14, 138, 123, .10) 35% 36%, transparent 37%, transparent 64%, rgba(14, 138, 123, .10) 65% 66%, transparent 67%);
}
.lf-radar::before { /* sweep */
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(14, 138, 123, .55), transparent 80deg);
  animation: lf-spin 1.5s linear infinite;
}
.lf-radar::after { /* center blip */
  content: ''; position: absolute; width: 6px; height: 6px; left: 50%; top: 50%;
  margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent);
}

/* Result rows: case-file cards with a verdict spine */
.lf-card {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: var(--paper-2);
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 12px; padding: 13px 16px; margin-bottom: 10px;
  transition: transform .18s, box-shadow .18s;
  animation: lf-rise .5s cubic-bezier(.2, .7, .3, 1) backwards;
}
.lf-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(28, 36, 64, .10); }
.lf-card.hot  { border-left-color: var(--err); }
.lf-card.warm { border-left-color: var(--warn); }
.lf-card.cool { border-left-color: var(--accent); }
@keyframes lf-rise { from { opacity: 0; transform: translateY(12px); } }

/* Score dial — conic ring, fill = score, color = band */
.lf-ring {
  --pct: 0; --c: var(--accent);
  position: relative; flex: none;
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), var(--line) 0);
}
.lf-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper-2); }
.lf-ring b { position: relative; font-size: 15px; font-weight: 800; color: var(--c); letter-spacing: -.02em; }
.lf-scorebox { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: 62px; }
.lf-scorebox .mono { font-size: 8px; letter-spacing: .18em; }

/* Verdict stamps (flags) */
.lf-stamp {
  display: inline-block; padding: 3px 8px 2px; border-radius: 4px;
  border: 1px dashed currentColor;
  font: 600 8.5px 'SF Mono', 'Courier New', monospace;
  letter-spacing: .13em; text-transform: uppercase;
  transform: rotate(-.5deg);
}
.lf-stamp:nth-child(even) { transform: rotate(.6deg); }
.lf-stamp.err  { color: var(--err); background: #C2452D0F; }
.lf-stamp.warn { color: var(--warn); background: #C98A1B0F; }
.lf-stamp.teal { color: var(--accent); background: var(--accent-soft); }
.lf-stamp.ink  { color: var(--ink-soft); }

/* Criterion ⓘ — hover explains WHY the flag fired */
.lf-info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 11px; height: 11px; margin-left: 5px; vertical-align: -1px;
  border: 1px solid currentColor; border-radius: 50%;
  font: italic 700 8px/1 Georgia, serif;
  text-transform: none; letter-spacing: 0;
  cursor: help; opacity: .7; position: relative;
}
.lf-info:hover, .lf-info:focus { opacity: 1; }
.lf-info::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  width: max-content; max-width: 240px;
  background: var(--ink); color: var(--paper);
  font: 400 11px/1.5 Georgia, serif;
  letter-spacing: normal; text-transform: none; white-space: normal;
  padding: 7px 10px; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(28, 36, 64, .25);
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
  pointer-events: none; z-index: 40;
}
.lf-info::before {
  content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
  pointer-events: none; z-index: 40;
}
.lf-info:hover::after, .lf-info:hover::before,
.lf-info:focus::after, .lf-info:focus::before { opacity: 1; visibility: visible; }

/* Deep-analysis evidence chips */
.lf-evidence { display: flex; gap: 0; flex-wrap: wrap; margin-top: 7px; font-size: 10.5px; color: var(--ink-soft); }
.lf-evidence > span { padding: 1px 10px; border-left: 1px solid var(--line); }
.lf-evidence > span:first-child { border-left: 0; padding-left: 0; }

/* Card scanning state */
.lf-scanning { position: relative; overflow: hidden; }
.lf-scanning::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(14, 138, 123, .08) 50%, transparent 68%);
  animation: lf-scanmove 1.3s ease-in-out infinite;
}
@keyframes lf-scanmove { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Saved ledger */
.lf-index { flex: none; width: 40px; font: 700 10px 'SF Mono', 'Courier New', monospace; letter-spacing: .1em; color: var(--ink-soft); }

/* CI4 pager, dossier-styled */
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pagination a, .pagination span {
  display: inline-block; min-width: 30px; text-align: center;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px;
  font: 600 11px 'SF Mono', 'Courier New', monospace;
  color: var(--ink-soft); text-decoration: none; background: var(--paper-2);
}
.pagination .active a, .pagination .active span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .lf-console { padding: 18px 16px 20px; }
  .lf-go { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .lf-card { animation: none; }
  .lf-scanning::after, .lf-radar::before { animation: none; }
}
.nav-drop { position: relative; }
.nav-drop-btn {
  background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); padding: 0 0 4px;
}
.nav-drop-btn.on { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--accent); }
.nav-drop-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 190px; padding: 6px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 36, 64, .12);
}
.nav-drop-menu a {
  display: block; padding: 8px 10px; border-radius: 6px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
}
.nav-drop-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.nav-drop-menu a.on { color: var(--ink); font-weight: 700; background: var(--accent-soft); }
.nav-toggle {
  display: none; margin-left: auto;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  font-size: 16px; cursor: pointer; align-items: center; justify-content: center;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-decoration: none;
}
.wrap { padding: 26px 30px 40px; max-width: 1240px; margin: 0 auto; }
footer.seal {
  padding: 12px 26px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; margin-top: 24px;
}

/* ---- components ---- */
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.hair { border-top: 1px dashed var(--line); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.pill.ok   { background: #2F9E6320; color: var(--ok); }
.pill.warn { background: #C98A1B20; color: var(--warn); }
.pill.err  { background: #C2452D18; color: var(--err); }
.pill.teal { background: var(--accent-soft); color: var(--accent); }
.pill.ink  { background: var(--ink); color: #fff; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.pulse { animation: pu 1.4s infinite; }
@keyframes pu { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 10px 18px;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn.teal  { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.danger{ background: var(--err); border-color: var(--err); }
.btn.sm    { padding: 6px 12px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.stat { padding: 18px; position: relative; }
.stat .n { font-size: 38px; font-weight: 800; margin: 8px 0 10px; }
.stat .cap { font-size: 11px; color: var(--ink-soft); padding-top: 9px; border-top: 1px dashed var(--line); }
.stat.lock { opacity: .75; }
.stat.lock .n { filter: blur(6px); }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }

.meter { height: 6px; background: #E4DCC9; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter i.w { background: var(--warn); }
.meter i.e { background: var(--err); }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); padding: 10px; border-bottom: 1px solid var(--line);
}
table.data td { padding: 12px 10px; border-bottom: 1px dashed var(--line); }
table.data tr:hover td { background: #EFE8D8; }

.drawer { border-left: 3px solid var(--accent); }

.bub { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.bub.caller { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.bub.ai     { background: var(--accent-soft); border: 1px solid #0E8A7B33; align-self: flex-end; }
.bub small { display: block; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.toolchip {
  align-self: center; font-size: 11px; background: #fff;
  border: 1px dashed var(--accent); color: var(--accent);
  border-radius: 99px; padding: 4px 12px;
}

.wizard-rail { display: flex; flex-direction: column; gap: 2px; }
.wizard-rail > div { padding: 11px 14px; border-left: 2px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.wizard-rail > div.done { border-color: var(--ok); color: var(--ink); }
.wizard-rail > div.now  { border-color: var(--accent); color: var(--ink); font-weight: 700; background: var(--accent-soft); }

.upsell-lock { position: relative; }
.upsell-lock .lock-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  background: #F4EEE3CC; border-radius: var(--radius); text-align: center; padding: 16px;
}

.form-field { margin-bottom: 14px; }
.form-field label { display: block; margin-bottom: 4px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: inherit; color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 0;
}
.form-error { color: var(--err); font-size: 11px; margin-top: 3px; }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  background: var(--ink); color: #fff; border-radius: 10px;
  padding: 12px 18px; font-size: 13px; box-shadow: 0 4px 18px rgba(28,36,64,.25);
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--err); }

.alert { border-radius: var(--radius); padding: 12px 16px; font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.alert.ok   { background: #2F9E6314; border-color: #2F9E6344; color: var(--ok); }
.alert.err  { background: #C2452D14; border-color: #C2452D44; color: var(--err); }
.alert.warn { background: #C98A1B14; border-color: #C98A1B44; color: var(--warn); }
.alert.info { background: var(--accent-soft); border-color: #0E8A7B44; color: var(--accent); }

.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-soft); }
.empty-state .btn { margin-top: 14px; }
.skeleton { background: linear-gradient(90deg, #EDE6D6 25%, #F4EEE3 50%, #EDE6D6 75%); background-size: 200% 100%; animation: shim 1.2s infinite; border-radius: 6px; min-height: 14px; }
@keyframes shim { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.chip { display: inline-block; background: #EDE6D6; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 11px; margin: 2px 3px 0 0; }
.chip.bad  { background: #C2452D14; border-color: #C2452D44; color: var(--err); }
.chip.good { background: #2F9E6314; border-color: #2F9E6344; color: var(--ok); }

/* auth screens */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 34px; }

/* ---- Agent Studio v2 (non-linear) ---- */
.astudio-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.astudio-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.astudio-layout { display: grid; grid-template-columns: 210px minmax(0,1fr) 300px; gap: 16px; align-items: start; }
.astudio-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 14px; }
.astudio-nav-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; cursor: pointer;
  padding: 9px 12px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.astudio-nav-btn:hover { background: var(--paper-2); }
.astudio-nav-btn.active { background: var(--paper-2); border-color: var(--line); color: var(--ink); font-weight: 700; }
.astudio-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line); }
.astudio-dot.done { background: var(--ok); }
.astudio-dot.todo { background: var(--warn); }
.astudio-main { min-width: 0; }
.astudio-panel { animation: astudioIn .18s ease; }
@keyframes astudioIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.astudio-eyebrow { font-family: 'SF Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.astudio-desc { font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px; }
.astudio-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.astudio-panel-head h2 { margin: 2px 0; font-size: 24px; }
.astudio-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.astudio-card-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.astudio-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.astudio-cards { display: grid; gap: 10px; }
.astudio-ovcard, .astudio-ritem { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; cursor: pointer; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: inherit; color: var(--ink); }
.astudio-ovcard:hover, .astudio-ritem:hover { border-color: var(--accent); }
.astudio-ovcard .astudio-dot, .astudio-ritem .astudio-dot { margin-top: 4px; }
.astudio-ovcard-title, .astudio-ritem-name { display: block; font-size: 13px; font-weight: 700; }
.astudio-ovcard-detail, .astudio-ritem-detail { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.astudio-ritem-detail.warn { color: var(--warn); }
.astudio-ritem-go { margin-left: auto; color: var(--ink-soft); align-self: center; }
.astudio-side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; }
.astudio-readiness { display: flex; align-items: center; gap: 12px; }
.astudio-ring {
  --pct: 0; width: 58px; height: 58px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: var(--ink);
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--line) 0);
}
.astudio-ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.astudio-readiness-list, .astudio-publish, .astudio-livever { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.astudio-readiness-list { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.astudio-publish { border-left: 3px solid var(--accent); }
.detail-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.detail-row:last-child { border-bottom: 0; }
.field-help { font-size: 11px; color: var(--ink-soft); margin-top: 5px; }
@media (max-width: 1080px) {
  .astudio-layout { grid-template-columns: 180px minmax(0,1fr); }
  .astudio-side { grid-column: 1 / -1; position: static; }
}
@media (max-width: 640px) {
  .astudio-layout { grid-template-columns: 1fr; }
  .astudio-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .astudio-nav-btn { width: auto; }
}

@media (max-width: 900px) {
  .statrow, .grid3 { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .wrap { padding: 18px 14px 32px; }
  h1.display { font-size: 30px; }
}
/* ── Client folder · THE FRONT DESK (S-05b receptionist tab) ──────────────
   Each desk is a filing dossier: an ink masthead carrying identity + the
   activation meter, then the seven Training Room steps as folio entries.
   The masthead is the only dark surface on the page, so a desk reads as a
   physical document rather than one more warm-paper card. */
.desk-card {
  position: relative; margin-bottom: 20px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 36, 64, .04), 0 8px 24px -18px rgba(28, 36, 64, .5);
}

/* ── Masthead ─────────────────────────────────────────────────────────── */
.desk-head {
  position: relative; padding: 20px 22px 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, #2A3358 0%, transparent 60%),
    linear-gradient(180deg, #1C2440 0%, #171E36 100%);
  color: var(--paper-2);
}
/* Faint dot grid — the "engineering paper" texture used in the lead console. */
.desk-head::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 15px 15px;
}
.desk-head > * { position: relative; }
.desk-head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }

.desk-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 25px; font-weight: 400; line-height: 1.15; letter-spacing: -.01em;
}
.desk-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
/* Pills sit on ink here, so they need their own light treatment. */
.desk-head .pill {
  background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .82);
  border-color: rgba(255, 255, 255, .16);
}
.desk-head .pill.ok { background: rgba(47, 158, 99, .22); color: #7BE0A8; border-color: rgba(123, 224, 168, .35); }
.desk-head .pill.warn { background: rgba(201, 138, 27, .2); color: #F0C36B; border-color: rgba(240, 195, 107, .35); }
.desk-head .pill.teal { background: rgba(14, 138, 123, .26); color: #6FD9C8; border-color: rgba(111, 217, 200, .35); }

/* The desk's own words — one human line among the telemetry. */
.desk-quote {
  margin-top: 13px; padding-left: 13px;
  border-left: 2px solid rgba(111, 217, 200, .45);
  font: italic 400 15px/1.55 Georgia, 'Times New Roman', serif;
  color: rgba(255, 255, 255, .72); max-width: 62ch;
}

/* Activation meter — the progress story, stated once and plainly. */
.desk-meter { margin-top: 16px; }
.desk-meter-bar {
  height: 5px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, .12);
}
.desk-meter-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #34C4AE);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.desk-card.complete .desk-meter-bar i { background: linear-gradient(90deg, #2F9E63, #58D398); }
.desk-meter-label {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 7px;
  font: 600 10px 'SF Mono', 'Courier New', monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.desk-meter-label b { color: var(--paper-2); font-weight: 700; }
.desk-card.complete .desk-meter-label b { color: #7BE0A8; }

/* The masthead's primary action — light on ink, unmistakably clickable. */
.desk-cta {
  flex-shrink: 0; text-decoration: none; white-space: nowrap;
  padding: 10px 17px; border-radius: 9px;
  background: var(--accent); color: #fff !important;
  border: 1px solid transparent;
  font-size: 12.5px; font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(14, 138, 123, .9);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.desk-cta:hover { background: #12A695; transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(18, 166, 149, .95); }
.desk-cta.quiet {
  background: transparent; color: rgba(255, 255, 255, .85) !important;
  border-color: rgba(255, 255, 255, .28); box-shadow: none;
}
.desk-cta.quiet:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); transform: translateY(-1px); }

/* ── Body ─────────────────────────────────────────────────────────────── */
.desk-body { padding: 6px 22px 4px; }

/* The Training Room ledger — one folio entry per wizard step. A continuous
   spine threads the numbered marks so the seven read as a single route; the
   done marks fill teal so progress is visible from across the room. */
.step-ledger { list-style: none; margin: 0; padding: 0; position: relative; }
.step-ledger::before {
  content: ''; position: absolute; top: 26px; bottom: 26px; left: 14px;
  border-left: 2px solid var(--line);
}
.step-row { display: flex; gap: 16px; padding: 16px 0; position: relative; }
.step-row + .step-row { border-top: 1px solid var(--line); }
.step-row.next { background: linear-gradient(90deg, #C98A1B0A, transparent 55%); }

.step-mark {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper-2); border: 2px solid var(--line);
  font: 700 11px 'SF Mono', 'Courier New', monospace;
  color: var(--ink-soft); position: relative; z-index: 1;
}
.step-row.done .step-mark {
  background: var(--accent); border-color: var(--accent); color: #fff;
  font-size: 13px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.step-row.next .step-mark {
  border-color: var(--warn); color: var(--warn);
  background: #FBF7EE; box-shadow: 0 0 0 4px #C98A1B1A;
}

.step-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.step-head b { font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
.step-row.todo .step-head b { color: var(--ink-soft); font-weight: 600; }
.step-edit {
  margin-left: auto; flex-shrink: 0;
  font-size: 10px; text-decoration: none; color: var(--accent);
  padding: 4px 10px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  transition: background .13s ease, border-color .13s ease;
}
.step-edit:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Configured values — inset panel so each step's contents read as a unit
   rather than free-floating text under a heading. */
.step-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px 20px; margin: 11px 0 0;
  padding: 12px 14px; border-radius: 9px;
  background: var(--paper); border: 1px solid var(--line);
}
.step-row.todo .step-facts { opacity: .72; }
.step-facts dt {
  font: 600 9px 'SF Mono', 'Courier New', monospace;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft);
}
.step-facts dd {
  margin: 3px 0 0; font-size: 13.5px; font-weight: 500;
  line-height: 1.4; overflow-wrap: anywhere;
}
.step-facts .pending dd span {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--warn); font-weight: 600; font-style: normal;
}
.step-facts .pending dd span::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn); flex-shrink: 0;
}

/* Provenance footer — facts no wizard step owns (created, on air, line). */
.desk-meta {
  display: flex; gap: 0; flex-wrap: wrap;
  padding: 13px 22px; margin: 0;
  border-top: 1px solid var(--line); background: var(--paper);
  font: 500 11px 'SF Mono', 'Courier New', monospace;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
}
.desk-meta > span { padding: 0 14px; border-left: 1px solid var(--line); }
.desk-meta > span:first-child { border-left: 0; padding-left: 0; }
.desk-meta b { color: var(--ink); font-weight: 700; }

@media (max-width: 600px) {
  .statrow, .grid3 { grid-template-columns: 1fr; }
  .topnav { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .navlinks {
    display: none; width: 100%; order: 3;
    flex-direction: column; gap: 2px;
    margin: 10px 0 0; padding-top: 10px;
    border-top: 1px dashed var(--line);
  }
  .navlinks.open { display: flex; }
  .navlinks a { padding: 10px 4px; }
  /* Dossier at phone width: tighter gutters, a full-bleed CTA, and two fact
     columns (one long column reads as an endless list). */
  .desk-head { padding: 16px 15px 15px; }
  .desk-body { padding: 4px 15px 2px; }
  .desk-meta { padding: 12px 15px; gap: 4px 0; }
  .desk-name { font-size: 21px; }
  .desk-cta { width: 100%; text-align: center; }
  .step-row { gap: 12px; }
  .step-facts { grid-template-columns: 1fr 1fr; padding: 10px 11px; gap: 10px 12px; }
  .nav-drop-btn { padding: 10px 4px; }
  .nav-drop-menu { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; padding: 0 0 0 10px; }
}

/* --------------------------------------------------------------------
   Foldable panel (S-05d) — a settings drawer that stays out of the way.
   Native <details>, so it folds with no JS, is keyboard-operable and is
   findable by the browser's own in-page search.
   -------------------------------------------------------------------- */
.fold { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.fold + .fold { margin-top: 12px; }

.fold > summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; list-style: none;
  border-radius: var(--radius);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--accent-soft); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Hand-drawn caret — rotates a quarter turn when the panel opens. */
.fold-caret {
  flex: none; width: 9px; height: 9px; margin-top: 1px;
  border-right: 1.5px solid var(--ink-soft); border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(-45deg); transition: transform .18s ease;
}
.fold[open] > summary .fold-caret { transform: rotate(45deg); }

.fold-title { flex: 1 1 auto; min-width: 0; }
.fold-title b { display: block; font-size: 14px; color: var(--ink); }
.fold-title span {
  display: block; margin-top: 2px;
  font-size: 11.5px; color: var(--ink-soft);
}
/* The summary line is the whole story when the panel is shut, so the state
   badge sits in it rather than inside the body. */
.fold-state { flex: none; }

.fold-body { padding: 0 18px 18px; }
.fold-body > .hair:first-child { margin-bottom: 16px; }

@media (max-width: 720px) {
  .fold > summary { padding: 12px 14px; gap: 10px; }
  .fold-body { padding: 0 14px 14px; }
  .fold-title span { display: none; }
}

/* --------------------------------------------------------------------
   Auto-Rescue settings panel (S-05d) — numbered sections inside the fold.
   -------------------------------------------------------------------- */

/* --------------------------------------------------------------------
   Toggle switch — reusable inline on/off control.

   Wraps a REAL checkbox (visually hidden, not display:none) so the control
   keeps its native semantics: form submission, keyboard focus, space to
   toggle, and screen-reader state. The span is only paint.

     <label class="switch">
       <input type="checkbox" name="..." value="1" checked>
       <span class="switch-track"></span>
     </label>
   -------------------------------------------------------------------- */
.switch { display: inline-flex; align-items: center; cursor: pointer; vertical-align: middle; }

.switch input {
  position: absolute; opacity: 0; width: 0; height: 0;
}

.switch-track {
  position: relative; display: block;
  width: 34px; height: 20px; flex: none;
  border-radius: 999px;
  background: #CFC7B5;
  border: 1px solid var(--line);
  transition: background .18s ease, border-color .18s ease;
}

.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28);
  transition: transform .18s ease;
}

.switch input:checked + .switch-track {
  background: var(--accent); border-color: var(--accent);
}

.switch input:checked + .switch-track::after { transform: translateX(14px); }

/* Focus must stay visible — the input itself is invisible, so the ring goes
   on the track the user can actually see. */
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.switch input:disabled + .switch-track { opacity: .45; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .switch-track, .switch-track::after { transition: none; }
}

/* Master switch: its own bar, because it decides whether anything below it
   matters. Turning it on tints the bar teal so the state reads at a glance. */
.rs-switch {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 13px 16px; margin-bottom: 20px;
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-left-color .18s ease, background .18s ease;
}
.rs-switch.on { border-left-color: var(--accent); background: var(--accent-soft); }

.rs-switch-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.rs-switch-label input { margin-top: 3px; flex: none; }
.rs-switch-label b { display: block; font-size: 13.5px; color: var(--ink); }
.rs-switch-label small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-soft); }

/* The rails are facts, not controls — mono, quiet, no input affordance. */
.rs-rails {
  font: 600 10px 'SF Mono', 'Courier New', monospace;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); white-space: nowrap;
}

/* Sections separated by rule lines rather than boxes: one card, three parts,
   so the panel doesn't read as three competing objects. */
.rs-sections { display: flex; flex-direction: column; }
.rs-section { padding: 20px 0; border-top: 1px dashed var(--line); }
.rs-section:first-child { padding-top: 4px; border-top: 0; }
.rs-section:last-child { padding-bottom: 4px; }

.rs-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.rs-head b { display: block; font-size: 14px; color: var(--ink); }
.rs-head small {
  display: block; margin-top: 3px; max-width: 68ch;
  font-size: 12px; line-height: 1.5; color: var(--ink-soft);
}
.rs-num {
  flex: none; width: 22px;
  font: 700 11px 'SF Mono', 'Courier New', monospace;
  color: var(--accent); letter-spacing: .06em;
}

.rs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }

.rs-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-soft); }

/* Merge-field chips — readable as things you can type, not as code blocks. */
.rs-tokens {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; font-size: 11px; color: var(--ink-soft);
}
.rs-tokens code {
  padding: 2px 7px; border-radius: 4px;
  background: var(--paper); border: 1px solid var(--line);
  font: 600 10.5px 'SF Mono', 'Courier New', monospace; color: var(--ink);
}

.rs-actions {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.rs-actions .rs-hint { margin-top: 0; max-width: 52ch; }

@media (max-width: 820px) {
  .rs-grid { grid-template-columns: 1fr; }
  .rs-rails { white-space: normal; }
  .rs-head { gap: 9px; }
  .rs-num { width: 18px; }
}

/* --------------------------------------------------------------------
   Brand Forge specimen (S-15) — shows the mark CURRENTLY in force
   (stored, inherited from the agency, or the DeskAgent default) and
   makes the specimen itself the control that replaces it.
   -------------------------------------------------------------------- */
.wl-specimen {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 8px; padding: 14px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--paper);
}

/* Checkerboard so a transparent PNG reads as transparent, not as white. */
.wl-thumb {
  flex: none; width: 132px; height: 66px; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #EFEAE0 25%, transparent 25%, transparent 75%, #EFEAE0 75%),
    linear-gradient(45deg, #EFEAE0 25%, transparent 25%, transparent 75%, #EFEAE0 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.wl-thumb.sq { width: 66px; }
.wl-thumb:hover { border-color: var(--accent); box-shadow: 0 3px 10px rgba(28,36,64,.10); }
.wl-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wl-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.wl-spec-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.wl-spec-meta input[type="file"] { font-size: 11.5px; max-width: 100%; }
.wl-spec-meta small { font-size: 11px; color: var(--ink-soft); line-height: 1.45; }

.wl-reset {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-soft); cursor: pointer;
}
.wl-reset input { margin: 0; }
.wl-reset:hover { color: var(--accent); }

@media (max-width: 720px) {
  .wl-specimen { flex-direction: column; }
  .wl-thumb { width: 100%; }
  .wl-thumb.sq { width: 66px; }
}

/* --------------------------------------------------------------------
   Brand Forge — import-from-URL row and the save toast (S-15).
   -------------------------------------------------------------------- */
.wl-fromurl { display: flex; gap: 6px; align-items: center; }
.wl-fromurl input[type="url"] {
  flex: 1 1 auto; min-width: 0;
  padding: 5px 9px; font-size: 11.5px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.wl-fromurl input[type="url"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.wl-fromurl .btn { flex: none; padding: 5px 11px; font-size: 11px; }
.wl-fromurl .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Confirmation next to the save button rather than a page-level banner —
   the form no longer reloads, so the feedback belongs where the click was. */
.wl-toast {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600;
}
.wl-toast::before { content: '✓'; font-weight: 700; }

/* --------------------------------------------------------------------
   Brain dossier modal (S-39 activation step 2) — the whole brain,
   unabridged, over the picker rather than squeezed inside a card.
   -------------------------------------------------------------------- */
.bd-scrim {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(28, 36, 64, .48);
  backdrop-filter: blur(2px);
}

.bd-modal {
  width: min(880px, 100%);
  max-height: min(88vh, 900px);
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -20px rgba(28, 36, 64, .45);
  overflow: hidden;
}
.bd-inner { display: flex; flex-direction: column; min-height: 0; }

.bd-head {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.bd-x {
  flex: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: 14px; line-height: 1;
}
.bd-x:hover { border-color: var(--coral); color: var(--coral); }

/* The body scrolls; the header and footer stay put, so "Deploy" is always
   reachable no matter how long the persona prompt runs. */
.bd-body { overflow-y: auto; padding: 4px 24px 20px; }

.bd-sec { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.bd-sec:last-child { border-bottom: 0; }
.bd-sec .mono { margin-bottom: 10px; }

/* Persona is authored prose with real line breaks — preserve them, and let
   it wrap rather than scroll sideways. */
.bd-prompt {
  margin: 0; padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13px; line-height: 1.65; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}

.bd-qa { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.bd-qa:last-child { border-bottom: 0; }
.bd-qa b { display: block; color: var(--ink); margin-bottom: 3px; }
.bd-qa > div { color: var(--ink-soft); line-height: 1.6; }

.bd-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; }
.bd-list li { margin-bottom: 6px; }

.bd-econ { display: flex; gap: 28px; flex-wrap: wrap; }
.bd-econ > div { display: flex; flex-direction: column; gap: 2px; }
.bd-econ b { font-size: 20px; color: var(--ink); }

.bd-note { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; }
.bd-sec .bd-note { margin-top: 8px; display: block; }

.bd-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.bd-foot .bd-note { max-width: 42ch; }

@media (max-width: 720px) {
  .bd-scrim { padding: 0; }
  .bd-modal { width: 100%; max-height: 100vh; border-radius: 0; border: 0; }
  .bd-head, .bd-foot { padding: 14px 16px; }
  .bd-body { padding: 4px 16px 16px; }
  .bd-foot .bd-note { display: none; }
  .bd-econ { gap: 18px; }
}

/* --------------------------------------------------------------------
   Custom-brain editors (S-08 step II) — repeating rows for the FAQ,
   triage, objection and disclaimer sections of a generated brain.
   -------------------------------------------------------------------- */
.cb-row {
  display: grid; grid-template-columns: 1fr 32px; gap: 8px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.cb-row:last-child { border-bottom: 0; }
.cb-row input[type="text"], .cb-row textarea, .cb-row select {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.cb-row textarea { resize: vertical; line-height: 1.5; }
.cb-row input:focus, .cb-row textarea:focus, .cb-row select:focus {
  outline: 2px solid var(--accent); outline-offset: -1px;
}
/* The question spans the row and the answer sits beneath it; the delete
   button stays pinned to the first line so rows stay scannable. */
.cb-row > input[type="text"]:first-child { grid-column: 1; }
.cb-row > textarea { grid-column: 1; }
.cb-x {
  grid-row: 1; grid-column: 2;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: 12px; line-height: 1;
}
.cb-x:hover { border-color: var(--coral); color: var(--coral); }

/* Triage needs three controls on one line. */
.cb-triage { grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1.2fr) 32px; align-items: start; }
.cb-triage > * { grid-column: auto !important; }
.cb-triage .cb-x { grid-column: 4 !important; }

.cb-single { grid-template-columns: 1fr 32px; }

@media (max-width: 720px) {
  .cb-triage { grid-template-columns: 1fr 32px; }
  .cb-triage .cb-x { grid-column: 2 !important; }
}

/* ── THE WIRE — app-wide announcement bulletin (FR0.5, S-20f) ───────────────
   Was `.alert info`: a flat mint slab that painted every child teal, with the
   dismiss form as a wrapping flex sibling that dropped onto its own line.
   This is a slip of paper pinned to the desk instead — warm stock, a teal
   rail down the edge, and a live dot, so a notice reads as something that
   just came in rather than as a validation error. */
.wire {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 14px 13px 16px;
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, var(--paper-2) 0%, #F7F2E6 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 #FFFFFFA0, 0 2px 10px #1C24400F;
  animation: wire-in .42s cubic-bezier(.2, .7, .3, 1) both;
}
/* Stack of notices arrives in sequence rather than all at once. */
.wire:nth-of-type(2) { animation-delay: .07s; }
.wire:nth-of-type(3) { animation-delay: .14s; }
.wire:nth-of-type(n+4) { animation-delay: .2s; }

.wire-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.wire-tag i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: wire-pulse 2.6s ease-out infinite;
}

.wire-body { flex: 1 1 auto; min-width: 0; }
.wire-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ink);
}
.wire-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-top: 2px;
}
.wire-cta {
  display: inline-block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .16s ease;
}
.wire-cta:hover { border-bottom-color: var(--accent); }
.wire-cta span { display: inline-block; transition: transform .16s ease; }
.wire-cta:hover span { transform: translateX(3px); }

/* flex:none + margin:0 is the whole fix for the ✕ dropping to its own row. */
.wire-dismiss { flex: none; margin: 0; }
.wire-dismiss button {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px; line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.wire-dismiss button:hover {
  background: #FFFFFF;
  border-color: var(--line);
  color: var(--ink);
}

@keyframes wire-in {
  from { opacity: 0; transform: translateY(-7px); }
  to   { opacity: 1; transform: none; }
}
@keyframes wire-pulse {
  0%      { box-shadow: 0 0 0 0 #0E8A7B66; }
  70%     { box-shadow: 0 0 0 7px #0E8A7B00; }
  100%    { box-shadow: 0 0 0 0 #0E8A7B00; }
}

@media (prefers-reduced-motion: reduce) {
  .wire, .wire-tag i, .wire-cta span { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .wire { gap: 10px; padding: 12px; }
  .wire-tag { margin-top: 2px; }
  .wire-title { font-size: 14px; }
}

/* The bulletin now renders INSIDE the dashboard content, which .wrap has
   already given a max-width and gutters — so this only needs to space itself
   off the greeting below. It briefly carried .wrap gutters of its own, from
   when it lived outside <main> and ran edge-to-edge. */
.wire-rail { margin-bottom: 20px; }
