:root {
  color-scheme: light;
  --bg: #f5f1ea;
  --bg-soft: #faf7f2;
  --surface: rgba(252, 249, 243, 0.88);
  --surface-strong: #fcfaf6;
  --surface-muted: #f1ece3;
  --panel: rgba(255, 252, 247, 0.78);
  --panel-border: rgba(155, 122, 94, 0.16);
  --panel-border-strong: rgba(155, 122, 94, 0.22);
  --text: #1f1914;
  --muted: #665952;
  --muted-soft: #8a7d76;
  --accent: #cc6237;
  --accent-strong: #b7542c;
  --accent-soft: rgba(204, 98, 55, 0.1);
  --success: #2f8a4d;
  --danger: #a64d42;
  --shadow: 0 24px 60px rgba(70, 41, 24, 0.06);
  --shadow-soft: 0 6px 30px rgba(70, 41, 24, 0.04);
  --ring: 0 0 0 4px rgba(56, 152, 236, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: Aptos, "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", monospace;
  --body-gradient:
    radial-gradient(circle at top left, rgba(204, 98, 55, 0.12), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(209, 189, 165, 0.22), transparent 30%),
    linear-gradient(180deg, #f9f6f1 0%, #f4eee6 100%);
  --topbar-bg: rgba(250, 247, 242, 0.8);
  --topbar-border: rgba(155, 122, 94, 0.14);
  --topbar-hover: rgba(255, 255, 255, 0.45);
  --story-divider: rgba(155, 122, 94, 0.12);
  --surface-card: rgba(255, 251, 246, 0.78);
  --field-bg: rgba(255, 252, 248, 0.92);
  --field-border: rgba(155, 122, 94, 0.18);
  --toggle-surface: rgba(255, 251, 246, 0.66);
  --toggle-switch: #ece7de;
  --secondary-bg: linear-gradient(180deg, rgba(253, 249, 243, 0.98) 0%, rgba(244, 237, 228, 0.96) 100%);
  --secondary-border: rgba(155, 122, 94, 0.16);
  --download-bg: rgba(204, 98, 55, 0.1);
  --download-border: rgba(204, 98, 55, 0.14);
  --artifact-bg: rgba(255, 252, 249, 0.8);
  --artifact-empty-bg: rgba(255, 252, 247, 0.72);
  --log-panel-bg: linear-gradient(180deg, #3a3734 0%, #2b2a28 100%);
  --log-surface: rgba(21, 21, 20, 0.34);
  --log-border: rgba(255, 255, 255, 0.05);
  --log-line-number: rgba(241, 237, 232, 0.45);
  --log-line-text: #f3efe8;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171310;
  --bg-soft: #1d1814;
  --surface: rgba(32, 27, 23, 0.9);
  --surface-strong: #28211d;
  --surface-muted: #221d18;
  --panel: rgba(30, 25, 21, 0.9);
  --panel-border: rgba(213, 183, 152, 0.12);
  --panel-border-strong: rgba(213, 183, 152, 0.18);
  --text: #f2e9df;
  --muted: #b7aa9d;
  --muted-soft: #8f8277;
  --accent: #dc744a;
  --accent-strong: #f28a61;
  --accent-soft: rgba(220, 116, 74, 0.18);
  --success: #5fc37e;
  --danger: #df7f77;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.18);
  --ring: 0 0 0 4px rgba(220, 116, 74, 0.16);
  --body-gradient:
    radial-gradient(circle at top left, rgba(220, 116, 74, 0.12), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(81, 57, 42, 0.34), transparent 28%),
    linear-gradient(180deg, #191512 0%, #120f0d 100%);
  --topbar-bg: rgba(22, 18, 15, 0.82);
  --topbar-border: rgba(213, 183, 152, 0.09);
  --topbar-hover: rgba(255, 255, 255, 0.05);
  --story-divider: rgba(213, 183, 152, 0.08);
  --surface-card: rgba(31, 26, 22, 0.9);
  --field-bg: rgba(39, 33, 28, 0.92);
  --field-border: rgba(213, 183, 152, 0.12);
  --toggle-surface: rgba(35, 29, 25, 0.92);
  --toggle-switch: #4e433c;
  --secondary-bg: linear-gradient(180deg, rgba(45, 37, 31, 0.96) 0%, rgba(33, 27, 23, 0.96) 100%);
  --secondary-border: rgba(213, 183, 152, 0.14);
  --download-bg: rgba(220, 116, 74, 0.12);
  --download-border: rgba(220, 116, 74, 0.22);
  --artifact-bg: rgba(34, 28, 24, 0.88);
  --artifact-empty-bg: rgba(30, 25, 21, 0.82);
  --log-panel-bg: linear-gradient(180deg, #14110f 0%, #0e0c0b 100%);
  --log-surface: rgba(255, 255, 255, 0.03);
  --log-border: rgba(255, 255, 255, 0.06);
  --log-line-number: rgba(255, 255, 255, 0.34);
  --log-line-text: #f2e9df;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ui);
  background: var(--body-gradient);
}

button,
input,
select {
  font: inherit;
}

button {
  appearance: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(16px, 1.8vw, 22px) clamp(16px, 2.6vw, 34px);
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, #d56e42 0%, #c95d33 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(201, 93, 51, 0.2);
}

.brand-name {
  display: block;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: 12px;
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.nav-link:hover {
  background: var(--topbar-hover);
  color: var(--text);
}

.nav-link.icon-only {
  padding: 0 10px;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-icon-moon {
  display: grid;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 296px) minmax(0, 1fr);
  min-height: calc(100vh - 93px);
}

.story-panel {
  padding: 30px 24px 24px;
  border-right: 1px solid var(--story-divider);
}

.story-kicker {
  margin: 0 0 10px;
  color: var(--muted-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-copy h1,
.job-panel h2,
.log-head h2,
.capability-item h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0;
  font-weight: 500;
}

.story-copy h1 {
  max-width: 7ch;
  font-size: clamp(28px, 2vw, 36px);
  line-height: 1.16;
}

.story-accent {
  width: 40px;
  height: 3px;
  margin: 18px 0 16px;
  border-radius: 999px;
  background: var(--accent);
}

.lead {
  max-width: 18em;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.capability-list {
  margin-top: 28px;
}

.capability-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-top: 1px solid var(--story-divider);
}

.capability-item h2 {
  margin-bottom: 4px;
  font-size: 16px;
}

.capability-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.capability-icon,
.trust-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
}

.capability-icon {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(204, 98, 55, 0.18);
  border-radius: 50%;
  background: var(--toggle-surface);
}

.capability-icon svg,
.trust-icon svg {
  width: 20px;
  height: 20px;
}

.trust-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--story-divider);
  color: var(--muted);
  line-height: 1.7;
}

.trust-note p {
  margin: 0;
  max-width: 22em;
  font-size: 13px;
}

.canvas-panel {
  padding: clamp(22px, 2.5vw, 32px) clamp(20px, 3vw, 38px) clamp(24px, 3vw, 38px);
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.job-panel {
  padding: clamp(24px, 2.5vw, 34px) clamp(22px, 2.6vw, 34px) clamp(24px, 2.2vw, 28px);
}

.job-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-kicker {
  margin: 0 0 8px;
  color: var(--muted-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.job-panel h2,
.log-head h2 {
  font-size: clamp(38px, 4vw, 52px);
  line-height: 1;
}

.panel-copy {
  max-width: 36em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--surface-muted);
  min-width: min(100%, 420px);
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.mode-pill.is-active {
  background: var(--surface-strong);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(204, 98, 55, 0.12);
}

.mode-pill-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(204, 98, 55, 0.1);
  color: var(--accent);
  flex: 0 0 auto;
}

.mode-pill-icon svg {
  width: 18px;
  height: 18px;
}

.mode-pill-copy strong,
.mode-pill-copy small {
  display: block;
}

.mode-pill-copy strong {
  font-size: 15px;
  font-weight: 600;
}

.mode-pill-copy small {
  margin-top: 4px;
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.45;
}

.mode-pill.is-hidden {
  display: none;
}

.mode-toggle.is-single {
  grid-template-columns: 1fr;
  min-width: 240px;
}

.job-form-grid {
  display: grid;
  gap: 20px;
}

.field,
.advanced-grid,
.toggle-grid {
  min-width: 0;
}

.field span,
.metric-label,
.artifact-title,
.summary-row span {
  display: block;
}

.field span,
.metric-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 10px;
}

.field-label > label,
.field-label > span:first-child {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}

.field .info-tooltip {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-bottom: 0;
  border: 1px solid rgba(204, 98, 55, 0.26);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1;
  cursor: help;
  outline: none;
}

.info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--panel-border-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  line-height: 1.65;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.info-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 21;
  width: 10px;
  height: 10px;
  border-right: 1px solid var(--panel-border-strong);
  border-bottom: 1px solid var(--panel-border-strong);
  background: var(--surface-strong);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after,
.info-tooltip:hover::before,
.info-tooltip:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.info-tooltip:hover::before,
.info-tooltip:focus-visible::before {
  transform: translateX(-50%) rotate(45deg);
}

.field-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.field-note p {
  margin: 0;
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.6;
}

.inline-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.inline-badge[data-kind="manual"] {
  color: var(--accent-strong);
  border-color: rgba(204, 98, 55, 0.16);
  background: rgba(204, 98, 55, 0.08);
}

.inline-badge[data-kind="server"] {
  color: var(--success);
  border-color: rgba(47, 138, 77, 0.18);
  background: rgba(47, 138, 77, 0.1);
}

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

.field-wide,
.advanced-row {
  grid-column: 1 / -1;
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(56, 152, 236, 0.44);
  box-shadow: var(--ring);
  background: var(--surface-strong);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--toggle-surface);
}

.toggle-card.compact {
  min-height: 68px;
}

.toggle-copy strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.toggle-copy small {
  display: block;
  color: var(--muted-soft);
  font-size: 13px;
  line-height: 1.55;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-ui {
  position: relative;
  display: inline-flex;
  width: 54px;
  height: 30px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--toggle-switch);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(51, 37, 28, 0.16);
  transition: transform 140ms ease;
}

.switch input:focus + .switch-ui {
  box-shadow: var(--ring);
}

.switch input:checked + .switch-ui {
  border-color: rgba(204, 98, 55, 0.3);
  background: rgba(204, 98, 55, 0.28);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(24px);
}

.advanced-row {
  padding-top: 18px;
  border-top: 1px solid var(--story-divider);
}

.advanced-head {
  margin-bottom: 18px;
}

.advanced-head p {
  margin: 0;
  color: var(--muted);
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}

.toggle-stack {
  display: grid;
  gap: 12px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--story-divider);
}

.form-note {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary,
.secondary,
.download-link,
.text-button {
  border: 0;
  text-decoration: none;
}

.primary,
.secondary {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary:hover,
.secondary:hover,
.download-link:hover {
  transform: translateY(-1px);
}

.primary:disabled,
.secondary:disabled,
.mode-pill:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.primary {
  background: linear-gradient(180deg, #dd6a3c 0%, #c95b2f 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(201, 91, 47, 0.22);
  min-width: 156px;
}

.secondary {
  background: var(--secondary-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--secondary-border);
  min-width: 108px;
}

.monitor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 24px;
}

.monitor-left {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.stats-grid {
  display: contents;
}

.metric-card,
.artifact-card {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-height: 148px;
  padding: 22px 24px;
}

.metric-value {
  display: block;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(34px, 2.9vw, 50px);
  line-height: 1.05;
  font-weight: 500;
}

.metric-subtle,
.artifact-empty p,
.summary,
.artifact-list li {
  color: var(--muted);
}

.artifact-card {
  padding: 24px;
  min-width: 0;
  overflow: hidden;
}

.artifact-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.artifact-card-head > div {
  min-width: 0;
}

.artifact-title {
  margin-top: 10px;
  color: var(--text);
  font-size: 15px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.download-actions {
  margin-top: 18px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--download-bg);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px var(--download-border);
}

.artifact-list {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--artifact-bg);
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
}

.artifact-list ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.artifact-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid var(--story-divider);
}

.artifact-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.artifact-file-size {
  color: var(--muted-soft);
  font-size: 12px;
  white-space: nowrap;
}

.artifact-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 36px 20px 28px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--artifact-empty-bg);
  text-align: center;
}

.artifact-empty strong {
  max-width: 100%;
  font-size: 18px;
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.artifact-empty p {
  margin: 0;
  line-height: 1.7;
}

.artifact-empty-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
}

.artifact-empty-icon svg {
  width: 20px;
  height: 20px;
}

.summary {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(7em, auto) minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--story-divider);
  font-size: 14px;
  min-width: 0;
}

.summary-row strong {
  min-width: 0;
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.log-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px;
  background: var(--log-panel-bg);
  color: #f1ede8;
}

.log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.log-head .panel-kicker,
.log-head h2,
.text-button,
.log-line {
  color: inherit;
}

.text-button {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  opacity: 0.8;
}

.text-button:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.log-view {
  display: grid;
  gap: 4px;
  min-height: 324px;
  height: 100%;
  padding: 16px 14px;
  border: 1px solid var(--log-border);
  border-radius: 14px;
  background: var(--log-surface);
  overflow: auto;
}

.log-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line-number {
  color: var(--log-line-number);
  text-align: right;
}

.log-line-text {
  color: var(--log-line-text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.badge.success {
  color: var(--success);
}

.badge.running {
  color: var(--accent-strong);
}

.badge.failed {
  color: var(--danger);
}

.mono {
  font-family: var(--font-mono);
}

.subtle {
  color: var(--muted-soft);
}

.hidden {
  display: none;
}

@media (max-width: 1360px) {
  .monitor-left {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .artifact-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .story-panel {
    padding-bottom: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--story-divider);
  }

  .story-copy h1 {
    max-width: 11ch;
  }
}

@media (max-width: 1080px) {
  .topbar,
  .canvas-panel,
  .story-panel {
    padding-left: 22px;
    padding-right: 22px;
  }

  .job-panel {
    padding: 24px;
  }

  .job-panel-head {
    display: grid;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .job-actions {
    justify-content: stretch;
  }

  .job-actions .primary,
  .job-actions .secondary {
    flex: 1 1 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-left,
  .topbar-nav {
    flex-wrap: wrap;
  }

  .brand-subtitle {
    display: none;
  }

  .story-panel {
    padding-top: 42px;
  }

  .story-copy h1 {
    max-width: none;
    font-size: 32px;
  }

  .job-panel h2,
  .log-head h2 {
    font-size: 40px;
  }

  .job-form-grid,
  .advanced-grid,
  .toggle-grid,
  .monitor-left {
    grid-template-columns: 1fr;
  }

  .job-actions {
    flex-direction: column-reverse;
  }

  .mode-toggle {
    width: 100%;
    min-width: 0;
  }

  .mode-pill {
    flex: 1 1 0;
    min-width: 0;
  }

  .toggle-card {
    align-items: flex-start;
  }

  .metric-value {
    font-size: 40px;
  }

  .info-tooltip::after {
    left: -88px;
    width: min(320px, calc(100vw - 44px));
    transform: translateY(4px);
  }

  .info-tooltip:hover::after,
  .info-tooltip:focus-visible::after {
    transform: translateY(0);
  }
}
