:root {
  --bg: #080a0f;
  --sidebar: #0c0f16;
  --panel: #10141d;
  --panel-2: #151a25;
  --line: #242b39;
  --text: #f6f8fb;
  --muted: #8f99aa;
  --accent: #7d5cff;
  --accent-2: #22d3a6;
  --warn: #ffb547;
  --danger: #ff5d75;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 75% 5%, rgba(125, 92, 255, .12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
}

button, textarea, select { font: inherit; }

button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 24px 18px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(12, 15, 22, .88);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 8px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; font-family: Manrope; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #4ab7ff);
  box-shadow: 0 8px 30px rgba(125, 92, 255, .28);
}
.brand strong { display: block; font-family: Manrope; }
.brand small { display: block; color: var(--muted); margin-top: 2px; font-size: 11px; }

.nav { display: grid; gap: 6px; margin-top: 42px; }
.nav-item {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 11px; padding: 12px 13px;
  border-radius: 11px; text-align: left; transition: .2s ease;
}
.nav-item:hover, .nav-item.active { background: #171c28; color: var(--text); }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.nav-item span { width: 20px; text-align: center; }

.sidebar-bottom { margin-top: auto; }
.environment {
  display: flex; gap: 10px; align-items: center; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #10141d;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px rgba(255, 181, 71, .1); }
.environment strong, .environment small { display: block; }
.environment strong { font-size: 12px; }
.environment small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.domain { text-align: center; color: #566075; font-size: 10px; margin-top: 14px; }

.main { min-width: 0; padding: 34px clamp(22px, 4vw, 54px) 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 30px; }
.eyebrow, .panel-kicker { font-size: 10px; letter-spacing: .16em; color: #7b8497; font-weight: 800; margin: 0 0 7px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, Inter, sans-serif; }
h1 { font-size: clamp(25px, 3vw, 34px); margin-bottom: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-status { color: #aab4c4; font-size: 12px; margin-right: 6px; }
.api-status i { display: inline-block; width: 7px; height: 7px; background: var(--accent-2); border-radius: 50%; margin-right: 6px; }

.button {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  background: #151a25; cursor: pointer; font-weight: 700; font-size: 12px;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 24px rgba(125, 92, 255, .22); }
.button.ghost { background: transparent; }
.button.small { padding: 8px 11px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.page-section { display: none; }
.page-section.active { display: block; animation: reveal .24s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-panel {
  min-height: 250px; padding: 34px; border: 1px solid #2d3150;
  border-radius: 24px; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr .7fr; align-items: center;
  background:
    radial-gradient(circle at 80% 50%, rgba(125, 92, 255, .22), transparent 17rem),
    linear-gradient(135deg, #121623, #0d1018 60%);
}
.hero-panel:after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to right, transparent, black); pointer-events: none; }
.hero-panel h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.03; max-width: 700px; margin: 17px 0 14px; letter-spacing: -.035em; }
.hero-panel p { color: #a8b0bf; line-height: 1.65; max-width: 680px; font-size: 14px; }
.pill { display: inline-flex; align-items: center; width: fit-content; padding: 7px 9px; border: 1px solid #343a52; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .12em; color: #b9c1d0; background: rgba(255,255,255,.025); }

.hero-orbit { position: relative; width: 210px; height: 210px; margin-left: auto; }
.hero-orbit:before, .hero-orbit:after { content: ""; position: absolute; inset: 14%; border: 1px solid rgba(160, 147, 255, .22); border-radius: 50%; }
.hero-orbit:after { inset: 0; }
.core { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(135deg, #7d5cff, #5140d9); font-family: Manrope; font-weight: 800; box-shadow: 0 0 60px rgba(125,92,255,.35); }
.satellite { position: absolute; width: 38px; height: 38px; display: grid; place-items: center; background: #151a25; border: 1px solid #343a52; border-radius: 12px; font-size: 10px; font-weight: 800; color: #cdd3df; }
.s1 { top: 0; left: 86px; } .s2 { right: 0; top: 86px; } .s3 { bottom: 0; left: 86px; } .s4 { left: 0; top: 86px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #111620, #0e121a);
}
.metric small { color: var(--muted); font-size: 11px; }
.metric strong { display: block; font-family: Manrope; font-size: 28px; margin-top: 10px; }
.metric em { display: block; color: #697386; font-size: 10px; font-style: normal; margin-top: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #0e121a; padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.link-button { border: 0; background: transparent; color: #9885ff; cursor: pointer; font-size: 11px; }
.stack { display: grid; }
.list-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid #1c2330; }
.list-row:first-child { border-top: 0; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: #1a2030; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.list-row strong, .list-row small { display: block; }
.list-row strong { font-size: 12px; }
.list-row small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.badge { padding: 5px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; background: #191f2b; color: #8f99aa; border: 1px solid #2a3241; }
.badge.ok { color: #57e7bf; border-color: rgba(34,211,166,.22); background: rgba(34,211,166,.07); }
.badge.warn { color: #ffc972; border-color: rgba(255,181,71,.2); background: rgba(255,181,71,.06); }
.queue-panel { margin-top: 18px; }
.queue { display: grid; gap: 9px; }
.queue-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid #1f2634; border-radius: 12px; background: #111620; }
.queue-row p { margin: 0; font-size: 11px; color: #b8c0ce; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section-intro { display: flex; justify-content: space-between; gap: 22px; align-items: end; margin: 8px 0 22px; }
.section-intro h2 { font-size: 28px; margin: 14px 0 6px; }
.section-intro p { color: var(--muted); margin-bottom: 0; max-width: 650px; font-size: 13px; }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.detail-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #0e121a; }
.detail-card .card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.detail-card h3 { font-size: 14px; margin: 13px 0 4px; }
.detail-card p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.meta span { font-size: 9px; padding: 5px 7px; border-radius: 7px; background: #171c27; color: #8d97a8; }

.content-list { display: grid; gap: 10px; }
.content-card { border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: #0e121a; display: grid; grid-template-columns: 140px 1fr auto; gap: 16px; align-items: center; }
.content-card p { margin: 0; font-size: 12px; color: #c7ced9; line-height: 1.55; }
.content-card-origin-realtime {
  border-color: rgba(255,181,71,.38);
  box-shadow: inset 3px 0 0 rgba(255,181,71,.75);
}
.meta span.content-origin {
  font-weight: 900;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.meta span.content-origin-realtime {
  color: #ffc972;
  border-color: rgba(255,181,71,.25);
  background: rgba(255,181,71,.08);
}
.meta span.content-origin-scheduled {
  color: #8fdbff;
  border-color: rgba(92,191,239,.24);
  background: rgba(92,191,239,.08);
}
.meta span.content-origin-manual-scan,
.meta span.content-origin-joe {
  color: #b6a8ff;
  border-color: rgba(142,117,255,.24);
  background: rgba(142,117,255,.08);
}


.empty-state { min-height: 460px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border: 1px dashed #2d3545; border-radius: 22px; background: rgba(15,19,27,.7); padding: 40px; }
.empty-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 18px; background: #171d2a; border: 1px solid #2e374a; font-size: 22px; }
.empty-state h2 { margin: 20px 0 8px; }
.empty-state p { color: var(--muted); max-width: 600px; line-height: 1.6; }
.future-tags { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; margin-top: 13px; }
.future-tags span { border: 1px solid #283144; border-radius: 999px; padding: 7px 10px; font-size: 10px; color: #8e98ab; }

dialog { border: 0; background: transparent; color: inherit; padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
.dialog-card { width: min(560px, calc(100vw - 30px)); padding: 22px; background: #10141d; border: 1px solid #303849; border-radius: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.dialog-head h3 { margin: 0; }
.icon-button { border: 0; background: transparent; font-size: 24px; cursor: pointer; color: #8f99aa; }
label { display: grid; gap: 7px; color: #a9b2c1; font-size: 11px; font-weight: 700; margin-top: 14px; }
select, textarea { width: 100%; border: 1px solid #2b3343; background: #0b0e14; color: var(--text); border-radius: 10px; padding: 11px; outline: none; }
textarea { resize: vertical; }
select:focus, textarea:focus { border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 15px; background: #171d28; border: 1px solid #333c4e; border-radius: 11px; color: #d8dde6; font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 82px 1fr; }
  .sidebar { padding-inline: 12px; }
  .brand span:last-child, .nav-item:not(.active) { font-size: 0; }
  .nav-item { justify-content: center; }
  .nav-item span { font-size: 18px; }
  .environment div, .domain { display: none; }
  .environment { justify-content: center; }
  .grid-2, .cards-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .brand { flex: 0 0 auto; }
  .nav { display: flex; margin: 0 0 0 18px; }
  .sidebar-bottom { display: none; }
  .main { padding: 24px 16px 50px; }
  .topbar, .section-intro { align-items: flex-start; flex-direction: column; }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-orbit { display: none; }
  .metric-grid, .grid-2, .cards-grid { grid-template-columns: 1fr; }
  .queue-row, .content-card { grid-template-columns: 1fr; }
}


/* v0.2 — authentication and Cost Center */
.button.danger { background: rgba(255,93,117,.1); border-color: rgba(255,93,117,.35); color: #ff8093; }
.button.safe-action { background: rgba(34,211,166,.09); border-color: rgba(34,211,166,.28); color: #65e9c4; }
.badge.danger { color: #ff8093; border-color: rgba(255,93,117,.3); background: rgba(255,93,117,.08); }

.storage-status { margin-top: 10px; text-align: center; font-size: 9px; color: #727d90; }
.storage-status.connected { color: #57e7bf; }
.storage-status.warning { color: #ffc972; }
.storage-status.error { color: #ff8093; }

.cost-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.cost-metric { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, #111620, #0e121a); }
.cost-metric > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cost-metric small { color: var(--muted); font-size: 11px; }
.cost-metric strong { display: block; font-family: Manrope; font-size: 29px; margin: 12px 0 5px; }
.cost-metric > span { color: #697386; font-size: 10px; }
.cost-grid { margin-top: 18px; }

.cost-chart { height: 220px; display: flex; align-items: flex-end; gap: 7px; padding: 20px 2px 0; border-bottom: 1px solid #242b39; }
.cost-bar-wrap { flex: 1; height: 100%; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.cost-bar { width: min(22px, 75%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #8e75ff, #5b46dd); box-shadow: 0 0 18px rgba(125,92,255,.15); }
.cost-bar-wrap small { color: #687286; font-size: 8px; }
.cost-bar-value { color: #919bad; font-size: 8px; min-height: 10px; white-space: nowrap; }

.budget-form { display: grid; gap: 17px; }
.budget-row label { display: grid; grid-template-columns: 1fr auto 110px; align-items: center; gap: 8px; margin: 0 0 8px; }
.budget-row label span { color: #5f697c; font-size: 9px; }
.budget-row input { margin: 0; }
.budget-progress { height: 7px; border-radius: 999px; overflow: hidden; background: #1a202c; }
.budget-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7054ef, #a48fff); border-radius: inherit; transition: width .25s ease; }

.safety-card { display: grid; gap: 2px; }
.safety-line { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid #1c2330; font-size: 11px; }
.safety-card p { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 14px 0 0; }

.cost-events { display: grid; }
.cost-event { display: grid; grid-template-columns: 155px 90px 1fr auto; gap: 13px; align-items: center; padding: 12px 0; border-top: 1px solid #1c2330; font-size: 10px; }
.cost-event:first-child { border-top: 0; }
.cost-event time { color: #737d8f; }
.cost-event strong { font-size: 10px; }
.cost-event span { color: #a3adbd; }
.cost-event em { font-style: normal; font-family: Manrope; font-weight: 800; }
.zero-state { padding: 26px 10px; text-align: center; color: #697386; font-size: 10px; }

input { width: 100%; border: 1px solid #2b3343; background: #0b0e14; color: var(--text); border-radius: 10px; padding: 11px; outline: none; }
input:focus { border-color: var(--accent); }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(440px, 100%); }
.login-brand { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 20px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-family: Manrope; }
.login-brand small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.login-card { padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: rgba(14,18,26,.96); box-shadow: 0 24px 90px rgba(0,0,0,.35); }
.login-card h1 { margin: 18px 0 10px; font-size: 28px; }
.login-card > p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-submit { width: 100%; margin-top: 20px; padding-block: 12px; }
.form-error { min-height: 16px; color: #ff8093; font-size: 10px; margin: 10px 0 0; text-align: center; }
.login-foot { color: #566075; font-size: 9px; text-align: center; margin-top: 18px; }
.setup-notice { margin: 18px 0; padding: 12px; border: 1px solid rgba(255,181,71,.25); background: rgba(255,181,71,.06); border-radius: 11px; }
.setup-notice strong, .setup-notice span { display: block; }
.setup-notice strong { color: #ffc972; font-size: 11px; }
.setup-notice span { color: #a5adba; font-size: 10px; line-height: 1.5; margin-top: 4px; }
.hidden { display: none !important; }

@media (max-width: 1050px) {
  .cost-metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .cost-metric-grid { grid-template-columns: 1fr; }
  .cost-intro .button { width: 100%; }
  .cost-event { grid-template-columns: 1fr 1fr; }
  .cost-event span { grid-column: 1 / -1; }
  .budget-row label { grid-template-columns: 1fr auto 100px; }
}


/* v0.4 — OpenAI simulation generator */
.ai-generator-panel { margin-bottom: 18px; border-color: #302d55; background: linear-gradient(145deg, #101420, #0e121a); }
.ai-generator-status { display: flex; align-items: center; justify-content: flex-end; }
.ai-generator-form { display: grid; gap: 14px; }
.ai-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ai-generator-form label { margin-top: 0; }
.ai-generator-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 2px; }
.ai-generator-actions small { color: #788398; font-size: 10px; line-height: 1.55; max-width: 620px; }
.ai-generator-actions .button { flex: 0 0 auto; }
.ai-generator-buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-generator-panel textarea { min-height: 116px; }
.ai-generator-panel select { min-height: 42px; }

@media (max-width: 760px) {
  .ai-form-grid { grid-template-columns: 1fr; }
  .ai-generator-actions { align-items: stretch; flex-direction: column; }
  .ai-generator-actions .button { width: 100%; }
  .ai-generator-buttons { width: 100%; flex-direction: column; align-items: stretch; }
}


/* v0.4.1 — database-only empty states */
#accountsGrid > .zero-state,
#agentsGrid > .zero-state {
  grid-column: 1 / -1;
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #2d3545;
  border-radius: 16px;
  background: rgba(15, 19, 27, .5);
}


/* v0.5 — managed agents and portable memory */
.dialog-card-wide { width: min(760px, calc(100vw - 30px)); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-2 label { margin-top: 0; }
.dialog-note {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #2b3343;
  border-radius: 11px;
  color: #8893a6;
  font-size: 10px;
  line-height: 1.55;
  background: #0c1017;
}
.agent-card { display: flex; flex-direction: column; }
.agent-learning { margin-top: 14px; color: #798397; font-size: 10px; line-height: 1.45; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.card-actions .button { flex: 1 1 auto; }
.agent-card .meta { margin-top: 12px; }

@media (max-width: 760px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}


/* v0.6 — X intelligence */
.intelligence-grid { margin-bottom: 18px; }
.scout-form { display: grid; gap: 14px; }
.scout-form .button { width: fit-content; }
.scout-configs { display: grid; gap: 16px; }
.scout-zero { border: 1px dashed #2d3545; border-radius: 16px; background: rgba(15,19,27,.5); }
.scout-card { border-color: #2c3347; }
.scout-times { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 2px; color: #778297; }
.scout-times small { font-size: 9px; }
.scout-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.scout-layout h4 { font: 700 11px Manrope, Inter, sans-serif; color: #c9d0dc; margin: 0 0 10px; }
.scout-sources { display: grid; gap: 6px; }
.scout-source {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border: 1px solid #222a38; border-radius: 10px; background: #111620;
}
.scout-source strong, .scout-source small { display: block; }
.scout-source strong { font-size: 10px; }
.scout-source small { color: #778297; font-size: 8px; margin-top: 3px; }
.scout-source .icon-button { font-size: 18px; }
.source-add-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; align-items: end; }
.source-add-form input { min-width: 0; }
.insight-box {
  padding: 13px; border: 1px solid rgba(125,92,255,.22); border-radius: 11px;
  background: rgba(125,92,255,.06);
}
.insight-box p { color: #c7cfdd; font-size: 10px; line-height: 1.65; margin: 0 0 9px; white-space: pre-wrap; }
.insight-box small { color: #7d8799; font-size: 8px; }
#xIntelStatus { display: flex; align-items: center; }
#xBudgetForm .dialog-note { margin-top: 2px; }

@media (max-width: 900px) {
  .scout-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .source-add-form { grid-template-columns: 1fr; }
  .scout-form .button { width: 100%; }
}

.scout-settings-form {
  display: grid;
  grid-template-columns: 1.3fr .7fr .7fr .9fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #222a38;
  border-radius: 11px;
  background: #0c1017;
}
.scout-settings-form label { margin: 0; }
.scout-settings-form input,
.scout-settings-form select { min-width: 0; }
@media (max-width: 1050px) {
  .scout-settings-form { grid-template-columns: 1fr 1fr; }
  .scout-settings-form .button { width: 100%; }
}
@media (max-width: 760px) {
  .scout-settings-form { grid-template-columns: 1fr; }
}


/* v0.6.2 — in-dialog provisioning feedback */
.form-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid #303849;
  background: #0c1017;
  color: #b8c2d2;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.form-status.info { border-color: rgba(125,92,255,.38); background: rgba(125,92,255,.08); }
.form-status.success { border-color: rgba(34,211,166,.38); background: rgba(34,211,166,.08); color: #bff8e8; }
.form-status.error { border-color: rgba(255,91,91,.45); background: rgba(255,91,91,.08); color: #ffd1d1; }


/* v0.6.5 — Light / Dark themes */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --sidebar: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #dfe4ec;
  --text: #18212f;
  --muted: #667085;
  --accent: #6f56e8;
  --accent-2: #0fa77f;
  --warn: #b86b00;
  --danger: #d93652;
}

:root[data-theme="dark"] { color-scheme: dark; }

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 75% 5%, rgba(111, 86, 232, .08), transparent 28rem),
    var(--bg);
}

:root[data-theme="light"] .sidebar {
  background: rgba(248, 250, 252, .92);
  box-shadow: 1px 0 0 rgba(24, 33, 47, .02);
}

:root[data-theme="light"] .nav-item:hover,
:root[data-theme="light"] .nav-item.active {
  background: #e8ebf3;
}

:root[data-theme="light"] .environment,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .detail-card,
:root[data-theme="light"] .content-card {
  background: #ffffff;
}

:root[data-theme="light"] .domain,
:root[data-theme="light"] .storage-status,
:root[data-theme="light"] .metric em,
:root[data-theme="light"] .cost-metric > span,
:root[data-theme="light"] .cost-event time,
:root[data-theme="light"] .zero-state,
:root[data-theme="light"] .login-foot {
  color: #7a8493;
}

:root[data-theme="light"] .eyebrow,
:root[data-theme="light"] .panel-kicker {
  color: #697386;
}

:root[data-theme="light"] .api-status,
:root[data-theme="light"] label {
  color: #5f6b7a;
}

:root[data-theme="light"] .button {
  background: #f7f8fb;
}

:root[data-theme="light"] .button.ghost {
  background: rgba(255, 255, 255, .72);
}

:root[data-theme="light"] .button.primary {
  color: #ffffff;
  background: var(--accent);
}

.theme-toggle {
  min-width: 94px;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

:root[data-theme="light"] .theme-toggle {
  background: #ffffff;
  border-color: #d8deea;
  color: #344054;
  box-shadow: 0 4px 14px rgba(28, 39, 58, .05);
}

:root[data-theme="light"] .hero-panel {
  border-color: #ddd9f4;
  background:
    radial-gradient(circle at 80% 50%, rgba(111, 86, 232, .13), transparent 17rem),
    linear-gradient(135deg, #ffffff, #f5f3ff 62%);
  box-shadow: 0 14px 40px rgba(44, 53, 72, .05);
}

:root[data-theme="light"] .hero-panel:after {
  background-image:
    linear-gradient(rgba(24,33,47,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,33,47,.035) 1px, transparent 1px);
}

:root[data-theme="light"] .hero-panel p {
  color: #667085;
}

:root[data-theme="light"] .pill {
  border-color: #d9deea;
  color: #596579;
  background: rgba(255,255,255,.72);
}

:root[data-theme="light"] .satellite {
  background: #ffffff;
  border-color: #dce1eb;
  color: #475467;
}

:root[data-theme="light"] .metric,
:root[data-theme="light"] .cost-metric {
  background: linear-gradient(180deg, #ffffff, #fafbfc);
  box-shadow: 0 5px 18px rgba(31, 42, 61, .035);
}

:root[data-theme="light"] .list-row,
:root[data-theme="light"] .safety-line,
:root[data-theme="light"] .cost-event {
  border-color: #e7eaf0;
}

:root[data-theme="light"] .avatar,
:root[data-theme="light"] .badge,
:root[data-theme="light"] .meta span,
:root[data-theme="light"] .empty-icon {
  background: #f0f2f6;
}

:root[data-theme="light"] .avatar {
  color: #445064;
}

:root[data-theme="light"] .badge {
  color: #667085;
  border-color: #d9dee7;
}

:root[data-theme="light"] .queue-row {
  border-color: #e2e6ed;
  background: #f9fafb;
}

:root[data-theme="light"] .queue-row p,
:root[data-theme="light"] .content-card p,
:root[data-theme="light"] .scout-layout h4,
:root[data-theme="light"] .insight-box p {
  color: #344054;
}

:root[data-theme="light"] .meta span {
  color: #667085;
}
:root[data-theme="light"] .content-card-origin-realtime {
  border-color: rgba(184,107,0,.30);
  box-shadow: inset 3px 0 0 rgba(184,107,0,.55);
}
:root[data-theme="light"] .meta span.content-origin-realtime {
  color: #9a5a00;
  border-color: rgba(184,107,0,.20);
  background: rgba(184,107,0,.07);
}
:root[data-theme="light"] .meta span.content-origin-scheduled {
  color: #176b8f;
  border-color: rgba(23,107,143,.18);
  background: rgba(23,107,143,.06);
}
:root[data-theme="light"] .meta span.content-origin-manual-scan,
:root[data-theme="light"] .meta span.content-origin-joe {
  color: #5c46bb;
  border-color: rgba(92,70,187,.18);
  background: rgba(92,70,187,.06);
}


:root[data-theme="light"] .empty-state,
:root[data-theme="light"] #accountsGrid > .zero-state,
:root[data-theme="light"] #agentsGrid > .zero-state,
:root[data-theme="light"] .scout-zero {
  border-color: #d8dde7;
  background: rgba(255,255,255,.72);
}

:root[data-theme="light"] .future-tags span {
  border-color: #d8dde7;
  color: #667085;
}

:root[data-theme="light"] dialog::backdrop {
  background: rgba(29, 41, 57, .30);
}

:root[data-theme="light"] .dialog-card,
:root[data-theme="light"] .login-card {
  background: #ffffff;
  border-color: #dfe4ec;
  box-shadow: 0 28px 80px rgba(35, 45, 65, .18);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: #ffffff;
  color: #18212f;
  border-color: #d7dde7;
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: #98a2b3;
}

:root[data-theme="light"] .icon-button {
  color: #667085;
}

:root[data-theme="light"] .toast {
  background: #ffffff;
  border-color: #d9dee8;
  color: #344054;
  box-shadow: 0 10px 35px rgba(35,45,65,.12);
}

:root[data-theme="light"] .cost-chart {
  border-color: #dfe4ec;
}

:root[data-theme="light"] .cost-bar-wrap small,
:root[data-theme="light"] .cost-bar-value,
:root[data-theme="light"] .budget-row label span,
:root[data-theme="light"] .agent-learning,
:root[data-theme="light"] .scout-times,
:root[data-theme="light"] .scout-source small,
:root[data-theme="light"] .insight-box small,
:root[data-theme="light"] .ai-generator-actions small {
  color: #7a8493;
}

:root[data-theme="light"] .budget-progress {
  background: #e9edf3;
}

:root[data-theme="light"] .login-card {
  background: rgba(255,255,255,.96);
}

:root[data-theme="light"] .setup-notice {
  background: rgba(184,107,0,.06);
}

:root[data-theme="light"] .ai-generator-panel {
  border-color: #ddd9f4;
  background: linear-gradient(145deg, #ffffff, #faf9ff);
}

:root[data-theme="light"] .dialog-note,
:root[data-theme="light"] .scout-settings-form,
:root[data-theme="light"] .form-status {
  background: #f8fafc;
  border-color: #dbe1ea;
  color: #667085;
}

:root[data-theme="light"] .scout-card {
  border-color: #dce2ea;
}

:root[data-theme="light"] .scout-source {
  border-color: #dfe4ec;
  background: #f9fafb;
}

:root[data-theme="light"] .insight-box {
  background: rgba(111,86,232,.06);
  border-color: rgba(111,86,232,.22);
}

:root[data-theme="light"] .form-status.info {
  background: rgba(111,86,232,.06);
}
:root[data-theme="light"] .form-status.success {
  color: #08795e;
  background: rgba(15,167,127,.07);
}
:root[data-theme="light"] .form-status.error {
  color: #b4233c;
  background: rgba(217,54,82,.07);
}

@media (max-width: 760px) {
  .theme-toggle { min-width: 0; }
}


.interaction-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.interaction-target:hover { text-decoration: underline; }


.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .section-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .section-actions .button {
    width: 100%;
  }
}


.cost-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}


.scout-source-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.source-realtime-option {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 7px;
  align-items: center;
  white-space: nowrap;
}

.source-realtime-option input {
  width: auto;
  margin: 0;
}

#xIntelStatus {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}


.relay-status {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border, rgba(127,127,127,.18));
  opacity: .82;
}


.account-autonomy-label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 700;
}

.account-autonomy-select {
  width: 100%;
}

.publish-error {
  display: block;
  margin-top: 8px;
  opacity: .8;
}


.x-connection-box {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border, rgba(127,127,127,.18));
  border-radius: 12px;
}

.x-connection-box .card-actions {
  margin-top: 0;
}


/* v0.7.1 — manual X publish controls */
.content-inline-actions {
  margin-top: 10px;
}
.content-inline-actions .button {
  width: 100%;
  white-space: nowrap;
}


/* Filtered Stream diagnostics */
.stream-diagnostic-panel { margin: 18px 0; }
.stream-diagnostics { display: grid; gap: 12px; }
.stream-diagnostic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stream-diagnostic-item { padding: 12px; border: 1px solid #242c3a; border-radius: 11px; background: #0b0f16; }
.stream-diagnostic-item small { display: block; color: #727d90; font-size: 9px; margin-bottom: 6px; }
.stream-diagnostic-item strong { display: block; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.stream-diagnostic-note { padding: 11px 12px; border-radius: 10px; border: 1px solid #283144; background: #111620; color: #8f99aa; font-size: 10px; line-height: 1.55; }
.stream-diagnostic-note.ok { color: #57e7bf; border-color: rgba(34,211,166,.22); background: rgba(34,211,166,.06); }
.stream-diagnostic-note.warn { color: #ffc972; border-color: rgba(255,181,71,.22); background: rgba(255,181,71,.06); }
.stream-diagnostic-note.danger { color: #ff8093; border-color: rgba(255,93,117,.28); background: rgba(255,93,117,.07); }
.stream-error-payload { padding: 12px; border: 1px solid #283144; border-radius: 10px; background: #0b0f16; }
.stream-error-payload small { display: block; color: #727d90; font-size: 9px; margin-bottom: 8px; }
.stream-error-payload pre { margin: 0; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: #aeb8c9; }
:root[data-theme="light"] .stream-error-payload { background: #f9fafb; border-color: #e1e6ee; }
:root[data-theme="light"] .stream-error-payload pre { color: #4b5565; }

:root[data-theme="light"] .stream-diagnostic-item {
  background: #f9fafb;
  border-color: #e1e6ee;
}
:root[data-theme="light"] .stream-diagnostic-note {
  background: #f8fafc;
  border-color: #dbe1ea;
}
@media (max-width: 900px) {
  .stream-diagnostic-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .stream-diagnostic-grid { grid-template-columns: 1fr; }
}


/* Follower growth analytics */
.growth-accounts { display: grid; gap: 10px; }
.growth-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid #1c2330;
}
.growth-account-row:first-child { border-top: 0; }
.growth-account-row strong,
.growth-account-row small { display: block; }
.growth-account-row strong { font-size: 12px; }
.growth-account-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.growth-deltas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.growth-post-signals { display: grid; }
.growth-signal {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid #1c2330;
}
.growth-signal:first-child { border-top: 0; }
.growth-signal strong,
.growth-signal small { display: block; }
.growth-signal strong { font-size: 11px; }
.growth-signal small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.growth-signal p { margin: 7px 0 0; color: #c7ced9; font-size: 11px; line-height: 1.5; }

:root[data-theme="light"] .growth-account-row,
:root[data-theme="light"] .growth-signal { border-color: #e7eaf0; }
:root[data-theme="light"] .growth-signal p { color: #344054; }

@media (max-width: 760px) {
  .growth-account-row,
  .growth-signal { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
  .growth-deltas { justify-content: flex-start; }
}
