:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --phone: #ffffff;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --cobalt: #2563eb;
  --emerald: #059669;
  --amber: #d97706;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 12px;
}

.legal-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 28px 12px;
}

.legal-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  color: var(--text);
  line-height: 1.65;
}

.legal-card h1 {
  margin-bottom: 14px;
  font-size: 28px;
}

.legal-card h2 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.legal-card p + p {
  margin-top: 10px;
}

.legal-card a,
.legal-links a {
  color: var(--cobalt);
  font-weight: 700;
  text-decoration: none;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 14px 0 2px;
  font-size: 13px;
}

.phone-frame {
  width: min(430px, 100%);
  min-height: 860px;
  border: 1px solid #d9e2ec;
  border-radius: 32px;
  background: var(--phone);
  box-shadow: var(--shadow);
  padding: 22px 18px 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 18px;
}

.eyeline {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.build-version-badge {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.15;
  font-weight: 750;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 720;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--cobalt);
  font-size: 20px;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #cce9dc;
  border-radius: 8px;
  background: #f0fdf7;
  color: #064e3b;
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-strip small {
  color: #047857;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.12);
}

.freshness-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.freshness-panel div {
  min-width: 0;
}

.freshness-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.freshness-panel strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.freshness-panel p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.freshness-panel.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.freshness-panel.fallback {
  border-color: #fed7aa;
  background: #fff7ed;
}

.freshness-panel.needs-auth,
.freshness-panel.error {
  border-color: #fecaca;
  background: #fff7f7;
}

.connection-troubleshooter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
}

.connection-troubleshooter strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.connection-troubleshooter p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.connection-troubleshooter-action {
  min-width: 86px;
  min-height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 760;
}

.connection-troubleshooter.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.connection-troubleshooter.connected .connection-troubleshooter-action {
  border-color: #86efac;
  background: #ffffff;
  color: #047857;
}

.connection-troubleshooter.fallback,
.connection-troubleshooter.checking {
  border-color: #fed7aa;
  background: #fff7ed;
}

.connection-troubleshooter.needs-auth {
  border-color: #fecaca;
  background: #fff7f7;
}

.connection-troubleshooter.needs-auth .connection-troubleshooter-action {
  border-color: #fecaca;
  background: #ffffff;
  color: #b91c1c;
}

.mobile-help-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.mobile-help-panel[hidden] {
  display: none;
}

