:root {
  --bg: #f4f1eb;
  --panel: #fffdf8;
  --ink: #1c1916;
  --muted: #6b645c;
  --line: #d9d2c6;
  --accent: #0f5c4c;
  --accent-ink: #ffffff;
  --shadow: 0 1px 0 rgba(28, 25, 22, 0.06);
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #e7efe9 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #efe6d8 0%, transparent 50%),
    var(--bg);
  font-family: var(--font);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.info-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.info-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.info-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 14px;
  height: calc(100% - 58px);
  padding: 14px;
}

.side {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.muted { color: var(--muted); margin: 0 0 6px; font-size: 13px; word-break: break-all; }
.side-note { word-break: normal; font-size: 12px; margin-bottom: 10px; }
.count { margin: 0; font-family: var(--mono); font-size: 13px; }

.data-file-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 6px;
}

.data-file-row .muted {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.icon-btn {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.field select,
.field input[type="search"],
.field input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.find-field {
  grid-template-columns: 48px 1fr;
}

.find-status {
  margin: 0 0 6px;
  font-size: 12px;
  word-break: normal;
}

.find-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow: auto;
  margin: 0 0 8px;
}

.find-hit {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.find-hit:hover {
  border-color: var(--accent);
}

.find-hit.is-active {
  border-color: var(--accent);
  background: #e7efe9;
}

.find-hit-main {
  font-family: var(--mono);
  font-size: 12px;
}

.find-hit-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.find-detail {
  max-height: 220px;
  overflow: auto;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.find-detail .hover-line {
  padding: 1px 0;
}

#btnFindClear[hidden] {
  display: none;
}

.btn {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-block { width: 100%; margin-top: 4px; }
.btn-small { padding: 4px 8px; font-size: 12px; }

.file-btn { display: inline-flex; align-items: center; }

.filter-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

.mat-btn {
  appearance: none;
  border: none;
  border-radius: 4px;
  padding: 3px 7px;
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  color: #fff;
  background: #888;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mat-btn.inactive {
  background: #b0aaa2 !important;
  color: #5a554e !important;
}

.field input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.field input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9d2c6 0%, #9ecfc0 55%, var(--accent) 100%);
}

.field input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9d2c6 0%, #9ecfc0 55%, var(--accent) 100%);
  border: none;
}

.field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(28, 25, 22, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.field input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(28, 25, 22, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.field input[type="range"]:hover:not(:disabled)::-webkit-slider-thumb,
.field input[type="range"]:active:not(:disabled)::-webkit-slider-thumb {
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(15, 92, 76, 0.16);
}

.field input[type="range"]:hover:not(:disabled)::-moz-range-thumb,
.field input[type="range"]:active:not(:disabled)::-moz-range-thumb {
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(15, 92, 76, 0.16);
}

.field input[type="range"]:disabled {
  cursor: default;
  opacity: 0.45;
}

.opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  cursor: pointer;
}

.opt-row input {
  margin: 0;
}

.opt-row:has(input:disabled) {
  cursor: default;
  opacity: 0.55;
}

.opt-hint {
  margin: 2px 0 0 24px !important;
  font-size: 11px !important;
}

.density-opts {
  margin: 4px 0 0 6px;
  padding: 4px 0 2px 8px;
  border-left: 1px solid #3a342e;
}

.density-shared,
.density-block {
  margin: 0 0 6px;
}

.density-block-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 245, 230, 0.45);
  margin: 2px 0 4px;
}

.density-field {
  grid-template-columns: 44px 1fr;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}

.density-field input[type="number"],
.density-field select {
  width: 100%;
  max-width: none;
  padding: 3px 6px;
  border: 1px solid #3a342e;
  border-radius: 4px;
  background: #1c1916;
  color: #f5f0e8;
  font: inherit;
  font-size: 12px;
}

.density-field input[type="range"] {
  width: 100%;
  max-width: none;
}

.density-field input[type="checkbox"] {
  justify-self: start;
  margin: 0;
}

.density-field input[type="number"]:disabled,
.density-field select:disabled,
.density-field input[type="range"]:disabled {
  opacity: 0.55;
}

.density-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin: 2px 0 4px;
}

.dens-check {
  margin: 0 !important;
  font-size: 12px;
  gap: 4px;
}

