[hidden] {
  display: none !important
}

.comparison-mode {
  border: 0;
  background: none;
  color: #ced9e8;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  text-align: left;
  font-size: 13px;
  border-radius: 7px;
  margin-top: 8px
}

.comparison-mode:hover {
  background: #ffffff09
}

.comparison-mode b {
  margin-left: auto
}

.comparison-children {
  padding-left: 13px;
  border-left: 1px solid #334259;
  margin: 0 0 15px 20px
}

.comparison-children .nav-link {
  font-size: 11px;
  padding: 10px 9px
}

.comparison-children .icon {
  width: 16px;
  height: 16px
}

.comparison-children .nav-link.active:before {
  left: -15px
}

.intent-preview {
  margin-top: 24px
}

.intent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 0
}

.intent-grid dt {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px
}

.intent-grid dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere
}

.intent-assumptions {
  padding: 20px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 24px
}

.intent-assumptions h3 {
  font-size: 12px
}

.intent-assumptions p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0
}

.intent-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px
}

.intent-actions .primary {
  margin-left: auto
}

.nl-ai {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px
}

.intent-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px
}

.intent-edit label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted)
}

.intent-edit input,
.intent-edit select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  min-width: 0
}

.nl-result-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin: 25px 0
}

.nl-result-heading h2 {
  font-size: 23px;
  line-height: 1.5;
  max-width: 850px;
  overflow-wrap: anywhere
}

.nl-result-heading p,
.nl-result-heading details {
  font-size: 12px;
  color: var(--muted)
}

.nl-result-heading .button {
  flex-shrink: 0
}

.dynamic-sections {
  display: grid;
  gap: 22px
}

.dynamic-bars {
  display: grid;
  gap: 22px
}

.dynamic-bar-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 2fr;
  gap: 30px;
  align-items: center;
  border-bottom: 1px solid #edf1f6;
  padding: 0 0 18px
}

.dynamic-bar-row:last-child {
  border-bottom: 0;
  padding-bottom: 0
}

.dynamic-row-label {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px
}

.dynamic-row-label strong {
  font-size: 13px;
  width: 100%;
  overflow-wrap: anywhere
}

.dynamic-bars .comparison-row {
  grid-template-columns: 65px 1fr 100px;
  margin-bottom: 8px
}

.dynamic-bars .bar-track {
  height: 9px
}

.dynamic-data {
  font-size: 11px;
  margin-top: 22px;
  color: var(--muted)
}

.dynamic-data summary {
  cursor: pointer
}

.dynamic-data .table-scroll {
  margin-top: 12px
}

.dynamic-chart svg {
  display: block;
  width: 100%;
  min-height: 150px
}

.dynamic-delivery {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center
}

.dynamic-delivery .path-node {
  flex: 1;
  min-width: 150px
}

.ask-followup {
  margin-top: 26px;
  border: 1px solid #cad9eb;
  border-radius: 12px;
  background: #fafdff;
  padding: 26px
}

.ask-followup h2 {
  margin: 9px 0;
  font-size: 22px
}

.ask-followup p {
  font-size: 12px;
  color: var(--muted)
}

.ask-followup textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  font: inherit;
  resize: vertical;
  margin-top: 12px
}

.ask-followup .intent-actions {
  margin-top: 12px
}

@media(max-width:1120px) {
  .comparison-mode {
    justify-content: center;
    padding: 13px 0
  }

  .comparison-mode span,
  .comparison-mode b {
    display: none
  }

  .comparison-children {
    margin: 0;
    padding: 0;
    border: 0
  }

  .composer-bottom {
    flex-wrap: wrap
  }

  .composer-bottom .button {
    margin-left: 0
  }

  .composer-bottom .muted-text {
    margin-left: auto
  }
}

@media(max-width:700px) {
  .ask-heading h2 {
    font-size: 28px
  }

  .composer-bottom {
    align-items: flex-start
  }

  .composer-bottom label {
    flex-direction: column;
    align-items: flex-start;
    width: 100%
  }

  .composer-bottom input {
    width: 100%
  }

  .composer-bottom .muted-text {
    margin: 0
  }

  .composer-bottom .button {
    width: 100%
  }

  .ask-principles {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 28px
  }

  .intent-grid,
  .intent-edit {
    grid-template-columns: 1fr
  }

  .intent-actions {
    flex-wrap: wrap
  }

  .dynamic-bar-row {
    grid-template-columns: 1fr;
    gap: 12px
  }

  .nl-result-heading {
    flex-direction: column
  }

  .sidebar.open .comparison-mode span,
  .sidebar.open .comparison-mode b {
    display: block
  }

  .sidebar.open .comparison-mode {
    justify-content: flex-start;
    padding-left: 12px
  }

  .sidebar.open .comparison-children {
    margin-left: 14px
  }

  .dynamic-bars .comparison-row {
    grid-template-columns: 50px 1fr 80px;
    gap: 5px
  }

  .ask-heading {
    margin-top: 0
  }
}

