:root {
    font-family: Inter, system-ui, sans-serif;
    color: #ebf1ff;
    background: #101724;
    color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0, #22344e, #101724 45rem); min-height: 100vh; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 8px; padding: .75rem 1rem; font-weight: 650; cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:hover:not(:disabled) { filter: brightness(1.12); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #9cf1cc; outline-offset: 3px; }
input, select { width: 100%; min-width: 0; margin-top: .5rem; padding: .7rem; border: 1px solid #52617b; border-radius: 7px; background: #121b2b; color: white; }
label { display: block; min-width: 0; font-size: .82rem; color: #c4d1e6; }
small { color: #a9b8d2; }
main { max-width: 1160px; margin: auto; padding: 3rem 1.5rem 2rem; }
header, .title { display: flex; justify-content: space-between; gap: 1.25rem; align-items: flex-start; }
header { padding-bottom: 1rem; }
h1 { font-size: clamp(2.7rem, 6vw, 4.6rem); margin: .5rem 0 1.2rem; line-height: 1.03; letter-spacing: -.045em; font-weight: 650; }
h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.025em; }
h3 { font-size: 1.1rem; }
p { line-height: 1.55; }
.intro { color: #b8c6db; font-size: 1.04rem; }
.eyebrow { font-size: .69rem; letter-spacing: .12em; color: #83dbb0; font-weight: 700; margin: 0 0 .65rem; }
.panel, .status { margin-top: 1.25rem; padding: 1.5rem; border: 1px solid #31415d; border-radius: 14px; background: #172238ed; }
.gate { max-width: 560px; padding: 2rem; }
.gate .primary { margin-top: 1rem; }
.primary { background: #83dbb0; color: #072315; }
.quiet { background: #293b57; color: #e5edff; }
.title > button { flex-shrink: 0; }
.remove { background: #402c36; color: #ffdce2; align-self: end; }
.status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #b5c2d9; }
.status strong { display: block; color: #83dbb0; margin-bottom: .4rem; }
.status span { font-size: .85rem; }
.status.stale strong { color: #ffca79; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; margin-top: 1.4rem; }
.grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: .6rem; align-self: center; padding-top: 1rem; }
.check input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: #83dbb0; }
.hint, .panel p { color: #b6c3d9; font-size: .88rem; }
.hint { margin-bottom: 0; }
.panel .eyebrow { color: #83dbb0; font-size: .69rem; }
.empty { margin-bottom: 0; border-top: 1px dashed #3b4c67; padding-top: 1rem; }
.stock-row, .offer-row, .limit-row { display: grid; gap: .8rem; align-items: end; padding-top: 1.2rem; margin-top: 1rem; border-top: 1px solid #34435d; }
.stock-row { grid-template-columns: minmax(180px, 2fr) 1fr 1fr auto; }
.offer-row { grid-template-columns: minmax(105px, 1.1fr) .7fr minmax(160px, 1.4fr) .9fr .8fr .8fr auto; }
.limit-row { grid-template-columns: minmax(180px, 1.5fr) .7fr .7fr minmax(205px, 1.4fr) auto; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.metrics, .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1.3rem 0; }
.metrics > div, .actions article, aside { padding: 1.1rem; background: #111b2c; border-radius: 10px; }
.metrics strong { display: block; margin-top: .5rem; font-size: 1.25rem; }
.metrics small { font-size: .75rem; }
.metrics span { display: block; color: #a9b8d2; font-size: .75rem; line-height: 1.45; margin-top: .45rem; }
.actions { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.actions article { border-top: 3px solid #83dbb0; overflow-wrap: anywhere; }
.actions article.cancel { border-top-color: #f8b5a8; }
.actions article.guidance-card { border-top-color: #ffca79; }
.actions h3 { margin: .5rem 0; }
.actions p { margin: .4rem 0; }
.actions .action-label { color: #83dbb0; font-size: .77rem; font-weight: 650; }
.actions .guidance-card .action-label { color: #ffca79; }
.guidance-message { color: #d8e1f1; font-size: .86rem; }
.quote-context { display: grid; gap: .28rem; margin-top: .75rem; padding-top: .7rem; border-top: 1px solid #34435d; }
.quote-context small { line-height: 1.35; }
.badge { padding: .4rem .6rem; border-radius: 6px; background: #293b57; font-size: .75rem; white-space: nowrap; }
aside { color: #c4d0e5; font-size: .88rem; line-height: 1.65; }
aside strong { display: block; }
aside p:last-child { margin-bottom: 0; }
.offer-results { scroll-margin-top: 1rem; }
.offer-results > .title > div > p:not(.eyebrow) { margin-bottom: 0; }
.results-filters { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(130px, 1fr)); gap: .8rem; align-items: end; margin-top: 1.25rem; }
.offer-results .error { margin-top: 1rem; }
.result-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-top: 1.2rem; }
.result-sections.daily-summary { grid-template-columns: minmax(0, 1fr); }
.result-sections > article, .recent-offers { padding: 1.1rem; border-radius: 10px; background: #111b2c; }
.result-sections h3, .recent-offers h3 { margin: 0; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; text-align: left; }
th, td { padding: .65rem .5rem; border-bottom: 1px solid #34435d; white-space: nowrap; }
th { color: #a9b8d2; font-size: .69rem; letter-spacing: .06em; text-transform: uppercase; }
td:first-child { color: #e5edff; }
td.unexplained { color: #ffca79; }
.gap-note { margin-top: 1rem; padding: .8rem 1rem; border-left: 3px solid #ffca79; border-radius: 0 7px 7px 0; background: #362e24; color: #ffe5af; font-size: .88rem; }
.recent-offers { margin-top: 1.2rem; }
.offer-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin-top: 1rem; }
.offer-cards > div { padding: 1rem; border-top: 3px solid #83dbb0; border-radius: 8px; background: #172238; overflow-wrap: anywhere; }
.offer-cards h4 { margin: .45rem 0; font-size: 1rem; }
.offer-cards p { margin: .35rem 0; font-size: .85rem; }
.forecast { color: #badfcb; }
.limitations { margin-top: 1.2rem; }
.limitations ul { margin: .65rem 0 0; padding-left: 1.25rem; }
.error { padding: 1rem; border: 1px solid #8d4657; border-radius: 8px; background: #35222d; color: #ffd1da; }
.notice { color: #badfcb; font-size: .88rem; }
footer { color: #9faec7; font-size: .77rem; margin-top: 2.5rem; }
a { color: #b0e7ce; }

@media (max-width: 1000px) {
    .grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .offer-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .limit-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    main { padding: 2rem 1rem; }
    .panel { padding: 1.1rem; }
    .grid, .metrics, .stock-row, .offer-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .title { flex-wrap: wrap; }
    .wide-only { display: none; }
    .badge { white-space: normal; }
    .results-filters, .result-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) {
    header { flex-direction: column; }
    .metrics { grid-template-columns: 1fr; }
    .stock-row, .offer-row, .limit-row { grid-template-columns: 1fr; }
    .results-filters, .result-sections { grid-template-columns: 1fr; }
    .stock-row .remove, .offer-row .remove, .limit-row .remove { justify-self: start; }
    .status { align-items: flex-start; }
    .status .quiet { padding: .6rem; }
    .check { align-self: end; padding-bottom: .6rem; font-size: .75rem; }
}
