:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-tint-1: rgba(37, 99, 235, 0.06);
  --bg-tint-2: rgba(139, 92, 246, 0.05);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-alt: rgba(248, 250, 253, 0.75);
  --panel-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-soft: #1e293b;
  --muted: #64748b;
  --muted-soft: #94a3b8;
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.1);
  --cyan: #06b6d4;
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.12);
  --amber: #f59e0b;
  --error: #ef4444;
  --error-soft: rgba(239, 68, 68, 0.1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.08), 0 6px 16px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-tint-1), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-tint-2), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea {
  font: inherit;
}

button {
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Custom scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.22); background-clip: padding-box; border: 2px solid transparent; }

.app-shell {
  --sidebar-w: 280px;
  --monitor-w: 400px;
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 10px minmax(0, 1fr) 10px var(--monitor-w);
  gap: 0;
  padding: 16px;
  overflow: hidden;
}

/* Draggable column dividers */
.col-divider {
  position: relative;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 5;
  align-self: stretch;
}

/* Thin visible line at the centre; hover/drag widens + colors it */
.col-divider::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transform: translateX(-50%);
  transition: background 140ms ease, box-shadow 140ms ease, width 140ms ease;
}

.col-divider:hover::before,
.col-divider.dragging::before,
.col-divider:focus-visible::before {
  background: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-soft);
  width: 3px;
}

.col-divider.dragging {
  cursor: col-resize;
}

/* When the shell is being dragged, kill text selection everywhere. */
body.is-resizing,
body.is-resizing * {
  user-select: none !important;
  cursor: col-resize !important;
}

.sidebar,
.workspace-panel,
.monitor-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 20px;
}

.brand {
  position: relative;
  padding: 4px 4px 18px;
  border-bottom: 1px solid var(--line);
}

.brand h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.runtime-panel,
.tool-status-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-alt);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.runtime-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.runtime-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.clock-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.clock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.clock-value {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

#log-clock {
  margin: 0;
}

.checkin-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-alt);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.checkin-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.checkin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.checkin-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted-soft);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.checkin-pill[data-status="on"] {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--green-soft);
  color: #065f46;
}

.checkin-pill[data-status="on"]::before {
  background: var(--green);
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.28),
    0 0 12px rgba(16, 185, 129, 0.6);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28), 0 0 12px rgba(16, 185, 129, 0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.16), 0 0 18px rgba(16, 185, 129, 0.7); }
}

.panel-title,
.topbar,
.file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Status pills */
.status,
#tool-status-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--panel-strong);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.status::before,
#tool-status-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted-soft);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.tool-status-section p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#log-clock {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  font-weight: 500;
}

/* ---------- Workspace ---------- */
.workspace-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  position: relative;
  min-height: 88px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  opacity: 0;
  transform: translateX(-100%);
}

.app-shell[data-agent-phase="thinking"] .topbar::after {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), var(--blue), rgba(37, 99, 235, 0.1), transparent);
  animation: run-light 1.3s linear infinite;
}

.app-shell[data-agent-phase="generating"] .topbar::after {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), var(--green), rgba(16, 185, 129, 0.1), transparent);
  animation: run-light 1.1s linear infinite;
}

.app-shell[data-agent-phase="tool"] .topbar::after {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), var(--purple), rgba(139, 92, 246, 0.1), transparent);
  animation: run-light 1s linear infinite;
}

@keyframes run-light {
  to { transform: translateX(100%); }
}

.workspace-identity h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.workspace-identity p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.workspace-section {
  min-height: 0;
  padding: 14px;
}

.workspace-body {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 14px;
}

.workspace-tree-panel,
.editor-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-alt);
  box-shadow: var(--shadow-sm);
}

.workspace-tree-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.workspace-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.workspace-tree-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace-tree {
  padding: 6px 4px;
  overflow: auto;
  min-height: 0;
}

.workspace-tree:empty::before {
  content: "No artifacts yet";
  display: block;
  padding: 24px 12px;
  color: var(--muted-soft);
  font-size: 12px;
  text-align: center;
}

