:root {
  --bg: #061018;
  --bg-deep: #03070c;
  --panel: #0d1824;
  --panel-strong: #121e2c;
  --line: rgba(186, 230, 253, 0.28);
  --line-strong: rgba(186, 230, 253, 0.50);
  --text: #f3f9ff;
  --muted: #c5d4e0;
  --dim: #a8b9c8;
  --cyan: #7cecff;
  --accent: #7cecff;
  --on-accent: #04121c;
  --teal: #4df0c8;
  --amber: #ffcd70;
  --ok: #5ee0a8;
  --bad: #ff8a8a;
  --warn: #ffcd70;
  --btn-bg: #152232;
  --btn-ghost-bg: transparent;
  --overlay: rgba(0, 0, 0, 0.55);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
}

/* Settings light mode — every page that loads app.css */
html.theme-light {
  --bg: #eef3f8;
  --bg-deep: #dce6ef;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: rgba(16, 34, 52, 0.32);
  --line-strong: rgba(16, 34, 52, 0.52);
  --text: #0c1a26;
  --muted: #3a5163;
  --dim: #4a6274;
  --cyan: #0a6a8c;
  --accent: #0a6a8c;
  --on-accent: #ffffff;
  --teal: #087a62;
  --amber: #8a5a10;
  --ok: #0b7a4e;
  --bad: #b4232c;
  --warn: #8a5a10;
  --btn-bg: #ffffff;
  --btn-ghost-bg: transparent;
  --overlay: rgba(16, 34, 52, 0.35);
  --shadow: 0 18px 40px rgba(16, 34, 52, 0.14);
}

