.forecast-host [hidden] { display: none !important; }
.forecast-host { padding-bottom: 24px; }
.forecast-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.forecast-title h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.forecast-heading-help { position: relative; }
.forecast-heading-help :is(h1, h2) { cursor: help; }
.forecast-heading-help :is(h1, h2):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.forecast-heading-help .form-help-tooltip-content { top: 100%; bottom: auto; transform: none; transition: none; }
.forecast-heading-help:not([data-dismissed]):is(:hover, :focus-within) .form-help-tooltip-content {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.forecast-source-status, .forecast-basis { margin: 0; color: #53667d; font-size: 13px; }
.forecast-source-status { margin: 12px 0; min-height: 18px; }
.forecast-toolbar { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.forecast-toolbar label, .forecast-fields label { display: grid; gap: 5px; font-size: 12px; font-weight: 650; }
.forecast-toolbar input, .forecast-fields :is(input, select) {
  width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid #bdcbd8; border-radius: 7px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 13px;
}
.forecast-page .secondary, .forecast-detail .secondary { background: var(--card); border-color: #bdcbd8; color: var(--ink); }
.forecast-page .primary, .forecast-detail .primary { background: var(--navy); color: var(--card); }
.forecast-page .primary:hover, .forecast-detail .primary:hover { background: #26364f; }
.forecast-page .secondary:hover, .forecast-detail .secondary:hover { background: var(--blue-soft); }
.forecast-page .button:disabled { opacity: .55; cursor: default; }
.forecast-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.forecast-materials-only .forecast-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.forecast-metrics .summary-metric { justify-content: flex-start; }
.forecast-metrics .summary-metric-value { display: block; font-size: clamp(28px, 3vw, 44px); }
.forecast-metrics small { display: block; margin-top: 5px; color: #53667d; font-size: 13px; }
.forecast-metrics [data-tone="margin"] { background: var(--blue-soft); }
.forecast-metrics [data-tone="pending"] { background: #fffaf0; border-color: #f1d487; }
.forecast-metrics [data-tone="pending"] :is(.summary-metric-value, small) { color: #624400; }
.forecast-register { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.forecast-register-heading { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 0 1px 10px; }
.forecast-register-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.forecast-register-heading h2, .forecast-detail h3 { font-size: 15px; margin: 0; }
.forecast-register-heading span { color: #53667d; font-size: 12px; }
.forecast-scroll { max-width: 100%; overflow: auto; }
.forecast-table { min-width: 1200px; }
.forecast-materials-only .forecast-table { min-width: 950px; }
.forecast-table th, .forecast-table td, .forecast-objects th, .forecast-objects td { padding-inline: 8px; }
.forecast-table thead tr:first-child th { border-bottom: 1px solid #bdcbd8; font-size: 11px; }
.forecast-table thead tr:first-child th[rowspan] { min-width: 174px; vertical-align: bottom; border-bottom-width: 2px; }
.forecast-table thead th:not([rowspan]) { text-align: center; }
.forecast-table thead tr:first-child th,
.forecast-table thead tr:nth-child(2) th:nth-child(3 of :not([hidden])),
.forecast-table :is(tbody, tfoot) :is(td,th):is(:nth-child(2), :nth-child(4)),
.forecast-host:not(.forecast-materials-only) .forecast-table thead tr:nth-child(2) th:is(:nth-child(6), :nth-child(12)),
.forecast-host:not(.forecast-materials-only) .forecast-table :is(tbody, tfoot) td:is(:nth-child(7), :nth-child(13)),
.forecast-materials-only .forecast-table thead tr:nth-child(2) th:nth-child(9 of :not([hidden])),
.forecast-materials-only .forecast-table :is(tbody, tfoot) td:nth-child(10) { border-left: 1px solid #d4e0eb; }
.forecast-table tbody tr:nth-child(odd of :not([hidden])):not(:hover, :focus-within) td { background: var(--card); }
.forecast-table tbody tr:nth-child(even of :not([hidden])):not(:hover, :focus-within) td { background: #edf2f7; }
.forecast-table tbody .forecast-project-row td { font-weight: 750; }
.forecast-element-row td:first-child { padding-left: 22px; }
.forecast-child-row td:first-child { padding-left: 36px; }
.forecast-element-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; }
.forecast-table tfoot :is(th,td) { background: var(--line); border-top: 2px solid #bdcbd8; font-weight: 750; }
.forecast-row-button {
  border: 0; background: transparent; padding: 2px 0; color: var(--ink); font: inherit; text-align: left;
  display: flex; align-items: flex-start; gap: 7px; flex-wrap: wrap;
}
.forecast-row-button:has(.forecast-caret) { flex-wrap: nowrap; }
.forecast-row-button span strong { white-space: nowrap; }
.forecast-caret {
  width: 7px; height: 7px; flex: none; border-right: 2px solid; border-bottom: 2px solid;
  transform: rotate(-45deg); margin: 4px 2px 0 0;
}
[aria-expanded="true"] .forecast-caret { transform: rotate(45deg); }
.forecast-detail-link, .forecast-inline-action { color: #234f75; text-decoration: underline; font-weight: 650; }
.forecast-detail-link { white-space: nowrap; }
.forecast-inline-action { font: inherit; background: none; border: 0; padding: 3px; }
.forecast-tag {
  display: inline-block; margin: 2px 4px 0 0; padding: 1px 5px; border-radius: 4px;
  background: #fff2cc; color: #624400; font-weight: 700; font-size: 10px;
}
.forecast-tag.missing { background: #fff0f1; color: #9b2432; }
.forecast-money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.forecast-negative { color: #9b2432; }
.forecast-margin small, .forecast-objects small, .forecast-lines-table small { display: block; color: #53667d; font-size: 11px; }
.forecast-margin .forecast-pending { color: #9b2432; font-weight: 650; }
.forecast-source-warning { color: #624400; }
.forecast-empty { padding: 24px 12px; margin: 0; background: var(--canvas); color: #53667d; border-radius: 7px; }
.forecast-detail {
  width: min(1050px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--card); box-shadow: var(--shadow);
}
.forecast-detail[open] { display: flex; flex-direction: column; }
.forecast-detail::backdrop { background: rgb(15 23 42 / 52%); }
.forecast-detail-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 17px; border-bottom: 1px solid var(--line); background: var(--canvas);
}
.forecast-detail-heading h2 { margin: 3px 0 0; font-size: 20px; }
.forecast-detail-heading p { margin: 0; color: #53667d; font-size: 12px; }
.forecast-detail-body { min-height: 0; overflow: auto; padding: 14px 17px; }
.forecast-detail-body > * + * { margin-top: 14px; }
.forecast-detail-body :is(h3, .forecast-lines summary) { margin-bottom: 7px; }
.forecast-detail-warning {
  padding: 8px 10px; border-radius: 5px; background: #fff2cc; color: #624400; font-size: 13px; font-weight: 650;
}
.forecast-objects { min-width: 785px; }
.forecast-materials-only .forecast-objects { min-width: 700px; }
.forecast-lines-table { min-width: 570px; }
.forecast-lines summary { color: #234f75; cursor: pointer; font-size: 13px; font-weight: 700; }
.forecast-editor { border-top: 1px solid var(--line); padding-top: 12px; }
.forecast-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.forecast-description { grid-column: 1 / -1; }
.forecast-form-error { margin: 8px 0 0; color: #9b2432; font-size: 13px; }
.forecast-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.forecast-detail-body > .forecast-source-status { margin-bottom: 0; min-height: 0; }
.forecast-detail-body > .forecast-source-status:empty { margin: 0; }
@media (max-width: 1050px) {
  .forecast-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .forecast-materials-only .forecast-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forecast-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forecast-toolbar { width: 100%; }
}
@media (max-width: 500px) {
  .forecast-metrics, .forecast-materials-only .forecast-metrics { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .forecast-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .forecast-row-button, .forecast-inline-action { min-height: 44px; align-items: center; }
}
