:root{color-scheme:light;--ink:#17243a;--muted:#52627a;--navy:#172c49;--blue:#31547c;--line:#dce4ef;--surface:#fff;--bg:#f5f7fb;--shadow:0 10px 32px rgba(23,44,73,.07)}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--ink);font:16px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
header{background:var(--navy);color:white}
nav{max-width:1380px;margin:auto;display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;padding:.9rem clamp(1rem,3vw,2.5rem)}
nav a{color:#eaf2ff;text-decoration:none;padding:.65rem .9rem;border-radius:9px;font-weight:550}
nav a:hover,nav a[aria-current=page]{background:#31547c}
nav a:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,button:focus-visible{outline:3px solid #6db9ff;outline-offset:3px}
main{max-width:1380px;margin:0 auto;padding:clamp(1.5rem,3vw,3rem) clamp(1rem,3vw,2.5rem) 4rem}
h1{font-size:clamp(1.85rem,3vw,2.8rem);line-height:1.2;letter-spacing:-.035em;margin:0 0 1rem}
h2{font-size:clamp(1.15rem,1.6vw,1.45rem);line-height:1.3;margin:0 0 1.1rem}
p{margin:.55rem 0 1.2rem}
#view{min-width:0}
#view:has(#track-form),#view:has(#prediction-form),#view:has(#yasso-form){display:grid;grid-template-columns:minmax(310px,.82fr) minmax(0,1.18fr);gap:clamp(1.25rem,2vw,2rem);align-items:start}
#view:has(#track-form)>h1,#view:has(#prediction-form)>h1,#view:has(#yasso-form)>h1{grid-column:1/-1;margin-bottom:0}
#view:has(#prediction-form)>p,#view:has(#yasso-form)>p,#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"]{grid-column:1/-1;max-width:1000px}
#view:has(#prediction-form)>p,#view:has(#yasso-form)>p{margin:0}
.panel,#track-results,#prediction-results,#results,.methods-attribution,#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"]{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:clamp(1.2rem,2.1vw,2rem);box-shadow:var(--shadow);min-width:0}
.panel{max-width:none}
#track-results,#prediction-results,#results{grid-column:2;grid-row:auto}
.methods-attribution{grid-column:1/-1}
#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"]{max-width:none}
#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"] p{max-width:85ch}
#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"] h2:not(:first-child){margin-top:1.5rem}
.inputs{display:flex;align-items:end;gap:clamp(.35rem,1vw,.8rem);max-width:100%}
.inputs label{display:grid;gap:.35rem;min-width:0;font-weight:650}
.inputs input{width:clamp(4.25rem,6.8vw,6.3rem);max-width:100%;font:inherit;font-variant-numeric:tabular-nums;padding:.65rem .5rem;text-align:center;border:1px solid #8795aa;border-radius:9px;background:white}
.inputs span{padding-bottom:.6rem;font-weight:700}
.field{display:grid;gap:.4rem;font-weight:650;margin-bottom:1.4rem}
.field select{font:inherit;width:100%;max-width:100%;padding:.7rem;border:1px solid #8795aa;border-radius:9px;background:white}
.note{color:var(--muted);font-size:.91rem;max-width:75ch}
table{border-collapse:collapse;width:100%;background:white}
th,td{border-bottom:1px solid var(--line);padding:.85rem 1rem;text-align:center}
th{background:#edf3fa;font-weight:650}
thead th:first-child{border-radius:8px 0 0 0}
thead th:last-child{border-radius:0 8px 0 0}
tbody th{background:white;text-align:left}
td{font-size:1.12rem;font-variant-numeric:tabular-nums;font-weight:600}
.table-scroll{max-width:100%;overflow-x:auto}
.table-scroll table{min-width:430px}
.table-scroll th,.table-scroll td{white-space:nowrap}
#track-results table{max-width:none}
#track-results>p:first-of-type{display:flex;flex-wrap:wrap;gap:.6rem 1.2rem;align-items:center;font-size:1.1rem}
#track-results>p:first-of-type span{font-weight:750;font-variant-numeric:tabular-nums;color:var(--blue)}
#results>table td{font-size:clamp(1.2rem,2.2vw,1.7rem);color:var(--blue)}
#results h2:not(:first-child){margin-top:2rem}
#results .table-scroll td{font-size:1rem}
#prediction-results td{font-size:1.08rem}
#prediction-results th,#prediction-results td{padding:.8rem .65rem}
#prediction-results>p:first-of-type strong{font-size:1.5rem;color:var(--blue);font-variant-numeric:tabular-nums}
#prediction-form input[type="range"]{width:100%;accent-color:var(--blue);cursor:pointer}
#prediction-form .field[for="riegel-exponent"]{margin-top:1.5rem;margin-bottom:.35rem}
.slider-labels{display:flex;justify-content:space-between;gap:1rem;font-size:.8rem;color:var(--muted)}
#reset-exponent{margin-top:1rem;padding:.7rem .9rem;border:1px solid #8795aa;background:white;border-radius:9px;cursor:pointer;font:inherit}
#error,#track-error,#prediction-error{color:#a12020}
#error:empty,#track-error:empty,#prediction-error:empty{display:none}
[hidden]{display:none!important}
.page-intro{margin:clamp(1rem,3vw,2.5rem) 0 clamp(1.5rem,3vw,3rem)}
.page-intro h1{font-size:clamp(2.2rem,4vw,3.8rem)}
.page-intro>p:last-child{font-size:1.15rem;color:var(--muted);max-width:60ch}
.eyebrow{font-size:.82rem;font-weight:800;letter-spacing:.13em;color:var(--blue)}
.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.3rem}
.tool-card{display:flex;flex-direction:column;min-height:280px;padding:clamp(1.4rem,2.4vw,2rem);border:1px solid var(--line);border-radius:16px;background:white;box-shadow:var(--shadow);color:inherit;text-decoration:none;transition:transform .15s ease,box-shadow .15s ease}
.tool-card:hover{transform:translateY(-3px);box-shadow:0 15px 34px rgba(23,44,73,.12)}
.tool-card h2{margin:.9rem 0 .3rem}
.tool-card p{color:var(--muted)}
.tool-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;background:#e8f0fa;color:var(--blue);font-size:1.7rem}
.tool-link{margin-top:auto;color:var(--blue);font-weight:750}
@media(max-width:950px){
  #view:has(#track-form),#view:has(#prediction-form),#view:has(#yasso-form){grid-template-columns:minmax(0,1fr)}
  #view:has(#track-form)>h1,#view:has(#prediction-form)>h1,#view:has(#yasso-form)>h1,#view:has(#prediction-form)>p,#view:has(#yasso-form)>p,#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"],#track-results,#prediction-results,#results,.methods-attribution{grid-column:1}
  .tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  nav{gap:.15rem;padding:.55rem .75rem}
  nav a{font-size:.88rem;padding:.5rem .55rem}
  main{padding:1.4rem .85rem 3rem}
  .panel,#track-results,#prediction-results,#results,.methods-attribution,#view:has(#yasso-form)>section[aria-labelledby="yasso-purpose"]{padding:1.1rem;border-radius:12px}
  .tool-grid{grid-template-columns:1fr}
  .tool-card{min-height:220px}
  .inputs input{width:clamp(4.1rem,19vw,5.5rem)}
  th,td{padding:.65rem .55rem}
  .slider-labels{font-size:.72rem}
  #track-results>p:first-of-type{display:block}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.tool-card{transition:none}.tool-card:hover{transform:none}}


/* Home uses two equal-width destination cards; the tools directory uses three. */
.home-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:600px){.home-grid{grid-template-columns:1fr}}