.stage {
  position: relative;
  min-height: 0;
  background: #161411;
  border: 1px solid #2a2520;
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.plot-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: #2a2520;
}

.plot-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #161411;
  overflow: hidden;
}

.plot-cell--filters {
  display: flex;
  flex-direction: column;
  padding: 26px 10px 10px;
  color: rgba(255, 245, 230, 0.78);
  overflow: auto;
}

.xyz-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  justify-content: center;
}

.xyz-axis {
  --axis: #b8b0a6;
  padding: 8px 10px 10px;
  border-radius: 10px;
  background: rgba(255, 245, 230, 0.045);
  border: 1px solid rgba(255, 245, 230, 0.08);
}

.xyz-axis[data-axis="x"] { --axis: #cfc7bc; }
.xyz-axis[data-axis="y"] { --axis: #a8a097; }
.xyz-axis[data-axis="z"] { --axis: #8a837a; }

.xyz-axis-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: rgba(255, 245, 230, 0.72);
}

.xyz-axis-name::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--axis);
  box-shadow: 0 0 0 3px rgba(255, 245, 230, 0.1);
}

.xyz-row {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 8px;
}

.xyz-end {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255, 245, 230, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
}

.xyz-row .xyz-end:first-child { text-align: right; }
.xyz-row .xyz-end:last-child { text-align: left; }

.xyz-dual {
  --lo: 0%;
  --hi: 100%;
  position: relative;
  height: 22px;
}

.xyz-dual::before,
.xyz-dual::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 999px;
  pointer-events: none;
}

.xyz-dual::before {
  left: 0;
  right: 0;
  background: rgba(255, 245, 230, 0.12);
}

.xyz-dual::after {
  left: var(--lo);
  width: max(0px, calc(var(--hi) - var(--lo)));
  background: linear-gradient(90deg, #d4cdc3, var(--axis));
  box-shadow: none;
}

.xyz-dual input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  top: 0;
  height: 22px;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.xyz-dual input.xyz-min { z-index: 2; }
.xyz-dual input.xyz-max { z-index: 3; }

.xyz-dual input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: transparent;
  border-radius: 999px;
}

.xyz-dual input[type="range"]::-moz-range-track {
  height: 5px;
  background: transparent;
  border: none;
  border-radius: 999px;
}

.xyz-dual input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #2a2520;
  border: 2px solid #d8d0c6;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.xyz-dual input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2a2520;
  border: 2px solid #d8d0c6;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.xyz-dual input[type="range"]:hover:not(:disabled)::-webkit-slider-thumb,
.xyz-dual input[type="range"]:active:not(:disabled)::-webkit-slider-thumb {
  transform: scale(1.15);
  background: #cfc7bc;
  border-color: #efe8de;
  box-shadow: 0 0 0 4px rgba(255, 245, 230, 0.14);
}

.xyz-dual input[type="range"]:hover:not(:disabled)::-moz-range-thumb,
.xyz-dual input[type="range"]:active:not(:disabled)::-moz-range-thumb {
  transform: scale(1.15);
  background: #cfc7bc;
  border-color: #efe8de;
  box-shadow: 0 0 0 4px rgba(255, 245, 230, 0.14);
}

.xyz-dual input[type="range"]:disabled::-webkit-slider-thumb {
  background: #2a2520;
  border-color: rgba(255, 245, 230, 0.22);
  box-shadow: none;
  cursor: default;
}

.xyz-dual input[type="range"]:disabled::-moz-range-thumb {
  background: #2a2520;
  border-color: rgba(255, 245, 230, 0.22);
  box-shadow: none;
  cursor: default;
}

.xyz-dual:has(input:disabled)::after {
  opacity: 0.35;
  box-shadow: none;
}

.xyz-reset {
  align-self: flex-start;
  margin-top: 4px;
  color: rgba(255, 245, 230, 0.88) !important;
  border-color: rgba(255, 245, 230, 0.28) !important;
  background: rgba(255, 245, 230, 0.06) !important;
  border-radius: 8px !important;
}

.xyz-reset:hover:not(:disabled) {
  background: rgba(255, 245, 230, 0.14) !important;
  border-color: rgba(255, 245, 230, 0.45) !important;
}

