/* lmprices. Every color is a custom property with a light and a dark value (light-dark());
   data-theme on <html> pins one, otherwise the page follows prefers-color-scheme. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#fcfcfb, #1a1a19);
  --raised: light-dark(#f3f3f1, #232322);
  --line: light-dark(#e4e3df, #353533);
  --text: light-dark(#0b0b0b, #f0efec);
  --muted: light-dark(#52514e, #c3c2b7);
  --faint: light-dark(#6b6a66, #9a998f);
  --accent: light-dark(#2a78d6, #3987e5);
  --link: light-dark(#1d66c2, #5a9cf0);
  --cut: light-dark(#007a00, #3cab3c);
  --rise: light-dark(#c93837, #e66767);
  --c-in: var(--accent);
  --c-out: light-dark(#eb6834, #d95926);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; z-index: 9; background: var(--bg); padding: .3rem .6rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: .25rem 1.25rem; flex-wrap: wrap; padding-block: .6rem; }
/* Monospace so the lowercase l can't be read as a capital I. */
.wordmark { font: 700 1rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .1rem .9rem; flex: 1; font-size: .9rem; }
.site-header nav a { color: var(--muted); text-decoration: none; padding-block: .35rem; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--text); }
.site-header nav a[aria-current] { box-shadow: inset 0 -2px var(--accent); }
.theme-toggle { margin-left: auto; display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.theme-toggle:hover { color: var(--text); }

main { flex: 1; padding-bottom: 3rem; }
.crumbs { font-size: .82rem; color: var(--faint); margin-top: 1rem; }
.crumbs a { color: var(--faint); }
h1 { font-size: 1.65rem; line-height: 1.2; letter-spacing: -.015em; margin: 1.1rem 0 .5rem; text-wrap: balance; }
h1 small { display: block; font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--faint); margin-bottom: .2rem; }
h2 { font-size: 1.15rem; margin: 2.2rem 0 .6rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
p { margin: 0 0 .8rem; max-width: 46rem; }
.lede { color: var(--muted); font-size: 1.02rem; }
.meta, .note { color: var(--faint); font-size: .85rem; }
.note { max-width: 46rem; }
code { font: .85em var(--mono); background: var(--raised); padding: .05em .3em; border-radius: 3px; }
.cols { display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

/* Tables scroll inside their wrapper on narrow screens, with the first column pinned. */
.tw { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .86rem; }
th, td { padding: .42rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; white-space: nowrap; }
th { font-weight: 600; font-size: .78rem; color: var(--muted); background: var(--bg); }
thead th { border-bottom-color: var(--muted); vertical-align: bottom; }
th:first-child, td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); padding-left: 0;
  white-space: normal; min-width: 8.5rem; max-width: 14rem; }
tbody th { font-weight: 400; font-size: inherit; color: var(--text); }
tbody tr:hover > * { background: var(--raised); }
td a:not(.p):not(.fn) { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: .76rem; color: var(--faint); }
/* Keeps a note link 24px-target-spaced from the model link above it (WCAG 2.2 target size). */
td .note { margin-top: 2px; }
tr.group th { padding-top: 1rem; color: var(--text); font-size: .82rem; border-bottom-color: var(--line); }
.p { color: inherit; text-decoration-color: var(--line); }
.p:hover { color: var(--link); text-decoration-color: currentColor; }
.ttl { color: var(--faint); font-size: .72rem; font-weight: 400; }
.stale, .stale .p { color: var(--faint); }
.na { color: var(--faint); cursor: help; }
.arrow { margin-right: .3rem; color: var(--faint); }

.cut { color: var(--cut); }
.rise { color: var(--rise); }
.mixed { color: var(--muted); }
.chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.5; padding: 0 .4rem; border-radius: 4px;
  border: 1px solid var(--line); color: var(--muted); vertical-align: .08em; white-space: nowrap; }
.badge.launch { color: var(--link); border-color: currentColor; }
.badge.restricted { cursor: help; }
.badge.sched { color: var(--text); border-color: var(--muted); }
.status-retired, .status-deprecated { color: var(--faint); }

/* Home */
.providers { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 1.2rem 0 0; padding: 0; list-style: none; }
.providers a { display: block; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); }
.providers a:hover { border-color: var(--accent); }
.providers b { display: block; }
.providers span { font-size: .82rem; color: var(--faint); }