html.theme-light,
html.theme-light body {
  background: linear-gradient(180deg, #f4f8fb, #e8eef4 55%);
  color: var(--text);
}

html.theme-light .bg-mesh,
html.theme-light .bg-orbit {
  opacity: 0.35;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(76, 178, 255, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(77, 240, 200, 0.12), transparent 20%),
    linear-gradient(180deg, #08131d, #04080d 55%);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-mesh,
.bg-orbit {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-mesh {
  background-image:
    linear-gradient(rgba(124, 236, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 236, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9), transparent 90%);
}

.bg-orbit::before,
.bg-orbit::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(124, 236, 255, 0.08);
}

.bg-orbit::before {
  width: 70vw;
  height: 70vw;
  top: -20vw;
  right: -18vw;
}

.bg-orbit::after {
  width: 36vw;
  height: 36vw;
  bottom: -10vw;
  left: -10vw;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.05rem;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.top-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
}

.top-links {
  display: flex;
  gap: 0.6rem;
}

.session-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.session-picker span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.session-row select,
.session-row input {
  min-width: 140px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 236, 255, 0.18), rgba(77, 240, 200, 0.12));
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 0 28px rgba(124, 236, 255, 0.12);
}

.brand-text {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.68rem;
}

.pill.ok {
  color: var(--teal);
  border-color: rgba(77, 240, 200, 0.28);
}

.pill.warn {
  color: var(--amber);
  border-color: rgba(255, 205, 112, 0.28);
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1.1rem;
  max-width: 1700px;
  margin: 0 auto;
}

.command-rail,
.main-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rail-panel,
.hero-card,
.mini-card,
.chat-panel,
.thought-bar {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.rail-panel,
.mini-card {
  padding: 1rem;
}

.mission-panel {
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(12, 25, 40, 0.95), rgba(10, 18, 28, 0.82)),
    radial-gradient(circle at top right, rgba(124, 236, 255, 0.12), transparent 35%);
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mission-panel h1,
.hero-card h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.1;
}

.panel-copy {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.workspace-tabs {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.tab-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(10, 18, 28, 0.72);
  color: var(--text);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-size: 0.96rem;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.tab-btn:hover,
.tab-btn.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(42, 79, 111, 0.68), rgba(15, 31, 48, 0.92));
  transform: translateX(4px);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem;
  background: rgba(9, 16, 24, 0.9);
}

.metric-label,
.stack-label {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value,
.stack-value {
  margin-top: 0.45rem;
  display: block;
  line-height: 1.55;
}

.stack-value.small {
  font-size: 0.88rem;
  color: var(--muted);
}

.mono {
  font-family: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
}

.small {
  word-break: break-word;
}

.stat-stack {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.hud-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}

.sys-box {
  margin: 0;
  white-space: pre-wrap;
  color: #b8d2df;
  font-size: 0.8rem;
}

.workspace-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.workspace-panel.active {
  display: flex;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(124, 236, 255, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(12, 22, 35, 0.95), rgba(10, 18, 28, 0.84));
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-content: flex-start;
  justify-content: flex-end;
}

.quick-chip,
.list-action {
  border: 1px solid var(--line);
  background: rgba(11, 20, 30, 0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.quick-chip:hover,
.list-action:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.thought-bar {
  padding: 0.95rem 1.15rem;
}

.thought-label {
  color: var(--cyan);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.thought-text {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.thought-feed {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.55rem;
  max-height: 180px;
  overflow: auto;
}

.thought-feed-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 16, 24, 0.7);
  padding: 0.65rem 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.thought-feed-item.thinking {
  border-color: rgba(124, 236, 255, 0.2);
  color: #c7ecf6;
}

.thought-feed-item.learned {
  border-color: rgba(77, 240, 200, 0.24);
  color: #bff4e9;
}

.thought-feed-item.warn {
  border-color: rgba(255, 205, 112, 0.22);
  color: #ffdba0;
}

.thought-feed-item.done {
  border-color: rgba(77, 240, 200, 0.24);
  color: var(--teal);
}

.thought-feed-item.muted {
  color: var(--muted);
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
}

.chat-panel {
  min-height: 680px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.bubble {
  max-width: 90%;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  line-height: 1.6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(46, 101, 145, 0.52), rgba(17, 35, 54, 0.92));
  border: 1px solid rgba(124, 236, 255, 0.18);
}

.bubble.jarvis {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(17, 30, 44, 0.98), rgba(10, 18, 27, 0.92));
  border: 1px solid var(--line);
  white-space: pre-wrap;
}

.bubble.jarvis.thinking {
  max-width: 96%;
  background: linear-gradient(135deg, rgba(9, 20, 31, 0.98), rgba(7, 13, 20, 0.94));
  border-color: rgba(124, 236, 255, 0.18);
}

html.theme-light .bubble.user {
  background: #d7ebf7;
  border: 1px solid rgba(10, 106, 140, 0.4);
  color: var(--text);
  box-shadow: none;
}

html.theme-light .bubble.jarvis,
html.theme-light .bubble.jarvis.thinking {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

html.theme-light .thinking-body {
  color: var(--muted);
}

.thinking-body {
  font-family: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #c4d9e4;
  white-space: pre-wrap;
}

.thinking-progress,
.thinking-plan,
.thinking-log {
  white-space: normal;
}

.thinking-progress {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(124, 236, 255, 0.12);
}

.thinking-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  color: #d7ebf6;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.thinking-progress-head strong {
  color: var(--cyan);
  font-size: 0.92rem;
}

.thinking-progress-bar {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(124, 236, 255, 0.08);
  border: 1px solid rgba(124, 236, 255, 0.12);
}

.thinking-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(77, 240, 200, 0.88), rgba(124, 236, 255, 0.92));
  box-shadow: 0 0 22px rgba(124, 236, 255, 0.18);
}

.thinking-progress-line {
  color: #c4d9e4;
  font-size: 0.84rem;
  line-height: 1.5;
}

.thinking-section-label {
  margin-bottom: 0.55rem;
  color: var(--cyan);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.thinking-checklist {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.thinking-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: rgba(10, 18, 27, 0.62);
  border: 1px solid rgba(124, 236, 255, 0.08);
}

.thinking-step-mark {
  color: var(--muted);
  font-weight: 700;
}

.thinking-step.done {
  border-color: rgba(77, 240, 200, 0.18);
  background: rgba(10, 26, 24, 0.55);
  color: #bff4e9;
}

.thinking-step.done .thinking-step-mark {
  color: var(--teal);
}

.thinking-step.active {
  border-color: rgba(124, 236, 255, 0.18);
  background: rgba(16, 30, 44, 0.72);
  color: #e3f6ff;
}

.thinking-step.active .thinking-step-mark {
  color: var(--cyan);
}

.thinking-step.todo {
  color: #a2bac8;
}

.thinking-log {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(124, 236, 255, 0.1);
  font-family: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #c4d9e4;
  white-space: pre-wrap;
}

.bubble .label {
  color: var(--cyan);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.45rem;
}

.voice-bar,
.composer {
  border-top: 1px solid var(--line);
}

.voice-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(10, 18, 28, 0.72);
}

.voice-toggle,
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.voice-status {
  color: var(--cyan);
  font-size: 0.82rem;
}

.composer {
  padding: 1rem;
  background: rgba(8, 14, 20, 0.88);
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 180px;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.field,
.mini-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin: -0.15rem 0 0.8rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 18, 26, 0.92);
  color: var(--text);
  padding: 0.78rem 0.9rem;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(124, 236, 255, 0.08);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-top: 0.8rem;
}

.feedback-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
}

