:root {
  color-scheme: dark;
  --bg: #111412;
  --surface: #1a1f1c;
  --surface-2: #222822;
  --line: #384238;
  --text: #f1f5ed;
  --muted: #aab5a7;
  --accent: #78d18f;
  --accent-2: #70b8ff;
  --warn: #e5b85c;
  --danger: #ff7f7f;
  --ok: #7dde93;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 20px;
}

.login-panel button {
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 38px;
  padding: 0 14px;
  background: var(--accent);
  color: #07110a;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 330px) 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #151915;
  padding: 16px;
  overflow-y: auto;
}

.brand,
.topbar,
.panel-title,
.button-row,
.stats {
  display: flex;
  align-items: center;
}

.brand,
.topbar,
.panel-title {
  justify-content: space-between;
  gap: 16px;
}

.report-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-tools select {
  min-width: 180px;
}

.brand {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.disclaimer {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.form-panel,
.compact,
.jobs-panel {
  padding: 14px;
}

.compact,
.jobs-panel {
  margin-top: 16px;
}

label,
fieldset {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

label span,
legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #0f120f;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(120, 209, 143, 0.38);
  outline-offset: 1px;
}

input.loading {
  border-color: rgba(112, 184, 255, 0.72);
}

input:disabled,
select:disabled,
input[readonly],
textarea:disabled {
  color: var(--muted);
  background: #121612;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  margin-bottom: 7px;
  color: var(--text);
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.vendor-policy {
  gap: 8px;
  padding: 10px;
}

.vendor-policy-list {
  display: grid;
  max-height: 220px;
  overflow-y: auto;
  gap: 8px;
  padding-right: 2px;
}

.vendor-category {
  display: grid;
  gap: 5px;
}

.vendor-category + .vendor-category {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.vendor-category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.vendor-category-head strong {
  font-size: 12px;
}

.vendor-category-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.vendor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.vendor-option {
  display: inline-grid;
  grid-template-columns: 14px auto;
  gap: 5px;
  align-items: center;
  margin: 0;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0f120f;
}

.vendor-option input {
  width: 14px;
  min-height: 14px;
}

.vendor-option span {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.vendor-option small {
  display: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.vendor-option.unconfigured small {
  color: var(--warn);
}

.vendor-option.unavailable {
  opacity: 0.56;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preset-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.date-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.button-row {
  gap: 10px;
}

.button-row button {
  flex: 1;
}

.workspace {
  min-width: 0;
  padding: 22px;
  overflow-y: auto;
}

.topbar {
  margin-bottom: 18px;
}

.stats {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.auth-banner {
  border: 1px solid rgba(229, 184, 92, 0.6);
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffe1a3;
  background: rgba(229, 184, 92, 0.08);
  font-size: 12px;
}

.progress-strip {
  margin-bottom: 18px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0f120f;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 180ms ease;
}

.stats span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(229, 184, 92, 0.12);
}

.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(125, 222, 147, 0.12);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 127, 127, 0.12);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(220px, 1.2fr);
  gap: 18px;
  margin-bottom: 18px;
}

.decision-card {
  min-height: 132px;
  padding: 16px;
}

.decision-card h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.decision-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.decision-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0f120f;
  color: var(--muted);
  font-size: 12px;
}

.decision-buy {
  color: var(--ok);
}

.decision-sell {
  color: var(--danger);
}

.decision-hold,
.decision-review {
  color: var(--warn);
}

.chart-panel {
  margin-bottom: 18px;
  padding: 16px;
}

.chart-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.chart-tools > * {
  height: 30px;
  box-sizing: border-box;
}

.chart-ranges,
.chart-indicators,
.chart-forecast-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #0f120f;
}

.chart-range {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  border-radius: 0;
  border-right: 1px solid var(--line);
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-range:last-child {
  border-right: 0;
}

.chart-range.active {
  background: rgba(120, 209, 143, 0.16);
  color: var(--accent);
}

.chart-indicators {
  gap: 8px;
  padding: 0 9px;
}

.chart-indicators label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-indicators input {
  display: block;
  width: 13px;
  min-height: 13px;
  margin: 0;
}

.chart-forecast-toggle {
  gap: 5px;
  justify-content: center;
  margin: 0;
  padding: 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.chart-forecast-toggle input {
  display: block;
  flex: 0 0 auto;
  width: 13px;
  min-height: 13px;
  margin: 0;
}

.chart-forecast-toggle span {
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.chart-forecast-toggle.disabled {
  opacity: 0.48;
}

.chart-forecast-toggle.disabled span {
  color: #6f786d;
}

.chart-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #0f120f;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-tools .small {
  min-height: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.chart-status.ok {
  color: var(--ok);
  border-color: rgba(125, 222, 147, 0.5);
}

.chart-status.loading {
  color: var(--accent-2);
  border-color: rgba(112, 184, 255, 0.5);
}

.chart-status.error {
  color: var(--danger);
  border-color: rgba(255, 127, 127, 0.5);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: clamp(280px, 34vh, 420px);
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f120f;
}

.price-chart {
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 206px;
  border: 1px solid rgba(112, 184, 255, 0.45);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(15, 18, 15, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
}

.forecast-badge {
  display: grid;
  grid-template-columns: minmax(88px, auto) repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px 12px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  border: 1px solid rgba(112, 184, 255, 0.36);
  border-radius: 7px;
  padding: 7px 10px;
  background: rgba(15, 18, 15, 0.72);
  color: var(--text);
  font-size: 11px;
  line-height: 1.45;
}

.forecast-badge strong {
  display: block;
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.forecast-badge span {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--accent-2);
  font-size: 12px;
}

.chart-tooltip em {
  display: block;
  margin: 7px 0 3px;
  padding-top: 5px;
  border-top: 1px solid rgba(112, 184, 255, 0.16);
  color: #4fc3ff;
  font-style: normal;
  font-weight: 800;
}

.chart-tooltip strong + em {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.chart-tooltip b {
  color: #d7ded4;
  font-weight: 700;
}

.chart-tooltip .forecast-mid {
  color: #d8f2ff;
}

.chart-tooltip .forecast-up {
  color: var(--ok);
}

.chart-tooltip .forecast-down {
  color: var(--danger);
}

.chart-tooltip .forecast-delta {
  color: var(--text);
}

.chart-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

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

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: #0f120f;
}

.chart-legend .buy {
  color: var(--ok);
}

.chart-legend .sell {
  color: var(--danger);
}

.chart-legend .hold {
  color: var(--warn);
}

.chart-legend .forecast {
  color: var(--accent-2);
}

.debate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8px;
  row-gap: 6px;
  margin-bottom: 10px;
}

.debate-card {
  min-height: 0;
  padding: 9px 11px;
}

.debate-judge {
  grid-column: 1 / -1;
  min-height: 0;
}

.debate-content {
  max-height: 260px;
  overflow: auto;
  margin-top: 5px;
  line-height: 1.42;
  font-size: 13px;
}

.debate-bubble {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 6px;
  margin-bottom: 5px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f120f;
}

.bubble-index {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(120, 209, 143, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.debate-bubble .markdown-body p,
.debate-bubble .markdown-body ul,
.debate-bubble .markdown-body blockquote,
.debate-bubble .markdown-body pre {
  margin-bottom: 3px;
}

.agent-card {
  min-height: 154px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.agent-card.in_progress {
  border-color: rgba(112, 184, 255, 0.55);
}

.agent-card.completed {
  border-color: rgba(125, 222, 147, 0.55);
}

.agent-card h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.agent-row {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.agent-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #586158;
}

.agent-row.in_progress {
  color: var(--accent-2);
}

.agent-row.in_progress .agent-mark {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(112, 184, 255, 0.13);
}

.agent-row.completed {
  color: var(--ok);
}

.agent-row.completed .agent-mark {
  background: var(--ok);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
}

.log-panel,
.report-panel {
  min-height: 500px;
  padding: 16px;
}

.event-log {
  height: 450px;
  overflow: auto;
  padding-right: 4px;
}

.event-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 0;
}

.event-item:last-child {
  border-bottom: 0;
}

.event-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.event-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.compact-log .event-item {
  padding: 7px 0;
}

.compact-log .event-meta {
  margin-bottom: 2px;
}

.compact-log .event-body {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.event-status .event-meta {
  color: var(--warn);
}

.event-message .event-meta {
  color: var(--accent-2);
}

.event-tool_call .event-meta {
  color: #c7a7ff;
}

.event-error .event-meta,
.event-client_error .event-meta {
  color: var(--danger);
}

.event-quality_flag .event-meta {
  color: var(--warn);
}

.report-content {
  height: 450px;
  overflow: auto;
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #0f120f;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  line-height: 1.58;
}

.report-content.muted {
  display: flex;
  align-items: center;
  color: #aab5a7;
}

.markdown-body {
  white-space: normal;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 0 0 10px;
  color: var(--text);
}

.markdown-body h1 {
  font-size: 22px;
}

.markdown-body h2 {
  font-size: 19px;
}

.markdown-body h3,
.markdown-body h4 {
  font-size: 16px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 12px;
}

.markdown-body ul {
  padding-left: 20px;
}

.markdown-body blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.markdown-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.markdown-body pre {
  overflow: auto;
  padding: 12px;
  border-radius: 6px;
  background: #0a0d0a;
  border: 1px solid var(--line);
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

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

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin: 0 0 13px;
  background: #111712;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.notice.error {
  color: #ffd1d1;
  border-color: rgba(255, 127, 127, 0.55);
}

.notice.warn {
  color: #ffe1a3;
  border-color: rgba(229, 184, 92, 0.6);
}

.notice.ok {
  color: #c9ffd4;
  border-color: rgba(125, 222, 147, 0.58);
}

.field-link {
  min-height: 0;
  margin: 0 7px 0 0;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
}

.quality-flags {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quality-flag {
  border: 1px solid rgba(229, 184, 92, 0.6);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(229, 184, 92, 0.08);
  color: #ffe1a3;
  font-size: 13px;
  line-height: 1.45;
}

.quality-flag.error {
  border-color: rgba(255, 127, 127, 0.55);
  background: rgba(255, 127, 127, 0.08);
  color: #ffd1d1;
}

.hidden {
  display: none;
}

.meta-list,
.jobs-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.meta-item,
.job-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111712;
  color: var(--muted);
  font-size: 13px;
}

.history-job {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111712;
}

.history-job-main {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font: inherit;
}

.history-job-main:hover .history-job-title,
.history-job-main:focus-visible .history-job-title {
  color: var(--accent-2);
}

.history-job-main:focus-visible {
  outline: 2px solid rgba(120, 209, 143, 0.35);
  outline-offset: 3px;
}

.history-job-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.history-job-title {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-job-version {
  min-width: 32px;
  padding: 2px 7px;
  border: 1px solid rgba(112, 184, 255, 0.35);
  border-radius: 999px;
  background: rgba(112, 184, 255, 0.08);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.history-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-job-chip {
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(120, 209, 143, 0.1);
  color: var(--accent);
}

.history-job-decision {
  flex: 1 1 100%;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-job-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.history-job-action {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-job-action:hover,
.history-job-action:focus-visible {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.history-job-action:focus-visible {
  outline: 2px solid rgba(120, 209, 143, 0.35);
  outline-offset: 2px;
}

.history-job-replay {
  border-color: rgba(120, 209, 143, 0.35);
  color: var(--accent);
}

.history-job-overwrite {
  border-color: rgba(112, 184, 255, 0.35);
  color: var(--accent-2);
}

.history-job-delete {
  border-color: rgba(255, 127, 127, 0.32);
  color: #ffd1d1;
}

.history-job-delete:disabled {
  color: var(--muted);
  cursor: wait;
}

.record-action-help {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  list-style: none;
}

.record-action-help li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.record-action-help strong {
  color: var(--text);
  font-weight: 800;
}

.records-search {
  margin: 12px 0 0;
}

.records-pagination {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.records-pagination span {
  text-align: center;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pipeline {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .sidebar,
  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-tools,
  .chart-ranges,
  .chart-indicators,
  .chart-forecast-toggle {
    width: 100%;
  }

  .chart-ranges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-range:nth-child(2) {
    border-right: 0;
  }

  .chart-range:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .chart-indicators {
    justify-content: space-between;
  }

  .forecast-badge {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forecast-badge strong {
    grid-column: 1 / -1;
  }

  .pipeline,
  .two-col {
    grid-template-columns: 1fr;
  }

  .log-panel,
  .report-panel {
    min-height: 420px;
  }

  .event-log,
  .report-content {
    height: 360px;
  }
}
