:root {
  color-scheme: light;
  --background: #f2f5f2;
  --ink: #172a21;
  --green: #104832;
  --line: #ced9d2;
  --muted: #4f5f58;
  --orange: #d55e00;
  --blue: #0072b2;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: var(--background); color: var(--ink); }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #7cb49a; outline-offset: 3px; }
.masthead { border-bottom: 1px solid #aabcb1; color: var(--green); }
.mast-inner { width: min(1390px, calc(100% - 72px)); min-height: 68px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand, .privacy { display: inline-flex; align-items: center; gap: 12px; }
.brand { font-weight: 750; font-size: 24px; letter-spacing: .015em; }
.brand svg { flex: none; }
.privacy { font-size: 17px; gap: 8px; white-space: nowrap; }
.shell { width: min(1440px, calc(100% - 42px)); margin: 0 auto 44px; }
.intro { text-align: center; margin: 37px 0 49px; }
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { color: var(--green); }
h1 { font-size: clamp(36px, 4.05vw, 61px); letter-spacing: -.025em; font-weight: 800; line-height: 1.15; }
.intro p { margin-top: 14px; font-size: clamp(15px, 1.8vw, 23px); line-height: 1.55; color: #264537; }
.workspace { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.94fr); gap: 16px; align-items: stretch; }
.panel { min-width: 0; padding: 20px; border: 1px solid #b1c0b7; border-radius: 15px; background: #fff; box-shadow: 0 1px 3px #1c3d2b0a; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 2px 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px; min-height: 52px; }
h2 { font-size: clamp(22px, 2.05vw, 29px); font-weight: 780; white-space: nowrap; line-height: 1.2; }
.example { color: var(--green); background: transparent; border: 0; border-radius: 4px; padding: 5px; font-size: 16px; white-space: nowrap; }
.example:hover { text-decoration: underline; text-underline-offset: 4px; }
form { display: flex; flex-direction: column; }
.upload { display: grid; place-items: center; gap: 6px; width: 100%; min-height: 140px; padding: 14px 8px; border: 1.5px dashed #7d9c8b; border-radius: 9px; background: #f3f8f5; color: var(--green); }
.upload svg { margin-bottom: 5px; }
.upload strong { font-weight: 650; font-size: 17px; }
.upload span { color: var(--muted); font-size: 13.5px; }
.upload:hover, .upload.drag { background: #e7f3eb; border-color: var(--green); }
.file-row { display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; background: #f6f8f6; margin: 12px 0 12px; min-height: 48px; font-size: 15px; }
.file-row > svg { color: #267852; flex-shrink: 0; }
#filename { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#file-extra { font-size: 12px; color: var(--muted); }
.check { background: #278855; font-size: 14px; flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: white; font-weight: 700; }
.field, .bounds-head strong { color: var(--green); font-weight: 700; font-size: 15px; }
.source { margin: 2px 0 6px; }
.upload + .file-row[hidden] + .source { margin-top: 13px; }
.control { border: 1px solid #a6b6ac; background: #fcfdfc; color: var(--ink); border-radius: 6px; min-height: 38px; width: 100%; min-width: 0; padding: 7px 10px; font-weight: 450; }
.control::placeholder { color: #718078; }
select.control { padding-right: 8px; }
.bounds { border: 0; min-inline-size: 0; padding: 10px 0 0; margin: 10px 0 0; border-top: 1px solid var(--line); }
.bounds-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.control.compact { width: auto; min-height: 30px; padding: 3px 7px; font-size: 13px; }
.anchor { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 14px; }
.anchor input { font-variant-numeric: tabular-nums; min-height: 35px; font-size: 14px; }
.helper { font-size: 12px; color: var(--muted); line-height: 1.45; }
.intervals { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.unit { display: block; position: relative; margin-top: 6px; }
.unit .control { padding-right: 39px; appearance: textfield; }
.unit input::-webkit-outer-spin-button, .unit input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.unit > span { position: absolute; right: 10px; top: 9px; font-weight: 500; pointer-events: none; }
.download { margin-top: 25px; width: 100%; padding: 12px 14px; min-height: 53px; border: 0; border-radius: 8px; display: flex; gap: 10px; align-items: center; justify-content: center; background: var(--green); color: #fff; font-size: 22px; font-weight: 750; }
.download:hover:not(:disabled) { background: #0a3826; }
.download:disabled { opacity: .46; }
.message { border-radius: 6px; margin-top: 12px; padding: 8px 10px; font-size: 13px; line-height: 1.45; color: #235f43; background: #eef7f1; }
.message.error { color: #8c332b; background: #faeeec; }
.message.warning { color: #71430a; background: #fcf3e5; }
.message:not([hidden]) + .download { margin-top: 12px; }
.preview { display: flex; flex-direction: column; }
.legend { display: flex; gap: 22px; align-items: center; font-size: 16px; white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; border-radius: 50%; }
.legend-km { width: 15px; height: 15px; background: var(--orange); }
.legend-hm { width: 9px; height: 9px; background: var(--blue); }
.plot { position: relative; flex: 1 1 auto; min-height: 330px; border: 1px solid #dce4df; border-radius: 5px; overflow: hidden; background-color: #f6f8f5; background-image: linear-gradient(to right,#dbe4de 1px,transparent 1px), linear-gradient(to bottom,#dbe4de 1px,transparent 1px); background-size: 34px 34px; }
#canvas { position: absolute; width: 100%; height: 100%; }
.compass { position: absolute; right: 15px; top: 9px; display: grid; justify-items: center; color: var(--green); font-size: 12px; line-height: 1.2; pointer-events: none; }
.empty-plot { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: #f6f8f58c; }
.point-tip { position: absolute; border: 1px solid #b9c9bf; padding: 5px 8px; border-radius: 5px; background: #fff; color: var(--green); font-size: 13px; font-weight: 650; box-shadow: 0 1px 3px #0001; white-space: nowrap; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0; text-align: center; }
.stats > div { display: flex; flex-direction: column-reverse; padding: 0 6px; gap: 4px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: clamp(13px, 1.5vw, 19px); }
.stats dd { font-weight: 780; color: var(--green); font-size: clamp(22px, 2.65vw, 36px); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stats small { font-size: .64em; }
.preview-note { border-top: 1px solid var(--line); padding: 14px 3px 4px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 820px) {
  .mast-inner { width: calc(100% - 32px); }
  .shell { width: calc(100% - 30px); }
  .intro { margin: 27px 0 25px; }
  .upload { min-height: 129px; }
  .file-row { min-height: 43px; }
  .workspace { grid-template-columns: 1fr; }
  .plot { min-height: 310px; }
}
@media (max-width: 440px) {
  .mast-inner { min-height: 56px; }
  .brand { gap: 8px; font-size: 17px; }
  .brand svg { width: 31px; }
  .privacy { gap: 4px; font-size: 13px; }
  .privacy svg { width: 17px; }
  .panel { padding: 14px; }
  .panel-head { padding-bottom: 12px; margin-bottom: 14px; }
  .example, .legend { font-size: 13px; }
  .legend { gap: 9px; }
  .legend span { gap: 4px; }
  .plot { min-height: 244px; }
  .compass { top: 7px; font-size: 10px; }
  .compass svg { width: 30px; height: 30px; }
}

/* Shared site navigation and a compact title above the original tool workspace. */
body { background: var(--site-bg); }
.shell { flex: 1; width: min(1390px, calc(100% - 64px)); margin: 30px auto 48px; }
.tool-breadcrumb { display: flex; align-items: center; gap: 10px; color: #65786c; font-size: 14px; line-height: 1.5; }
.tool-breadcrumb a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.tool-breadcrumb > span { color: #92a59a; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 24px 0 30px; text-align: left; }
.intro h1 { font-size: clamp(34px, 4vw, 46px); line-height: 1.2; font-weight: 750; }
.intro p { margin-top: 10px; font-size: 17px; color: #5b7164; }
.tool-privacy { display: inline-flex; align-items: center; gap: 8px; color: #5b7164; font-size: 14px; white-space: nowrap; }
.panel { border-color: #becfc3; }
.panel-head h2 { font-size: 23px; }
.download { font-size: 19px; }
.tool-help { margin-top: 20px; color: #607468; font-size: 13px; line-height: 1.7; }
.tool-help summary { cursor: pointer; width: fit-content; color: #315c44; }
.tool-help ul { margin: 12px 0 0; padding-left: 20px; }
@media (max-width: 820px) {
  .shell { width: calc(100% - 36px); margin-top: 22px; }
  .intro { margin: 20px 0 24px; }
  .intro p { font-size: 15px; }
  .tool-privacy { font-size: 12px; }
}
@media (max-width: 440px) {
  .intro { align-items: flex-start; flex-direction: column; gap: 12px; }
  .intro h1 { font-size: 34px; }
  .intro p { font-size: 14px; }
  .panel-head h2 { font-size: 21px; }
}