.fb-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.fb-input {
  min-width: 200px;
  flex: 1;
}

.btn {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line-strong));
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: var(--btn-ghost-bg);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.sm {
  padding: 0.6rem 0.75rem;
}

.nav-link {
  text-decoration: none;
}

.mic-btn.active {
  border-color: rgba(77, 240, 200, 0.35);
  color: var(--teal);
}

.side-stack,
.task-grid {
  display: grid;
  gap: 1rem;
}

.task-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-grid.two-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-list {
  display: grid;
  gap: 0.65rem;
}

.list-action {
  border-radius: 18px;
  text-align: left;
}

.footer {
  position: relative;
  z-index: 2;
  padding: 1rem 1.4rem 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.feed-list {
  display: grid;
  gap: 0.8rem;
}

.feed-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(9, 16, 24, 0.86);
  padding: 0.85rem;
}

.workspace-command-output {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  margin-top: 0.9rem;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.feed-title {
  font-weight: 700;
  color: var(--text);
}

.feed-badge {
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  color: var(--muted);
}

.feed-badge.success {
  color: var(--teal);
  border-color: rgba(77, 240, 200, 0.28);
}

.feed-badge.low {
  color: #9ec7ff;
  border-color: rgba(158, 199, 255, 0.28);
}

.feed-badge.high {
  color: #ffcd70;
  border-color: rgba(255, 205, 112, 0.28);
}

.feed-badge.urgent {
  color: #ff8e8e;
  border-color: rgba(255, 120, 120, 0.3);
}

.feed-badge.failure {
  color: #ff8e8e;
  border-color: rgba(255, 120, 120, 0.25);
}

.feed-badge.partial,
.feed-badge.neutral {
  color: var(--amber);
  border-color: rgba(255, 205, 112, 0.24);
}

.feed-summary {
  margin-top: 0.55rem;
  color: var(--text);
  line-height: 1.5;
}

.feed-detail {
  margin-top: 0.45rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.assistant-shell {
  position: relative;
  z-index: 2;
  max-width: 1580px;
  margin: 0 auto;
  padding: 1.1rem;
  display: grid;
  gap: 1rem;
}

.assistant-simple-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.assistant-simple-rail {
  display: none;
  gap: 1rem;
}

.assistant-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top right, rgba(77, 240, 200, 0.11), transparent 28%),
    linear-gradient(180deg, rgba(12, 22, 35, 0.96), rgba(9, 17, 27, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.assistant-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-content: flex-start;
  justify-content: flex-end;
}

.assistant-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 1rem;
}

.assistant-column {
  display: grid;
  gap: 1rem;
}

.assistant-chat-panel {
  min-height: 780px;
}

.assistant-briefing-card {
  background:
    radial-gradient(circle at top right, rgba(124, 236, 255, 0.09), transparent 30%),
    rgba(11, 21, 33, 0.82);
}

.briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.assistant-status-bar {
  display: flex;
  gap: 0.55rem;
  padding: 1rem 1rem 0;
  flex-wrap: wrap;
}

.assistant-messages {
  min-height: 420px;
}

.assistant-composer-grid {
  grid-template-columns: 200px 1fr;
}

.assistant-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.assistant-settings-card {
  margin: 0 1rem;
  padding-top: 1rem;
}

.assistant-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.toggle-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 27, 0.72);
}

