/* TrailPrint 1.90 · Notion-inspired workspace theme
   Visual-only override: all existing ids, controls and interaction layers stay intact. */

:root {
  --ink: #191919;
  --muted: #787774;
  --line: #e3e3e1;
  --line-strong: #d3d3d1;
  --green: #326b4f;
  --green-dark: #25533d;
  --green-soft: #eaf3ed;
  --cream: #ffffff;
  --paper: #ffffff;
  --canvas: #f7f7f5;
  --hover: #efefed;
  --red: #d04a3a;
  --acid: #326b4f;
  --shadow: 0 1px 2px rgb(15 15 15 / 5%), 0 6px 18px rgb(15 15 15 / 4%);
}

html { background: var(--canvas); }
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }
button { transition: background-color .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid rgb(50 107 79 / 42%);
  outline-offset: 2px;
}

/* Header: compact page chrome, similar to a focused Notion workspace. */
.app-header {
  height: 64px;
  grid-template-columns: minmax(230px, 1fr) auto minmax(190px, 1fr);
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: rgb(255 255 255 / 94%);
  box-shadow: none;
  backdrop-filter: blur(16px);
}
.brand { gap: 10px; color: var(--ink); }
.brand-logo {
  width: 31px;
  height: 38px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  filter: invert(1);
  object-fit: contain;
}
.brand-divider { width: 1px; height: 24px; background: var(--line-strong); }
.brand-product {
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.brand small { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .04em; }

.workflow { height: 100%; gap: 4px; }
.workflow-step {
  min-width: 104px;
  height: 40px;
  margin: auto 0;
  padding: 0 12px;
  gap: 7px;
  border-radius: 7px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0;
}
.workflow-step:hover { color: var(--ink); background: var(--hover); }
.workflow-step b {
  width: 20px;
  height: 20px;
  border-color: var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 650;
}
.workflow-step::before, .workflow-step::after { display: none; }
.workflow-step.active { color: var(--ink); background: var(--hover); }
.workflow-step.active b { border-color: var(--ink); color: #fff; background: var(--ink); }

.mode-switch {
  justify-self: end;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
}
.mode-switch button {
  min-width: 72px;
  height: 30px;
  border-radius: 5px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
}
.mode-switch button:hover { color: var(--ink); background: var(--hover); }
.mode-switch button.selected { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgb(15 15 15 / 10%); }

/* Document heading block. */
.workspace-heading {
  min-height: 80px;
  grid-template-columns: minmax(260px, 340px) 1fr auto;
  gap: 28px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.workspace-heading span, .preset-chip span {
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: .04em;
}
.workspace-heading strong { margin-top: 3px; font-size: 20px; font-weight: 720; letter-spacing: -.03em; }
.workspace-heading p { max-width: 680px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.preset-chip {
  padding: 7px 10px;
  border: 1px solid #cfe0d5;
  border-radius: 6px;
  background: var(--green-soft);
}
.preset-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.preset-chip span { color: var(--green-dark); }

/* Main working canvas. */
.split-stage {
  height: clamp(440px, 58vh, 680px);
  min-height: 440px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}
.model-pane, .map-pane {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgb(15 15 15 / 4%);
}
.model-pane {
  container-type: inline-size;
  background: radial-gradient(circle at 48% 42%, #f8f8f6 0, #e8ece8 58%, #c7d2ca 118%);
}
.map-pane { background: #6f806f; }
.model-pane.interaction-active, .map-pane.interaction-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgb(50 107 79 / 52%);
}

.pane-label, .map-caption, .terrain-status {
  top: 14px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 54%);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgb(15 15 15 / 14%);
  backdrop-filter: blur(10px);
}
.pane-label { left: 14px; color: var(--ink); background: rgb(255 255 255 / 90%); }
.map-caption { left: 14px; color: #fff; background: rgb(25 25 25 / 68%); }
.pane-label span, .map-caption span { font-family: inherit; font-size: 10px; font-weight: 650; letter-spacing: .03em; }
.terrain-status { right: 14px; color: #fff; background: rgb(25 25 25 / 72%); }
.terrain-status i { width: 7px; height: 7px; border-radius: 50%; background: #75b790; }
.model-refresh-notice {
  top: auto;
  right: auto;
  bottom: 14px;
  left: 14px;
  max-width: calc(100% - 28px);
  border-color: var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow);
  transform: none;
}

.map-search {
  top: 14px;
  right: 108px;
  left: 82px;
  min-height: 40px;
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: 0 2px 8px rgb(15 15 15 / 12%);
}
.map-search input { color: var(--ink); }
.map-search button { color: var(--ink); background: var(--canvas); font-weight: 600; }
.map-search button:hover { background: var(--hover); }
.map-search:focus-within { box-shadow: 0 0 0 2px rgb(50 107 79 / 36%), 0 2px 8px rgb(15 15 15 / 12%); }

.map-pan-tool, .map-reset, .map-zoom, .map-ui > div, .view-presets {
  border-radius: 6px;
  box-shadow: 0 1px 4px rgb(15 15 15 / 18%);
}
.map-pan-tool, .map-reset { border: 1px solid var(--line); color: var(--ink); background: rgb(255 255 255 / 92%); }
.map-pan-tool.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.map-zoom button { color: var(--ink); }
.map-zoom button:hover, .map-zoom button:focus-visible { background: var(--hover); }
.map-type { color: var(--muted); background: rgb(255 255 255 / 92%); font-weight: 600; }
.map-type.selected { color: var(--ink); background: #fff; }
.map-overlay .map-mask { fill: #11150f75; }
.map-overlay .map-selection { stroke: #fff; stroke-width: 1; }
.map-overlay #mapTrail { stroke: #d94f3d; stroke-width: 1.1; }

.view-actions {
  top: 14px;
  right: 14px;
  bottom: auto;
  left: auto;
  gap: 6px;
}
.view-actions .soft-button,
.preview-render-slot .primary-button {
  width: 82px;
  min-width: 82px;
  height: 36px;
  min-height: 36px;
  padding: 0 8px;
  font-size: 11px;
}
.preview-render-slot {
  position: static;
  display: flex;
}
.preview-render-slot .primary-button { box-shadow: 0 1px 4px rgb(15 15 15 / 18%); }
.view-presets button { min-height: 36px; padding: 0 11px; color: var(--muted); background: rgb(255 255 255 / 92%); font-size: 11px; font-weight: 600; }
.view-presets button:hover { color: var(--ink); background: #fff; }
.view-presets button.active { color: #fff; background: var(--ink); }
.view-actions #toggleExplodedView.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.render-overlay { background: rgb(25 25 25 / 80%); }
.render-spinner { border-top-color: #fff; }

.empty-preview { background: radial-gradient(ellipse at center, #dfe8e1 0 14%, transparent 48%); }
.empty-preview .empty-icon { border-color: var(--line-strong); color: var(--green); background: #fff; }
.empty-preview strong { color: var(--ink); font-weight: 700; }
.empty-preview small { color: var(--muted); }

/* Form blocks and controls. */
.control-deck {
  min-height: 250px;
  padding-right: 24px;
  padding-left: 24px;
  border-top: 0;
  background: #fff;
}
.panel-number {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--ink);
  background: var(--hover);
  font-family: inherit;
  font-size: 10px;
}
.panel-intro h2 { color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.panel-intro p { color: var(--muted); line-height: 1.7; }
.source-card, .option-group, .preset-overview, .template-option,
.quality-checks li, .render-summary, .render-callout, .pro-panel {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.source-card { border-left: 1px solid var(--line); }
.source-card:hover { border-color: var(--line-strong); background: #fdfdfc; }
.source-icon { border-radius: 5px; color: var(--green-dark); background: var(--green-soft); }
.card-heading strong, .option-group legend { color: var(--ink); font-weight: 650; }
.card-heading small { color: var(--muted); }

.soft-button, .upload-button, .primary-button {
  min-height: 38px;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: none;
  transform: none;
}
.soft-button, .upload-button { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.soft-button:hover, .soft-button:focus-visible, .upload-button:hover { border-color: #b9b9b7; color: var(--ink); background: var(--hover); transform: none; box-shadow: none; }
.primary-button { border-color: var(--ink); color: #fff; background: var(--ink); }
.primary-button:hover, .primary-button:focus-visible { border-color: #333; color: #fff; background: #333; transform: none; box-shadow: none; }
.primary-button:disabled { opacity: .42; }

.shape-option, .template-option {
  border-color: var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}
.shape-option:hover, .template-option:hover { border-color: var(--line-strong); background: var(--canvas); }
.shape-option.active, .template-option.active {
  border-color: #9ebba9;
  color: var(--green-dark);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px #9ebba9;
}
.shape-option em { border-radius: 4px; color: var(--green-dark); background: #d7eadf; }
.template-option > b { border-radius: 5px; color: var(--muted); background: var(--hover); }
.template-option.active > b { color: #fff; background: var(--green); }

.field, .edge-field label { color: var(--ink); font-weight: 600; }
.field output { color: var(--green-dark); }
.field input, .select-control, .edge-field input, .chinese-choice, .chinese-metric-picker select {
  border-color: var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
.field input:hover, .select-control:hover, .edge-field input:hover { border-color: #b6b6b3; }
.field input:focus, .select-control:focus, .edge-field input:focus { border-color: #8caa98; box-shadow: 0 0 0 2px rgb(50 107 79 / 14%); outline: 0; }
input[type="checkbox"] { accent-color: var(--green); }
.route-visibility-control { border-color: var(--line); border-radius: 7px; background: var(--canvas); }
.inline-status.success { color: var(--green-dark); background: var(--green-soft); }
.edge-field.too-long input { border-color: #d88b81; background: #fff8f7; }
.pro-panel summary { color: var(--ink); font-weight: 650; }
.measurements div { border-color: var(--line); }
.quality-checks li.passed i { color: var(--green-dark); background: var(--green-soft); }
.render-callout { background: var(--canvas); }

/* Compose side sheet: a Notion-like properties panel. */
.compose-aside { padding: 16px; background: var(--canvas); }
body:is(.mode-normal,.mode-pro) .personal-section,
body:is(.mode-normal,.mode-pro) .personal-export-section {
  border-color: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 15 15 / 3%);
}
body:is(.mode-normal,.mode-pro) .personal-section summary { color: var(--ink); font-weight: 650; }
body:is(.mode-normal,.mode-pro) .personal-section summary::before { color: var(--muted); }
body:is(.mode-normal,.mode-pro) .personal-section summary span {
  border-radius: 4px;
  color: var(--green-dark);
  background: var(--green-soft);
}
.parameter-lock-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}
.parameter-lock-copy { display: grid; min-width: 0; gap: 2px; }
.parameter-lock-copy strong { color: var(--ink); font-size: 10px; font-weight: 650; }
.parameter-lock-copy span { color: var(--muted); font-size: 8px; line-height: 1.35; }
.parameter-lock-control .soft-button {
  width: 82px;
  min-width: 82px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 10px;
}
body:not(.advanced-parameters-locked) .parameter-lock-control {
  border-color: #9ebba9;
  background: var(--green-soft);
}
.advanced-parameters-locked #terrainSectionContent .pro-panel,
.advanced-parameters-locked #baseSectionContent .pro-panel { opacity: .52; }
.advanced-parameters-locked #terrainSectionContent input,
.advanced-parameters-locked #terrainSectionContent select,
.advanced-parameters-locked #baseSectionContent input,
.advanced-parameters-locked #baseSectionContent select { cursor: not-allowed; }

.future-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.future-feature-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--canvas);
  text-align: left;
  cursor: not-allowed;
  opacity: .72;
}
.future-feature-button span { font-size: 9px; filter: grayscale(1); }
.future-feature-button strong { font-size: 9px; font-weight: 650; }
.future-feature-button small {
  padding: 2px 5px;
  border-radius: 4px;
  color: #777;
  background: #e9e9e7;
  font-size: 8px;
  white-space: nowrap;
}

.model-dimensions {
  position: absolute;
  z-index: 10;
  top: 14px;
  right: 194px;
  bottom: auto;
  left: 108px;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.model-pane > .pane-label {
  display: flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}
.model-dimensions dl {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  max-width: 230px;
  height: 100%;
  margin: 0;
}
.model-dimensions dl div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: baseline;
  gap: 4px;
  width: 100%;
  min-height: 18px;
  line-height: 18px;
}
.model-dimensions dt { color: var(--muted); font-size: 9px; }
.model-dimensions dt::after { content: "："; }
.model-dimensions dd {
  margin: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@container (max-width: 520px) {
  .model-dimensions {
    top: 14px;
    right: 158px;
    left: 80px;
    height: 36px;
  }
  .model-dimensions dl {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: 100%;
  }
  .model-dimensions dl div { grid-template-columns: 27px minmax(0, 1fr); gap: 2px; }
  .model-dimensions dt,
  .model-dimensions dd { font-size: 8px; }
  .model-pane .view-actions { gap: 4px; }
  .model-pane .view-actions .soft-button {
    width: 68px;
    min-width: 68px;
    padding: 0 4px;
    font-size: 9px;
  }
}
@media (max-width: 720px) {
  .model-dimensions dt,
  .model-dimensions dd { font-size: 8px; }
}

.height-limit-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid #e7c784;
  border-radius: 8px;
  color: #654711;
  background: #fff7df;
}
.height-limit-notice[hidden] { display: none !important; }
.height-limit-notice > div { display: grid; gap: 2px; }
.height-limit-notice strong { font-size: 10px; }
.height-limit-notice span { font-size: 8px; line-height: 1.45; }
.height-limit-notice .soft-button {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 32px;
  padding: 0 9px;
  border-color: #d4aa55;
  color: #654711;
  background: #fff;
  font-size: 9px;
}
.height-limit-notice.is-over-limit {
  border-color: #d99a8e;
  color: #783528;
  background: #fff0ed;
}

.future-feature-section {
  min-width: 0;
  padding: 0 10px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.future-feature-section > header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--ink);
}
.future-feature-section > header span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 8px;
}
.future-feature-section > header strong { font-size: 11px; font-weight: 680; }
.future-feature-button {
  min-height: 44px;
  padding: 9px 11px;
}
.future-feature-button span { font-size: 11px; }
.future-feature-button strong { font-size: 10px; }
.future-feature-button small { font-size: 9px; }

/* 编辑页右侧是参数面板，不再露出或响应卫星地图。 */
body:has(.step-panel[data-panel="compose"].active) .map-pane {
  cursor: default !important;
  touch-action: auto;
  background: var(--canvas) !important;
}
body:has(.step-panel[data-panel="compose"].active) .map-pane > :is(
  .map-tiles,
  .map-search,
  .map-caption,
  .map-pan-tool,
  .map-reset,
  .map-zoom,
  .map-ui,
  .map-scale,
  .map-overlay,
  .interaction-gate
) { display: none !important; }
body:has(.step-panel[data-panel="compose"].active) .map-pane > #composeAside {
  display: block !important;
}
@media (max-width: 520px) {
  .future-feature-list { grid-template-columns: 1fr; }
}

.privacy-dialog { background: rgb(15 15 15 / 40%); backdrop-filter: blur(4px); }
.privacy-sheet { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 60px rgb(15 15 15 / 22%); }
.privacy-sheet > header, .privacy-sheet > footer { border-color: var(--line); background: var(--canvas); }
.privacy-close, .privacy-links a { border-color: var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.privacy-close:hover, .privacy-links a:hover { background: var(--hover); }

.designer > footer {
  border-color: var(--line);
  color: var(--muted);
  background: var(--canvas);
  font-family: inherit;
}
.designer > footer button { color: var(--green-dark); }

/* Track page: two equal square workspaces, one information rail and a content feed. */
.track-info-panel,
.track-content-feed { display: none; }

@media (min-width: 721px) {
  body.mode-pro:has(.step-panel[data-panel="track"].active) {
    --track-square: min(calc((100vw - 336px) / 2), calc(100vh - 356px));
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .designer {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .split-stage {
    display: grid !important;
    grid-template-columns: var(--track-square) var(--track-square) minmax(270px, 1fr) !important;
    align-items: stretch;
    height: calc(var(--track-square) + 20px) !important;
    min-height: 0 !important;
    flex: 0 0 auto;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 0;
    background: var(--canvas);
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .model-pane,
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-pane {
    width: var(--track-square);
    height: var(--track-square);
    min-height: 0;
    aspect-ratio: 1 / 1;
    align-self: start;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .model-pane {
    background: #d7e0d9;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .model-pane .scene {
    inset: 64px 0 0;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .track-info-panel {
    display: grid;
    grid-template-rows: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    height: var(--track-square);
    min-height: 0;
    align-self: start;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .control-deck {
    display: none;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .track-content-feed {
    display: grid;
    /* 内容区从外框内边缘起算；+7px 补齐顶部两块之间的 12px 间距，
       使右栏分隔线与顶部信息栏左边界落在同一像素列。 */
    grid-template-columns: calc(var(--track-square) + var(--track-square) + 7px) minmax(270px, 1fr);
    flex: 0 0 220px;
    height: 220px;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-caption,
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-pan-tool { display: none !important; }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-ui {
    top: 14px;
    right: auto;
    left: 14px;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-reset {
    top: 14px;
    right: 138px;
    bottom: auto;
    left: auto;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-zoom {
    top: 14px;
    right: 14px;
    bottom: auto;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-scale {
    bottom: 14px;
    left: 14px;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-tiles .leaflet-bottom .leaflet-control-scale {
    margin: 0 0 16px 16px !important;
  }
}

.track-upload-block,
.about-howoo-block,
.trail-posts-panel,
.related-posts-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 15 15 / 4%);
}
.track-upload-block,
.about-howoo-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}
.track-info-kicker,
.trail-posts-panel header span,
.related-posts-panel header span {
  color: var(--green-dark);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
}
.track-upload-block h2,
.about-howoo-block h2 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -.03em;
}
.track-upload-button {
  display: grid;
  width: 100%;
  min-height: 36px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.track-upload-button:hover { background: #30302e; }
.track-file-meta {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-file-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.gpx-help { position: relative; flex: 0 0 auto; margin: 0; color: var(--muted); font-size: 9px; }
.gpx-help summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 3px; }
.gpx-help summary::-webkit-details-marker { display: none; }
.gpx-help p { position: absolute; top: 16px; right: 0; z-index: 20; width: 220px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: rgb(255 255 255 / 96%); box-shadow: var(--shadow); font-size: 9px; line-height: 1.55; }
.edit-model-button {
  width: 100%;
  min-height: 36px;
  margin-top: 6px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 650;
}
.edit-model-button:hover { border-color: #30302e; background: #30302e; }
.track-edit-step {
  display: grid;
  width: 100%;
  gap: 3px;
  margin-top: auto;
  padding-top: 2px;
}
.track-edit-step > strong { color: var(--ink); font-size: 10px; font-weight: 650; }
.track-edit-step .edit-model-button { margin-top: 0; }
.track-compact-status {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.track-compact-status strong { grid-column: 1; grid-row: 1; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.track-compact-status span { grid-column: 1; grid-row: 2; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.track-compact-status .soft-button { min-height: 28px; grid-column: 2; grid-row: 1 / 3; margin: 0; padding: 0 8px; font-size: 8px; }
.about-howoo-block { justify-content: center; }
.about-howoo-block p { margin: 0; color: #555550; font-size: 9px; line-height: 1.6; }
.about-howoo-block p + p { margin-top: 6px; }

.track-content-feed {
  grid-template-columns: minmax(0, 2.35fr) minmax(260px, 1fr);
  gap: 0;
  margin: 0 16px 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 15 15 / 4%);
}
.trail-posts-panel,
.related-posts-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.trail-posts-panel { padding-right: 16px; }
.related-posts-panel { padding-left: 16px; border-left: 1px solid var(--line); }
.trail-posts-panel header,
.related-posts-panel header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.trail-posts-panel h2,
.related-posts-panel h2 { margin: 0; color: var(--ink); font-size: 14px; letter-spacing: -.02em; }
.trail-post-card-grid {
  display: grid;
  height: 158px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  justify-items: start;
  gap: 9px;
}
.trail-post-card {
  position: relative;
  display: flex;
  min-width: 0;
  width: min(100%, 158px);
  aspect-ratio: 1 / 1;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 72%);
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, rgb(255 255 255 / 78%), rgb(220 232 223 / 58%));
  box-shadow: 0 8px 24px rgb(36 62 46 / 10%), inset 0 1px 0 rgb(255 255 255 / 72%);
  backdrop-filter: blur(16px) saturate(115%);
}
.trail-post-card::before {
  display: none;
}
.trail-post-card:hover { border-color: #9ebba9; background: linear-gradient(145deg, rgb(255 255 255 / 88%), rgb(211 229 216 / 72%)); }
.trail-post-card > * { position: relative; z-index: 1; }
.trail-post-card span { margin-bottom: auto; font-size: 8px; font-weight: 650; letter-spacing: .1em; }
.trail-post-card strong { font-size: 11px; line-height: 1.45; }
.trail-post-card small { margin-top: 7px; color: var(--muted); font-size: 7px; }
.related-posts-panel nav { display: grid; gap: 7px; }
.related-posts-panel nav a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--canvas);
  font-size: 9px;
  line-height: 1.4;
  text-decoration: none;
}
.related-posts-panel nav a:hover { border-color: #9ebba9; background: var(--green-soft); }
.related-posts-panel nav span { color: var(--green-dark); font-size: 8px; font-variant-numeric: tabular-nums; }
.related-posts-more {
  display: flex;
  height: 18px;
  align-items: center;
  justify-content: flex-start;
  padding-left: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: .18em;
}

/* Full-height compose mode keeps the same app behavior, only changes its surface. */
body:has(.step-panel[data-panel="compose"].active) .split-stage {
  height: calc(100vh - 64px);
  min-height: 680px;
  padding: 12px 16px;
  background: var(--canvas);
}

@media (min-width: 721px) {
  body:has(.step-panel[data-panel="compose"].active) .control-deck {
    display: none !important;
  }
  body:has(.step-panel[data-panel="compose"].active) .app-header {
    flex: 0 0 64px;
  }
  body:has(.step-panel[data-panel="compose"].active) {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  body:has(.step-panel[data-panel="compose"].active) .designer {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  body:has(.step-panel[data-panel="compose"].active) .split-stage {
    height: auto !important;
    min-height: 0 !important;
    flex: 1 1 0 !important;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    border-bottom: 0;
  }
  body:has(.step-panel[data-panel="compose"].active) .model-pane {
    width: min(calc(100% - 24px), calc(100vh - 120px));
    height: auto;
    aspect-ratio: 1 / 1;
    align-self: start;
    justify-self: center;
    border: 1px solid var(--line);
    background: #d7e0d9;
  }
  body:has(.step-panel[data-panel="compose"].active) .model-pane .scene {
    inset: 64px 0 0;
  }
  body:has(.step-panel[data-panel="compose"].active) .map-pane {
    height: auto;
    min-height: 0;
    align-self: start;
    border: 0;
    background: transparent;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #personalizationSections {
    height: auto;
    grid-template-rows: auto auto auto auto auto auto;
    grid-template-areas:
      "shape copy"
      "lock lock"
      "height height"
      "terrain base"
      "future future"
      "export export";
    gap: 8px;
    align-content: start;
    overflow: visible;
  }
  body.mode-pro #shapeRouteSection { grid-area: shape !important; }
  body.mode-pro #copySection { grid-area: copy !important; }
  body.mode-pro #advancedParameterLock { grid-area: lock !important; }
  body.mode-pro #heightLimitNotice { grid-area: height !important; }
  body.mode-pro #terrainSection { grid-area: terrain !important; }
  body.mode-pro #baseSection { grid-area: base !important; }
  body.mode-pro #futureFeatureSection { grid-area: future !important; }
  body.mode-pro #exportSection {
    grid-area: export !important;
    align-self: start;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #exportSection {
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) .personal-section {
    padding: 0 9px 9px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) .personal-section summary {
    padding: 7px 0;
    font-size: 11px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) .personal-section-content {
    gap: 6px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .shape-options {
    gap: 6px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .shape-option {
    height: 56px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .shape-symbol {
    margin: 0 0 2px;
    transform: scale(.78);
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .route-visibility-control {
    min-height: 34px;
    padding: 6px 8px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .template-picker {
    gap: 6px !important;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .template-option {
    min-height: 40px;
    padding: 5px 6px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .edge-copy-editor {
    gap: 5px 8px !important;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .edge-field label {
    margin-bottom: 2px;
    font-size: 8px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #composeAside .edge-field input {
    height: 30px;
  }
  .mode-pro #composeAside .pro-panel summary {
    display: none;
  }
  .mode-pro #composeAside .pro-panel {
    padding: 0 !important;
    overflow: visible !important;
  }
  .mode-pro #composeAside .pro-panel .parameter-grid {
    gap: 6px 8px !important;
  }
  .mode-pro #composeAside .pro-panel .field {
    font-size: 9px;
    line-height: 1.25;
  }
  .mode-pro #composeAside .pro-panel .field input,
  .mode-pro #composeAside .pro-panel .select-control {
    min-height: 32px;
    height: 32px;
    margin-top: 3px;
    padding: 4px 8px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #exportSection .actions {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 4px 10px 10px;
  }
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #exportSection .actions #finalRender,
  body:is(.mode-normal,.mode-pro):has(.step-panel[data-panel="compose"].active) #exportSection .actions #exportPrintModels {
    width: 100%;
    min-height: 40px;
  }
}

@media (max-width: 1080px) {
  .app-header { grid-template-columns: 210px 1fr 160px; padding: 0 12px; }
  .workflow-step { min-width: 80px; padding: 0 8px; }
  .workspace-heading { grid-template-columns: 270px 1fr; }
  .preset-chip { display: none; }
}

@media (max-width: 720px) {
  .app-header { height: 56px; grid-template-columns: 112px minmax(0, 1fr) 96px; padding: 0 9px; }
  .brand { gap: 6px; }
  .brand-logo { width: 25px; height: 32px; padding: 4px 3px; border-radius: 5px; }
  .brand-divider { display: none; }
  .brand-product { font-size: 11px; }
  .workflow-step { height: 34px; border-radius: 5px; }
  .workflow-step b { width: 18px; height: 18px; border-radius: 4px; }
  .mode-switch { border-radius: 6px; }
  .mode-switch button { min-width: 44px; height: 27px; border-radius: 4px; }
  .split-stage { height: clamp(310px, 48vh, 430px); min-height: 310px; gap: 6px; padding: 6px; }
  .model-pane, .map-pane { border-radius: 7px; }
  .pane-label, .map-caption { border-radius: 5px; }
  .control-deck { padding: 12px 12px 18px; }
  .source-card, .option-group, .preset-overview, .template-option, .quality-checks li, .render-summary, .render-callout, .pro-panel { border-radius: 7px; }
  body:has(.step-panel[data-panel="compose"].active) .split-stage { height: calc(100vh - 56px); min-height: 600px; padding: 6px; }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .split-stage {
    display: grid !important;
    height: auto;
    grid-template-columns: 1fr !important;
    padding: 8px;
  }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .model-pane,
  body.mode-pro:has(.step-panel[data-panel="track"].active) .map-pane { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .track-info-panel { display: grid; gap: 8px; }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .control-deck { display: none; }
  body.mode-pro:has(.step-panel[data-panel="track"].active) .track-content-feed { display: grid; }
  .track-content-feed { grid-template-columns: 1fr; padding: 0 8px 8px; }
  .trail-post-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
