:root {
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: #1a2524;
  background: #f8f9f5;
  font-synthesis: none;
  --ink: #1a2524;
  --muted: #4b5c56;
  --line: #d5ded6;
  --green: #c4e9a5;
  --dark: #172321;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; line-height: 1.55; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button:not(:disabled), input[type="range"], input[type="checkbox"], .file-actions label { cursor: pointer; }
:focus-visible { outline: 3px solid #42794f; outline-offset: 3px; }
.screen-reader { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 1rem; top: 1rem; z-index: 2; transform: translateY(-240%); padding: .5rem 1rem; background: white; }
.skip:focus { transform: none; }
.shell { width: min(100% - 3rem, 72.5rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, .footer-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .58rem; text-decoration: none; font-size: 1.14rem; font-weight: 820; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark { position: relative; width: 1.38rem; height: 1.38rem; border-radius: .33rem; background: var(--dark); }
.brand-mark::before { content: ""; position: absolute; inset: .37rem .27rem; background: var(--green); clip-path: polygon(0 86%, 28% 0, 52% 53%, 84% 0, 100% 13%, 52% 100%, 32% 50%, 12% 100%); }
nav { display: flex; gap: clamp(.8rem, 3vw, 1.6rem); align-items: center; }
nav a { color: var(--muted); font-size: .92rem; font-weight: 650; text-decoration: none; }
nav a:hover, .brand:hover { text-decoration: underline; text-underline-offset: .22em; }
.intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(12rem, .75fr); gap: 1.2rem 2rem; align-items: end; padding-block: clamp(2.1rem, 5.15vw, 4.5rem) clamp(1.7rem, 4vw, 3.45rem); }
h1 { font-size: clamp(2.8rem, 6.1vw, 5.8rem); line-height: .95; font-weight: 850; letter-spacing: -.077em; }
h1 em { color: #396e48; font-style: normal; }
.intro-details { padding-bottom: .1rem; }
.intro-details > p:first-child { max-width: 27rem; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.22rem); }
.local-note { display: flex; align-items: center; gap: .5rem; margin-top: .92rem; font-size: .88rem; font-weight: 720; color: #375846; }
.local-note span { display: inline-block; width: .48rem; height: .48rem; border-radius: 50%; background: #56804f; }
.workspace { display: grid; grid-template-columns: minmax(16rem, .86fr) minmax(0, 1.25fr); gap: 1rem; }
.controls { background: white; border: 1px solid var(--line); border-radius: 1.15rem; padding: clamp(1rem, 2.2vw, 1.55rem); }
.controls h2 { font-size: 1.25rem; font-weight: 770; letter-spacing: -.025em; }
.controls h2 + p { color: var(--muted); margin-top: .14rem; font-size: .9rem; }
.file-zone { padding: .85rem; border-radius: .8rem; border: 1px dashed #b0c2b2; background: #f6f9f3; }
.file-zone.dragging { border-color: #527c43; background: #edf9df; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; margin-top: .7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; flex-flow: row wrap; border-radius: .52rem; padding: .62rem .85rem; min-height: 2.6rem; font-size: .89rem; font-weight: 750; border: 1px solid transparent; }
.button-main { background: var(--dark); color: #fff; }
.button-main:hover:not(:disabled) { background: #31473e; }
.button-main:focus-within { outline: 3px solid #42794f; outline-offset: 3px; }
.button-text { color: #3d6746; background: transparent; padding-inline: .35rem; }
.button-text:hover { text-decoration: underline; text-underline-offset: .2em; }
.button:disabled { opacity: .58; }
.trim-panel { margin-top: 1.1rem; }
fieldset { min-inline-size: 0; border: 0; margin: 0; padding: 0; }
fieldset:disabled { opacity: .62; }
.presets { display: flex; flex-wrap: wrap; gap: .38rem; margin-top: .85rem; }
.presets legend { padding: 0; margin-bottom: .4rem; color: var(--muted); font-size: .84rem; font-weight: 700; }
.chip { padding: .32rem .64rem; border: 1px solid #cedacb; background: #f7f9f5; color: #354a3e; font-size: .84rem; font-weight: 730; border-radius: 10rem; }
.chip[aria-pressed="true"] { border-color: #86aa74; background: #e1f3d8; color: #294c33; }
.chip:hover:not(:disabled) { border-color: #88a67a; }
.chip:disabled { opacity: .48; }
.cut-inputs { display: grid; gap: .76rem; margin-top: .9rem; }
.cut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.1rem, auto); gap: .18rem .6rem; align-items: center; }
.cut label { font-size: .9rem; font-weight: 700; }
.number { display: flex; align-items: center; border: 1px solid #c5d3c6; border-radius: .48rem; padding-inline: .4rem; }
.number span { font-weight: 650; color: var(--muted); font-size: .82rem; }
.number:focus-within { outline: 2px solid #497c50; outline-offset: 2px; }
.number input { min-width: 1.9rem; width: 4.9rem; border: 0; background: transparent; text-align: right; padding-block: .27rem; color: var(--ink); font-weight: 720; }
.number input:focus-visible { outline: 0; }
.cut input[type="range"] { grid-column: 1 / -1; width: 100%; height: 1.4rem; margin: 0; accent-color: #497c50; }
.export-panel { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid #e0e7dd; }
.options { display: flex; flex-wrap: wrap; gap: .4rem .85rem; margin-block: .45rem .72rem; font-size: .87rem; color: var(--muted); }
.options label { display: flex; align-items: center; gap: .3rem; }
.options input { margin: 0; accent-color: #497c50; width: 1rem; height: 1rem; }
.export-button { width: 100%; }
.file-error:not(:empty), .export-status:not(:empty) { margin-top: .48rem; font-size: .86rem; }
.file-error { color: #9a3d2c; font-weight: 650; }
.export-status { color: #386641; }
.preview { align-self: start; min-width: 0; padding: clamp(.92rem, 2.28vw, 1.55rem); border-radius: 1.15rem; background: #172321; color: #fff; }
.preview-header { display: flex; align-items: start; justify-content: space-between; gap: .55rem 1rem; }
.preview-header > div { min-width: 0; }
.preview-header p { color: #bdcfc1; font-size: .77rem; text-transform: uppercase; letter-spacing: .105em; font-weight: 750; }
.preview-header h2 { color: #fff; margin-top: .12rem; font-size: clamp(1.25rem, 3vw, 2.05rem); letter-spacing: -.04em; line-height: 1.13; overflow-wrap: anywhere; }
.point-tag:not(:empty) { flex: 0 0 auto; border-radius: .36rem; border: 1px solid #465f53; padding: .26rem .43rem; font-size: .76rem; color: #d3e4d7; }
.plot { position: relative; min-height: 15.5rem; height: clamp(15.5rem, 31vw, 25rem); border-radius: .64rem; border: 1px solid #344940; margin-top: 1rem; overflow: hidden; background-color: #1c2a27; background-image: linear-gradient(to right, #33463d 1px, transparent 1px), linear-gradient(to bottom, #33463d 1px, transparent 1px); background-size: 1.7rem 1.7rem; background-position: center center; }
.plot-axis { position: absolute; z-index: 1; display: grid; place-items: center; top: .65rem; left: .72rem; color: #cfddd2; font-size: .75rem; font-weight: 770; line-height: 1.1; }
.plot-axis span + span { width: .7rem; height: .8rem; margin-top: .15rem; background: #cfddd2; clip-path: polygon(50% 0, 100% 100%, 50% 69%, 0 100%); }
.trace-layer { position: absolute; inset: 0; overflow: hidden; }
.route-line, .route-marker { display: block; position: absolute; }
.route-line { height: 4px; border-radius: 2px; transform-origin: 0 50%; margin-top: -2px; }
.route-line.is-removed { background: #ff9d78; }
.route-line.is-kept { background: #c4e9a5; }
.route-marker { width: .65rem; height: .65rem; border-radius: 50%; background: #253e34; border: 2px solid #c4e9a5; transform: translate(-50%, -50%); }
.plot-key { position: absolute; z-index: 1; right: .62rem; bottom: .57rem; display: flex; gap: .6rem; padding: .35rem .48rem; border-radius: .25rem; background: #182621; color: #eff5ee; font-size: .76rem; line-height: 1; }
.plot-key span { display: flex; align-items: center; gap: .27rem; }
.plot-key i { display: block; width: .56rem; height: .25rem; border-radius: .13rem; background: #c4e9a5; }
.plot-key i.removed-key { background: #ff9d78; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: .75rem; }
.metrics > div { border-radius: .55rem; background: #233530; padding: .6rem .65rem; }
.metrics dt { color: #c7dacd; font-size: .83rem; font-weight: 650; }
.metrics dd { color: #fff; font-size: clamp(1rem, 2.65vw, 1.55rem); font-weight: 760; white-space: nowrap; letter-spacing: -.035em; }
.metrics div:nth-child(2) dd { color: #ffb99d; }
.metrics div:nth-child(3) dd { color: #d5efba; }
.preview-note { color: #bbd0c0; margin-top: .68rem; font-size: .83rem; }
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; margin-block: 2rem 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.guide h2, .guide h3 { font-size: 1.02rem; font-weight: 780; }
.guide p { margin-top: .35rem; color: var(--muted); font-size: .95rem; }
.site-footer { color: var(--muted); border-top: 1px solid var(--line); font-size: .86rem; }
.site-footer .brand { color: var(--ink); }
@media (max-width: 45rem) {
  .shell { width: calc(100% - 2rem); }
  .intro, .workspace { grid-template-columns: minmax(0, 1fr); }
  .intro { gap: .95rem; }
  .workspace { gap: .8rem; }
  .guide { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
  .controls { display: grid; }
}
@media (max-width: 26rem) {
  .shell { width: calc(100% - 1.25rem); }
  .plot { height: 14.5rem; min-height: 0; }
  .metrics > div { padding-inline: .4rem; }
  .metrics dd { font-size: .94rem; }
  .footer-inner { flex-wrap: wrap; align-content: center; gap: .25rem .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