.toggle-copy {
  display: grid;
  gap: 0.3rem;
}

.toggle-title {
  font-weight: 600;
  color: var(--text);
}

.toggle-detail {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.assistant-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.assistant-send-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.assistant-live-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.simple-session-list,
.simple-starter-list {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.simple-session-chip {
  border: 1px solid var(--line);
  background: rgba(10, 18, 27, 0.86);
  color: var(--text);
  border-radius: 999px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
}

.simple-session-chip.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(42, 79, 111, 0.68), rgba(15, 31, 48, 0.92));
}

.simple-starter-head {
  margin-top: 0.35rem;
}

.assistant-simple-mode .assistant-hero,
.assistant-simple-mode .assistant-briefing-card,
.assistant-simple-mode .assistant-side,
.assistant-simple-mode .assistant-hint,
 .assistant-simple-mode .assistant-settings-card,
.assistant-simple-mode #assistantModeSelect,
.assistant-simple-mode #assistantModelInput,
.assistant-simple-mode .assistant-composer-grid label.field {
  display: none;
}

.assistant-simple-mode .assistant-shell {
  max-width: 920px;
  padding: 0.75rem;
}

.assistant-simple-mode .assistant-grid {
  grid-template-columns: 1fr;
}

.assistant-simple-mode .assistant-simple-banner {
  display: flex;
}

.assistant-simple-mode .assistant-simple-rail {
  display: grid;
}

.assistant-simple-mode .assistant-chat-panel {
  min-height: calc(100vh - 180px);
  border-radius: 28px;
}

.assistant-simple-mode .assistant-status-bar {
  padding: 0.85rem 0.95rem 0;
}

.assistant-simple-mode .thought-bar {
  margin: 0 0.8rem;
  border-radius: 18px;
}

.assistant-simple-mode .assistant-messages {
  min-height: 55vh;
  padding: 1rem 0.95rem;
}

.assistant-simple-mode .composer {
  position: sticky;
  bottom: 0;
  background: rgba(8, 14, 20, 0.96);
}

.assistant-simple-mode .composer-actions {
  align-items: center;
}

.assistant-simple-mode .assistant-tools {
  width: 100%;
  justify-content: space-between;
}

.assistant-simple-mode .assistant-send-actions {
  width: 100%;
  justify-content: flex-end;
}

.assistant-simple-mode .top-links .nav-link {
  display: none;
}

.calendar-list-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .assistant-settings-grid {
    grid-template-columns: 1fr;
  }
}

.calendar-feed {
  margin-top: 1rem;
}

