/* OptDeck page layouts and staged progress. Inherited design tokens unchanged. SPEC §13. */
#progressbar {
  overflow: hidden;
}
.grid-2 > .panel {
  min-width: 0;
}
#backtest-comparison .grid-2 > div,
#backtest-report .grid-2 > div {
  min-width: 0;
}
.turnover-values.annual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.turnover-control,
.turnover-conversion {
  min-width: 0;
}
.turnover-control input {
  width: 100%;
}
.turnover-conversion {
  padding: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line-1);
  border-radius: 8px;
}
.turnover-conversion output {
  display: block;
  font-family: var(--font-data);
  font-size: 16px;
  color: var(--direction-long);
  overflow-wrap: anywhere;
}
.job-error {
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: var(--status-bad);
  margin-top: 6px;
}
.folio-number {
  font-family: var(--font-data);
  font-size: 11px;
  opacity: 0.65;
  width: 22px;
}
.sidebar-note {
  margin: auto 24px 36px;
  padding-top: 32px;
  color: var(--vitrine-text);
}
.sidebar-note p {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.6;
  margin: 10px 0 12px;
}
.sidebar-note .panel-eyebrow {
  font-size: 8px;
  color: var(--vitrine-text);
  opacity: 0.5;
}
.sidebar-note .small {
  opacity: 0.5;
  font-size: 10px;
}
#sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar-bottom {
  margin-top: 0;
}
#view-root {
  padding: 32px 36px 48px;
  max-width: 1500px;
}
.workspace-footer {
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line-1);
  margin: 0 36px;
  padding: 16px 0;
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--ink-400);
}
.workspace-footer span:last-child {
  margin-left: auto;
}
.page-intro {
  margin: 0 0 26px;
}
.page-intro h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  color: var(--direction-long-deep);
  margin: 8px 0;
}
.page-intro p {
  color: var(--ink-500);
}
.hero-index {
  float: right;
  font: 72px var(--font-display);
  color: var(--line-1);
  line-height: 1;
}
.hero-index small {
  font-size: 12px;
  font-family: var(--font-data);
}
.submit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(285px, 1fr);
  gap: 24px;
  align-items: start;
}
.submit-layout > .panel {
  min-width: 0;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 26px 0 14px;
  font-size: 12px;
  color: var(--ink-500);
  border-top: 1px solid var(--line-0);
  padding-top: 20px;
}
.section-label:first-child {
  border: 0;
  margin-top: 0;
  padding-top: 0;
}
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--line-1);
  background: var(--paper-2);
  min-height: 155px;
  padding: 20px;
  border-radius: var(--radius-2);
  cursor: pointer;
  position: relative;
  transition: border-color 0.26s;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--direction-long);
  background: var(--direction-long-soft);
}
.dropzone strong {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--direction-long-deep);
  font-weight: 500;
}
.dropzone .upload-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 14px;
  color: var(--direction-long);
}
.dropzone input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.dropzone p {
  margin-top: 7px;
  font-size: 11px;
  color: var(--ink-500);
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.upload-grid .dropzone {
  min-height: 122px;
}
.preview {
  font-family: var(--font-data);
  font-size: 11px;
  padding: 10px 0;
  color: var(--ink-500);
  overflow-wrap: anywhere;
}
.preview strong {
  color: var(--direction-long);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 12px;
  color: var(--ink-700);
}
.field input,
.field select {
  width: 100%;
  padding: 9px 11px;
  min-width: 0;
}
.field small {
  color: var(--ink-400);
  font-size: 10.5px;
  line-height: 1.5;
}
.field input:invalid {
  border-color: var(--status-bad);
}
.span-2 {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.actions .btn {
  padding: 8px 14px;
}
.actions .btn-primary {
  padding: 10px 18px;
}
.submit-button {
  width: 100%;
  justify-content: center;
  padding: 12px !important;
  font-size: 13px !important;
  margin-top: 20px;
}
.budget-row {
  display: grid;
  grid-template-columns: minmax(85px, 1.5fr) 1fr 1fr 26px;
  gap: 6px;
  margin: 8px 0;
}
.budget-row input {
  width: 100%;
  min-width: 0;
  padding: 6px;
}
.budget-row button {
  justify-content: center;
  padding: 0;
}
.budget-heading {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 26px;
  font-size: 10px;
  color: var(--ink-400);
}
.resource-card {
  background: var(--paper-2);
  border: 1px solid var(--line-0);
  padding: 16px;
  border-radius: 8px;
  margin-top: 20px;
}
.resource-values {
  display: flex;
  gap: 26px;
  margin: 10px 0;
}
.resource-values strong {
  font: 22px var(--font-display);
  color: var(--direction-long-deep);
  display: block;
}
.resource-values small {
  font-size: 10px;
  color: var(--ink-400);
}
.upstream-estimate {
  font-size: 11px;
  line-height: 1.8;
}
.cache-hit {
  color: var(--direction-long);
}
.health-ok {
  color: var(--status-ok);
}
.health-warn {
  color: var(--status-warn);
}
.health-bad {
  color: var(--status-bad);
}
.muted-box {
  background: var(--paper-2);
  padding: 18px;
  border: 1px solid var(--line-0);
  border-radius: 8px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.8;
}
.result-notice {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid var(--status-warn);
  border-radius: 8px;
  background: var(--status-warn-soft);
  color: var(--ink-700);
  line-height: 1.8;
}
.result-notice p {
  margin: 6px 0;
}
.progress-card {
  padding: 20px 22px;
  margin-bottom: 16px;
}
.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.progress-numbers {
  font-family: var(--font-data);
  font-size: 11px;
  white-space: nowrap;
}
.stage-segments {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}
.stage-segment {
  height: 7px;
  flex: 1;
  background: var(--paper-2);
  border-radius: 3px;
  overflow: hidden;
}
.stage-fill {
  height: 100%;
  background: var(--direction-long);
  transition: width var(--duration-base) var(--easing-calm);
  position: relative;
}
.stage-segment.current .stage-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: direction_flow_sheen 2.2s infinite;
}
.stage-labels {
  display: flex;
  gap: 5px;
  margin-bottom: 14px;
}
.stage-labels span {
  flex: 1;
  font-size: 9px;
  color: var(--ink-400);
}
.stage-labels .current {
  color: var(--direction-long);
  font-weight: 600;
}
.progress-message {
  font-size: 11px;
  color: var(--ink-500);
  min-height: 17px;
}
.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  border-top: 1px solid var(--line-0);
  padding-top: 12px;
}
.progress-footer .actions {
  margin: 0;
}
.job-id {
  font-family: var(--font-data);
  font-size: 11px;
}
.ledger-table td {
  vertical-align: middle;
}
.empty-state {
  padding: 54px 24px;
  text-align: center;
  color: var(--ink-500);
}
.empty-state .empty-symbol {
  font: 48px var(--font-display);
  color: var(--line-1);
}
.empty-state h3 {
  font: 22px var(--font-display);
  color: var(--direction-long-deep);
  margin: 14px 0 8px;
}
.empty-state .btn {
  margin-top: 18px;
}
.result-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 20px 0;
}
.result-toolbar select {
  min-width: 280px;
}
.chart-panel {
  margin-bottom: 20px;
}
.chart-panel .chart {
  height: 280px;
}
.chart-panel.wide .chart {
  height: 360px;
}
.details-table {
  max-height: 320px;
  overflow: auto;
}
.account-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.account-card {
  padding: 20px;
}
.account-card h3 {
  font: 20px var(--font-display);
  margin-bottom: 10px;
}
.account-card .job-id {
  color: var(--ink-400);
}
.account-card .pill {
  margin: 10px 0;
}
.history-summary {
  margin-top: 24px;
}
.history-summary > .panel {
  margin: 20px 0;
}
.parameter-difference {
  background: var(--status-warn-soft);
}
.compare-selection {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px 0;
}
.compare-selection label {
  cursor: pointer;
}
.compare-selection input {
  accent-color: var(--direction-long);
}
dialog {
  border: 1px solid var(--line-1);
  border-radius: 14px;
  background: var(--paper-1);
  padding: 28px;
  max-width: 460px;
  color: var(--ink-700);
}
dialog::backdrop {
  background: rgba(22, 50, 42, 0.4);
  backdrop-filter: blur(5px);
}
dialog p {
  margin: 14px 0;
}
dialog input {
  width: 100%;
}
html[data-visual-effects="off"] .stage-segment.current .stage-fill::after,
.no-visual-effects .stage-segment.current .stage-fill::after {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .stage-fill {
    transition: none;
  }
  .stage-segment.current .stage-fill::after {
    display: none;
  }
}
@media (max-width: 1150px) {
  .submit-layout {
    grid-template-columns: 1fr;
  }
  .sidebar-note {
    display: none;
  }
  #view-root {
    padding: 24px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .stage-labels span {
    font-size: 8px;
  }
}
@media (max-width: 900px) {
  #nav a .folio-number,
  .sidebar-bottom a .folio-number {
    display: inline-block;
  }
}
@media (max-width: 700px) {
  #view-root {
    padding: 20px 14px;
  }
  .form-grid,
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .hero-index {
    font-size: 50px;
  }
  .page-intro h1 {
    font-size: 26px;
  }
  .progress-heading {
    align-items: start;
    flex-direction: column;
  }
  .stage-labels {
    display: none;
  }
  .workspace-footer {
    margin: 0 14px;
  }
  .workspace-footer span:last-child {
    display: none;
  }
  .result-toolbar select {
    min-width: 0;
    width: 100%;
  }
  .topbar-right {
    flex-wrap: wrap;
  }
  .sidebar-note {
    display: none;
  }
}