.mobile-help-panel strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.mobile-help-panel p {
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.simple-workbench-nav {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.simple-workbench-nav button {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--cobalt);
  font-size: 12px;
  font-weight: 760;
}

.workbench-actions {
  display: flex;
  justify-content: flex-end;
}

.workbench-actions .secondary-button {
  min-height: 34px;
  padding: 0 12px;
}

.mobile-command-center {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.mobile-command-center .section-heading span {
  background: #eff6ff;
  color: #1d4ed8;
}

.command-next-action {
  margin: 6px 0 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
}

.command-question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.command-question-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 104px;
  padding: 11px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.command-question-card span,
.command-question-card strong,
.command-question-card small {
  display: block;
  min-width: 0;
}

.command-question-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.command-question-card strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.25;
}

.command-question-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.command-question-card.ready {
  border-color: #bbf7d0;
  background: #f7fef9;
}

.command-question-card.warning {
  border-color: #fed7aa;
  background: #fffaf3;
}

.command-question-card.limited {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.command-question-card:active {
  border-color: #2563eb;
  background: #eff6ff;
}

.command-connection-health {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.command-connection-health span,
.command-connection-health strong,
.command-connection-health small {
  min-width: 0;
  font-size: 11px;
  line-height: 1.25;
}

.command-connection-health span {
  color: var(--muted);
}

.command-connection-health strong {
  color: #1d4ed8;
}

.command-connection-health small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.command-connection-health.connected {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.command-connection-health.connected strong {
  color: #047857;
}

.command-connection-health.fallback {
  border-color: #fed7aa;
  background: #fff7ed;
}

.command-connection-health.fallback strong,
.command-connection-health.needs-auth strong {
  color: #c2410c;
}

.command-connection-health.needs-auth {
  border-color: #fecaca;
  background: #fff7f7;
}

.command-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 14px;
}

.owner-action-queue {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.owner-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.owner-action-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.owner-action-card span,
.owner-action-main span {
  min-width: 0;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.owner-action-card small,
.owner-action-main small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.owner-action-card strong,
.owner-action-pill {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  padding: 6px 9px;
  border-radius: 999px;
  border: 0;
  background: #eff6ff;
  color: #2563eb;
  font-family: inherit;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.owner-action-card.needs_owner,
.owner-action-card.warning {
  border-color: #fed7aa;
  background: #fffaf3;
}

.owner-action-card.needs_owner strong,
.owner-action-card.needs_owner .owner-action-pill,
.owner-action-card.warning strong,
.owner-action-card.warning .owner-action-pill {
  background: #fff7ed;
  color: #c2410c;
}

.owner-action-card.ready {
  border-color: #bbf7d0;
  background: #f7fef9;
}

.owner-action-card.ready strong,
.owner-action-card.ready .owner-action-pill {
  background: #dcfce7;
  color: #047857;
}

.owner-action-card.limited {
  border-color: #e5e7eb;
  background: #f8fafc;
}

.owner-action-card.limited strong,
.owner-action-card.limited .owner-action-pill {
  background: #e2e8f0;
  color: #475569;
}

.command-reason {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.command-reason.owner_action {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.command-reason.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.command-reason.limited {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #64748b;
}

.remote-control-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.remote-control-lane {
  min-height: 76px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.remote-control-lane button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.remote-control-lane button:active {
  background: rgba(37, 99, 235, 0.08);
}

.remote-control-lane strong {
  color: #111827;
  font-size: 13px;
}

.remote-control-lane span {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

.remote-control-lane small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.remote-control-lane em {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.remote-control-lane.ready span {
  background: #dcfce7;
  color: #047857;
}

.remote-control-lane.running span {
  background: #e0f2fe;
  color: #0369a1;
}

.remote-control-lane.needs_owner span,
.remote-control-lane.warning span {
  background: #ffedd5;
  color: #c2410c;
}

.remote-control-lane.limited span {
  background: #e2e8f0;
  color: #475569;
}

.command-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.command-flow button {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  color: #2563eb;
  font-size: 14px;
  font-weight: 800;
}

.command-flow button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.command-summary-panel {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.command-summary-panel .row-meta {
  margin-bottom: 10px;
}

.release-readiness-panel {
  border-color: #fed7aa;
  background: #fffaf3;
}

.release-readiness-panel.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.release-readiness-panel.attention {
  border-color: #fde68a;
  background: #fffbeb;
}

.release-readiness-panel.blocked {
  border-color: #fed7aa;
  background: #fff7ed;
}

.readiness-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.readiness-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.readiness-item strong,
.readiness-item small {
  display: block;
}

.readiness-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.readiness-item > span {
  min-width: 38px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.readiness-item.blocker > span {
  background: #ffedd5;
  color: #c2410c;
}

.readiness-item.warning > span {
  background: #fef3c7;
  color: #b45309;
}

.readiness-item.ready > span {
  background: #dcfce7;
  color: #047857;
}

.readiness-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.readiness-actions .compact-button {
  width: 100%;
  min-width: 0;
}

.deploy-manifest-panel {
  border-color: #c7d2fe;
  background: #f8fbff;
}

.deploy-manifest-panel.attention {
  border-color: #fde68a;
  background: #fffbeb;
}

.deploy-manifest-meta {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.deploy-manifest-meta span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.deploy-manifest-meta strong {
  color: var(--text);
  font-size: 13px;
}

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

.deploy-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.deploy-command-row strong {
  display: block;
  margin-bottom: 4px;
}

.deploy-command-row code {
  display: block;
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quick-cleanup-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.quick-cleanup-actions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.runner-debug-tools {
  display: grid;
  gap: 10px;
}

.mobile-safety-preflight {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.mobile-safety-preflight.safe_to_dispatch {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.mobile-safety-preflight.safe_with_warnings {
  border-color: #fde68a;
  background: #fffbeb;
}

.mobile-safety-preflight.review_first {
  border-color: #fed7aa;
  background: #fff7ed;
}

.mobile-safety-preflight strong,
.mobile-safety-preflight span {
  display: block;
}

.mobile-safety-preflight strong {
  font-size: 14px;
}

.mobile-safety-preflight span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.safety-checklist {
  display: grid;
  gap: 7px;
}

.safety-check {
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.safety-check:active {
  background: #f8fafc;
}

.safety-check span,
.safety-check strong,
.safety-check small,
.safety-check em {
  display: block;
}

.safety-check span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.safety-check small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.safety-check strong {
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.safety-check em,
.safety-evidence {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.safety-check.blocker {
  border-color: #fed7aa;
}

.safety-check.warning {
  border-color: #fde68a;
}

.safety-check.ready {
  border-color: #bbf7d0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  margin-top: 12px;
}

.advanced-collapsed {
  display: none;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.auth-panel {
  display: block;
  border-color: #d8e4f2;
  background: #f8fafc;
}

.auth-panel.attention {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.auth-token-grid {
  display: grid;
  grid-template-columns: 1fr 72px 72px;
  gap: 8px;
}

.auth-token-grid input {
  min-width: 0;
}

.system-diagnostics-panel {
  border-color: #d8e4f2;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.diagnostic-item {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: var(--surface-strong);
}

.diagnostic-item strong,
.diagnostic-item small {
  display: block;
  overflow-wrap: anywhere;
}

.diagnostic-item strong {
  font-size: 12px;
  line-height: 1.2;
}

.diagnostic-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.diagnostic-item.pass {
  border-color: #bbf7d0;
  background: #f0fdf7;
}

.diagnostic-item.pass small {
  color: #047857;
}

.diagnostic-item.warn {
  border-color: #fde68a;
  background: #fffdf5;
}

.diagnostic-item.warn small {
  color: #a16207;
}

.diagnostic-item.fail {
  border-color: #fecaca;
  background: #fef2f2;
}

.diagnostic-item.fail small {
  color: #b91c1c;
}

.ops-log-panel {
  border-color: #d8e4f2;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.ops-diagnostic-list,
.memory-audit-list {
  display: grid;
  gap: 8px;
}

.ops-diagnostic-row,
.memory-audit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.ops-diagnostic-row.warning {
  border-color: #fde68a;
  background: #fffdf5;
}

.ops-diagnostic-row.error {
  border-color: #fecaca;
  background: #fef2f2;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}

.row-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.task-list,
.project-list,
.agent-list,
.approval-list {
  display: grid;
  gap: 10px;
}

.voice-panel {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.voice-recorder {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mic-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--cobalt);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
  font-size: 15px;
}

.mic-button.recording {
  background: var(--emerald);
  box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.12);
}

.voice-input {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.voice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.primary-button,
.secondary-button {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--emerald);
  background: var(--emerald);
  color: #ffffff;
}

.primary-button:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #94a3b8;
}

.action-busy {
  cursor: wait;
  opacity: 0.78;
}

.secondary-button {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--cobalt);
}

.voice-draft-preview {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf7;
}

.voice-draft-preview.visible {
  display: grid;
  gap: 4px;
}

.handoff-panel {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff, #f8faff);
}

.import-wizard-panel {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #ffffff, #f7fcff);
}

.handoff-grid {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 9px 10px;
}

.wizard-grid {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 9px 10px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.handoff-input {
  width: 100%;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}

textarea.handoff-input {
  grid-column: 1 / -1;
  min-height: 88px;
  resize: vertical;
}

.handoff-actions {
  display: grid;
  margin-top: 10px;
}

.wizard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

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

.wizard-step {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.wizard-step strong,
.wizard-step small {
  display: block;
  overflow-wrap: anywhere;
}

.wizard-step strong {
  font-size: 11px;
  line-height: 1.2;
}

.wizard-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.wizard-step.completed {
  border-color: #bbf7d0;
  background: #f0fdf7;
}

.wizard-step.current {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.wizard-stats {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.wizard-latest {
  padding: 9px 10px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
}

.wizard-stats span {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: var(--surface-strong);
}

.wizard-stats strong {
  color: var(--cobalt);
  font-size: 18px;
  line-height: 1;
}

.wizard-stats small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.transfer-preview {
  display: none;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.transfer-preview.visible {
  display: grid;
  gap: 8px;
}

.transfer-result-list {
  display: grid;
  gap: 6px;
}

.transfer-result-list span {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #ffffff;
}

.transfer-result-list strong {
  font-size: 13px;
  line-height: 1.25;
}

.transfer-result-list small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.transfer-report-button {
  width: 100%;
  margin-top: 10px;
}

.transfer-report-panel {
  display: none;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf7;
}

.transfer-report-panel.visible {
  display: grid;
  gap: 9px;
}

.transfer-report-projects {
  display: grid;
  gap: 8px;
}

.transfer-report-projects article {
  padding: 9px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8f5e3;
}

.transfer-report-projects strong,
.transfer-report-projects small {
  display: block;
}

.transfer-report-projects small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.transfer-report-projects ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.transfer-report-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

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

.danger-button:disabled,
.compact-button:disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
}

.transfer-next-actions {
  display: grid;
  gap: 6px;
}

.transfer-next-actions span {
  padding: 7px 9px;
  border-radius: 8px;
  background: #ffffff;
  color: #047857;
  font-size: 12px;
  line-height: 1.35;
}

.handoff-preview {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
}

.handoff-preview.visible {
  display: grid;
  gap: 8px;
}

.notification-panel {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff, #f6fef9);
}

.notification-list,
.media-job-list {
  display: grid;
  gap: 8px;
}

.notification-row,
.media-job-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.26);
}

.detail-modal[hidden] {
  display: none;
}

.detail-modal-card {
  width: min(392px, 100%);
  max-height: min(72vh, 640px);
  overflow: auto;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 14px;
}

.detail-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7edf5;
}

.detail-modal-body dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.detail-decision-guide {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-decision-guide div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-decision-guide span {
  color: var(--muted);
  font-size: 11px;
}

.detail-decision-guide strong {
  color: var(--text);
  font-size: 13px;
}

.detail-decision-guide p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.detail-decision-guide.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.detail-decision-guide.needs-owner,
.detail-decision-guide.running {
  border-color: #fed7aa;
  background: #fff7ed;
}

.detail-decision-guide.blocked {
  border-color: #fecaca;
  background: #fef2f2;
}

.detail-decision-guide.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.detail-safety-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 16px;
  color: #475569;
  font-size: 12px;
  line-height: 1.42;
}

.detail-modal-body dl div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-modal-body dt {
  color: var(--muted);
  font-size: 11px;
}

.detail-modal-body dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.detail-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.detail-modal-actions:empty {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

.handoff-export-panel {
  border-color: #ddd6fe;
  background: linear-gradient(180deg, #ffffff, #fbfaff);
}

.handoff-export-panel > .primary-button {
  width: 100%;
}

.media-panel {
  border-color: #fde68a;
  background: linear-gradient(180deg, #ffffff, #fffdf5);
}

.media-create-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.media-create-grid textarea {
  grid-column: 1 / -1;
  resize: vertical;
}

.handoff-result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.handoff-result-grid span {
  display: grid;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.handoff-result-grid strong {
  color: var(--cobalt);
  font-size: 18px;
  line-height: 1;
}

.handoff-result-grid small {
  color: var(--muted);
  font-size: 11px;
}

.memory-review-panel {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff, #f8fffb);
}

.memory-review-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.memory-review-toolbar span {
  min-width: 64px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.batch-review-actions {
  display: grid;
  grid-template-columns: 1fr 0.72fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.batch-review-actions button {
  min-width: 0;
  padding-inline: 6px;
}

.batch-result {
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf7;
  color: #047857;
  font-size: 12px;
  line-height: 1.35;
}

.memory-candidate-list {
  display: grid;
  gap: 8px;
}

.memory-candidate-row {
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: var(--surface-strong);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.memory-candidate-row.selected {
  border-color: var(--emerald);
  background: #f0fdf7;
}

.memory-candidate-button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px 12px 11px 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--text);
}

.memory-candidate-button strong,
.memory-candidate-button small {
  display: block;
}

.memory-candidate-button strong {
  font-size: 14px;
  line-height: 1.25;
}

.memory-candidate-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.memory-candidate-button em {
  min-width: 42px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--emerald);
  padding: 5px 8px;
  font-size: 12px;
  font-style: normal;
  text-align: center;
  font-weight: 700;
}

.memory-select-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 100%;
}

.memory-select-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--emerald);
}

.memory-candidate-button em.conflict {
  background: #fff7ed;
  color: var(--amber);
}

.memory-candidate-editor {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.memory-candidate-editor[hidden] {
  display: none;
}

.review-input {
  width: 100%;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

textarea.review-input {
  min-height: 86px;
  resize: vertical;
}

.memory-evidence {
  display: grid;
  gap: 7px;
}

.memory-evidence blockquote {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid var(--emerald);
  border-radius: 8px;
  background: #f8fafc;
}

.memory-evidence blockquote strong,
.memory-evidence blockquote span {
  display: block;
}

.memory-evidence blockquote strong {
  font-size: 12px;
  color: var(--text);
}

.memory-evidence blockquote span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.conflict-note {
  color: var(--amber);
  font-size: 12px;
  line-height: 1.35;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.danger-button {
  min-height: 38px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  padding: 0 12px;
}

.task-row,
.project-row,
.agent-row,
.approval-row {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: var(--surface-strong);
}

.task-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.row-title {
  font-size: 14px;
  font-weight: 680;
  line-height: 1.25;
}

.row-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.tap-hint {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.badge {
  min-width: 76px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--cobalt);
  text-align: center;
  font-size: 12px;
  font-weight: 680;
}

.badge.warning {
  background: #fff7ed;
  color: var(--amber);
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compact {
  min-height: 154px;
}

.approval-row {
  border-color: #fed7aa;
  background: #fff7ed;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.graph-preview {
  position: relative;
  height: 88px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #eef6ff);
  border: 1px solid #e7edf5;
  overflow: hidden;
}

.graph-node {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--cobalt);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.09);
}

.graph-node:nth-child(2n) {
  background: var(--emerald);
  box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.09);
}

.memory-guard-panel {
  border-color: #d8e4f2;
}

.workbench-target-highlight {
  animation: workbenchTargetPulse 1.4s ease;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.workbench-target-highlight:focus {
  outline: none;
}

@keyframes workbenchTargetPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.22);
  }

  45% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.memory-audit-panel {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff, #fbfaff);
}

.memory-guard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.memory-guard-grid div {
  padding: 10px 8px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: var(--surface-strong);
}

.memory-guard-grid strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.runner-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.runner-stats span {
  padding: 9px 10px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: var(--surface-strong);
}

.runner-stats strong,
.runner-stats small {
  display: block;
}

.runner-stats strong {
  font-size: 18px;
  line-height: 1.1;
}

.runner-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.runner-dispatch-gate {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.runner-dispatch-gate[hidden] {
  display: none;
}

.runner-dispatch-gate strong,
.runner-dispatch-gate p {
  display: block;
}

.runner-dispatch-gate strong {
  color: #9a3412;
  font-size: 13px;
  line-height: 1.25;
}

.runner-dispatch-gate p {
  margin: 4px 0 0;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.35;
}

.runner-dispatch-action {
  white-space: nowrap;
}

.runner-pause-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}

.runner-pause-control.paused {
  border-color: #fed7aa;
  background: #fff7ed;
}

.runner-pause-control strong,
.runner-pause-control p {
  display: block;
}

.runner-pause-control strong {
  color: #047857;
  font-size: 13px;
  line-height: 1.25;
}

.runner-pause-control.paused strong {
  color: #9a3412;
}

.runner-pause-control p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.runner-pause-control.paused p {
  color: #7c2d12;
}

.runner-guide {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.runner-command-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #d8e4f2;
  border-radius: 8px;
  background: var(--surface-strong);
}

.runner-command-card div {
  min-width: 0;
}

.runner-command-card strong,
.runner-command-card code {
  display: block;
}

.runner-command-card strong {
  font-size: 12px;
  line-height: 1.25;
}

.runner-command-card code {
  margin-top: 4px;
  color: #334155;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.runner-guide-state {
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf7;
  color: #047857;
  font-size: 12px;
  line-height: 1.35;
}

.runner-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.runner-maintenance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 10px;
}

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

.runner-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
}

.runner-row-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.runner-row strong,
.runner-row small {
  display: block;
}

.runner-row strong {
  font-size: 13px;
  line-height: 1.25;
}

.runner-row small,
.runner-log,
.runner-explanation {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.runner-log {
  margin-top: 5px;
  color: #047857;
}

.runner-explanation {
  margin-top: 5px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.project-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.project-row strong,
.agent-row strong {
  font-size: 14px;
}

.agent-row {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.agent-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--cobalt);
  font-weight: 760;
}

.switch {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  padding: 3px;
}

.switch::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
}

.switch.on {
  background: var(--emerald);
}

.switch.on::after {
  margin-left: auto;
}

@media (max-width: 460px) {
  .app-shell {
    padding: 0;
    background: var(--phone);
  }

  .phone-frame {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
