/* BlazeChip — modern, elegant, soft; ember accents. Light default, dark via [data-theme="dark"]. */
:root {
  --bg: #faf7f4;
  --glow-1: rgba(255, 122, 47, .10);
  --glow-2: rgba(255, 179, 71, .09);
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, .82);
  --panel-2: #f4f0ec;
  --line: #eae3db;
  --text: #241d18;
  --muted: #83786e;
  --flame: #f2600f;
  --flame-2: #ffab40;
  --flame-soft: rgba(242, 96, 15, .10);
  --think: #3878e0;
  --think-bg: rgba(56, 120, 224, .05);
  --act: #e0473f;
  --act-glow: rgba(224, 71, 63, .14);
  --act-bg: rgba(224, 71, 63, .05);
  --ok: #1a9d57;
  --shadow: 0 18px 50px rgba(120, 72, 40, .12);
  --shadow-soft: 0 6px 24px rgba(120, 72, 40, .08);
  --primary-fg: #fff7ef;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #121015;
  --glow-1: rgba(255, 110, 40, .10);
  --glow-2: rgba(255, 170, 60, .06);
  --panel: #1a171d;
  --panel-glass: rgba(26, 23, 29, .82);
  --panel-2: #221e26;
  --line: #2e2932;
  --text: #f1ede8;
  --muted: #9b93a0;
  --flame: #ff7a2f;
  --flame-2: #ffb35c;
  --flame-soft: rgba(255, 122, 47, .12);
  --think: #5b9dff;
  --think-bg: rgba(91, 157, 255, .06);
  --act: #ff5d55;
  --act-glow: rgba(255, 93, 85, .18);
  --act-bg: rgba(255, 93, 85, .05);
  --ok: #37d67a;
  --shadow: 0 24px 70px rgba(0, 0, 0, .5);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, .35);
  --primary-fg: #fff7ef;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1100px 560px at 12% -12%, var(--glow-1), transparent 60%),
    radial-gradient(900px 480px at 88% -8%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--flame-soft); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#app { height: 100vh; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ── Auth ── */
#auth-view { align-items: center; justify-content: center; }
.auth-card {
  width: min(430px, 92vw); background: var(--panel-glass); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.brand {
  font-family: var(--display); font-size: 27px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 10px;
}
.brand.small { font-size: 18px; }
.flame { display: inline-flex; align-items: center; filter: drop-shadow(0 2px 8px rgba(255, 122, 47, .45)); }
.flame svg { display: block; }
.brand.small .flame svg { width: 18px; height: 18px; }
.tagline { color: var(--muted); margin: 8px 0 24px; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; background: var(--panel-2); padding: 4px; border-radius: 999px; }
.tab { flex: 1; background: transparent; color: var(--muted); border: 0;
  padding: 9px 12px; border-radius: 999px; font: inherit; font-weight: 500; transition: color .18s, background .18s, box-shadow .18s; }
.tab.active { color: var(--text); background: var(--panel); box-shadow: var(--shadow-soft); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input, .modal input, .modal select, .modal textarea {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 15px; border-radius: var(--radius-sm); font: inherit; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.auth-form input:focus, .modal input:focus, .modal select:focus, .modal textarea:focus {
  border-color: var(--flame); box-shadow: 0 0 0 3px var(--flame-soft);
}
.primary {
  background: linear-gradient(135deg, var(--flame), var(--flame-2)); color: var(--primary-fg);
  border: 0; padding: 12px 18px; border-radius: 999px; font: inherit; font-weight: 600;
  letter-spacing: .01em; box-shadow: 0 6px 20px rgba(242, 96, 15, .30);
  transition: filter .18s, box-shadow .18s, transform .18s;
}
.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 26px rgba(242, 96, 15, .38); transform: translateY(-1px); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 500;
  transition: color .18s, border-color .18s, background .18s; }
.ghost:hover { color: var(--text); border-color: var(--flame); background: var(--flame-soft); }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--muted);
  width: 36px; height: 36px; border-radius: 999px; font-size: 15px; line-height: 1;
  transition: color .18s, border-color .18s, background .18s; }
