:root {
  color-scheme: light;
  --orange: #FA9549;
  --slate: #5F668C;
  --steel: #2B2F3A;
  --cyan: #4895EF;
  --gold: #D4AF37;
  --copper: #D97236;
  --magenta: #C84B9E;
  --concrete: #7A7D80;
  --silver: #E2E1E6;
  --background: #f4f4f7;
  --surface: #fff;
  --surface-subtle: #f8f8fb;
  --ink: #292d38;
  --muted: #5d6270;
  --line: var(--silver);
  --dark: var(--steel);
  --accent: var(--orange);
  --accent-dark: #ffad70;
  --link: #8d400f;
  --active: #fce9dc;
  --input: #fff;
  --field-border: #dedee7;
  --card-icon: #fcebdd;
  --card-icon-ink: #8b451e;
  --sidebar: #fff;
  --nav-hover: #f2f1f7;
  --nav-active: #ececf4;
  --summary: var(--slate);
  --metric: #4a5172;
  --step: #f4f3f8;
  --warning: #9a3e26;
  --radius: 17px;
  --mobile-nav: 66px;
  --banner-height: 0px;
  font-family: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
button, select, input, textarea { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, canvas:focus-visible {
  outline: 2px solid #af4e28;
  outline-offset: 3px;
}
button, a, input, select { touch-action: manipulation; }
svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
i { font-style: normal; display: inline-flex; }
h1, h2, p { margin: 0; }
button, select, input, textarea { color: inherit; }
button { border: 0; background: none; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 28px 17px 18px;
  background: var(--dark); color: #f2f0e5;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 5px 32px; }
.brand-mark { width: 41px; height: 41px; border-radius: 12px; background: #e6a16c; color: #35251d; display: grid; place-items: center; }
.brand-mark svg { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 21px; line-height: 1.05; font-weight: 750; letter-spacing: -.075em; }
.brand small { display: block; color: #bfc2b3; font-size: 11px; margin-top: 5px; letter-spacing: .01em; }
.tabs { display: grid; gap: 6px; }
.tabs a { display: flex; align-items: center; gap: 12px; color: #d7d9cd; font-weight: 600; min-height: 43px; padding: 0 13px; border-radius: 9px; font-size: 13px; }
.tabs a svg { width: 18px; height: 18px; }
.tabs a:hover { background: #343a32; color: #fffdf6; }
.tabs a[aria-current="page"] { color: #f7b990; background: #434039; }
.sidebar-footer { margin-top: auto; padding: 17px 8px 4px; display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid #454c42; }
.status-point { width: 7px; height: 7px; border-radius: 50%; background: #91b48a; margin-top: 4px; flex-shrink: 0; }
.sidebar-footer strong, .sidebar-footer small { display: block; font-size: 11px; }
.sidebar-footer small { margin-top: 4px; color: #acb0a3; }
main { min-width: 0; }
.topbar {
  min-height: 69px; padding: 12px clamp(23px, 3.8vw, 56px); display: flex; align-items: center; justify-content: space-between;
  gap: 14px; border-bottom: 1px solid var(--line); background: #fbfaf5;
}
.breadcrumb { color: var(--muted); display: flex; gap: 9px; align-items: center; font-size: 12px; white-space: nowrap; }
.breadcrumb svg { width: 17px; height: 17px; color: #7a7f70; }
.breadcrumb b { color: #a7a89c; font-weight: 400; }
.breadcrumb span { color: var(--ink); font-weight: 700; }
.content { max-width: 1540px; margin: auto; padding: 34px clamp(23px, 3.8vw, 56px) 48px; }
.page-heading { margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(29px, 4vw, 47px); line-height: 1.06; letter-spacing: -.055em; font-weight: 790; }
.page-heading p { color: var(--muted); margin-top: 9px; line-height: 1.55; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 355px) minmax(0, 1fr); gap: 19px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 3px #312c1605; }
.setup, .result-card { padding: 20px; min-width: 0; }
.plan-output { display: grid; gap: 16px; scroll-margin-top: 12px; }
.plan-output:empty { display: none; }
.panel-heading { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 16px; }
.panel-heading h2 { font-size: 16px; font-weight: 750; line-height: 1.2; letter-spacing: -.02em; }
.panel-icon { color: #985331; background: #f6e8d8; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; flex-shrink: 0; }
.panel-icon svg { width: 18px; height: 18px; }
.button, .text-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.button { min-height: 42px; padding: 0 13px; border-radius: 9px; font-size: 13px; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.button svg, .text-button svg { width: 16px; height: 16px; }
.button-outline { border: 1px solid #dcded3; background: var(--surface); }
.button-outline:hover { background: #eeeee5; }
.button-primary { background: var(--accent); color: #fff9f3; }
.button-primary:hover { background: var(--accent-dark); }
.button-primary.full { width: 100%; justify-content: flex-start; padding: 0 13px; min-height: 47px; }
.trailing { margin-left: auto; }
.text-button { padding: 0; min-height: 32px; font-size: 12px; color: #99441f; font-weight: 700; text-align: left; }
.text-button:hover { color: #733719; text-decoration: underline; }
.icon-button { width: 34px; min-height: 35px; padding: 0; color: #687063; border-radius: 7px; }
.icon-button:hover { background: #f1eee5; color: #8e3f22; }
.icon-button svg { width: 16px; height: 16px; }
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid #e8e5da; border-radius: 10px; background: #f4f3ec; margin-bottom: 20px; }
.mode-switch button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 37px; border-radius: 7px; color: #5d6457; font-weight: 700; padding: 4px; font-size: 12px; }
.mode-switch button[aria-pressed="true"] { color: #8c3717; background: #fffdf7; box-shadow: 0 1px 3px #49372620; }
.mode-switch button svg { width: 15px; height: 15px; }
.field-group { border: 0; padding: 0; margin: 0 0 15px; min-width: 0; }
.field-group legend { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; padding: 0; }
.field-icon { color: #686e61; }
.field-icon svg { width: 16px; height: 16px; }
.field-group > p { line-height: 1.48; margin: 5px 0 8px; color: var(--muted); font-size: 12px; }
.entry-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 68px auto; gap: 5px; align-items: center; padding: 4px; margin-bottom: 5px;
  border: 1px solid #e5e3d8; border-radius: 9px; background: #fcfbf6; min-height: 46px; min-width: 0;
}
.entry-row .item-icon { width: 32px; height: 32px; border-radius: 7px; }
.entry-row .item-icon svg { width: 16px; height: 16px; }
.entry-row .row-remove { width: 25px; }
.entry-row .row-remove svg { width: 14px; height: 14px; }
.select-wrap { position: relative; display: block; min-width: 0; }
.select-wrap > svg { position: absolute; pointer-events: none; right: 9px; top: calc(50% - 7px); width: 14px; height: 14px; color: var(--muted); }
.select-wrap select {
  appearance: none; width: 100%; min-width: 0; height: 42px; padding: 0 27px 0 10px; border: 1px solid #e1dfd4; border-radius: 8px;
  background: #fcfbf5; font-size: 13px; font-weight: 650; text-overflow: ellipsis;
}
.row-select select { background: transparent; border: 0; font-size: 12px; height: 34px; padding-left: 2px; padding-right: 17px; }
.row-select > svg { right: 1px; }
.quantity { display: flex; align-items: center; min-width: 0; padding-right: 5px; border: 1px solid #e2dfd3; border-radius: 7px; background: #fffefa; color: #5f6659; }
.quantity input { background: transparent; border: 0; width: 100%; min-width: 0; height: 33px; text-align: right; font-weight: 750; padding: 0 3px; border-radius: inherit; }
.quantity span { flex-shrink: 0; font-size: 10px; }
.standalone-field { display: grid; gap: 6px; margin: 0 0 14px; min-width: 0; }
.standalone-field > span:first-child { font-size: 13px; font-weight: 700; }
.standalone-field > input, .standalone-field textarea { width: 100%; padding: 10px 11px; border: 1px solid #e1dfd4; border-radius: 8px; background: #fcfbf5; }
.standalone-field textarea { resize: vertical; }
.standalone-field .quantity { padding-right: 10px; }
.standalone-field .quantity input { height: 40px; margin-right: 3px; padding: 0 10px; text-align: left; }
.standalone-field .quantity span { font-size: 12px; }
.advanced { border-top: 1px solid var(--line); padding: 3px 0 6px; margin: 0 0 12px; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.advanced summary { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; min-height: 39px; color: var(--muted); }
.advanced summary > svg { width: 15px; height: 15px; }
.advanced summary > svg:last-child { margin-left: auto; }
.advanced[open] summary > svg:last-child, .step[open] summary > svg:last-child { transform: rotate(180deg); }
.form-message { font-size: 12px; line-height: 1.5; margin-top: 9px; color: #953e1f; }
.power-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.summary { background: #30382f; color: #f8f6e9; padding: 18px; border-color: #30382f; overflow: hidden; }
.summary-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 17px; }
.summary-top p { color: #c6cbbb; font-size: 11px; font-weight: 650; margin-bottom: 3px; }
.summary h2 { font-size: clamp(18px, 2.4vw, 27px); letter-spacing: -.045em; line-height: 1.12; }
.pill { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; border-radius: 99px; padding: 5px 8px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.pill svg { width: 12px; height: 12px; }
.pill.good { color: #d3ead1; background: #445b44; }
.pill.warn { color: #ffdab7; background: #694333; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { padding: 9px 10px; background: #40493d; border-radius: 9px; min-width: 0; }
.metric > span { display: flex; gap: 5px; align-items: center; color: #d3d8c8; font-size: 11px; font-weight: 630; line-height: 1.2; }
.metric svg { width: 14px; height: 14px; color: #f0ad79; }
.metric strong { display: block; font-size: clamp(19px, 3vw, 29px); font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.metric small { font-size: 11px; font-weight: 600; color: #d3d8c8; margin-left: 5px; letter-spacing: 0; }
.summary-note { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #f1d4ad; font-size: 12px; margin-top: 12px; }
.summary-note svg { width: 14px; height: 14px; }
.output-lines { margin-top: 9px; }
.output-lines > div { display: flex; align-items: center; gap: 7px; padding-top: 7px; color: #edf2e8; font-size: 12px; }
.output-lines b { margin-left: auto; white-space: nowrap; }
.output-lines .item-icon { width: 26px; height: 26px; }
.output-lines .item-icon svg { width: 14px; height: 14px; }
.result-card .panel-heading { margin-bottom: 8px; }
.section-count { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.result-list { display: grid; }
.result-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px 0; min-height: 52px; min-width: 0; }
.result-list > * + * { border-top: 1px solid #edebe3; }
.result-row strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.result-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.result-row > svg { height: 15px; width: 15px; color: var(--muted); }
.result-value { text-align: right; font-variant-numeric: tabular-nums; }
.item-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 8px; flex-shrink: 0; }
.item-icon svg { width: 17px; height: 17px; }
.tone-stone, .tone-graphite { color: #52594e; background: #eeeee6; }
.tone-rust { color: #9a532e; background: #f5e9dd; }
.tone-copper { color: #9b5531; background: #f6e9d8; }
.tone-ochre, .tone-gold { color: #825524; background: #f4ebd3; }
.tone-teal, .tone-green { color: #386551; background: #e3eee4; }
.tone-blue { color: #405f6e; background: #e6eef1; }
.tone-purple, .tone-pink { color: #765477; background: #f0e8f0; }
.warn-text, .result-row small.warn-text { color: #a44222; }
.step .result-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.step-details { background: #f7f6ef; border-radius: 8px; padding: 8px 10px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.step-details > strong { color: var(--ink); display: block; margin-bottom: 5px; }
.step-details > div { display: flex; gap: 12px; justify-content: space-between; padding: 3px 0; }
.step-details p { margin-top: 5px; }
.result-footer { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 6px; color: var(--muted); font-size: 11px; }
.result-footer .text-button { min-height: 28px; }
.empty-note { color: var(--muted); font-size: 13px; padding: 12px 0; }
.empty-projects { display: grid; place-items: center; justify-content: center; gap: 10px; min-height: 250px; padding: 25px; text-align: center; }
.empty-projects h2 { font-size: 20px; letter-spacing: -.035em; }
.empty-projects p, .muted, .project-date { color: var(--muted); }
.empty-projects p { max-width: 33ch; font-size: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 15px; }
.project-card { padding: 16px; min-width: 0; overflow-wrap: anywhere; }
.project-header, .project-actions { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.project-date { font-size: 11px; }
.project-card h2 { font-size: 18px; margin-top: 12px; }
.project-card p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.project-notes { white-space: pre-wrap; }
.project-actions { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 7px; }
.map-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 11px; }
.map-search {
  display: flex; align-items: center; flex: 1 1 210px; min-width: 0; gap: 8px; padding: 0 10px; border-radius: 8px;
  border: 1px solid #e3e1d4; background: #fcfbf6; min-height: 42px;
}
.map-search svg { width: 16px; height: 16px; color: var(--muted); }
.map-search input { font-size: 13px; border: 0; background: transparent; min-width: 0; width: 100%; padding: 0; height: 38px; }
.map-filters { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 0; }
.filter-chip { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: 11px; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 0 9px; }
.filter-chip[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: #d7d6ca; }
.filter-chip span { width: 8px; height: 8px; border-radius: 50%; background: #7b8072; }
.filter-chip[aria-pressed="true"] span { background: var(--marker); border: 1px solid #31281b33; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 285px); gap: 13px; align-items: start; }
.atlas { overflow: hidden; min-width: 0; }
.atlas-head, .atlas-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 13px; }
.atlas-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.atlas-name > span { color: var(--muted); }
.atlas-name h2 { font-size: 15px; overflow-wrap: anywhere; }
.atlas-name p, .atlas-footer { color: var(--muted); font-size: 11px; line-height: 1.35; }
.atlas-footer label { display: inline-flex; align-items: center; gap: 4px; }
.atlas-footer input { accent-color: var(--accent); }
.canvas-wrap { position: relative; background: #232e2a; height: clamp(320px, 46vw, 540px); }
#atlas-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#atlas-canvas:active { cursor: grabbing; }
.atlas-controls, .atlas-compass { position: absolute; right: 10px; display: grid; gap: 3px; }
.atlas-controls { bottom: 10px; }
.atlas-compass { top: 10px; color: #ece9ce; place-items: center; font-size: 12px; pointer-events: none; }
.atlas-controls button { display: grid; place-items: center; width: 37px; height: 36px; border: 1px solid #7b8576; border-radius: 7px; background: #2a362e; color: #f3f0e3; }
.atlas-controls button:hover { background: #414e43; }
.atlas-controls svg { width: 17px; height: 17px; }
.atlas-scale { position: absolute; bottom: 11px; left: 10px; min-width: 100px; color: #fcf4da; border-bottom: 2px solid #fcf4da; text-align: center; padding-bottom: 3px; font-size: 11px; pointer-events: none; }
.map-list-panel { padding: 13px; min-width: 0; }
.map-list-panel .panel-heading { margin: 0 0 10px; }
.map-list { display: grid; max-height: 450px; overflow: auto; overscroll-behavior: contain; }
.map-list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; text-align: left; align-items: center; padding: 6px 3px; min-height: 46px; border-radius: 7px; }
.map-list-row:hover, .map-list-row[aria-pressed="true"] { background: #f2efe4; }
.pin-icon, .pin-title i { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 7px; background: #3a3f35; color: var(--marker); }
.pin-icon svg, .pin-title i svg { width: 16px; height: 16px; }
.map-list-row > svg { color: var(--muted); width: 14px; height: 14px; }
.map-list-row strong, .map-list-row small { display: block; word-break: break-word; }
.map-list-row strong { font-size: 12px; }
.map-list-row small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.map-pin-details { background: #f3f1e7; border-radius: 9px; padding: 8px; margin-bottom: 8px; overflow-wrap: anywhere; }
.pin-title { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.map-pin-details p { color: var(--muted); margin: 6px 0; font-size: 11px; }
.map-pin-details .button { min-height: 35px; margin-top: 4px; white-space: normal; }
.privacy-button { margin-top: 12px; }
.banner-active .content { padding-bottom: calc(48px + var(--banner-height)); }
dialog { padding: 20px; width: min(390px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px #252a2550; }
dialog::backdrop { background: #262b2470; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 15px; }
.toast { z-index: 20; position: fixed; bottom: calc(19px + var(--banner-height)); right: 16px; max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 9px; background: #252a25; color: #fff9ec; font-size: 13px; box-shadow: 0 4px 16px #232b2840; }

@media (min-width: 900px) and (max-width: 1130px) {
  .shell { grid-template-columns: 180px minmax(0, 1fr); }
  .content, .topbar { padding-left: 22px; padding-right: 22px; }
  .plan-grid { grid-template-columns: minmax(0, 310px) minmax(0, 1fr); gap: 13px; }
  .setup, .result-card { padding: 14px; }
}
@media (max-width: 899px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: max(11px, env(safe-area-inset-top)) 16px 10px; }
  .brand { padding: 0; width: fit-content; }
  .brand-mark { height: 35px; width: 35px; border-radius: 8px; }
  .brand-mark svg { height: 20px; width: 20px; }
  .brand strong { font-size: 19px; }
  .brand small { font-size: 10px; margin-top: 3px; }
  .sidebar-footer { display: none; }
  .tabs {
    position: fixed; inset: auto 0 0; z-index: 10; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; min-height: var(--mobile-nav);
    padding: 6px max(5px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left));
    background: var(--dark); border-top: 1px solid #464d42;
  }
  .tabs a { flex-direction: column; justify-content: center; gap: 4px; min-height: 46px; padding: 3px; font-size: 10px; text-align: center; }
  .tabs a svg { width: 19px; height: 19px; }
  .content { padding-bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 22px); }
  .banner-active .content { padding-bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 22px + var(--banner-height)); }
  .toast { bottom: calc(var(--mobile-nav) + env(safe-area-inset-bottom) + 10px + var(--banner-height)); }
  .topbar { min-height: 51px; padding-top: 5px; padding-bottom: 5px; }
  .topbar .button { min-height: 36px; }
}
@media (max-width: 650px) {
  .topbar { padding-left: 12px; padding-right: 12px; }
  .breadcrumb { font-size: 0; gap: 4px; }
  .breadcrumb b { display: none; }
  .breadcrumb span { font-size: 12px; }
  .content { padding-top: 21px; padding-left: 12px; padding-right: 12px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading h1 { font-size: clamp(25px, 7.7vw, 35px); }
  .page-heading p { font-size: 13px; }
  .plan-grid, .map-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .setup, .result-card, .summary { padding: 13px; }
  .summary h2 { font-size: 19px; }
  .metric strong { font-size: 23px; }
  .plan-output { gap: 12px; }
  .map-toolbar .button { flex: 1 1 120px; }
  .map-toolbar .select-wrap { flex: 1 1 130px; }
  .canvas-wrap { height: clamp(310px, 92vw, 430px); }
  .entry-row { grid-template-columns: auto minmax(0, 1fr) 72px auto; }
  .entry-row input, .entry-row select, .standalone-field input, .map-search input, .standalone-field select, .standalone-field textarea { font-size: 16px; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #22242b;
  --surface: var(--steel);
  --surface-subtle: #292d38;
  --ink: #f4f3f8;
  --muted: #c1c3d1;
  --line: #414657;
  --dark: #1d2027;
  --link: #ffb17a;
  --active: #593c31;
  --input: #242731;
  --field-border: #494e62;
  --card-icon: #594033;
  --card-icon-ink: #ffc095;
  --sidebar: #272a34;
  --nav-hover: #383b4b;
  --nav-active: #3e445e;
  --summary: #414862;
  --metric: #30364b;
  --step: #333747;
  --warning: #ffab8d;
}

.sidebar { background: var(--sidebar); color: var(--ink); border-right: 1px solid var(--line); }
.brand-mark { background: var(--orange); color: #242835; }
.brand small, .sidebar-footer small, .breadcrumb svg, .breadcrumb b { color: var(--muted); }
.tabs a { color: var(--muted); }
.tabs a:hover { background: var(--nav-hover); color: var(--ink); }
.tabs a[aria-current="page"] { color: #424a70; background: var(--nav-active); }
:root[data-theme="dark"] .tabs a[aria-current="page"] { color: #f7bd98; }
.sidebar-footer { border-color: var(--line); }
.status-point { background: var(--cyan); }
.topbar { background: var(--surface); }
.top-actions { display: flex; align-items: center; gap: 7px; }
.theme-select select { background: var(--surface-subtle); padding-left: 31px; min-width: 100px; }
.theme-select > i { position: absolute; top: calc(50% - 8px); left: 9px; color: var(--muted); pointer-events: none; }
.theme-select > i:last-child { left: auto; right: 7px; }
.theme-select > i svg { width: 15px; height: 15px; }
.panel-icon { color: var(--card-icon-ink); background: var(--card-icon); }
.button-outline { border-color: var(--line); background: var(--surface); }
.button-outline:hover, .icon-button:hover { background: var(--nav-hover); }
.button-primary, .button-primary:hover { color: #271f1a; }
.text-button, .text-button:hover { color: var(--link); }
.icon-button, .field-icon, .form-message { color: var(--muted); }
.form-message { color: var(--warning); }
.icon-button:hover { color: var(--link); }
.entry-row, .map-search { background: var(--surface-subtle); border-color: var(--line); }
.mode-switch { background: var(--surface-subtle); border-color: var(--line); }
.mode-switch button { color: var(--muted); }
.mode-switch button[aria-pressed="true"] { color: var(--link); background: var(--active); }
.select-wrap select, .standalone-field > input, .standalone-field textarea { background: var(--input); border-color: var(--field-border); }
.row-select select { background: transparent; }
.row-select option { background: var(--input); }
.quantity { background: var(--input); border-color: var(--field-border); color: var(--ink); }
.summary { background: var(--summary); border-color: var(--summary); color: #fff; }
.summary-top p, .metric small, .metric > span { color: #e9ebf6; }
.metric { background: var(--metric); }
.metric svg { color: var(--orange); }
.pill.good { color: #f9f8ff; background: #373e5d; }
.pill.warn { color: #ffdfc6; background: #604036; }
.result-list > * + * { border-color: var(--line); }
.step-details, .map-pin-details { background: var(--step); }
.warn-text, .result-row small.warn-text { color: var(--warning); }
.tone-stone, .tone-graphite { color: #4c515b; background: #e8e8ed; }
.tone-rust, .tone-copper { color: #813714; background: #f4dfd4; }
.tone-ochre, .tone-gold { color: #675114; background: #f3e8c1; }
.tone-teal, .tone-green { color: #285276; background: #deeaf6; }
.tone-blue { color: #1b5390; background: #deebfa; }
.tone-purple, .tone-pink { color: #7c3767; background: #f2dfed; }
:root[data-theme="dark"] .tone-stone, :root[data-theme="dark"] .tone-graphite { color: #e0e1e9; background: #4b505c; }
:root[data-theme="dark"] .tone-rust, :root[data-theme="dark"] .tone-copper { color: #ffd2b8; background: #633d31; }
:root[data-theme="dark"] .tone-ochre, :root[data-theme="dark"] .tone-gold { color: #f7dd87; background: #544924; }
:root[data-theme="dark"] .tone-teal, :root[data-theme="dark"] .tone-green, :root[data-theme="dark"] .tone-blue { color: #c2ddff; background: #324c6a; }
:root[data-theme="dark"] .tone-purple, :root[data-theme="dark"] .tone-pink { color: #ffd2f1; background: #593955; }
.tone-copper { box-shadow: inset 2px 0 var(--copper); }
.tone-gold { box-shadow: inset 2px 0 var(--gold); }
.tone-blue { box-shadow: inset 2px 0 var(--cyan); }
.tone-pink { box-shadow: inset 2px 0 var(--magenta); }
.tone-stone { box-shadow: inset 2px 0 var(--concrete); }
.map-list-row:hover, .map-list-row[aria-pressed="true"] { background: var(--step); }
.filter-chip[aria-pressed="true"] { border-color: var(--line); }
.canvas-wrap, .atlas-controls button, .pin-icon, .pin-title i { background: var(--steel); }
.atlas-controls button:hover { background: var(--slate); }
.toast { background: var(--steel); color: #fff; }

@media (max-width: 899px) {
  .sidebar { border-right: 0; }
  .tabs { background: var(--sidebar); border-color: var(--line); }
  .theme-select select { height: 36px; }
}
@media (max-width: 440px) {
  .top-actions { gap: 5px; }
  .topbar .button { padding: 0 7px; font-size: 11px; gap: 4px; }
  .theme-select select { min-width: 84px; padding-left: 7px; font-size: 12px; }
  .theme-select > i:first-child { display: none; }
}