/* --- VS Code-ish tree rows --- */
.tree-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 26px;
  margin: 1px 0;
  border: 0;
  border-radius: 4px;
  padding: 0 8px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: background 100ms ease, color 100ms ease;
}

.tree-row:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--text);
}

.tree-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.tree-row .tree-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chevron for folders; gutter is a same-width spacer for files */
.tree-chevron,
.tree-gutter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: var(--muted);
}

.tree-chevron {
  transition: transform 140ms ease;
}

.tree-folder.open .tree-chevron {
  transform: rotate(90deg);
}

.tree-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.tree-icon-folder {
  color: #f5a623;
}

.tree-icon-file {
  color: var(--muted);
}

.tree-icon-file[data-ext="md"]      { color: #60a5fa; }
.tree-icon-file[data-ext="sv"],
.tree-icon-file[data-ext="svh"],
.tree-icon-file[data-ext="v"],
.tree-icon-file[data-ext="vh"]      { color: #eab308; }
.tree-icon-file[data-ext="sh"]      { color: #22c55e; }
.tree-icon-file[data-ext="py"]      { color: #3b82f6; }
.tree-icon-file[data-ext="json"]    { color: #a78bfa; }
.tree-icon-file[data-ext="log"],
.tree-icon-file[data-ext="rpt"]     { color: #94a3b8; }

.tree-folder {
  color: var(--text);
  font-weight: 600;
}

.tree-folder.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.tree-folder.active .tree-icon-folder {
  color: var(--blue);
}

/* Small pill on version folders that have PPA data attached */
.tree-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  flex: 0 0 auto;
}

.tree-file.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 600;
}

.tree-file.active .tree-icon-file {
  color: var(--blue);
}

.tree-file.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 999px;
  background: var(--blue);
}

.editor-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--panel-strong);
}

.file-toolbar {
  min-height: 46px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
  gap: 12px;
}

.file-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.file-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--panel-strong);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.file-toolbar-btn:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.file-toolbar-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.file-toolbar-btn.primary {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}

.file-toolbar-btn.primary:hover:not(:disabled) {
  color: #ffffff;
  transform: translateY(-1px);
}

.file-toolbar-btn.primary:disabled {
  background: rgba(148, 163, 184, 0.35);
  color: #ffffff;
  box-shadow: none;
}

#file-info {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  flex: 1 1 auto;
}

#editor-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file-preview {
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px 22px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 253, 0.5), transparent 40px),
    #fdfdff;
  color: #1e293b;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  tab-size: 2;
}

/* Code files: preserve original line breaks and let long lines scroll
   horizontally rather than wrap awkwardly. */
.file-preview.as-code {
  white-space: pre;
}