.xyz-reset:disabled {
  color: rgba(255, 245, 230, 0.35) !important;
}

.plot-label {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 245, 230, 0.55);
  pointer-events: none;
}

.plot-pin {
  appearance: none;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 245, 230, 0.45);
  cursor: pointer;
}

.plot-pin:hover {
  color: rgba(255, 245, 230, 0.9);
  border-color: rgba(255, 245, 230, 0.22);
  background: rgba(255, 245, 230, 0.06);
}

.plot-pin.is-active {
  color: var(--accent);
  border-color: rgba(217, 119, 38, 0.45);
  background: rgba(217, 119, 38, 0.12);
}

.plot-pin:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.plot-cell canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.plot-cell canvas.is-hovering { cursor: default; }
.plot-cell canvas.is-panning { cursor: grabbing; }

.plot-grid.is-expanded .plot-cell {
  display: none;
}

.plot-grid.is-expanded .plot-cell.is-focus {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 4;
}

.hover-card {
  position: absolute;
  z-index: 5;
  max-width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  pointer-events: none;
  padding: 8px 10px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(28, 25, 22, 0.28);
  font-size: 12px;
}

.hover-card[hidden] { display: none; }

.hover-line {
  display: grid;
  grid-template-columns: minmax(72px, 42%) 1fr;
  gap: 8px;
  padding: 2px 0;
}

.hover-key { color: var(--muted); word-break: break-word; }
.hover-val { font-family: var(--mono); word-break: break-word; }

.hint {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0;
  color: rgba(255, 245, 230, 0.72);
  font-size: 13px;
  pointer-events: none;
}

.hint.is-hidden { display: none; }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 25, 22, 0.45);
}

.modal-back[hidden] { display: none; }

.modal {
  width: min(480px, 100%);
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(28, 25, 22, 0.18);
}

.modal-wide { width: min(920px, 100%); }

