:root {
  color-scheme: light;
  --ink: #172624;
  --muted: #65706d;
  --paper: #f2f0e9;
  --panel: #fffefa;
  --line: #d9d8d0;
  --green: #0c6b55;
  --green-dark: #064a3b;
  --mint: #dcefe8;
  --buy: #2e6f95;
  --buy-soft: #dbeaf3;
  --sell: #b34b3d;
  --sell-soft: #f5e1dd;
  --idle: #6c7472;
  --idle-soft: #e7e8e4;
  --gold: #d6ad5c;
  font-family: Inter, "Avenir Next", Avenir, ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
button, input, select { font: inherit; }
button, select, input { color: inherit; }
button { cursor: pointer; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 20; background: white; padding: 10px 16px; color: var(--ink); }
.skip-link:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hero { min-height: 610px; color: #f9fbf8; background: radial-gradient(circle at 83% 22%, rgb(214 173 92 / 18%), transparent 24%), linear-gradient(125deg, #0a352c 0%, #0a4f40 52%, #063c32 100%); padding: 0 max(24px, calc((100vw - 1240px) / 2)); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 460px; height: 460px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; right: -90px; bottom: -230px; box-shadow: 0 0 0 70px rgb(255 255 255 / 3%), 0 0 0 140px rgb(255 255 255 / 2%); }
.hero-copy { max-width: 900px; padding: 82px 0 90px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 12px; color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; }
.hero .eyebrow { color: #a8d9c8; }
h1, h2, h3, p { text-wrap: pretty; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(3.25rem, 7.4vw, 6.8rem); line-height: .92; letter-spacing: -.045em; }
h1 em { color: #d5b56f; font-weight: 400; }
.lede { color: #cee0da; max-width: 700px; font-size: 1.1rem; margin: 32px 0 28px; }
.source-line { display: inline-flex; gap: 10px; align-items: center; border-top: 1px solid rgb(255 255 255 / 20%); padding-top: 18px; color: #d5e5e0; font-size: .84rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #74d4b4; box-shadow: 0 0 0 4px rgb(116 212 180 / 15%); }
.status-dot.loading { background: var(--gold); animation: pulse 1.2s infinite alternate; }
.status-dot.error { background: #ef8e7e; }
@keyframes pulse { to { opacity: .35; } }
main { max-width: 1240px; margin: -56px auto 0; padding: 0 24px 100px; position: relative; z-index: 2; }
.panel { background: var(--panel); border: 1px solid rgb(23 38 36 / 9%); border-radius: 8px; box-shadow: 0 18px 50px rgb(19 50 42 / 8%); padding: clamp(24px, 4vw, 52px); }
.section-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.section-heading.compact { align-items: start; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.02; font-weight: 400; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 1.2rem; }
.section-note { color: var(--muted); max-width: 340px; margin: 0; font-size: .86rem; text-align: right; }
.config-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1.2fr 1.2fr 1.2fr; gap: 14px; margin-top: 28px; }
.config-grid > * { min-width: 0; }
fieldset { border: 0; padding: 0; margin: 0; }
legend, .input-field > span:first-child, .locked-value > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .74rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: #e9e8e2; padding: 4px; border-radius: 4px; height: 51px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: grid; place-items: center; height: 100%; border-radius: 3px; font-weight: 750; font-size: .88rem; }
.segmented input:checked + span { background: var(--green); color: white; box-shadow: 0 2px 8px rgb(6 74 59 / 22%); }
.segmented input:focus-visible + span { outline: 3px solid #e6b34b; outline-offset: 2px; }
.locked-value { padding: 10px 12px; border-left: 1px solid var(--line); }
.locked-value > span { margin: 0; }
.locked-value strong { display: block; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; }
.locked-value small { color: var(--muted); font-size: .68rem; }
.input-field small { float: right; text-transform: none; color: var(--green); letter-spacing: 0; }
.input-field small.custom { color: var(--sell); }
.input-shell { height: 51px; display: flex; align-items: center; border: 1px solid #c7c8c0; border-radius: 4px; background: white; transition: border .2s, box-shadow .2s; }
.input-shell:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgb(12 107 85 / 13%); }
.input-shell b { color: var(--muted); padding-left: 13px; font-weight: 600; }
.input-shell input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 12px 0 7px; font-variant-numeric: tabular-nums; }
.input-shell:has(input:disabled) { background: #f0f1ed; border-color: #d8dad4; }
.input-shell input:disabled { color: #26302e; opacity: 1; cursor: not-allowed; }
.input-shell.suffix b { padding: 0 13px 0 0; }
.input-shell.suffix input { padding-left: 13px; }
.config-actions { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 16px; }
.config-actions p { color: var(--muted); max-width: 780px; font-size: .72rem; margin: 0; text-align: right; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; white-space: nowrap; }
.strategy-block { margin-top: 42px; padding-top: 36px; border-top: 1px solid var(--line); }
.strategy-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.strategy-heading p { color: var(--muted); font-size: .86rem; margin: 5px 0 0; }
.strategy-controls { display: flex; flex-direction: column; align-items: end; gap: 10px; }
.strategy-mode-field { width: 360px; }
.strategy-mode { grid-template-columns: 1fr 1fr; }
.strategy-mode span { padding: 0 13px; white-space: nowrap; }
.action-legend { display: flex; gap: 8px; }
.action-legend span { padding: 5px 9px; border-radius: 3px; font-size: .72rem; font-weight: 700; }
.action-legend .buy { color: var(--buy); background: var(--buy-soft); }
.action-legend .idle { color: var(--idle); background: var(--idle-soft); }
.action-legend .sell { color: var(--sell); background: var(--sell-soft); }
.strategy-scroll { overflow-x: auto; margin: 20px -4px 0; padding: 4px 4px 12px; }
.strategy-grid { display: grid; grid-template-columns: repeat(24, minmax(64px, 1fr)); min-width: 1536px; gap: 6px; }
.hour-control { min-width: 0; margin: 0; padding: 0; border: 0; }
.hour-control legend { width: 100%; margin-bottom: 7px; padding: 0; color: var(--muted); font-size: .67rem; text-align: center; font-variant-numeric: tabular-nums; }
.hour-actions { display: grid; gap: 4px; }
.hour-action { position: relative; display: block; cursor: pointer; }
.hour-action input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hour-action span { display: flex; min-height: 32px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--muted); font-size: .67rem; font-weight: 750; transition: border-color .15s, background .15s, color .15s, box-shadow .15s; }
.hour-action:hover span { border-color: #aeb3ad; }
.hour-action.buy input:checked + span { border-color: var(--buy-soft); background: var(--buy-soft); color: var(--buy); }
.hour-action.idle input:checked + span { border-color: var(--idle-soft); background: var(--idle-soft); color: var(--idle); }
.hour-action.sell input:checked + span { border-color: var(--sell-soft); background: var(--sell-soft); color: var(--sell); }
.hour-action input:focus-visible + span { outline: 3px solid #e0a528; outline-offset: 2px; }
.rule-feedback { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); gap: 24px; align-items: center; margin-top: 18px; }
.feedback-title { margin: 0 0 7px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.soc-preview { height: 92px; }
.soc-preview svg { width: 100%; height: 100%; display: block; }
.validation-message { padding: 14px 16px; border-left: 3px solid var(--green); background: var(--mint); color: var(--green-dark); font-size: .82rem; }
.validation-message.invalid { border-color: var(--sell); background: var(--sell-soft); color: #7d3127; }
.validation-message ul { margin: 5px 0 0; padding-left: 18px; }
.perfect-strategy { margin-top: 22px; padding: 28px; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.4fr); gap: 28px; align-items: start; background: linear-gradient(120deg, #eff5f0, #f7f4eb); border: 1px solid #d8e1da; }
.perfect-strategy h3 { font-family: Georgia, serif; font-size: 1.65rem; font-weight: 400; }
.perfect-strategy p:not(.eyebrow) { color: var(--muted); font-size: .82rem; margin: 10px 0 0; }
.perfect-strategy > .validation-message { grid-column: 1 / -1; margin-top: -6px; }
.constraint-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.constraint-list li { min-width: 0; padding: 13px; background: var(--panel); }
.constraint-list li:last-child { grid-column: 1 / -1; }
.constraint-list strong, .constraint-list span { display: block; }
.constraint-list strong { color: var(--green-dark); font-family: Georgia, serif; font-size: 1.1rem; font-weight: 400; }
.constraint-list span { color: var(--muted); font-size: .66rem; }
.calculate-row { margin: 38px -52px -52px; padding: 24px 52px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #e9eee9; border-radius: 0 0 8px 8px; }
.formula-note { color: var(--muted); font-size: .77rem; margin: 0; max-width: 650px; }
.input-error { color: var(--sell); margin: 4px 0 0; font-size: .76rem; }
.primary-button { border: 0; border-radius: 3px; color: white; background: var(--green); font-weight: 800; padding: 16px 22px; min-width: 270px; text-align: left; display: flex; justify-content: space-between; gap: 20px; box-shadow: 0 6px 18px rgb(12 107 85 / 18%); }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { cursor: not-allowed; color: #909794; background: #d2d5d1; box-shadow: none; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #d99e26; outline-offset: 3px; }
.plain-error { margin-top: 20px; padding: 18px; background: #f8e4df; border: 1px solid #e2a99d; color: #752f26; }
.results-intro { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 100px 4px 28px; }
.results-intro > div:first-child p:last-child { color: var(--muted); }
.hash-card { background: #e5e3da; padding: 14px 16px; max-width: 420px; }
.hash-card span { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.hash-card code { display: block; margin-top: 5px; font-size: .7rem; overflow-wrap: anywhere; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #cad0ca; border: 1px solid #cad0ca; margin-bottom: 24px; }
.kpi { background: var(--panel); padding: 23px 22px; min-height: 132px; }
.kpi span { display: block; min-height: 34px; color: var(--muted); text-transform: uppercase; font-size: .67rem; letter-spacing: .07em; font-weight: 750; }
.kpi strong { display: block; font-family: Georgia, serif; font-size: clamp(1.35rem, 2.4vw, 2rem); font-weight: 400; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .7rem; }
.kpi.positive strong { color: var(--green); }
.kpi.negative strong { color: var(--sell); }
.result-panel { margin-top: 24px; }
.result-panel .section-heading { margin-bottom: 28px; }
.chart-frame { width: 100%; overflow-x: auto; }
.chart-frame svg { display: block; width: 100%; min-width: 720px; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 6px 0 14px; color: var(--muted); font-size: .72rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.legend i.bar-key { width: 7px; height: 14px; border-radius: 2px; vertical-align: -3px; }
details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
summary { color: var(--green); font-size: .82rem; font-weight: 750; cursor: pointer; }
.table-wrap { width: 100%; overflow: auto; max-height: 560px; margin-top: 14px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .72rem; font-variant-numeric: tabular-nums; background: white; }
th { position: sticky; top: 0; z-index: 1; background: #e9eee9; color: #44524e; text-align: left; font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e4e3dc; white-space: nowrap; }
tbody tr:hover { background: #f7f7f2; }
td.positive { color: var(--green); }
td.negative { color: var(--sell); }
.calendar-stack { display: grid; gap: 30px; }
.calendar-stack > *, .heatmap-pair > *, .chart-stack > *, .day-chart-grid > * { min-width: 0; }
.calendar-year { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.calendar-year:last-child { border: 0; padding-bottom: 0; }
.calendar-year h3 { margin-bottom: 14px; font-family: Georgia, serif; font-weight: 400; font-size: 1.45rem; }
.heatmap-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.heatmap-title { color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.heatmap { overflow-x: auto; }
.heatmap svg { min-width: 520px; width: 100%; display: block; }
.heatmap rect { cursor: pointer; stroke: rgb(23 38 36 / 10%); stroke-width: .5; }
.heatmap rect:focus { outline: none; stroke: #d99e26; stroke-width: 3; }
.chart-stack { display: grid; gap: 28px; }
.chart-stack h3 { font-family: Georgia, serif; font-weight: 400; margin-bottom: 8px; }
.explorer { margin-top: 24px; border-top: 5px solid var(--green); }
.date-navigation { display: flex; align-items: center; gap: 7px; }
.date-navigation button { width: 40px; height: 40px; border: 1px solid var(--line); background: white; }
.date-navigation input { height: 40px; border: 1px solid var(--line); padding: 0 10px; background: white; }
.date-navigation button:disabled { opacity: .35; cursor: not-allowed; }
.day-reconciliation { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 0 0 28px; }
.day-stat { background: white; padding: 14px; }
.day-stat span { display: block; color: var(--muted); font-size: .62rem; text-transform: uppercase; min-height: 30px; }
.day-stat strong { font-family: Georgia, serif; font-weight: 400; font-size: 1.1rem; }
.day-chart-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.day-chart-grid h3 { font-family: Georgia, serif; font-weight: 400; }
.day-chart-grid .chart-frame { overflow-x: hidden; }
.day-chart-grid .chart-frame svg { min-width: 0; }
.downloads { margin-top: 24px; padding: 48px; color: white; background: var(--green-dark); display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; border-radius: 8px; }
.downloads .eyebrow { color: #96cfbb; }
.downloads h2 { max-width: 420px; }
.downloads p { color: #bad7cd; font-size: .86rem; }
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: center; }
.download-button { border: 1px solid rgb(255 255 255 / 25%); color: white; background: rgb(255 255 255 / 6%); text-align: left; padding: 13px; font-size: .75rem; font-weight: 750; text-decoration: none; }
.download-button:first-child { grid-column: 1 / -1; color: #113a31; background: #d6b56e; border-color: #d6b56e; }
.download-button:hover { background: rgb(255 255 255 / 13%); }
.download-button:first-child:hover { background: #e2c686; }
@media (max-width: 980px) {
  .config-grid { grid-template-columns: repeat(3, 1fr); }
  .duration-field { grid-column: span 1; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .heatmap-pair, .day-chart-grid, .downloads { grid-template-columns: 1fr; }
  .day-reconciliation { grid-template-columns: repeat(3, 1fr); }
  .perfect-strategy { grid-template-columns: 1fr; }
  .perfect-strategy > .validation-message { grid-column: auto; }
}
@media (max-width: 680px) {
  .hero { min-height: 520px; }
  .hero-copy { padding: 62px 0 76px; }
  h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  main { padding: 0 12px 70px; margin-top: -36px; }
  .panel { padding: 24px 18px; }
  .section-heading, .strategy-heading, .results-intro, .config-actions { display: block; }
  .section-note, .config-actions p { text-align: left; margin-top: 10px; }
  .config-grid { grid-template-columns: 1fr 1fr; }
  .duration-field { grid-column: 1 / -1; }
  .input-field { grid-column: 1 / -1; }
  .locked-value { border-left: 0; padding-left: 0; }
  .action-legend { margin-top: 14px; }
  .strategy-controls { align-items: stretch; margin-top: 16px; }
  .strategy-mode-field { width: 100%; }
  .strategy-mode span { padding: 0 6px; font-size: .76rem; }
  .perfect-strategy { padding: 20px 16px; }
  .constraint-list { grid-template-columns: 1fr 1fr; }
  .rule-feedback { grid-template-columns: 1fr; }
  .calculate-row { margin: 32px -18px -24px; padding: 20px 18px; display: block; }
  .primary-button { width: 100%; margin-top: 15px; min-width: 0; }
  .results-intro { padding-top: 72px; }
  .hash-card { margin-top: 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 16px 13px; min-height: 116px; }
  .kpi strong { font-size: 1.25rem; }
  .date-navigation { margin-top: 16px; }
  .day-reconciliation { grid-template-columns: 1fr 1fr; }
  .downloads { padding: 28px 20px; gap: 25px; }
  .download-grid { grid-template-columns: 1fr; }
  .download-button:first-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Minimal application theme */
:root {
  --ink: #1f2523;
  --muted: #68706d;
  --paper: #f7f8f7;
  --panel: #ffffff;
  --line: #dfe3e1;
  --green: #176b57;
  --green-dark: #125443;
  --mint: #edf6f2;
}
body { background: var(--paper); }
.hero {
  min-height: 0;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  color: var(--ink);
  background: white;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.hero::after { display: none; }
.hero-copy { max-width: 820px; padding: 48px 0 44px; }
.hero .eyebrow, .eyebrow { color: var(--muted); letter-spacing: .08em; font-size: .67rem; }
h1, h2, .perfect-strategy h3, .calendar-year h3, .chart-stack h3, .day-chart-grid h3 { font-family: inherit; }
h1 { max-width: 760px; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 650; }
h1 em { color: inherit; font-style: normal; font-weight: inherit; }
.lede { max-width: 720px; margin: 20px 0; color: var(--muted); font-size: 1rem; }
.source-line { padding-top: 14px; border-color: var(--line); color: var(--muted); font-size: .78rem; }
.status-dot { width: 7px; height: 7px; box-shadow: none; background: var(--green); }
main { max-width: 1180px; margin: 0 auto; padding: 32px 24px 72px; }
.panel { padding: 32px; border: 1px solid var(--line); border-radius: 4px; box-shadow: none; }
.section-heading { align-items: start; padding-bottom: 22px; }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
h3 { font-size: 1.05rem; }
.config-grid { margin-top: 24px; }
.segmented { border: 1px solid var(--line); background: #f2f4f3; }
.segmented input:checked + span { background: white; color: var(--ink); box-shadow: none; outline: 1px solid #aeb8b4; }
.locked-value strong, .kpi strong, .day-stat strong, .constraint-list strong { font-family: inherit; font-weight: 650; }
.locked-value { padding: 8px 12px; }
.input-shell { border-color: var(--line); box-shadow: none; }
.input-shell:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px rgb(23 107 87 / 10%); }
.strategy-block { margin-top: 32px; padding-top: 28px; }
.strategy-scroll { margin-top: 16px; }
.action-legend span { border: 1px solid var(--line); background: white !important; }
.hour-action span { transition: none; }
.hour-action.buy input:checked + span { border-color: #86b7d0; }
.hour-action.idle input:checked + span { border-color: #aeb5b2; }
.hour-action.sell input:checked + span { border-color: #d4a29a; }
.validation-message { border: 1px solid #cfe2da; border-left-width: 3px; background: #f7fbf9; }
.validation-message.invalid { border-color: #e5c4bd; background: #fff9f8; }
.perfect-strategy { padding: 22px; background: #fafbfa; border-color: var(--line); }
.perfect-strategy h3 { font-size: 1.2rem; font-weight: 650; }
.constraint-list strong { color: var(--ink); font-size: 1rem; }
.calculate-row { margin: 28px -32px -32px; padding: 20px 32px; border-top: 1px solid var(--line); border-radius: 0; background: #f7f8f7; }
.primary-button { min-width: 245px; padding: 13px 18px; border-radius: 3px; box-shadow: none; }
.results-intro { padding: 64px 0 22px; }
.hash-card { padding: 11px 13px; border: 1px solid var(--line); background: white; }
.kpi-grid { gap: 12px; border: 0; background: transparent; }
.kpi { min-height: 112px; padding: 18px; border: 1px solid var(--line); }
.kpi strong { font-size: clamp(1.25rem, 2vw, 1.65rem); }
.result-panel { margin-top: 16px; }
.result-panel .section-heading { margin-bottom: 22px; }
.yearly-profit-block { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.yearly-profit-block > h3 { font-size: 1.05rem; }
.yearly-profit-block > p { margin: 5px 0 16px; color: var(--muted); font-size: .78rem; }
.extrapolation-controls { margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); background: #fafbfa; }
.extrapolation-toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .84rem; }
.extrapolation-toggle input { width: 16px; height: 16px; accent-color: var(--green); }
.extrapolation-inputs { display: grid; grid-template-columns: 130px minmax(240px, 310px) minmax(220px, 280px) minmax(190px, 240px); gap: 12px; margin-top: 14px; }
.extrapolation-inputs > label > span:first-child { display: block; margin-bottom: 6px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.extrapolation-inputs > label > input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 3px; background: white; }
.extrapolation-inputs .input-shell { height: 42px; }
.projection-method-field legend { margin-bottom: 6px; font-size: .7rem; text-transform: none; letter-spacing: 0; }
.projection-method-field .segmented { height: 42px; }
.projection-method-field .segmented span { padding: 0 8px; font-size: .72rem; }
.extrapolation-inputs input:disabled { color: #9aa19e; background: #f1f2f1; cursor: not-allowed; }
.extrapolation-controls > p:not(.input-error) { max-width: 780px; margin: 12px 0 0; color: var(--muted); font-size: .72rem; }
.projection-formula { margin: 18px 0 0; color: var(--muted); font-size: .76rem; }
.profit-view-controls { display: grid; grid-template-columns: repeat(2, minmax(220px, 290px)); gap: 12px; margin-top: 14px; }
.profit-view-controls legend { margin-bottom: 6px; font-size: .67rem; }
.profit-view-controls .segmented { height: 42px; }
.profit-view-controls .profit-interval { grid-template-columns: repeat(3, 1fr); }
.profit-view-controls .segmented span { font-size: .76rem; }
.legend .break-even-key { width: 12px; height: 2px; border-radius: 0; background: #b45309; border-top: 1px dashed #b45309; }
.break-even-note { margin: 8px 0 0; color: #7c3f0c; font-size: .76rem; font-weight: 650; }
.explorer { border-top: 1px solid var(--line); }
.downloads { padding: 32px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 4px; gap: 32px; }
.downloads .eyebrow, .downloads p { color: var(--muted); }
.downloads h2 { max-width: 480px; }
.download-button, .download-button:first-child { border: 1px solid var(--line); color: var(--ink); background: #f7f8f7; }
.download-button:hover, .download-button:first-child:hover { background: #eef1ef; }

/* Configuration controls use a roomy, aligned card grid. */
.config-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; align-items: start; }
.duration-field legend,
.input-field > span:first-child { min-height: 36px; margin-bottom: 8px; }
.input-field > span:first-child { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; line-height: 1.35; }
.input-field small { float: none; flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: #e7f1ed; font-size: .62rem; line-height: 1; white-space: nowrap; }
.input-field small.custom { background: #f5e9e6; }
.config-grid .segmented,
.config-grid .input-shell { height: 56px; }
.config-grid .input-shell input { min-width: 0; font-size: 1rem; }
.config-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duration-field { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .hero { min-height: 0; }
  .hero-copy { padding: 34px 0; }
  h1 { font-size: 2.35rem; }
  main { margin: 0; padding: 20px 12px 56px; }
  .panel { padding: 22px 16px; }
  .calculate-row { margin: 26px -16px -22px; padding: 18px 16px; }
  .results-intro { padding-top: 48px; }
  .downloads { padding: 22px 16px; }
  .extrapolation-inputs { grid-template-columns: 1fr; }
  .profit-view-controls { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: 1fr; gap: 16px; }
  .duration-field, .input-field { grid-column: auto; }
  .duration-field legend, .input-field > span:first-child { min-height: 0; }
}

.date-navigation{flex-wrap:wrap}.date-navigation label{display:grid;gap:6px}.date-navigation select{max-width:300px;padding:10px;font:inherit}#day-market-summary{line-height:1.6}

#market-field { margin: 1rem 0; }
#market-input { display:block; width:100%; max-width:30rem; padding:.75rem; margin:.5rem 0; font:inherit; }

.chart-scenario { max-width: 460px; margin: 16px 0; }