.calendar-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .assistant-grid,
  .assistant-hero {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 820px) {
  .assistant-composer-grid,
  .composer-grid,
  .task-grid,
  .briefing-grid {
    grid-template-columns: 1fr;
  }

  .top-bar,
  .session-row,
  .top-controls {
    align-items: stretch;
  }

  .session-row {
    flex-direction: column;
  }

  .assistant-simple-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 900px) {
  .top-bar,
  .top-controls,
  .session-picker {
    align-items: stretch;
  }

  .session-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-card,
  .composer-actions {
    flex-direction: column;
  }

  .task-grid,
  .task-grid.two-wide,
  .composer-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

/* Quick Capture Float Button */
.quick-capture-fab { position: fixed; bottom: 28px; right: 28px; width: 52px; height: 52px; border-radius: 50%; background: var(--accent, #7c6fff); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 4px 20px rgba(124,111,255,0.4); z-index: 999; transition: transform .15s, box-shadow .15s; }
.quick-capture-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(124,111,255,0.6); }
.quick-capture-modal { display:none; position:fixed; bottom:90px; right:28px; width:340px; background:#1a1b26; border:1px solid rgba(255,255,255,0.12); border-radius:16px; padding:16px; z-index:1000; box-shadow:0 8px 40px rgba(0,0,0,0.6); }
.quick-capture-modal.open { display:block; }
.quick-capture-modal textarea { width:100%; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.12); border-radius:8px; color:#e8eaf6; padding:10px; font-size:14px; resize:none; outline:none; height:80px; box-sizing:border-box; }
.quick-capture-modal-footer { display:flex; gap:8px; margin-top:10px; }
.quick-capture-modal-footer button { flex:1; padding:8px; border-radius:8px; border:none; cursor:pointer; font-size:13px; font-weight:600; }
.qcm-save { background:var(--accent,#7c6fff); color:#fff; }
.qcm-cancel { background:rgba(255,255,255,0.07); color:#e8eaf6; }
.capture-count-badge { position:absolute; top:-4px; right:-4px; background:#e05c5c; color:#fff; border-radius:10px; padding:1px 6px; font-size:10px; font-weight:700; display:none; }

/* ---- GPU details modal ---- */
.gpu-card { transition: border-color .15s ease, transform .15s ease; }
.gpu-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.gpu-card-hint { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.04em; margin-left: 4px; }

.gpu-overlay {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 13, 0.72);
  backdrop-filter: blur(6px);
}
.gpu-overlay[hidden] { display: none !important; }

.gpu-modal {
  width: min(720px, 96vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel-strong); box-shadow: var(--shadow);
}
.gpu-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.gpu-modal-title { font-size: 1.05rem; color: var(--text); }
.gpu-modal-head .pill {
  font-size: 0.72rem; color: var(--cyan);
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px;
}
.gpu-modal-head .neural-x { margin-left: auto; }
.gpu-modal-body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 14px; }

.gpu-card-detail {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; background: rgba(12, 25, 40, 0.55);
}
.gpu-card-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gpu-card-detail-head strong { font-size: 0.95rem; color: var(--text); }
.gpu-role-tag {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--teal); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 2px 8px;
}
.gpu-temp { margin-left: auto; color: var(--amber); font-size: 0.85rem; font-weight: 600; }
.gpu-bar { height: 7px; border-radius: 999px; background: rgba(90, 222, 255, 0.12); overflow: hidden; }
.gpu-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--cyan)); }
.gpu-card-detail-meta { margin-top: 8px; font-size: 0.74rem; color: var(--muted); }

.gpu-model-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.gpu-model-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 9px;
  background: rgba(90, 222, 255, 0.06); border: 1px solid var(--line);
}
.gpu-model-name { color: var(--text); font-size: 0.82rem; }
.gpu-model-meta { margin-left: auto; color: var(--muted); font-size: 0.7rem; }
.gpu-model-empty { color: var(--muted); font-size: 0.78rem; justify-content: center; }

/* ───────────────────────────────────────────────────────────
   Keyboard focus visibility (a11y).
   Interactive controls above define :hover but no keyboard-
   focus indicator, and form fields set outline:none on :focus.
   :focus-visible only fires for keyboard/AT navigation, so the
   ring never shows for mouse users — purely additive, no visual
   change to existing mouse/touch interaction. Placed last so it
   wins source-order over the earlier `outline:none`.
   --------------------------------------------------------------- */
.btn:focus-visible,
.tab-btn:focus-visible,
.quick-chip:focus-visible,
.list-action:focus-visible,
.simple-session-chip:focus-visible,
.gpu-card:focus-visible,
.nav-link:focus-visible,
.mic-btn:focus-visible,
.pill:focus-visible,
.voice-toggle:focus-visible,
.inline-check:focus-visible,
.qcm-save:focus-visible,
.qcm-cancel:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
  border-color: var(--line-strong);
}

.quick-capture-fab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Honour reduced-motion: drop the transform/box-shadow animations
   on controls that move or scale. */
@media (prefers-reduced-motion: reduce) {
  .tab-btn,
  .btn,
  .quick-chip,
  .list-action,
  .gpu-card,
  .quick-capture-fab {
    transition: none;
  }
}

/* ── Light-mode surface fixes (buttons/cards that used dark rgba) ── */
html.theme-light .metric-card,
html.theme-light .toggle-card,
html.theme-light .hero-card,
html.theme-light .tab-btn,
html.theme-light .quick-chip,
html.theme-light .list-action,
html.theme-light .simple-session-chip {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

html.theme-light .tab-btn.active,
html.theme-light .quick-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
}

html.theme-light input,
html.theme-light textarea,
html.theme-light select {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

html.theme-light kbd {
  background: color-mix(in srgb, var(--text) 8%, var(--panel)) !important;
  color: var(--text) !important;
  border: 1px solid var(--line);
}