.coord-box {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.coord-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.map-scroll {
  overflow: auto;
  max-height: min(52vh, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.map-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}

.map-table th,
.map-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-table th {
  background: #f0ebe3;
  position: sticky;
  top: 0;
  z-index: 1;
}

.map-role-row td { background: #f7f3ec; }

.map-role {
  width: 100%;
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.map-role.is-required { color: #a11f1f; border-color: #d9a0a0; }
.map-role.is-optional { color: #9a5b00; border-color: #e0c08a; }

.map-opt-required { color: #a11f1f; }
.map-opt-optional { color: #9a5b00; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 8px;
  font-size: 12px;
}

.map-leg-req { color: #a11f1f; }
.map-leg-opt { color: #9a5b00; }

.map-info { margin: 0 0 8px; }

.modal-warn {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e0c36a;
  background: #fff7df;
  color: #6a5310;
  font-size: 12px;
}

.modal-warn[hidden] { display: none; }

.modal h2 {
  margin: 0 0 6px;
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.type-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.type-btn.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
}

.file-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}

.file-row input[type="file"] { font-size: 12px; }

.modal-error {
  margin: 8px 0 0;
  color: #8a2b22;
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.check-row[hidden],
.file-row[hidden],
.field[hidden],
.coord-box[hidden],
.modal-error[hidden],
.modal-warn[hidden] { display: none; }

.modal-export {
  width: min(440px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
}

.modal-help {
  width: min(640px, 100%);
  max-height: min(90vh, 780px);
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -16px -16px 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #f0b429 0%, #e08a2e 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--ink);
}

.help-head h2 {
  margin: 0;
  color: var(--ink);
}

.help-head .btn-ghost {
  border-color: rgba(28, 25, 22, 0.35);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.55);
}

.help-head .btn-ghost:hover {
  background: #fffdf8;
  border-color: var(--ink);
}

.help-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  margin: 8px 0 4px;
  padding-right: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}

.help-toc {
  flex-shrink: 0;
  margin: 4px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.help-foot {
  flex-shrink: 0;
  margin: 4px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.help-licence {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.modal-help .modal-actions {
  flex-shrink: 0;
  margin-top: 8px;
}

.help-toc-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.help-toc-list {
  margin: 0;
  padding: 0 0 0 16px;
  columns: 2;
  gap: 12px;
}

.help-toc-list a {
  color: var(--accent);
  text-decoration: none;
}

.help-toc-list a:hover { text-decoration: underline; }

.help-section {
  margin: 0 0 18px;
  padding-top: 2px;
}

.help-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink);
}

.help-section h4 {
  margin: 12px 0 6px;
  font-size: 13px;
  color: var(--ink);
}

.help-section p {
  margin: 0 0 8px;
}

.help-list {
  margin: 0 0 8px;
  padding: 0 0 0 18px;
}

.help-list li { margin: 0 0 4px; }

.help-table-wrap {
  overflow: auto;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.help-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.help-table th,
.help-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.help-table th {
  background: #f0ebe3;
  font-weight: 600;
}

.help-table tr:last-child td { border-bottom: none; }

.help-section code {
  font-family: var(--mono);
  font-size: 12px;
  background: #f0ebe3;
  padding: 1px 4px;
  border-radius: 3px;
}

.help-example {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e0d5c4;
  background: #faf6ef;
  font-size: 12.5px;
  line-height: 1.45;
}

.help-example-title {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a7355;
  margin: 0 0 6px;
}

.help-example p { margin: 0 0 6px; }
.help-example p:last-child { margin-bottom: 0; }

.help-example pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  overflow: auto;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: pre-wrap;
}

.export-block {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.export-block-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.export-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.export-row {
  margin-bottom: 8px;
}

.export-select,
.export-input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.export-input-block {
  width: 100%;
  margin-bottom: 8px;
}

.export-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
}

.export-inline .export-input {
  width: 96px;
}

.export-note {
  margin: 6px 0 0;
  font-size: 12px;
}

.export-color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.export-color {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.export-color:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .stage { min-height: 60vh; }
}

/* —— Splash (PLOT-style layout, Lite palette) —— */
#splashScreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 28px 72px;
  overflow: auto;
  box-sizing: border-box;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #e7efe9 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #efe6d8 0%, transparent 50%),
    linear-gradient(180deg, #fffdf8 0%, #f4f1eb 100%);
  transition: opacity 0.45s ease-out;
}

#splashScreen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-layout {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 300px) minmax(280px, 1.15fr);
  gap: 28px;
  align-items: start;
  margin-top: 12px;
}

.splash-tech-info,
.splash-content {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

.splash-tech-info h2,
.splash-description p:first-child {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.splash-tech-info h2 + h2,
.splash-tech-info h2:nth-of-type(2) {
  margin-top: 22px;
}

.splash-tech-info p,
.splash-description p {
  margin: 0 0 10px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 400;
}

.splash-description p:first-child {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 600;
}

.splash-tech-info ul,
.splash-description ul {
  margin: 0;
  padding-left: 1.15em;
}

.splash-tech-info li,
.splash-description li {
  margin: 0.35em 0;
}

.splash-image-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.splash-brand {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.15;
}

.splash-brand strong {
  color: var(--accent);
  font-weight: 700;
}

.splash-image {
  display: block;
  width: min(100%, 280px);
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(28, 25, 22, 0.12));
}

.splash-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.splash-button {
  appearance: none;
  border: 1px solid #0a4a3d;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 92, 76, 0.22);
  min-width: 160px;
}

.splash-button:hover {
  background: #0a4a3d;
  box-shadow: 0 4px 14px rgba(15, 92, 76, 0.28);
}

.splash-button:active {
  transform: translateY(1px);
}

.splash-timer {
  font-size: 12px;
  color: var(--muted);
  min-height: 1.2em;
}

.splash-version-footer {
  position: fixed;
  left: 20px;
  bottom: 16px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  z-index: 10001;
  user-select: none;
}

.splash-legal-footer {
  position: fixed;
  right: 20px;
  bottom: 16px;
  max-width: min(520px, calc(100vw - 160px));
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.peu-disclaimer,
.peu-license {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: right;
}

.peu-license a {
  color: inherit;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .splash-layout {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .splash-version-footer,
  .splash-legal-footer {
    position: static;
    max-width: none;
    margin-top: 24px;
    text-align: center;
    align-items: center;
  }

  .peu-disclaimer,
  .peu-license {
    text-align: center;
  }

  #splashScreen {
    flex-direction: column;
    align-items: center;
  }
}