/* PPA record view (clicking a version folder) */
.file-preview.as-ppa {
  white-space: normal;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  padding: 0;
  background:
    radial-gradient(600px 320px at 10% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
    radial-gradient(600px 320px at 100% 100%, rgba(139, 92, 246, 0.05), transparent 55%),
    #ffffff;
  overflow: auto;
}

.ppa-card {
  padding: 28px 32px;
  color: var(--text);
  max-width: 900px;
}

.ppa-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.ppa-eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ppa-pdk {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ppa-corner {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.ppa-badge {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ppa-badge-ok {
  background: var(--green-soft);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.ppa-badge-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.ppa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.ppa-stat {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ppa-stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  opacity: 0.5;
  background: radial-gradient(circle, var(--blue-soft), transparent 70%);
  pointer-events: none;
}
.ppa-stat[data-tone="purple"]::after { background: radial-gradient(circle, var(--purple-soft), transparent 70%); }
.ppa-stat[data-tone="cyan"]::after   { background: radial-gradient(circle, rgba(6, 182, 212, 0.18), transparent 70%); }
.ppa-stat[data-tone="green"]::after  { background: radial-gradient(circle, var(--green-soft), transparent 70%); }

.ppa-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.ppa-stat-value {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ppa-stat-unit {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.ppa-notes {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: var(--blue-soft);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.ppa-section {
  margin-bottom: 22px;
}

.ppa-section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ppa-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ppa-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.ppa-table td {
  padding: 8px 12px;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.ppa-table thead th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--line-strong);
}

.ppa-table code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  font-weight: 500;
}

/* Markdown files rendered as a real document */
.file-preview.as-markdown {
  white-space: normal;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  padding: 28px 36px;
  background: #ffffff;
}

.file-preview.as-markdown > *:first-child { margin-top: 0; }
.file-preview.as-markdown > *:last-child  { margin-bottom: 0; }

.file-preview.as-markdown .md-h1,
.file-preview.as-markdown .md-h2,
.file-preview.as-markdown .md-h3,
.file-preview.as-markdown .md-h4,
.file-preview.as-markdown .md-h5,
.file-preview.as-markdown .md-h6 {
  margin: 24px 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.file-preview.as-markdown .md-h1 { font-size: 28px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.file-preview.as-markdown .md-h2 { font-size: 22px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.file-preview.as-markdown .md-h3 { font-size: 18px; }
.file-preview.as-markdown .md-h4 { font-size: 15px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.file-preview.as-markdown .md-h5 { font-size: 14px; color: var(--muted); }
.file-preview.as-markdown .md-h6 { font-size: 13px; color: var(--muted); }

.file-preview.as-markdown .md-p { margin: 12px 0; }

.file-preview.as-markdown .md-ul,
.file-preview.as-markdown .md-ol { margin: 12px 0; padding-left: 24px; }

.file-preview.as-markdown .md-ul li,
.file-preview.as-markdown .md-ol li { margin: 4px 0; }

.file-preview.as-markdown .md-blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: var(--text-soft);
  border-radius: 0 8px 8px 0;
}

.file-preview.as-markdown .md-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

.file-preview.as-markdown .md-code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
}

.file-preview.as-markdown .md-pre {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  overflow-x: auto;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.file-preview.as-markdown .md-pre code {
  background: transparent;
  padding: 0;
  color: #1e293b;
}

.file-preview.as-markdown .md-table {
  border-collapse: collapse;
  margin: 14px 0;
  width: auto;
  max-width: 100%;
  font-size: 13px;
  overflow-x: auto;
  display: block;
}

.file-preview.as-markdown .md-table thead th {
  background: var(--panel-alt);
  border-bottom: 2px solid var(--line-strong);
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.file-preview.as-markdown .md-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  vertical-align: top;
}

.file-preview.as-markdown .md-table tbody tr:nth-child(even) td {
  background: rgba(37, 99, 235, 0.02);
}

.file-preview.as-markdown a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.3);
}
.file-preview.as-markdown a:hover { border-bottom-color: var(--blue); }

.file-preview.as-markdown strong { color: var(--text); font-weight: 700; }
.file-preview.as-markdown em     { color: var(--text-soft); }

/* CSV rendered as an HTML table */
.file-preview.as-table {
  padding: 0;
  overflow: auto;
  background: #ffffff;
}

.csv-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  color: var(--text);
}

.csv-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-alt);
  border-bottom: 2px solid var(--line-strong);
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--line-strong);
}

.csv-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  border-right: 1px solid rgba(15, 23, 42, 0.04);
  vertical-align: top;
  line-height: 1.45;
  max-width: 360px;
  word-break: break-word;
}

.csv-table tbody tr:nth-child(even) td {
  background: rgba(37, 99, 235, 0.025);
}

.csv-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.csv-table tbody td:first-child,
.csv-table thead th:first-child {
  border-left: 3px solid transparent;
}

.csv-table tbody tr:hover td:first-child {
  border-left-color: var(--blue);
}

/* ---------- Monitor / Right column ---------- */
.monitor-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.updates-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 22px 20px 16px;
}

.panel-title h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

/* Supervision banner — sits above the stepper when the run is waiting on
   a human review to move forward. Green means "no action needed, take
   your time"; amber (data-tone="warn") can flag "action requested". */
.supervision-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #065f46;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.supervision-banner[hidden] { display: none; }

.supervision-banner[data-tone="warn"] {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #b45309;
}

.supervision-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: supervision-pulse 2.4s ease-in-out infinite;
}