.icon-btn:hover { color: var(--text); border-color: var(--flame); background: var(--flame-soft); }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.msg { margin-top: 12px; font-size: 13px; min-height: 18px; }
.msg.err { color: var(--act); }
.msg.ok { color: var(--ok); }

/* ── Topbar ── */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--panel-glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.badge { color: var(--muted); font-size: 12.5px; }
.badge b { color: var(--text); font-weight: 600; }

/* ── Stream ── */
.stream { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 22px; }
.turn { margin: 0 auto 22px; max-width: 860px; }
.turn .who { font-family: var(--display); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.turn.user .who { color: var(--flame); text-align: right; }
.turn.think .who { color: var(--think); }
.turn.act .who { color: var(--act); }
.turn .body { white-space: pre-wrap; word-break: break-word; }
.turn.user .body {
  background: linear-gradient(135deg, var(--flame-soft), transparent 160%);
  border: 1px solid var(--line); border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  padding: 12px 16px; margin-left: auto; width: fit-content; max-width: 82%;
}
.turn.user { display: flex; flex-direction: column; align-items: flex-end; }
.turn.think .body {
  background: var(--think-bg); border: 1px solid var(--line); border-left: 3px solid var(--think);
  border-radius: 4px var(--radius-md) var(--radius-md) 4px; padding: 12px 16px;
}
.turn.act .body {
  background: var(--act-bg); border: 1px solid var(--line); border-left: 3px solid var(--act);
  border-radius: 4px var(--radius-md) var(--radius-md) 4px; padding: 12px 16px;
}
.turn .status { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-style: italic; min-height: 16px; }
.cursor::after {
  content: ""; display: inline-block; width: 8px; height: 1em; margin-left: 2px;
  vertical-align: text-bottom; border-radius: 3px;
  background: linear-gradient(180deg, var(--flame), var(--flame-2));
  animation: blink 1.1s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .15; } }

