:root {
  color-scheme: light;
  --ink: #20232c;
  --muted: #626b7a;
  --soft: #525f6e;
  --line: #dfe3e9;
  --paper: #f4f5f7;
  --white: #fff;
  --night: #171b25;
  --night-soft: #252b38;
  --red: #c73538;
  --red-dark: #b62f33;
  --red-soft: #fff0ee;
  --green: #14785b;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.topbar { min-height: 66px; padding: env(safe-area-inset-top) max(18px, 5vw, env(safe-area-inset-right)) 0 max(18px, 5vw, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #303747; background: var(--night); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 19px; font-weight: 760; letter-spacing: -.035em; }
.brand svg { width: 31px; height: 31px; fill: none; stroke: #f06a60; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.brand span span { color: #f06a60; font-weight: 510; }
.topbar-right { display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); }
.source-chip { display: inline-flex; align-items: center; gap: 8px; color: #ffd7d1; background: #38272e; border-radius: 99px; padding: 7px 11px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.sample-mark { width: 7px; height: 7px; border-radius: 50%; background: #ff806f; }
.repo-link { color: #d7dce5; text-decoration: none; font-size: 13px; font-weight: 650; }
.repo-link:hover { color: #fff; }
main { width: min(1220px, calc(100% - 36px)); margin: 0 auto; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 42px 0 28px; }
.intro-copy { max-width: 740px; }
h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); line-height: 1.03; letter-spacing: -.04em; font-weight: 770; color: #222733; }
h1 span { color: var(--red); }
.lede { max-width: 64ch; margin: 15px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.primary-button, .button { border: 1px solid transparent; border-radius: 9px; min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 690; text-decoration: none; cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.primary-button { background: var(--red); color: #fff; white-space: nowrap; }
.primary-button:hover, .button-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.workbench { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); align-items: stretch; gap: 16px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: clamp(17px, 2.1vw, 25px); min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.025em; }
.format-pill { padding: 6px 9px; background: #f0f1f4; color: var(--muted); border-radius: 99px; font-size: 10px; white-space: nowrap; }
.panel-description { min-height: 38px; max-width: 65ch; margin: 11px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.input-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.button { min-height: 34px; padding: 0 10px; border-radius: 7px; font-size: 11px; }
.button-secondary { border-color: var(--line); background: #fff; color: #343c4b; }
.button-secondary:hover { border-color: #adb5c2; background: #f7f8fa; }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover { background: #f0f1f4; color: var(--ink); }
.button-primary { background: var(--red); color: #fff; }
textarea { display: block; width: 100%; min-height: 335px; resize: vertical; border: 1px solid #cfd4dd; border-radius: 9px; background: #fafbfc; color: #363e4c; padding: 13px; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
textarea:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #f39b8c; outline-offset: 2px; }
.editor-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--soft); font-size: 10px; line-height: 1.4; }
.editor-footer span:last-child { white-space: nowrap; }
.asof-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 13px; color: #404958; font-size: 11px; }
.asof-row label { font-weight: 680; }
.asof-row input { width: 142px; padding: 6px 8px; border: 1px solid #cfd4dd; border-radius: 6px; color: #303847; background: #fff; font-size: 11px; }
.asof-row span { color: var(--soft); }
.error-message { margin: 11px 0 0; color: #af3033; font-size: 12px; line-height: 1.45; }
.computed-chip { display: inline-flex; align-items: center; gap: 7px; color: #176447; background: #e7f4ed; border-radius: 99px; padding: 6px 10px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
.summary { border: 1px solid #e1e4e9; border-radius: 9px; padding: 12px; min-height: 88px; }
.summary-label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 660; }
.summary-value { margin: 8px 0 2px; color: var(--ink); font-size: clamp(20px, 2.6vw, 29px); line-height: 1; letter-spacing: -.04em; font-weight: 760; overflow-wrap: anywhere; }
.summary-value.red { color: var(--red-dark); }
.summary-value.unavailable { font-size: 14px; letter-spacing: 0; color: var(--soft); }
.summary-detail { color: var(--soft); font-size: 9px; line-height: 1.35; }
.findings-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid #e8e9ed; }
.findings-head h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.findings-head span { display: inline-block; margin-top: 4px; color: var(--soft); font-size: 10px; }
.result-actions { display: flex; gap: 6px; }
.findings { display: grid; gap: 7px; margin-top: 11px; max-height: 290px; overflow: auto; padding-right: 2px; }
.finding { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 11px; border: 1px solid #e4e6eb; border-radius: 8px; }
.finding-main { min-width: 0; }
.finding-title { margin: 0; color: #282e39; font-size: 11px; font-weight: 690; overflow-wrap: anywhere; }
.finding-meta { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.finding-type { display: inline-block; margin-right: 5px; padding: 3px 6px; border-radius: 99px; background: var(--red-soft); color: #973332; font-size: 9px; font-weight: 680; }
.finding-savings { color: #176447; font-size: 11px; font-weight: 750; white-space: nowrap; }
.finding-advice { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.4; }
.empty-findings { margin: 0; padding: 18px 10px; border: 1px dashed #cfd4dd; border-radius: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.toast { min-height: 16px; margin: 8px 0 0; color: var(--green); font-size: 10px; }
.method { padding: 28px 0 35px; }
.method-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.method-head h2 { font-size: 18px; }
.method-head span { color: var(--soft); font-size: 10px; }
.definitions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.definitions p { margin: 0; padding: 13px; background: #fff; color: var(--muted); font-size: 10px; line-height: 1.5; }
.definitions strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 11px; }
.limit-note { margin: 11px 0 0; color: var(--soft); font-size: 10px; line-height: 1.5; }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 17px max(18px, 5vw, env(safe-area-inset-right)) max(17px, env(safe-area-inset-bottom)) max(18px, 5vw, env(safe-area-inset-left)); border-top: 1px solid #313744; background: var(--night); color: #d4d9e1; font-size: 10px; }
.footer-mark { margin: 0 5px; color: #9ba4b3; }
.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; }
[hidden] { display: none !important; }
@media (max-width: 880px) {
  .workbench { grid-template-columns: 1fr; }
  textarea { min-height: 285px; }
  .intro { align-items: start; flex-direction: column; padding-top: 34px; }
  .definitions { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar { min-height: 60px; padding-inline: 14px; }
  .brand { font-size: 17px; }
  .brand svg { width: 27px; height: 27px; }
  .source-chip { max-width: 145px; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
  .repo-link { font-size: 10px; white-space: nowrap; }
  main { width: min(100% - 24px, 1220px); }
  .intro { gap: 18px; padding: 29px 0 22px; }
  h1 { font-size: clamp(34px, 10vw, 47px); }
  .lede { font-size: 13px; }
  .panel { padding: 15px; border-radius: 11px; }
  .panel-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .panel-description { min-height: 0; font-size: 11px; }
  .input-actions .button { flex: 1 1 auto; }
  textarea { min-height: 260px; padding: 10px; font-size: 10px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary { min-height: 81px; padding: 10px; }
  .summary-value { font-size: 22px; }
  .findings-head, .method-head { align-items: flex-start; flex-direction: column; }
  .findings-head { gap: 9px; }
  .result-actions { width: 100%; }
  .result-actions .button { flex: 1; }
  .finding { grid-template-columns: minmax(0, 1fr) auto; }
  .asof-row span { flex-basis: 100%; }
  .footer { flex-direction: column; padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