.supervision-banner[data-tone="warn"] .supervision-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

@keyframes supervision-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08); }
}

/* Horizontal stepper — reads left→right as a run progresses. */
.stage-progress {
  list-style: none;
  margin: 0;
  padding: 8px 6px 4px;
  display: flex;
  align-items: flex-start;
}

.stage-step {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  color: var(--muted-soft);
}

/* Marker row: dot + connector line */
.stage-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 22px;
}

/* The dot */
.stage-marker::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 2px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

/* Connector line to the NEXT step; hidden after the last step */
.stage-step:not(:last-child) .stage-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(50% + 10px);
  right: calc(-50% + 10px);
  height: 2px;
  background: var(--line-strong);
  transform: translateY(-1px);
  z-index: 1;
  transition: background 220ms ease;
}

.stage-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

/* Status caption below the name, driven by data-status via attr() */
.stage-step::after {
  content: attr(data-status);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  min-height: 12px;
  line-height: 1;
}

/* --- Per-status styling --- */

/* Editing (violet, pulsing) */
.stage-step[data-status="editing"] { color: var(--purple); }
.stage-step[data-status="editing"] .stage-marker::before {
  background: var(--purple);
  border-color: var(--purple);
  box-shadow:
    0 0 0 4px rgba(139, 92, 246, 0.16),
    0 0 12px rgba(139, 92, 246, 0.45);
  animation: stage-pulse-purple 1.6s ease-in-out infinite;
}
.stage-step[data-status="editing"]::after { color: var(--purple); }

/* Running / active (blue, pulsing) */
.stage-step[data-status="running"],
.stage-step[data-status="active"] { color: var(--blue); }
.stage-step[data-status="running"] .stage-marker::before,
.stage-step[data-status="active"]  .stage-marker::before {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow:
    0 0 0 4px var(--blue-soft),
    0 0 12px rgba(37, 99, 235, 0.45);
  animation: stage-pulse-blue 1.4s ease-in-out infinite;
}
.stage-step[data-status="running"]::after,
.stage-step[data-status="active"]::after  { color: var(--blue); }

/* Confirmed / done (green, filled with checkmark, connector fills green) */
.stage-step[data-status="confirmed"],
.stage-step[data-status="done"]      { color: var(--green); }
.stage-step[data-status="confirmed"] .stage-marker::before,
.stage-step[data-status="done"]      .stage-marker::before {
  background: var(--green);
  border-color: var(--green);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 8.5l2.7 2.7L12 5.6' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  box-shadow: 0 0 0 3px var(--green-soft);
}
.stage-step[data-status="confirmed"] .stage-marker::after,
.stage-step[data-status="done"]      .stage-marker::after {
  background: var(--green);
}
.stage-step[data-status="confirmed"]::after,
.stage-step[data-status="done"]::after      { color: var(--green); }

@keyframes stage-pulse-blue {
  0%, 100% { box-shadow: 0 0 0 4px var(--blue-soft), 0 0 12px rgba(37, 99, 235, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1), 0 0 18px rgba(37, 99, 235, 0.6); }
}
@keyframes stage-pulse-purple {
  0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16), 0 0 12px rgba(139, 92, 246, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.08), 0 0 18px rgba(139, 92, 246, 0.6); }
}

.messages {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.message {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm);
  animation: message-in 260ms ease;
}

.message::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--muted-soft);
  opacity: 0.6;
}

.message.assistant::before {
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  opacity: 1;
}