.stacked-distribution {
  height: 28px;
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  gap: 1px;
  margin: 20px 0
}

.dynamic-lineage {
  margin-top: 12px
}

/* Completed facts reports have compact empty states and no reserved chart height. */
.facts-report { gap: 16px; }
.facts-report .card-body { padding-top: 14px; padding-bottom: 14px; }
.facts-report .card-body > p:only-child { margin: 0; }
.facts-report .report-comparison { margin: 12px 0; }
.facts-report svg { display: block; width: 100%; max-height: 280px; }
.facts-report .ai-panel { margin-top: 0; }

.nl-workflow { display:flex; flex-wrap:wrap; gap:8px; padding:0; list-style:none; margin:16px 0; }
.nl-workflow li, .plan-chips span { padding:8px 12px; border:1px solid #dce5ef; border-radius:8px; }
.nl-workflow .active { background:#edf5ff; border-color:#2575d9; }
.plan-chips { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0 6px; }
.parser-modes { flex-basis:100%; font-size:13px; color:#526278; }
.plan-edit-command { display:flex; align-items:end; gap:12px; flex-wrap:wrap; margin:16px 0; }
.plan-edit-command label { flex:1; min-width:220px; }
.plan-edit-command small { flex-basis:100%; }
.clarification label { display:block; margin:12px 0; }

.workflow-progress { color:#637187; font-size:13px; margin:8px 0 20px; }
.investigation-failure { border:2px solid #b42318; background:#fff5f4; }
.investigation-failure h2 { color:#b42318; }
.investigation-failure details { margin-top:18px; }
.investigation-failure pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.intent-preview details { margin:12px 0; }

.stage-progress { list-style:none; padding:0; display:grid; gap:14px; }
.stage-progress .current { color:#176bc3; font-weight:600; }
.stage-progress .pending { color:#8793a4; }
.stage-progress .done { color:#187451; }

/* Ask uses the shared card, accordion, button, badge and empty-state components. */
.ask-heading { margin: 0 0 16px; text-align: left; }
.ask-heading h2 { font-size: 25px; letter-spacing: -.6px; margin: 4px 0 6px; }
.ask-heading p { color: var(--muted); max-width: 760px; }
.workflow-progress { display: flex; flex-wrap: wrap; gap: 10px 24px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 12px; color: var(--muted); }
.workflow-progress li { display: flex; align-items: center; gap: 7px; }
.workflow-progress li > span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-size: 10px; }
.workflow-progress [aria-current] { color: var(--blue); font-weight: 600; }
.workflow-progress [aria-current] > span { background: var(--blue-soft); border-color: var(--blue); }
.ask-card-title, .ask-history-title { display: inline-flex; align-items: center; gap: 10px; }
.ask-card-title .icon { color: var(--blue); }
.ask-composer textarea { display: block; width: 100%; min-height: 112px; resize: vertical; padding: 14px 16px; font: inherit; font-size: 15px; line-height: 1.7; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.ask-composer textarea::placeholder { color: var(--muted); opacity: .8; }
.ask-composer textarea:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.ask-composer-actions { display: flex; align-items: end; gap: 20px; margin-top: 20px; }
.ask-field { display: grid; gap: 7px; font-size: 12px; font-weight: 600; }
.host-control { flex: 1; min-width: 0; }
.ask-host-input { position: relative; display: block; }
.ask-host-input .icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.ask-field input, .ask-field select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; font-weight: 400; }
.ask-host-input input { padding-left: 41px; }
.ask-composer-actions > .primary { min-height: 44px; padding-inline: 22px; font-size: 13px; }
.ask-advanced { margin-top: 20px; box-shadow: none; }
.ask-advanced summary { font-size: 12px; }
.ask-advanced-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 24px; }
.ask-advanced-fields select { max-width: 100%; }
.ask-advanced-fields > p { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.ask-advanced .nl-ai { cursor: pointer; }
.ask-advanced input[type=checkbox] { accent-color: var(--blue); width: 16px; height: 16px; }
.example-strip { margin: 24px 0; }
.ask-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ask-section-heading > span { font-size: 12px; }
.ask-examples { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ask-examples .button { min-height: 58px; white-space: normal; text-align: left; justify-content: flex-start; padding: 12px; }
.ask-examples .icon { color: var(--blue); width: 18px; height: 18px; }
.ask-history > summary { min-height: 64px; }
.ask-history-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ask-history-row:first-child { padding-top: 0; }
.ask-history-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ask-history-row > div { min-width: 0; }
.ask-history-row .button { font-size: 13px; white-space: normal; text-align: left; }
.ask-history-row small { display: block; }
.ask-history .empty-inline { padding: 12px 0; }
.intent-preview .card-body > p { color: var(--muted); margin-bottom: 20px; }
.intent-preview .intent-grid { background: var(--bg); padding: 18px; border-radius: var(--radius); }
.intent-preview .intent-grid dd { line-height: 1.6; }
.intent-preview .intent-actions { justify-content: flex-end; }
.intent-preview .intent-actions .primary { margin-left: 0; }
@media (max-width: 1100px) {
  .ask-examples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ask-advanced-fields { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ask-composer-actions { flex-direction: column; align-items: stretch; gap: 14px; }
  .ask-examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ask-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .ask-composer .card-header > span, .intent-preview .card-header > span { display: none; }
  .ask-history > summary { flex-wrap: wrap; gap: 4px; }
  .ask-history-row { align-items: flex-start; }
  .intent-preview .intent-actions { flex-direction: column; align-items: stretch; }
}
.ask-advanced > summary > span,
.ask-history > summary > span:last-child { float: right; margin-left: 16px; font-weight: 400; color: var(--muted); }
@media (max-width: 700px) {
  .ask-advanced > summary > span,
  .ask-history > summary > span:last-child { float: none; display: block; margin: 5px 0 0 16px; font-size: 11px; }
}

/* Secondary plan tools share the Advanced Options disclosure and form controls. */
.intent-preview .ask-advanced { margin: 16px 0 0; }
.plan-language-edit .ask-field { width: 100%; }
.plan-language-edit p { margin-top: 10px; font-size: 12px; line-height: 1.6; }
.plan-language-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.plan-language-actions .button, .plan-action-footer .button { min-height: 40px; padding-inline: 16px; font-size: 12px; }
.plan-action-footer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.plan-action-footer > p { font-size: 12px; margin-bottom: 12px; }
.plan-action-footer .intent-actions { margin-top: 0; gap: 10px; }
.plan-action-footer .button:disabled { cursor: not-allowed; }
@media (max-width: 700px) {
  .plan-language-actions .button { width: 100%; }
  .plan-action-footer .intent-actions { flex-direction: column; align-items: stretch; }
}

.diagnostic-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:20px; }
.execution-diagnostics table { width:100%; }
.execution-diagnostics th { text-align:left; white-space:normal; text-transform:none; letter-spacing:normal; width:55%; font-weight:500; }
.execution-diagnostics td { text-align:right; white-space:normal; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.execution-diagnostics > div > h3 { margin:16px 0 8px; }
@media(max-width:1100px) { .diagnostic-grid { grid-template-columns:1fr; } }

/* Timeline only: measured viewBox width keeps SVG units equal to CSS pixels. */
tp-timeline { display:block; width:100%; min-width:0; }
.timeline-plot { position:relative; width:100%; height:300px; }
.facts-report .timeline-plot svg, .timeline-plot svg { display:block; width:100%; height:300px; max-height:none; }
.timeline-axes text { font-size:12px; fill:#526278; }
.timeline-axes path { fill:none; stroke:#9aaabc; }
.timeline-grid { stroke:#e4eaf1; stroke-width:1; }
.timeline-guide { stroke:#8395aa; stroke-dasharray:3 4; pointer-events:none; }
.timeline-point { cursor:crosshair; outline:none; }
.timeline-hit { pointer-events:all; }
.timeline-point.active .timeline-dot, .timeline-point:focus .timeline-dot { r:5.5px; stroke:#172c47; stroke-width:2; }
.timeline-tooltip { position:absolute; z-index:5; pointer-events:none; box-sizing:border-box; width:250px; max-width:calc(100% - 16px); padding:12px; border:1px solid #c4cfdd; border-radius:8px; background:#fff; color:#172c47; box-shadow:0 4px 16px #172c4726; font-size:12px; }
.timeline-tooltip[hidden] { display:none; }
.timeline-tooltip dl { display:grid; grid-template-columns:auto 1fr; gap:6px 10px; margin:0; }
.timeline-tooltip dt { color:#526278; }
.timeline-tooltip dd { margin:0; overflow-wrap:anywhere; }
.timeline-legend { display:flex; flex-wrap:wrap; gap:10px 24px; margin:12px 0; font-size:12px; }
.timeline-legend span { display:inline-flex; align-items:center; gap:7px; }
.timeline-legend i { display:inline-block; width:24px; border-top-width:2px; }
