.ww-history-demo { min-width: 0; margin: 0 0 24px; color: var(--ww-text); }
.ww-history-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; padding: 22px; border: 1px solid var(--ww-border); border-radius: var(--ww-radius) var(--ww-radius) 12px 12px; background: linear-gradient(135deg, var(--ww-surface), color-mix(in srgb, var(--ww-blue) 6%, var(--ww-surface))); box-shadow: var(--ww-shadow); }
.ww-history-head h2 { margin: 2px 0 4px; color: var(--ww-navy); font-size: clamp(21px, 2.3vw, 29px); letter-spacing: -.02em; }
.ww-history-head p { margin: 0 0 10px; color: var(--ww-muted); font-size: 12px; }
.ww-history-mode { display: inline-flex; width: fit-content; padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--ww-warning) 42%, var(--ww-border)); border-radius: 999px; color: #79570d; background: var(--ww-warning-soft); font-size: 10px; font-weight: 800; line-height: 1.3; }
.ww-history-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.ww-history-controls label { display: grid; gap: 5px; color: var(--ww-muted); font-size: 10px; font-weight: 800; }
.ww-history-controls input { min-height: 44px; padding: 8px 10px; border: 1px solid var(--ww-border); border-radius: 10px; color: var(--ww-text); background: var(--ww-surface); font: 600 12px Inter, sans-serif; }
.ww-history-controls fieldset { display: flex; gap: 3px; margin: 0; padding: 3px; border: 1px solid var(--ww-border); border-radius: 11px; background: var(--ww-surface); }
.ww-history-controls legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.ww-history-controls button { min-height: 38px; padding: 6px 10px; border: 0; border-radius: 8px; color: var(--ww-muted); background: transparent; font: 700 10px Inter, sans-serif; }
.ww-history-controls button.is-active { color: #fff; background: var(--ww-blue); }
.ww-history-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 16px; }
.ww-history-summary > div { min-width: 0; padding: 13px 14px; border: 1px solid var(--ww-border); border-radius: 11px; background: var(--ww-surface); }
.ww-history-summary span, .ww-history-summary small { display: block; color: var(--ww-muted); font-size: 9.5px; }
.ww-history-summary span { font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.ww-history-summary strong { display: block; margin-top: 4px; color: var(--ww-navy); font-size: 15px; overflow-wrap: anywhere; }
.ww-history-state { min-height: 56px; display: grid; place-items: center; padding: 14px; border: 1px solid var(--ww-border); border-radius: 12px; color: var(--ww-muted); background: var(--ww-surface); font-size: 12px; text-align: center; }
.ww-history-state[hidden] { display: none; }
.ww-history-state[data-state="ERROR"] { color: var(--ww-danger); border-color: color-mix(in srgb, var(--ww-danger) 35%, var(--ww-border)); background: var(--ww-danger-soft); }
.ww-history-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); gap: 16px; align-items: start; }
.ww-history-layout[hidden] { display: none; }
.ww-history-charts { display: grid; gap: 16px; min-width: 0; }
.ww-history-panel, .ww-history-assistant, .ww-history-details { min-width: 0; border: 1px solid var(--ww-border); border-radius: var(--ww-radius); background: var(--ww-surface); box-shadow: var(--ww-shadow); }
.ww-history-panel { padding: 18px; }
.ww-history-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ww-history-panel h3, .ww-history-assistant h3, .ww-history-details h3 { margin: 0 0 4px; color: var(--ww-navy); font-size: 16px; }
.ww-history-panel-head p { margin: 0; max-width: 680px; color: var(--ww-muted); font-size: 11px; }
.ww-history-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 13px 0 8px; color: var(--ww-muted); font-size: 9.5px; }
.ww-history-legend span::before { content: ""; display: inline-block; width: 16px; height: 3px; margin: 0 5px 2px 0; border-radius: 2px; background: var(--ww-blue); }
.ww-history-legend .later::before { background: var(--ww-cyan); }
.ww-history-legend .forecast::before { background: repeating-linear-gradient(90deg, var(--ww-warning) 0 5px, transparent 5px 8px); }
.ww-history-legend .interval::before { height: 8px; background: color-mix(in srgb, var(--ww-warning) 20%, transparent); }
.ww-history-legend .missing::before { background: repeating-linear-gradient(90deg, #94a3b8 0 2px, transparent 2px 5px); }
.ww-history-legend .rain::before { height: 8px; background: var(--ww-cyan); }
.ww-history-legend .zero::before { height: 8px; border: 1px solid var(--ww-cyan); background: transparent; }
.ww-history-legend .issue::before { width: 2px; height: 10px; background: var(--ww-navy); }
.ww-history-chart-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--ww-border); border-radius: 11px; background: var(--ww-surface-soft); }
.ww-history-chart { display: block; width: 100%; min-width: 660px; height: auto; }
.ww-history-chart text { fill: var(--ww-muted); font: 10px Inter, sans-serif; }
.ww-history-chart .grid { stroke: var(--ww-border); stroke-width: 1; }
.ww-history-chart .axis { stroke: #8da0af; stroke-width: 1; }
.ww-history-chart .known-line { fill: none; stroke: var(--ww-blue); stroke-width: 2.5; }
.ww-history-chart .later-line { fill: none; stroke: var(--ww-cyan); stroke-width: 2.5; }
.ww-history-chart .forecast-line { fill: none; stroke: var(--ww-warning); stroke-width: 2.5; stroke-dasharray: 6 4; }
.ww-history-chart .forecast-interval { fill: color-mix(in srgb, var(--ww-warning) 18%, transparent); }
.ww-history-chart .issue-line { stroke: var(--ww-navy); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ww-history-chart .known-dot { fill: var(--ww-blue); }
.ww-history-chart .later-dot { fill: var(--ww-cyan); }
.ww-history-chart .forecast-dot { fill: var(--ww-warning); stroke: var(--ww-surface); stroke-width: 2; }
.ww-history-chart .rain-bar { fill: var(--ww-cyan); }
.ww-history-chart .zero-bar { fill: transparent; stroke: var(--ww-cyan); stroke-width: 1; }
.ww-history-chart .missing-mark { stroke: #94a3b8; stroke-width: 1.25; }
.ww-history-chart [tabindex="0"]:focus { outline: none; stroke: var(--ww-navy); stroke-width: 3; filter: drop-shadow(0 0 3px var(--ww-cyan)); }
.ww-history-chart-summary, .ww-history-note { margin: 9px 0 0; color: var(--ww-muted); font-size: 10.5px; line-height: 1.55; }
.ww-history-table { margin-top: 10px; border-top: 1px solid var(--ww-border); }
.ww-history-table summary { min-height: 42px; padding: 12px 2px 4px; color: var(--ww-blue); font-size: 10.5px; font-weight: 750; cursor: pointer; }
.ww-history-table > div { max-height: 280px; overflow: auto; }
.ww-history-table table { width: 100%; border-collapse: collapse; font-size: 10px; }
.ww-history-table caption { padding: 6px; color: var(--ww-muted); text-align: left; }
.ww-history-table th, .ww-history-table td { padding: 7px; border-bottom: 1px solid var(--ww-border); text-align: left; }
.ww-history-assistant { position: sticky; top: 92px; padding: 18px; }
.ww-history-assistant-status { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #79570d; background: var(--ww-warning-soft); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.ww-history-assistant-status[data-status="AVAILABLE"] { color: var(--ww-green); background: var(--ww-green-soft); }
.ww-history-assistant > p { color: var(--ww-muted); font-size: 11px; line-height: 1.55; }
.ww-history-examples { display: grid; gap: 6px; margin: 12px 0; }
.ww-history-examples button { min-height: 38px; padding: 8px 10px; border: 1px solid var(--ww-border); border-radius: 9px; color: var(--ww-text); background: var(--ww-surface-soft); font: 650 10.5px Inter, sans-serif; text-align: left; cursor: pointer; }
.ww-history-assistant form { display: grid; gap: 7px; }
.ww-history-assistant form label { color: var(--ww-navy); font-size: 10px; font-weight: 800; }
.ww-history-assistant textarea { width: 100%; padding: 9px; resize: vertical; border: 1px solid var(--ww-border); border-radius: 9px; color: var(--ww-text); background: var(--ww-surface); font: 12px/1.5 Inter, sans-serif; }
.ww-history-answer { margin-top: 13px; padding: 12px; border: 1px solid color-mix(in srgb, var(--ww-blue) 25%, var(--ww-border)); border-radius: 10px; background: color-mix(in srgb, var(--ww-blue) 5%, var(--ww-surface)); }
.ww-history-answer strong { color: var(--ww-navy); font-size: 11px; }
.ww-history-answer p { margin: 4px 0 0; color: var(--ww-text); font-size: 11px; line-height: 1.6; }
.ww-history-answer-sources { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--ww-border); }
.ww-history-answer-sources ul { margin: 4px 0 0; padding-left: 17px; color: var(--ww-muted); font-size: 9.5px; line-height: 1.45; }
.ww-history-assistant-boundary { padding-top: 10px; border-top: 1px solid var(--ww-border); font-size: 9.5px !important; }
.ww-history-details { margin-top: 16px; }
.ww-history-details > summary { min-height: 52px; padding: 16px 18px; color: var(--ww-navy); font-size: 12px; font-weight: 800; cursor: pointer; }
.ww-history-details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 18px 18px; }
.ww-history-details-grid > div { min-width: 0; padding: 13px; border: 1px solid var(--ww-border); border-radius: 10px; background: var(--ww-surface-soft); }
.ww-history-details dl { margin: 0; }
.ww-history-details dl div { padding: 7px 0; border-bottom: 1px solid var(--ww-border); }
.ww-history-details dt { color: var(--ww-muted); font-size: 9px; text-transform: uppercase; }
.ww-history-details dd { margin: 2px 0 0; color: var(--ww-text); font-size: 10px; overflow-wrap: anywhere; }
.ww-history-details ul { margin: 0; padding-left: 18px; color: var(--ww-muted); font-size: 10px; line-height: 1.55; }
.ww-history-map { min-height: 180px; overflow: hidden; border-radius: 9px; background: linear-gradient(135deg, #dce9ee, #c5dce5); }
.ww-history-details a { color: var(--ww-blue); font-size: 10px; font-weight: 700; }
.ww-history-demo button:focus-visible, .ww-history-demo input:focus-visible, .ww-history-demo textarea:focus-visible, .ww-history-demo summary:focus-visible, .ww-history-demo a:focus-visible { outline: 3px solid color-mix(in srgb, var(--ww-cyan) 70%, transparent); outline-offset: 2px; }
@media (max-width: 980px) { .ww-history-layout { grid-template-columns: minmax(0, 1fr); } .ww-history-assistant { position: static; } .ww-history-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ww-history-head { grid-template-columns: minmax(0, 1fr); padding: 17px; } .ww-history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ww-history-panel-head { flex-direction: column; } .ww-history-details-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 430px) { .ww-history-controls, .ww-history-controls label, .ww-history-controls input, .ww-history-controls fieldset { width: 100%; } .ww-history-controls button { flex: 1; min-height: 44px; } .ww-history-summary { grid-template-columns: minmax(0, 1fr); } .ww-history-panel, .ww-history-assistant { padding: 14px; } .ww-history-chart { min-width: 100%; } }
html[data-theme="dark"] .ww-history-mode, html[data-theme="dark"] .ww-history-assistant-status { color: var(--ww-warning); }