.message.user::before {
  background: var(--purple);
  opacity: 1;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Message title (direct child <strong>) — block, uppercase, muted.
   Do NOT match inline <strong> inside the rendered markdown body. */
.message > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* --- Rendered markdown inside message body --- */
.message p,
.message .md-p {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.message ul,
.message ol,
.message .md-ul,
.message .md-ol {
  margin: 6px 0 10px;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.message li { margin: 2px 0; }

.message h1, .message h2, .message h3, .message h4, .message h5, .message h6,
.message .md-h1, .message .md-h2, .message .md-h3,
.message .md-h4, .message .md-h5, .message .md-h6 {
  margin: 10px 0 6px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
  text-transform: none;
}

.message .md-h1, .message h1 { font-size: 16px; }
.message .md-h2, .message h2 { font-size: 15px; }
.message .md-h3, .message h3 { font-size: 14px; }
.message .md-h4, .message h4 { font-size: 13px; color: var(--text-soft); }
.message .md-h5, .message h5 { font-size: 12px; color: var(--muted); }
.message .md-h6, .message h6 { font-size: 11px; color: var(--muted); }

/* Inline bold / italic in the markdown body — normal weight/case, no block. */
.message p strong, .message li strong, .message td strong, .message th strong,
.message .md-p strong, .message .md-ul strong, .message .md-ol strong {
  display: inline;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.message em, .message .md-p em, .message .md-ul em, .message .md-ol em {
  color: var(--text-soft);
  font-style: italic;
}

.message .md-code,
.message code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
}

.message .md-pre {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}
.message .md-pre code { background: transparent; padding: 0; }

.message .md-blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  color: var(--text-soft);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
}

.message .md-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

.message .md-table {
  border-collapse: collapse;
  width: auto;
  max-width: 100%;
  margin: 8px 0;
  font-size: 12px;
  overflow-x: auto;
  display: block;
}
.message .md-table thead th {
  background: var(--panel-alt);
  border-bottom: 1.5px solid var(--line-strong);
  padding: 6px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.message .md-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--text);
}

.message time {
  display: block;
  margin-top: 4px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.messages:empty::before {
  content: "No run updates yet";
  display: block;
  padding: 32px 12px;
  color: var(--muted-soft);
  font-size: 12px;
  text-align: center;
}

.tool-status-section {
  margin: 0 20px 20px;
}

.tool-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tool-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 14px;
  background:
    linear-gradient(160deg, rgba(37, 99, 235, 0.06), transparent 55%),
    var(--panel-strong);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tool-stat::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--blue-soft), transparent 70%);
  pointer-events: none;
}

.tool-stat strong {
  display: block;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text) 0%, #4b5b7a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- User chip (sidebar) ---------- */
.user-chip {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-alt);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.user-chip[hidden] { display: none; }

.user-chip-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.user-badge {
  border-radius: 999px;
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.user-badge[hidden] { display: none; }

.user-chip-email {
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-logout {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--panel-strong);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.user-chip-logout:hover {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--error);
  background: var(--error-soft);
}

/* ---------- Auth overlay ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 400px at 20% 10%, rgba(37, 99, 235, 0.12), transparent 65%),
    radial-gradient(700px 400px at 90% 90%, rgba(139, 92, 246, 0.1), transparent 65%),
    rgba(244, 246, 251, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  animation: auth-fade-in 220ms ease;
}

.auth-overlay[hidden] { display: none; }

@keyframes auth-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
  animation: auth-card-in 260ms cubic-bezier(0.2, 0.9, 0.25, 1.1);
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card .eyebrow {
  margin-top: 0;
}

.auth-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.05);
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-field input {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 14px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.auth-error {
  margin: 2px 0 0;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--error-soft);
  color: var(--error);
  font-size: 12px;
  font-weight: 600;
}

.auth-submit {
  margin-top: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.32);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

/* ---------- Preview banner (admin viewing as a user) ---------- */
.preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.preview-banner strong {
  color: #ffffff;
  text-transform: none;
  letter-spacing: 0;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-weight: 600;
}

.preview-banner-exit {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.preview-banner-exit:hover { color: #ffffff; }

.preview-banner[hidden] { display: none; }

body.has-preview-banner .app-shell {
  height: calc(100vh - 34px);
  padding-top: 42px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    gap: 16px;
    overflow: auto;
  }

  .col-divider { display: none; }

  .workspace-body {
    min-height: 520px;
    grid-template-columns: 1fr;
  }

  .monitor-panel {
    min-height: 520px;
  }
}
