:root {
  color-scheme: dark;
  --mono:
    "JetBrains Mono", "SFMono-Regular", "SF Mono", ui-monospace, "Cascadia Code",
    "Roboto Mono", Menlo, Consolas, monospace;
  --cyan: #67e8f9;
  --amber: #fbbf24;
  --teal: #1ed3b7;
  --ink: #07111f;
  --line: rgba(99, 232, 255, 0.16);
  --line-strong: rgba(99, 232, 255, 0.28);
  --muted: rgba(239, 247, 255, 0.62);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  background: var(--ink);
  color: #eff7ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  background:
    linear-gradient(rgba(77, 221, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 221, 255, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #07111f 0%, #10192d 52%, #062224 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

body.public-mode {
  background:
    radial-gradient(circle at 78% 12%, rgba(103, 232, 249, 0.16), transparent 36%),
    linear-gradient(rgba(77, 221, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 221, 255, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #07111f 0%, #10192d 52%, #062224 100%);
  background-size: auto, 34px 34px, 34px 34px, auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ---------- Status light ---------- */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px rgba(30, 211, 183, 0.8);
}

.dot.warn {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

.dot.busy {
  background: #4f9bff;
  box-shadow: 0 0 8px rgba(79, 155, 255, 0.85);
}

.dot.off {
  background: #5b6b82;
  box-shadow: none;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 0 4vw;
  background: rgba(7, 17, 31, 0.92);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav {
  margin-left: auto;
}

.brand {
  color: #fff;
  text-decoration: none;
}

.brand span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #07111f;
  background: linear-gradient(135deg, var(--cyan), var(--amber));
  border-radius: 8px;
  font-weight: 950;
  font-size: 13px;
  box-shadow: 0 0 16px rgba(103, 232, 249, 0.35);
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-tag {
  padding: 3px 7px;
  color: var(--cyan);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.sys-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 5px 12px;
  background: rgba(9, 20, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.sys-light {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b8fff2;
}

.sys-clock {
  color: var(--cyan);
}

nav button {
  min-height: 36px;
  padding: 0 14px;
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  transition: border-color 0.15s ease, transform 0.05s ease;
}

.login-card button,
form button,
.line-login,
.row-actions button {
  min-height: 40px;
  padding: 0 16px;
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: border-color 0.15s ease, transform 0.05s ease;
}

nav button:hover,
.row-actions button:hover {
  border-color: var(--line-strong);
}

nav button:active {
  transform: translateY(1px);
}

nav button:first-of-type,
.login-card button,
.public-showcase button,
form button,
.line-login {
  background: linear-gradient(135deg, var(--teal), #2c7dff);
  border-color: transparent;
}

.public-mode nav button {
  display: none;
}

.line-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(44, 125, 255, 0.3);
}

.user-badge {
  max-width: min(34vw, 320px);
  overflow: hidden;
  color: #b8fff2;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  width: min(1460px, calc(100% - 6vw));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.doc-page {
  width: min(820px, calc(100% - 28px));
}

.doc-page h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  color: #fff;
}

.notice {
  margin-bottom: 14px;
  padding: 13px 16px;
  color: #ffd1c7;
  background: rgba(255, 112, 67, 0.12);
  border: 1px solid rgba(255, 112, 67, 0.45);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Surfaces ---------- */
.panel,
.metrics article {
  background: rgba(9, 20, 38, 0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.public-showcase {
  display: grid;
  gap: 16px;
  width: 100%;
}

.kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lead {
  color: rgba(239, 247, 255, 0.72);
  line-height: 1.6;
}

/* ---------- Public hero ---------- */
.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: center;
}

.public-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-width: 0;
  padding: clamp(8px, 2vw, 24px) 0;
}

.public-copy h1 {
  margin: 0;
  max-width: 620px;
  color: #fff;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.public-copy .lead {
  max-width: 540px;
  font-size: clamp(14px, 1.2vw, 16px);
}

.public-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.public-actions span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

#loginStatus {
  min-height: 16px;
  margin: 0;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.public-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.public-mini-stats div {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  background: rgba(9, 20, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.public-mini-stats strong {
  color: #fff;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.public-mini-stats span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- HQ preview stage ---------- */
.hq-stage {
  align-self: stretch;
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(99, 232, 255, 0.12), rgba(251, 191, 36, 0.06)),
    rgba(4, 12, 24, 0.74);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hq-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 14px;
  color: #b8fff2;
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hq-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
}

.hq-toolbar strong {
  color: #fff6c8;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.hq-console {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 10px;
  margin-top: 10px;
}

.hq-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hq-team {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  background: rgba(9, 20, 38, 0.84);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.hq-team-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
}

.hq-team-row strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.hq-team-row span {
  color: var(--muted);
  font-size: 11px;
}

.hq-team-row em {
  color: #b8fff2;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hq-main {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.hq-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 13px;
  background: rgba(9, 20, 38, 0.86);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.hq-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hq-card strong {
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.hq-bars {
  display: grid;
  gap: 8px;
}

.hq-bar {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.hq-bar span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.hq-bar i {
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--amber));
  border-radius: 999px;
}

.hq-queue {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  background: rgba(9, 20, 38, 0.84);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.hq-queue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
}

.hq-queue-row strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.hq-queue-row span {
  color: var(--muted);
  font-size: 11px;
}

.hq-queue-row em {
  color: #fff6c8;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.hq-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- Public strip ---------- */
.public-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.public-strip article {
  display: grid;
  gap: 7px;
  padding: 18px;
  background: rgba(9, 20, 38, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.public-strip span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.public-strip strong {
  color: #fff;
  font-size: 17px;
}

.public-strip p {
  margin: 0;
  color: rgba(239, 247, 255, 0.7);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Forms ---------- */
form {
  display: grid;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  color: #fff;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.16);
}

textarea {
  min-height: 84px;
  resize: vertical;
}

/* ---------- Console status strip (logged in) ---------- */
.console-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px 20px;
  background:
    linear-gradient(90deg, rgba(9, 20, 38, 0.96), rgba(9, 20, 38, 0.7)),
    linear-gradient(135deg, rgba(44, 125, 255, 0.28), rgba(251, 191, 36, 0.1));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
}

.cs-plan {
  min-width: 0;
}

.cs-label {
  display: block;
  margin-bottom: 6px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cs-plan p {
  display: -webkit-box;
  margin: 0;
  color: #fff;
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 700;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.cs-stat {
  display: grid;
  gap: 3px;
}

.cs-stat span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cs-stat strong {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: -0.01em;
}

/* ---------- Telemetry metrics band ---------- */
.metrics-band {
  margin: 14px 0;
  padding: 15px 18px;
  background: rgba(9, 20, 38, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.metrics-band .kicker {
  margin-bottom: 11px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
}

.metrics article {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: none;
}

.metrics span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metrics strong {
  color: #fff;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Command center ---------- */
.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) minmax(280px, 0.72fr);
  gap: 14px;
  margin: 14px 0;
}

.command-summary,
.command-panel {
  position: relative;
  min-width: 0;
  padding: 18px;
  background: rgba(9, 20, 38, 0.82);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.command-summary {
  display: grid;
  align-content: space-between;
  gap: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(44, 125, 255, 0.18), rgba(30, 211, 183, 0.07)),
    rgba(9, 20, 38, 0.82);
  border-color: var(--line-strong);
}

.command-summary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--teal));
}

.command-summary h2,
.command-panel h2 {
  margin: 0;
  color: #fff;
}

.command-summary h2 {
  max-width: 760px;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.command-summary p {
  max-width: 740px;
  margin: 10px 0 0;
  color: rgba(239, 247, 255, 0.74);
  font-size: 14px;
  line-height: 1.55;
}

.command-signals,
.pipeline-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.command-signals article,
.pipeline-list article {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.command-signals span,
.pipeline-list span,
.command-signals small,
.pipeline-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.command-signals strong,
.pipeline-list strong {
  color: #fff;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.quick-command-list {
  display: grid;
  gap: 8px;
}

.quick-command-list button {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px 13px;
  color: #eff7ff;
  text-align: left;
  background: rgba(103, 232, 249, 0.06);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quick-command-list button:hover {
  border-color: rgba(103, 232, 249, 0.5);
  background: rgba(103, 232, 249, 0.1);
}

.quick-command-list strong {
  color: #fff;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.quick-command-list span {
  display: -webkit-box;
  color: rgba(239, 247, 255, 0.64);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.pipeline-list {
  grid-template-columns: 1fr;
}

/* ---------- Panels ---------- */
.panel {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  padding: 18px;
}

.panel p {
  color: rgba(239, 247, 255, 0.7);
  line-height: 1.55;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.panel h2 {
  margin: 0;
  color: #fff;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  color: #b8fff2;
  background: rgba(30, 211, 183, 0.12);
  border: 1px solid rgba(30, 211, 183, 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pill.warn,
.risk {
  border-color: rgba(255, 112, 67, 0.45);
}

.pill.warn {
  color: #ffd1c7;
  background: rgba(255, 112, 67, 0.12);
}

.ready-card {
  border-color: rgba(30, 211, 183, 0.24) !important;
}

/* ---------- Today plan ---------- */
.today-panel {
  margin-bottom: 14px;
  border-color: var(--line-strong);
}

.today-panel .lead {
  margin: 0;
  font-size: 14px;
}

.today-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.today-stats article {
  display: grid;
  gap: 5px;
  min-height: 66px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.today-stats span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.today-stats strong {
  color: #fff;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
}

.today-focus {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.today-focus article {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  background: rgba(103, 232, 249, 0.06);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 11px;
}

.today-focus span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.today-focus strong {
  color: #fff;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.today-focus p {
  margin: 0;
  color: rgba(239, 247, 255, 0.7);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- Live AI status ---------- */
.agent-status-panel {
  margin-bottom: 14px;
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.1), rgba(251, 191, 36, 0.04)),
    rgba(9, 20, 38, 0.82);
}

.agent-status-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.agent-status-card {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 172px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(9, 20, 38, 0.86);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 12px;
}

.agent-status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.75;
}

.agent-status-card.agent-working {
  border-color: rgba(79, 155, 255, 0.42);
  box-shadow: inset 0 0 28px rgba(79, 155, 255, 0.08);
}

.agent-status-card.agent-review,
.agent-status-card.agent-queued {
  border-color: rgba(251, 191, 36, 0.32);
}

.agent-status-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.agent-status-top strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.agent-status-top small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.agent-status-top em {
  min-height: 23px;
  padding: 4px 8px;
  color: #b8fff2;
  background: rgba(30, 211, 183, 0.12);
  border: 1px solid rgba(30, 211, 183, 0.24);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.agent-review .agent-status-top em,
.agent-queued .agent-status-top em {
  color: #fff6c8;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.26);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 12px rgba(30, 211, 183, 0.85);
}

.status-dot.busy {
  background: #4f9bff;
  box-shadow: 0 0 12px rgba(79, 155, 255, 0.95);
}

.status-dot.warn,
.status-dot.queue {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.88);
}

.agent-status-card p {
  display: -webkit-box;
  margin: 0;
  color: rgba(239, 247, 255, 0.72);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.agent-load {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.agent-load i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--amber));
  border-radius: inherit;
}

.agent-status-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.agent-status-chips span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 26px;
  padding: 5px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.agent-status-chips b {
  color: #fff;
  font-size: 12px;
}

.agent-detail-button {
  min-height: 34px;
  padding: 7px 9px;
  color: #eaffff;
  background: rgba(103, 232, 249, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.agent-detail-button:hover {
  border-color: rgba(103, 232, 249, 0.46);
  background: rgba(103, 232, 249, 0.16);
}

/* ---------- Owner action queue ---------- */
.owner-action-panel {
  margin-bottom: 14px;
  border-color: rgba(79, 155, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(79, 155, 255, 0.12), rgba(30, 211, 183, 0.055)),
    rgba(9, 20, 38, 0.84);
}

.owner-action-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.owner-action-card {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 11px;
  min-height: 186px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    rgba(9, 20, 38, 0.9);
  border: 1px solid rgba(103, 232, 249, 0.17);
  border-radius: 12px;
}

.owner-action-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.85;
}

.owner-action-card.next-risk,
.owner-action-card.next-review {
  border-color: rgba(251, 191, 36, 0.34);
  box-shadow: inset 0 0 30px rgba(251, 191, 36, 0.07);
}

.owner-action-card.next-active {
  border-color: rgba(79, 155, 255, 0.38);
  box-shadow: inset 0 0 30px rgba(79, 155, 255, 0.08);
}

.owner-action-card.next-queue {
  border-color: rgba(30, 211, 183, 0.3);
}

.owner-action-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
}

.owner-action-top span:not(.status-dot) {
  display: block;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.owner-action-top strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 14px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.owner-action-top em {
  padding: 4px 8px;
  color: #eaffff;
  background: rgba(103, 232, 249, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.owner-action-card.next-risk .owner-action-top em,
.owner-action-card.next-review .owner-action-top em {
  color: #fff4c2;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
}

.owner-action-card p {
  display: -webkit-box;
  margin: 0;
  color: rgba(239, 247, 255, 0.72);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.owner-action-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.owner-action-meta span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 25px;
  padding: 5px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.owner-action-meta b {
  color: #fff;
  font-size: 12px;
}

.owner-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.owner-action-card button {
  min-height: 34px;
  padding: 7px 9px;
  color: #08101f;
  background: linear-gradient(90deg, var(--cyan), #b8fff2);
  border: 0;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.owner-action-card button:last-child {
  color: #eaffff;
  background: rgba(103, 232, 249, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.22);
}

.owner-action-card button:hover {
  filter: brightness(1.08);
}

/* ---------- Owner review queue ---------- */
.owner-review-panel {
  margin-bottom: 14px;
  border-color: rgba(251, 191, 36, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 112, 67, 0.1), rgba(103, 232, 249, 0.055)),
    rgba(9, 20, 38, 0.84);
}

.owner-review-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.owner-review-card {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 170px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(9, 20, 38, 0.9);
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 12px;
}

.owner-review-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--cyan);
  opacity: 0.85;
}

.owner-review-card.review-risk {
  border-color: rgba(255, 112, 67, 0.38);
  box-shadow: inset 0 0 30px rgba(255, 112, 67, 0.07);
}

.owner-review-card.review-risk::before {
  background: #ff7043;
}

.owner-review-card.review-review {
  border-color: rgba(251, 191, 36, 0.34);
}

.owner-review-card.review-review::before {
  background: var(--amber);
}

.owner-review-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.owner-review-top span,
.owner-review-top em {
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.owner-review-top span {
  color: #fff4c2;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.24);
}

.owner-review-top em {
  max-width: 48%;
  overflow: hidden;
  color: #b8fff2;
  background: rgba(30, 211, 183, 0.1);
  border: 1px solid rgba(30, 211, 183, 0.2);
  text-overflow: ellipsis;
}

.owner-review-card strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.owner-review-card p {
  display: -webkit-box;
  margin: 0;
  color: rgba(239, 247, 255, 0.7);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.owner-review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.owner-review-actions button {
  min-height: 34px;
  padding: 7px 9px;
  color: #08101f;
  background: linear-gradient(90deg, var(--cyan), #b8fff2);
  border: 0;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.owner-review-actions button:first-child {
  color: #eaffff;
  background: rgba(103, 232, 249, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.22);
}

.owner-review-actions button:hover {
  filter: brightness(1.08);
}

/* ---------- Auto pilot readiness ---------- */
.autopilot-panel {
  margin-bottom: 14px;
  border-color: rgba(251, 191, 36, 0.24);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(79, 155, 255, 0.055)),
    rgba(9, 20, 38, 0.82);
}

.autopilot-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.autopilot-step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 132px;
  padding: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.autopilot-step::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: rgba(103, 232, 249, 0.55);
}

.autopilot-step.step-ready::before {
  background: var(--teal);
}

.autopilot-step.step-active::before {
  background: #4f9bff;
}

.autopilot-step.step-review::before,
.autopilot-step.step-lock::before,
.autopilot-step.step-wait::before {
  background: var(--amber);
}

.autopilot-step.step-lock {
  border-color: rgba(251, 191, 36, 0.28);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
}

.autopilot-step span {
  justify-self: start;
  min-height: 22px;
  padding: 3px 8px;
  color: #b8fff2;
  background: rgba(30, 211, 183, 0.12);
  border: 1px solid rgba(30, 211, 183, 0.24);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.autopilot-step.step-lock span,
.autopilot-step.step-review span,
.autopilot-step.step-wait span {
  color: #fff4c2;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.26);
}

.autopilot-step strong {
  color: #fff;
  font-size: 14px;
}

.autopilot-step p {
  display: -webkit-box;
  margin: 0;
  color: rgba(239, 247, 255, 0.68);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.modal-card.agent-detail-card {
  width: min(1040px, 100%);
}

.agent-detail-summary {
  display: grid;
}

.agent-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(79, 155, 255, 0.11), rgba(30, 211, 183, 0.06)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 12px;
}

.agent-detail-hero > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.agent-detail-hero strong {
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
}

.agent-detail-hero p {
  grid-column: 2;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.agent-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}

.agent-detail-metrics span {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.agent-detail-metrics b {
  color: #fff;
  font-size: 18px;
}

.agent-next-action {
  display: grid;
}

.agent-next-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(30, 211, 183, 0.11), rgba(103, 232, 249, 0.055)),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(30, 211, 183, 0.22);
  border-radius: 12px;
}

.agent-next-card.next-risk,
.agent-next-card.next-review {
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
  border-color: rgba(251, 191, 36, 0.3);
}

.agent-next-card.next-active {
  border-color: rgba(79, 155, 255, 0.32);
  background:
    linear-gradient(135deg, rgba(79, 155, 255, 0.14), rgba(103, 232, 249, 0.05)),
    rgba(255, 255, 255, 0.035);
}

.agent-next-card span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agent-next-card strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 15px;
}

.agent-next-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.agent-next-card button {
  min-height: 38px;
  padding: 0 13px;
  color: #08101f;
  background: var(--cyan);
  border: 0;
  border-radius: 8px;
  white-space: nowrap;
}

.agent-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.agent-command-grid button {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 11px;
  text-align: left;
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 10px;
}

.agent-command-grid button:hover {
  background: rgba(103, 232, 249, 0.13);
  border-color: rgba(103, 232, 249, 0.42);
}

.agent-command-grid strong {
  color: #fff;
  font-size: 13px;
}

.agent-command-grid span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.agent-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 13px;
}

.agent-detail-card h3 {
  margin: 2px 0 8px;
  color: #fff;
  font-size: 14px;
}

.compact-stack {
  max-height: 340px;
  overflow: auto;
  padding-right: 2px;
}

/* ---------- Orchestrator / agents ---------- */
.orchestrator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 14px;
  margin-bottom: 14px;
}

.agent-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agent-card {
  display: grid;
  align-content: space-between;
  gap: 11px;
  min-height: 188px;
  padding: 15px;
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.09), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 12px;
}

.agent-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.agent-card strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 16px;
}

.agent-card p {
  margin: 7px 0 0;
  font-size: 13px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-row em {
  min-height: 22px;
  padding: 3px 8px;
  color: #fff6c8;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- Work grids ---------- */
.grid-main,
.grid-bottom {
  display: grid;
  gap: 14px;
}

.grid-main {
  grid-template-columns: 0.95fr 1.15fr 0.9fr;
  margin-bottom: 14px;
}

.grid-bottom {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  margin-top: 14px;
}

.idea-panel {
  border-color: var(--line-strong);
}

.outbox-panel {
  border-color: var(--line-strong);
}

/* ---------- HQ Chat ---------- */
.hq-chat-panel {
  margin-bottom: 14px;
  border-color: rgba(99, 232, 255, 0.32);
  background:
    linear-gradient(135deg, rgba(99, 232, 255, 0.1), rgba(17, 28, 49, 0.78)),
    var(--panel);
}

.hq-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
}

.hq-chat-head-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.hq-chat-form textarea {
  min-height: 86px;
  resize: vertical;
}

.hq-chat-note {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.hq-chat-actions {
  display: grid;
  align-content: stretch;
  gap: 9px;
}

.hq-live-toggle {
  align-self: stretch;
  min-height: 38px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #b8fff2;
  font-size: 12px;
  font-weight: 800;
}

.hq-chat-list {
  max-height: min(68vh, 640px);
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.hq-chat-card {
  align-content: start;
  background: linear-gradient(135deg, rgba(30, 211, 183, 0.1), rgba(255, 255, 255, 0.05)) !important;
}

.hq-chat-card.just-added {
  animation: hqPulse 1.6s ease-out;
  border-color: rgba(36, 255, 214, 0.7);
}

.hq-chat-card p {
  display: block;
  white-space: pre-line;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.hq-chat-card.risk {
  border-color: rgba(255, 98, 98, 0.38);
  background: linear-gradient(135deg, rgba(255, 98, 98, 0.14), rgba(255, 255, 255, 0.05)) !important;
}

.hq-chat-card.pending {
  border-color: rgba(79, 155, 255, 0.38);
  background: linear-gradient(135deg, rgba(79, 155, 255, 0.14), rgba(255, 255, 255, 0.05)) !important;
}

.hq-chat-card.error {
  border-color: rgba(255, 98, 98, 0.42);
  background: linear-gradient(135deg, rgba(255, 98, 98, 0.16), rgba(255, 255, 255, 0.05)) !important;
}

.hq-safe-note {
  color: #b8fff2 !important;
  background: rgba(30, 211, 183, 0.1) !important;
  border-color: rgba(30, 211, 183, 0.24) !important;
}

.hq-live-reply {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: rgba(79, 155, 255, 0.1);
  border: 1px solid rgba(79, 155, 255, 0.22);
  border-radius: 9px;
}

.hq-live-reply p {
  white-space: pre-line;
  -webkit-line-clamp: 8;
}

.hq-live-error {
  background: rgba(255, 98, 98, 0.1);
  border-color: rgba(255, 98, 98, 0.24);
}

.hq-live-badge {
  color: #b8fff2 !important;
  background: rgba(79, 155, 255, 0.12) !important;
  border-color: rgba(79, 155, 255, 0.24) !important;
}

@keyframes hqPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 255, 214, 0.42);
  }

  100% {
    box-shadow: 0 0 0 16px rgba(36, 255, 214, 0);
  }
}

/* ---------- Stack cards ---------- */
.stack {
  display: grid;
  gap: 10px;
}

.task-scroll-list {
  max-height: min(56vh, 520px);
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.stack article {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
}

.stack span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.redacted-card {
  position: relative;
}

.redacted-card strong,
.redacted-card p {
  color: rgba(239, 247, 255, 0.48);
  filter: blur(2.8px);
  user-select: none;
}

.redacted-card::after {
  content: "ซ่อนรายละเอียด";
  justify-self: start;
  min-height: 22px;
  padding: 3px 8px;
  color: #b8fff2;
  background: rgba(30, 211, 183, 0.12);
  border: 1px solid rgba(30, 211, 183, 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.stack strong {
  color: #fff;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.stack p {
  display: -webkit-box;
  margin: 0;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.hq-chat-list .hq-chat-card p {
  display: block;
  white-space: pre-line;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.stack small {
  justify-self: start;
  min-height: 22px;
  padding: 3px 8px;
  color: #b8fff2;
  background: rgba(30, 211, 183, 0.12);
  border: 1px solid rgba(30, 211, 183, 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.updates {
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.outbox-list article {
  background: linear-gradient(135deg, rgba(44, 125, 255, 0.12), rgba(255, 255, 255, 0.05));
}

.outbox-list article small {
  color: #fff6c8;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.22);
}

.line-intent {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: rgba(103, 232, 249, 0.08);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.line-intent strong {
  color: #b8fff2;
  font-size: 12px;
}

.line-intent span {
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
}

.panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.task-output {
  display: grid;
  gap: 8px;
  padding: 11px;
  background: rgba(99, 232, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.task-output p {
  margin: 0;
  font-size: 13px;
  -webkit-line-clamp: 4;
}

.work-tag {
  width: fit-content;
}

.work-production-risk {
  color: #ffd1c7 !important;
  background: rgba(255, 90, 65, 0.14) !important;
  border-color: rgba(255, 90, 65, 0.26) !important;
}

.work-test {
  color: #fff6c8 !important;
  background: rgba(251, 191, 36, 0.12) !important;
  border-color: rgba(251, 191, 36, 0.22) !important;
}

.work-real {
  color: #b8fff2 !important;
  background: rgba(52, 211, 153, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.22) !important;
}

.error-text {
  color: #ffd1c7 !important;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.row-actions button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.ghost-button {
  min-height: 32px;
  padding: 0 12px;
  color: #eff7ff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(10px);
}

.modal-card {
  display: grid;
  gap: 13px;
  width: min(600px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  background: rgba(9, 20, 38, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
}

.modal-card label {
  display: grid;
  gap: 8px;
  color: rgba(239, 247, 255, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.route-hint {
  color: #b8fff2;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.workflow-options {
  display: grid;
  gap: 10px;
  padding: 13px;
  background: rgba(99, 232, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1160px) {
  .grid-main,
  .grid-bottom,
  .orchestrator-grid,
  .command-center,
  .public-hero,
  .hq-console {
    grid-template-columns: 1fr;
  }

  .console-strip {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .today-stats,
  .today-focus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-status-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .owner-action-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-review-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .autopilot-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-detail-hero,
  .agent-next-card,
  .agent-detail-grid,
  .agent-command-grid {
    grid-template-columns: 1fr;
  }

  .agent-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-strip,
  .public-mini-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 5vw;
  }

  .sys-cluster {
    order: 3;
  }

  nav {
    order: 2;
  }

  main {
    width: min(100% - 28px, 1460px);
    padding-top: 14px;
  }

  .public-copy {
    padding-top: 6px;
  }

  .public-copy h1 {
    font-size: clamp(24px, 7vw, 34px);
  }

  .cs-meta {
    gap: 16px;
  }

  .hq-stage {
    padding: 10px;
  }

  .hq-bar {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .panel-tools {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-stats,
  .today-focus,
  .agent-status-board,
  .owner-action-list,
  .owner-review-list,
  .autopilot-steps,
  .agent-detail-metrics,
  .agent-list,
  .command-signals {
    grid-template-columns: 1fr;
  }

  .public-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .owner-action-buttons {
    grid-template-columns: 1fr;
  }

  .owner-review-actions {
    grid-template-columns: 1fr;
  }

  .hq-chat-form {
    grid-template-columns: 1fr;
  }

  .task-scroll-list {
    max-height: 430px;
  }
}
