:root {
  color-scheme: light;
  --cp-bg: #f7f4ef;
  --cp-bg-elevated: #fcfbf8;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f5f5f5;
  --cp-border: #dedede;
  --cp-border-strong: #919191;
  --cp-text: #242424;
  --cp-text-muted: #5c5c5c;
  --cp-text-soft: #6f6f6f;
  --cp-accent: #b11f4b;
  --cp-accent-hover: #9a1a41;
  --cp-accent-soft: rgba(177, 31, 75, 0.08);
  --cp-accent-fg: #ffffff;
  --cp-success: #16a34a;
  --cp-danger: #dc2626;
  --cp-warning: #f59e0b;
  --cp-link: #0078d4;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --cp-overlay: rgba(255, 255, 255, 0.8);
  --cp-panel: rgba(255, 255, 255, 0.86);
  --cp-panel-strong: rgba(255, 255, 255, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.55);
  --cp-highlight: rgba(177, 31, 75, 0.12);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --cp-bg: #3d3b3a;
  --cp-bg-elevated: #343231;
  --cp-surface: #292929;
  --cp-surface-soft: #2e2e2e;
  --cp-border: #474747;
  --cp-border-strong: #5f5f5f;
  --cp-text: #dedede;
  --cp-text-muted: #919191;
  --cp-text-soft: #b0b0b0;
  --cp-accent: #fd8ea1;
  --cp-accent-hover: #fb7b91;
  --cp-accent-soft: rgba(253, 142, 161, 0.14);
  --cp-accent-fg: #1a1a1a;
  --cp-success: #4ade80;
  --cp-danger: #f87171;
  --cp-warning: #fbbf24;
  --cp-link: #4da6ff;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --cp-overlay: rgba(41, 41, 41, 0.88);
  --cp-panel: rgba(41, 41, 41, 0.72);
  --cp-panel-strong: rgba(41, 41, 41, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.04);
  --cp-highlight: rgba(253, 142, 161, 0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--cp-bg); color: var(--cp-text);
  font-family: "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex; flex-direction: column; padding: 12px; gap: 12px;
}
.topbar { display: flex; align-items: center; gap: 16px; padding: 4px 8px; }
.brand { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tagline { color: var(--cp-text-muted); font-size: 13px; flex: 1; }
button {
  font: inherit; font-size: 13px; border: 1px solid var(--cp-border); background: var(--cp-surface); color: var(--cp-text);
  border-radius: 2px; padding: 6px 14px; cursor: pointer;
}
button:hover { border-color: var(--cp-text-soft); background: var(--cp-surface-soft); }
button:focus-visible { outline: 2px solid var(--cp-text); outline-offset: 2px; }

.split { flex: 1; display: flex; gap: 12px; min-height: 0; }
.pane {
  background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 2px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.term { flex: 0 0 calc(80% - 6px); }
.dash { flex: 0 0 calc(20% - 6px); min-width: 0; }
.pane-title {
  display: flex; justify-content: space-between; padding: 8px 14px; font-size: 12px;
  border-bottom: 1px solid var(--cp-border); background: var(--cp-surface-soft); color: var(--cp-text-soft);
}
.muted { color: var(--cp-text-muted); }

.screen, .dashbody { font-family: Consolas, "Courier New", Courier, monospace; font-size: 13.5px; line-height: 1.45; }
.screen { flex: 1; overflow-y: auto; padding: 12px 14px; cursor: text; }
#output div { white-space: pre-wrap; word-break: break-word; min-height: 1.45em; }
.inputline { display: flex; white-space: pre; }
.inputline.hidden { visibility: hidden; height: 0; }
#cmd {
  flex: 1; border: 0; outline: 0; background: transparent; color: var(--cp-text);
  font: inherit; padding: 0; margin: 0; caret-color: var(--cp-text);
}
.prompt .venv { color: var(--cp-text-muted); }
.prompt .uh { color: var(--cp-text); font-weight: 600; }
.prompt .cwd { color: var(--cp-link); font-weight: 600; }

.err { color: var(--cp-danger); }
.ok, .warn { color: var(--cp-text); }
.info { color: var(--cp-link); }
.hd { color: var(--cp-text); font-weight: 600; }
.dim { color: var(--cp-text-muted); }
.prog .bar { color: var(--cp-text); }
.prog .pct { color: var(--cp-text-muted); }

html[data-theme="dark"] .prompt .uh,
html[data-theme="dark"] .ok,
html[data-theme="dark"] .prog .bar { color: var(--cp-success); }
html[data-theme="dark"] .warn { color: var(--cp-warning); }

.dashbody { flex: 1; overflow-y: auto; padding: 12px; font-size: 12.5px; }
.dashbody .sec { color: var(--cp-text-muted); margin: 10px 0 4px; border-bottom: 1px dashed var(--cp-border); white-space: nowrap; overflow: hidden; }
.dashbody .row { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.dashbody .row span:first-child { overflow: hidden; text-overflow: ellipsis; }
.clock { font-size: 26px; font-weight: 600; color: var(--cp-text); letter-spacing: 1px; }
.clock.done { color: var(--cp-success); }
.meter { color: var(--cp-text-muted); white-space: nowrap; overflow: hidden; }
.big { font-size: 20px; font-weight: 600; }
.status { margin-top: 4px; }
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

@media (max-width: 900px) {
  .split { flex-direction: column; }
  .term { flex: 1 1 65%; }
  .dash { flex: 0 0 auto; max-height: 35%; }
  .tagline { display: none; }
}

@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .brand { flex-basis: 100%; }
}

.topbar {
  min-height: 46px;
  gap: 14px;
  padding: 0 4px;
}
.brand { gap: 9px; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 28px;
  color: var(--cp-text);
  font: 700 14px Consolas, "Courier New", Courier, monospace;
}
html[data-theme="dark"] .brand-mark { color: var(--cp-success); }
.brand-name { letter-spacing: -0.02em; }
.build-tag, .pane-meta, .term-statusbar, .clock-prefix {
  font-family: Consolas, "Courier New", Courier, monospace;
}
.build-tag {
  color: var(--cp-text-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.tagline {
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 12px;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions button {
  min-height: 34px;
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 11px;
}
.split { gap: 10px; }
.pane-title {
  min-height: 38px;
  align-items: center;
  padding: 7px 12px;
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 11px;
}
.pane-title > span:first-child { color: var(--cp-text); }
.pane-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cp-text-muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cp-success);
}
.screen { padding: 14px 16px 10px; }
#output div { min-height: 1.5em; }
.term-statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  padding: 5px 12px;
  overflow-x: auto;
  border-top: 1px solid var(--cp-border);
  background: var(--cp-surface-soft);
  color: var(--cp-text-muted);
  font-size: 10px;
  white-space: nowrap;
}
.tty-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  color: var(--cp-text);
  font-weight: 700;
  letter-spacing: 0.08em;
}
html[data-theme="dark"] .tty-state { color: var(--cp-success); }
kbd {
  color: var(--cp-text);
  font: inherit;
}
kbd::before { content: "["; color: var(--cp-text-muted); }
kbd::after { content: "]"; color: var(--cp-text-muted); }
.dashbody {
  padding: 12px 13px 16px;
  font-size: 11.5px;
  line-height: 1.55;
}
.dashbody .sec {
  margin: 14px 0 5px;
  border-bottom: 1px dashed var(--cp-border);
  color: var(--cp-text-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
}
.dashbody .sec:first-child { margin-top: 0; }
.clock-face {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 3px 0 1px;
}
.clock-prefix {
  color: var(--cp-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.clock {
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: clamp(22px, 2vw, 29px);
  letter-spacing: 0.035em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.status {
  min-height: 1.6em;
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.dashbody .big { font-size: 17px; }
.meter {
  margin: 2px 0 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.dashbody .row { min-height: 1.65em; }

@media (max-width: 1100px) {
  .tagline { display: none; }
  .topbar { justify-content: space-between; }
}
@media (max-width: 900px) {
  .term { flex: 1 1 65%; }
  .dash { flex: 0 0 auto; max-height: 35%; }
  .term-statusbar { gap: 9px; }
}
@media (max-width: 520px) {
  body { padding: 8px; gap: 8px; }
  .topbar { min-height: 40px; }
  .brand { gap: 7px; }
  .brand-name { font-size: 13px; }
  .build-tag { font-size: 8px; }
  .top-actions { gap: 5px; }
  .top-actions button { padding: 6px 8px; font-size: 10px; }
  .term-statusbar { gap: 8px; font-size: 9px; }
  .tty-state { margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