/* ── ACT live activity panel: makes "CHIP is working" unmistakable ── */
.act-activity {
  margin-top: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--act-bg); box-shadow: 0 0 0 3px var(--act-glow), var(--shadow-soft);
  display: flex; flex-direction: column; gap: 6px;
}
.act-activity .act-now { display: flex; align-items: center; gap: 8px; }
.act-activity .act-spin {
  width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--act); border-top-color: transparent;
  animation: act-spin .8s linear infinite;
}
@keyframes act-spin { to { transform: rotate(360deg); } }
.act-activity .act-label { font-family: var(--display); font-weight: 600; color: var(--act); font-size: 13px; letter-spacing: .02em; }
/* Task timer — the live "working for …" / frozen "worked for …" readout. */
.act-activity .act-elapsed { margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--act); font-size: 12px; font-weight: 600; }
/* Session timer — total worked time this session, kept visually secondary. */
.act-activity .act-session { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; opacity: .85; }
/* Idle/ready: stop the spinner and turn it solid green so "done" reads at a glance. */
.act-activity .act-spin.done { animation: none; border-color: var(--ok, #3fb950); border-top-color: var(--ok, #3fb950); background: var(--ok, #3fb950); }
.act-activity .act-step { font-size: 12.5px; color: var(--text); opacity: .85; min-height: 15px; }
.act-activity .act-log { margin: 2px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.act-activity .act-log li { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.act-activity .act-log .act-log-dot { color: var(--flame); font-weight: 700; }
.act-activity .act-log .act-log-text { overflow-wrap: anywhere; }
.act-activity .act-stop {
  margin-left: 10px; padding: 4px 16px; font-size: 12px; font-weight: 600;
  color: var(--act); background: transparent; border: 1px solid var(--act);
  border-radius: 999px; flex: 0 0 auto;
  transition: background .18s ease, color .18s ease;
}
.act-activity .act-stop:hover { background: var(--act); color: #fff; }
.act-activity .act-stop:disabled { opacity: .55; cursor: default; }
.act-activity.stopping .act-spin { animation-duration: .4s; opacity: .5; }

/* ── Command bar — floating composer ── */
.cmdbar { display: flex; align-items: center; gap: 10px;
  margin: 10px auto 18px; padding: 10px 12px 10px 18px; width: min(904px, calc(100% - 36px));
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel-glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  transition: border-color .18s, box-shadow .18s;
}
.cmdbar:focus-within { border-color: var(--flame); box-shadow: 0 0 0 3px var(--flame-soft), var(--shadow-soft); }
.plus {
  color: var(--flame); font-family: var(--display); font-size: 20px; font-weight: 500; line-height: 1;
}
.mode {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px;
  font: inherit; font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: .08em; min-width: 82px;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s;
}
.mode.think { color: var(--think); border-color: var(--think); background: var(--think-bg); box-shadow: 0 0 14px rgba(56, 120, 224, .14); }
.mode.act { color: #fff; background: linear-gradient(135deg, var(--act), #ff7a55); border-color: transparent;
  box-shadow: 0 4px 16px var(--act-glow); }
#cmd-input { flex: 1; background: transparent; border: 0; color: var(--text);
  font: inherit; font-size: 16px; outline: none; min-width: 0; }
#cmd-input::placeholder { color: var(--muted); opacity: .8; }
.send {
  background: linear-gradient(135deg, var(--flame), var(--flame-2)); border: 0; color: var(--primary-fg);
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
  box-shadow: 0 4px 14px rgba(242, 96, 15, .30);
  transition: filter .18s, box-shadow .18s, transform .18s, opacity .18s;
}
.send:hover { filter: brightness(1.06); transform: translateY(-1px); }
.send:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
.send svg { display: block; }

/* ── Admin ── */
.admin-body { padding: 24px; overflow-y: auto; }
.admin-body h2 { font-family: var(--display); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-top: 26px; }
.table { display: flex; flex-direction: column; gap: 8px; }
.row { display: grid; grid-template-columns: 1.6fr .7fr .8fr 1fr auto; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 16px;
  box-shadow: var(--shadow-soft); }
.row .email { font-weight: 600; }
.row .status { font-size: 12px; }
.status.approved { color: var(--ok); }
.status.waitlisted { color: var(--flame); }
.status.suspended { color: var(--act); }
.row .muted { color: var(--muted); font-size: 12px; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(18, 12, 8, .40); display: flex; align-items: center; justify-content: center; z-index: 50;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { width: min(520px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); }
.modal-card h3 { margin-top: 0; font-family: var(--display); letter-spacing: -.01em; }
.modal-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.modal-card textarea { min-height: 60px; resize: vertical; }
.aws { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.aws legend { color: var(--muted); font-size: 12px; padding: 0 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
/* ── your public address ── */
.site-url { display: inline-block; margin-top: 6px; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px; color: var(--flame); text-decoration: none; word-break: break-all; }
.site-url:hover { text-decoration: underline; }
.modal-note { margin: -6px 0 16px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.modal-card label .opt { opacity: .6; font-weight: 400; }
.dom-list-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 8px; }
.dom-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dom-name { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
.dom-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.dom-status.s-live { background: rgba(26,157,87,.15); color: var(--ok); }
.dom-status.s-declined { background: rgba(224,71,63,.15); color: var(--act); }
.dom-status.s-approved { background: rgba(242,96,15,.15); color: var(--flame); }
.dom-note { flex-basis: 100%; font-size: 12px; color: var(--muted); }

/* Consequential yes/no inside a dialog of text fields: row layout, and the
   explanation sits under the label so the choice is legible at a glance. */
.modal-card label.check-row { flex-direction: row; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; }
.modal-card label.check-row input { width: 15px; height: 15px; margin-top: 1px; flex: none; accent-color: var(--flame); }
.modal-card label.check-row span { display: flex; flex-direction: column; gap: 4px; color: var(--text); font-size: 13px; }
.modal-card label.check-row small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* ── Settings ── */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: 0; }
.setting-row .label { font-size: 14px; color: var(--text); font-weight: 500; }
.setting-row .sub { font-size: 12.5px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel-2); padding: 3px; gap: 2px; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 6px 16px; font: inherit; font-size: 13px; border-radius: 999px;
  transition: color .18s, background .18s; }
.seg button.active { background: linear-gradient(135deg, var(--flame), var(--flame-2)); color: var(--primary-fg); font-weight: 600; }

/* ── CHIP message formatting (Think + ACT bodies) ── */
.turn .body .chip-p { margin: 0 0 10px; line-height: 1.6; }
.turn .body .chip-p:last-child { margin-bottom: 0; }
.turn .body .chip-h { font-family: var(--display); font-weight: 600; font-size: 15.5px; margin: 14px 0 8px; }
.turn .body .chip-h:first-child { margin-top: 0; }
.turn .body .chip-list { margin: 0 0 10px; padding-left: 22px; line-height: 1.6; }
.turn .body .chip-list li { margin: 3px 0; }
.turn .body .code-block {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 15px; margin: 4px 0 10px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
  white-space: pre;
}
.turn .body .inline-code {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-family: var(--mono); font-size: 13px;
}
.turn .body .action-line {
  display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--muted);
}
.turn .body .action-line .action-dot { color: var(--flame); font-weight: 700; }
.turn .body .action-line .action-text { overflow-wrap: anywhere; }
/* Formatted bodies build their own blocks — pre-wrap would double the gaps. */
.turn.act .body, .turn.think .body { white-space: normal; }

/* ── Settings: top options (Profile, …) ── */
.settings-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.settings-option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 14px; font: inherit; color: var(--text);
  transition: border-color .18s, background .18s;
}
.settings-option:hover { border-color: var(--flame); background: var(--flame-soft); }
.settings-option .so-icon {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 16px;
}
.settings-option .so-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.settings-option .so-label { font-size: 14px; font-weight: 600; }
.settings-option .so-sub { font-size: 12.5px; color: var(--muted); }
.settings-option .so-chev { color: var(--muted); font-size: 20px; }

/* ── Profile modal ── */
.profile-card { width: min(760px, 96vw); padding: 0; overflow: hidden; }
.profile-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.profile-head h3 { margin: 0; }
.profile-body { display: flex; min-height: 440px; max-height: 78vh; }
.profile-nav {
  flex: none; width: 210px; border-right: 1px solid var(--line); padding: 12px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; background: var(--panel-2);
}
.profile-nav .pnav {
  text-align: left; background: transparent; border: 0; border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; color: var(--muted); font-size: 13px;
  transition: color .18s, background .18s;
}
.profile-nav .pnav:hover { color: var(--text); background: var(--panel); }
.profile-nav .pnav.active { color: var(--text); background: var(--panel); box-shadow: inset 0 0 0 1px var(--flame); font-weight: 600; }
.profile-pane { flex: 1; min-width: 0; padding: 20px 22px; overflow-y: auto; }
.pf-title { margin: 0 0 16px; font-family: var(--display); font-size: 17px; }
.pf-intro { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.pf-sub-h { margin: 22px 0 12px; font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.pf-identity { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.pf-avatar {
  width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--flame), var(--flame-2)); color: var(--primary-fg);
  font-family: var(--display); font-weight: 700; font-size: 24px;
  box-shadow: 0 4px 14px rgba(242, 96, 15, .28);
}
.pf-who .pf-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pf-who .pf-role { font-size: 12px; color: var(--muted); }

.pf-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pf-label { font-size: 12px; color: var(--muted); }
.pf-value { font-size: 14px; overflow-wrap: anywhere; }
.profile-pane input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 13px; border-radius: var(--radius-sm); font: inherit; outline: none; width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
.profile-pane input:focus { border-color: var(--flame); box-shadow: 0 0 0 3px var(--flame-soft); }
.pf-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.pf-msg { margin-top: 12px; font-size: 13px; min-height: 18px; text-align: right; }
.pf-msg.ok { color: var(--ok); }
.pf-msg.err { color: var(--act); }

.pill { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ok); border-color: var(--ok); }
.pill.off { color: var(--muted); }

.conn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.conn-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; color: var(--text);
  border-left: 3px solid var(--brand, var(--line)); transition: border-color .15s, background .15s;
}
.conn-btn:hover { border-color: var(--brand, var(--flame)); }
.conn-btn .conn-badge {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 7px; color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
.conn-btn .conn-label { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-btn .conn-mark { color: var(--ok); font-weight: 700; }
.conn-btn.connected { background: color-mix(in srgb, var(--ok) 9%, var(--panel-2)); border-color: var(--ok); }
@media (max-width: 620px) { .conn-grid { grid-template-columns: 1fr; } }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-text { min-width: 0; }
.toggle-name { font-size: 14px; font-weight: 600; }
.toggle-sub { font-size: 12.5px; color: var(--muted); }
.toggle-extra { padding: 0 0 14px; }
.switch { flex: none; width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); position: relative; padding: 0; transition: background .18s, border-color .18s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: left .18s, background .18s; }
.switch.on { background: linear-gradient(135deg, var(--flame), var(--flame-2)); border-color: transparent; }
.switch.on .knob { left: 22px; background: var(--primary-fg); }

.sess-list { display: flex; flex-direction: column; gap: 8px; }
.sess-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.sess-when { font-size: 13px; }
.sess-ip { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.bill-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin-bottom: 18px; background: var(--panel-2); }
.bill-plan { font-family: var(--display); font-size: 18px; font-weight: 700; }
.bill-plan-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

@media (max-width: 620px) {
  .profile-body { flex-direction: column; min-height: 0; }
  .profile-nav { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-nav .pnav { white-space: nowrap; }
  .cmdbar { width: calc(100% - 20px); margin: 8px auto 12px; padding-left: 14px; }
  body { font-size: 16px; }
}

/* ── Add-ons marketplace ─────────────────────────────────────────────────────
   Cards, not switches: a priced card reads as a purchase, a toggle reads as a
   free flip. Locked cards stay visible so the catalog itself does the selling. */
.addon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.addon-card {
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel);
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.addon-card:hover { border-color: var(--flame); box-shadow: 0 4px 18px rgba(242, 96, 15, .12); }
.addon-card.active { border-color: var(--flame); background: linear-gradient(180deg, var(--flame-soft), transparent); }
.addon-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.addon-name { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--text); }
.addon-price { font-size: 13px; font-weight: 600; color: var(--flame); white-space: nowrap; }
.addon-blurb { font-size: 13px; line-height: 1.5; color: var(--muted); flex: 1; }
.addon-note { font-size: 12px; color: var(--muted); opacity: .85; font-style: italic; }
.addon-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.addon-foot button { padding: 7px 14px; font-size: 13px; }
.addon-summary { border-top: 1px solid var(--line); padding-top: 12px; }
.addon-total { font-family: var(--display); font-size: 17px; font-weight: 650; color: var(--text); }
.addon-total-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Plan chooser */
.plan-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.plan-card {
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; background: var(--panel);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  transition: border-color .18s, box-shadow .18s;
}
.plan-card.current { border-color: var(--flame); background: linear-gradient(180deg, var(--flame-soft), transparent); }
.plan-name { font-family: var(--display); font-weight: 600; }
.plan-price { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--text); }
.plan-cap { font-size: 12px; color: var(--muted); flex: 1; }
.plan-card button { width: 100%; margin-top: 4px; }

/* Billing line items */
.bill-lines { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.bill-line { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.bill-line-name { color: var(--muted); }
.bill-line-amt { color: var(--text); font-weight: 600; }
.bill-line-sub { font-size: 13px; color: var(--muted); }

/* Inline offer inside a CHIP reply — the door, shown at the wall. */
.addon-offer {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--flame); border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--flame-soft), transparent);
  padding: 12px 14px; margin: 10px 0;
}
.addon-offer-info { flex: 1; min-width: 180px; }
.addon-offer-name { font-family: var(--display); font-weight: 600; font-size: 14px; }
.addon-offer-blurb { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.addon-tagline { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Decorative motion off for users who ask for it; the ACT spinner stays (functional). */
@media (prefers-reduced-motion: reduce) {
  .cursor::after { animation: none; }
  .primary, .send { transition: none; }
  .primary:hover, .send:hover { transform: none; }
}