/* Model page */
.status-line { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); font-size: .88rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: .3rem 1rem .9rem; margin: 1rem 0; }
.card h2 { margin-top: .8rem; }
.card table, .event table { font-size: .9rem; max-width: 36rem; }
.card th:first-child, .card td:first-child { min-width: 11rem; }
.upcoming { border-color: var(--muted); }
.figure { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: .4rem 0 .8rem; padding: 0; }
.figure div { font-size: .8rem; color: var(--faint); }
.figure dd { margin: 0; font-size: 1.35rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); margin: .4rem 0 .2rem; }
.legend i { display: inline-block; width: 1rem; height: 2px; vertical-align: middle; margin-right: .35rem; }
.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .narrow { display: none; max-width: 30rem; }
.chart figcaption { margin-top: .3rem; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart text { fill: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart text.end { fill: var(--muted); font-weight: 600; }
.chart .s-in { stroke: var(--c-in); } .chart .f-in { fill: var(--c-in); }
.chart .s-out { stroke: var(--c-out); } .chart .f-out { fill: var(--c-out); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .mk { stroke-width: 2; }
.chart .mk.solid { stroke: var(--bg); }
.chart .mk.open { fill: var(--bg); }
.chart .lead { stroke: var(--faint); stroke-width: 1; }
.events { list-style: none; padding: 0; margin: 0; }
.event { border-top: 1px solid var(--line); padding: .9rem 0 .4rem; scroll-margin-top: 1rem; }
.event:target { background: var(--raised); box-shadow: -1rem 0 0 var(--raised), 1rem 0 0 var(--raised); }
.event h3 { margin: 0 0 .35rem; font-size: .98rem; }
.event h3 .when { font-weight: 400; color: var(--muted); }
.event table { margin-bottom: .6rem; }
.diff { margin: 0 0 .6rem; padding-left: 1.1rem; font-size: .9rem; }
.sources { font-size: .84rem; margin: .4rem 0 .6rem; padding-left: 1.1rem; }
.sources li { margin-bottom: .25rem; }
details { display: inline; }
summary { display: inline; cursor: pointer; color: var(--faint); font-size: .8rem; margin-left: .3rem; }
blockquote { margin: .3rem 0 .5rem; padding: .3rem .7rem; border-left: 2px solid var(--line); color: var(--muted); font-size: .84rem; max-width: 46rem; overflow-wrap: anywhere; }
.ids { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }

/* Changes */
.month { margin-top: 1.8rem; }

.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--faint); font-size: .82rem; padding: 1.2rem 0 1.6rem; }
.site-footer p { margin: 0 0 .4rem; }
.site-footer a { color: var(--muted); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
td.wraps { white-space: normal; min-width: 12rem; }
.ticker td.change { white-space: normal; min-width: 7rem; max-width: 22rem; }
.ticker td.change .sub { color: var(--muted); font-size: .8rem; line-height: 1.9; }

/* Fixed proportions, so the month tables on /changes line up. */
@media (min-width: 40.01rem) {
  .ticker { table-layout: fixed; }
  .ticker th:nth-child(1) { width: 21%; } .ticker th:nth-child(2) { width: 21%; } .ticker th:nth-child(3) { width: 19%; }
  .ticker td.when { white-space: normal; }
}
@media (max-width: 40rem) {
  body { font-size: 14.5px; }
  .site-header nav { order: 3; flex-basis: 100%; gap: 0 .85rem; }
  h1 { font-size: 1.4rem; }
  th, td { padding: .38rem .45rem; }
  th:first-child, td:first-child { min-width: 7.5rem; max-width: 9.5rem; }
  .models td:nth-child(2) { min-width: 5.5rem; }
  /* The ticker keeps Model, When, Change and Blended on screen; raw input and output are on the model page. */
  .ticker .io { display: none; }
  .ticker th, .ticker td { padding-inline: .35rem; }
  .ticker { font-size: .82rem; }
  .ticker th:first-child, .ticker td:first-child { min-width: 5.4rem; max-width: 6.6rem; padding-left: 0; }
  .ticker td.when { white-space: normal; min-width: 4.6rem; font-size: .76rem; }
  .ticker td.pair { white-space: normal; line-height: 1.8; } /* spaces stacked price links as tap targets */
  .ticker td.change { min-width: 4rem; }
  .badge.restricted { display: table; margin-top: .15rem; }
  .wide-only { display: none; }
  .chart .wide { display: none; }
  .chart .narrow { display: block; }
  .card { padding-inline: .7rem; }
}
@media print { .site-header nav, .theme-toggle { display: none; } }
