:root {
  color-scheme: light;
  --ink: #12251f;
  --muted: #64727a;
  --line: #dce2e5;
  --paper: #f4f6f7;
  --white: #ffffff;
  --orange: #b54a1f;
  --orange-dark: #8d3514;
  --orange-deep: #572712;
  --orange-soft: #f8ece6;
  --orange-pale: #fcf8f6;
  --navy: #19343f;
  --navy-dark: #102630;
  --navy-soft: #eaf0f2;
  --green: var(--orange);
  --green-dark: var(--orange-dark);
  --green-soft: var(--orange-soft);
  --danger: #a23c35;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  min-width: 320px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

button, a { font: inherit; }
input { font: inherit; }

button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(181, 74, 31, 0.28);
  outline-offset: 2px;
}

.app-shell { height: 100%; display: grid; grid-template-rows: 72px 1fr; }

.topbar {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; font-family: Georgia, serif; font-size: 22px; line-height: 1; }
.brand small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.15em; }

.brand-mark { position: relative; display: block; width: 34px; height: 34px; transform: rotate(30deg); }
.brand-mark span { position: absolute; width: 18px; height: 18px; border: 2px solid var(--green); }
.brand-mark span:nth-child(1) { top: 0; left: 8px; }
.brand-mark span:nth-child(2) { top: 12px; left: 0; }
.brand-mark span:nth-child(3) { top: 12px; right: 0; background: rgba(24, 122, 85, 0.09); }

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.save-state { color: var(--muted); font-size: 12px; }
.save-state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #64a985; }

.workspace { min-height: 0; display: grid; grid-template-columns: 330px 1fr; }

.panel {
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  padding: 30px 26px 24px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--white);
  box-shadow: 8px 0 32px rgba(25, 47, 39, 0.06);
}

.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.panel-heading h1 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1.08; }
.panel-heading > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.primary-actions { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; }
.button { min-height: 42px; padding: 0 15px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 750; transition: 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; color: #8a9296; border-color: #dfe3e5; background: #eceff0; box-shadow: none; opacity: 1; }
.button-primary { color: white; background: var(--ink); }
.button-primary.is-active { background: var(--green); }
.button-success { color: white; background: var(--green); }
.button-secondary { min-height: 36px; color: var(--ink); border-color: var(--line); background: white; }
.button-icon { margin-right: 6px; font-size: 17px; line-height: 0; }

.drawing-actions { display: flex; gap: 18px; margin-top: -12px; }
.text-button, .danger-button { padding: 0; border: 0; cursor: pointer; background: none; font-size: 11px; font-weight: 700; }
.text-button { color: var(--green-dark); }
.danger-button { color: var(--danger); }
.text-button:disabled, .danger-button:disabled { cursor: not-allowed; opacity: 0.35; }

.transform-card { flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfa; }
.transform-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 13px; background: #f7f9f6; }
.transform-header .eyebrow { margin-bottom: 3px; font-size: 8px; }
.transform-header h2 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.transform-header .mini-button { min-width: 88px; }
.transform-selection-actions { display: flex; gap: 5px; }
.transform-selection-actions .mini-button { min-width: 0; padding-inline: 8px; }
.transform-controls { display: grid; gap: 13px; padding: 14px; border-top: 1px solid var(--line); }
.selection-summary { display: grid; gap: 3px; padding: 9px 10px; border-radius: 4px; background: #fff4e8; }
.selection-summary > span { display: flex; align-items: center; gap: 7px; color: #8b4e25; font-size: 10px; }
.selection-summary i { width: 8px; height: 8px; border: 2px solid #d66d2e; border-radius: 50%; background: white; }
.selection-summary small { padding-left: 15px; color: #9a7255; font-size: 8px; }
.transform-scale-grid { gap: 7px; }
.nudge-section { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding-top: 2px; }
.nudge-heading { display: grid; gap: 7px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.nudge-heading label { display: flex; align-items: center; gap: 5px; }
.nudge-heading input { width: 58px; height: 27px; padding: 0 6px; border: 1px solid #d7dfda; border-radius: 4px; color: var(--ink); background: white; font-size: 10px; }
.nudge-heading em { font-size: 8px; font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; }
.nudge-pad { display: grid; grid-template-columns: repeat(3, 27px); grid-template-rows: repeat(3, 27px); gap: 2px; }
.nudge-pad button { display: grid; place-items: center; padding: 0; border: 1px solid #cdd7d1; border-radius: 3px; cursor: pointer; color: var(--green-dark); background: white; font-size: 13px; }
.nudge-pad button:hover { border-color: var(--green); background: var(--green-soft); }
.nudge-pad [data-nudge="north"] { grid-column: 2; grid-row: 1; }
.nudge-pad [data-nudge="west"] { grid-column: 1; grid-row: 2; }
.nudge-pad #reset-translation-button { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 18px; }
.nudge-pad [data-nudge="east"] { grid-column: 3; grid-row: 2; }
.nudge-pad [data-nudge="south"] { grid-column: 2; grid-row: 3; }
.transform-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 2px; }
.transform-footer .button { min-height: 32px; padding-inline: 20px; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.guide-card { flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfa; }
.guide-card summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none; background: #f5f7f4; }
.guide-card summary::-webkit-details-marker { display: none; }
.guide-card summary > span { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; }
.guide-card summary > span i { width: 14px; height: 11px; border: 1.5px solid var(--green); background: linear-gradient(135deg, transparent 48%, rgba(24,122,85,.2) 49%); transform: rotate(-4deg); }
.guide-card summary small { max-width: 110px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.guide-card[open] summary { border-bottom: 1px solid var(--line); }
.guide-body { padding: 14px; }
.guide-intro { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.upload-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border: 1px dashed #aabbb2; border-radius: 5px; cursor: pointer; color: var(--green-dark); background: white; font-size: 10px; font-weight: 800; }
.upload-button:hover { border-color: var(--green); background: #f5faf7; }
.upload-button > span:first-child { font-size: 16px; }
.guide-load-actions { display: grid; gap: 7px; }
.sample-guide-button { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 11px; border: 1px solid #c6d2d6; border-radius: 5px; cursor: pointer; color: var(--navy-dark); background: #f4f7f8; text-align: left; }
.sample-guide-button:hover { border-color: #8fa2a9; background: var(--navy-soft); }
.sample-guide-button .sample-icon { display: grid; flex: 0 0 auto; place-items: center; width: 28px; height: 28px; border: 1px solid var(--orange); border-radius: 4px; color: var(--orange); font-size: 18px; transform: rotate(-5deg); }
.sample-guide-button strong, .sample-guide-button small { display: block; }
.sample-guide-button strong { font-size: 10px; }
.sample-guide-button small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 600; }
.guide-controls { display: grid; gap: 12px; padding-top: 13px; }
.guide-drag-hint { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 9px; border-radius: 4px; color: var(--navy-dark); background: var(--navy-soft); font-size: 9px; font-weight: 700; line-height: 1.35; }
.guide-drag-hint span { display: grid; flex: 0 0 auto; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: white; background: var(--navy); font-size: 11px; }
.guide-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-button { min-height: 30px; padding: 0 8px; border: 1px solid #cad5cf; border-radius: 4px; cursor: pointer; color: var(--ink); background: white; font-size: 9px; font-weight: 750; }
.mini-button:hover, .mini-button.is-active { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-grid label { min-width: 0; }
.field-grid label > span, .range-field > span { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.field-grid em { font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; }
.field-grid input { width: 100%; height: 30px; padding: 0 7px; border: 1px solid #d7dfda; border-radius: 4px; color: var(--ink); background: white; font-size: 10px; }
.field-grid input:focus { border-color: var(--green); outline: 2px solid rgba(24,122,85,.12); }
.check-field { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 650; }
.check-field input { width: 13px; height: 13px; margin: 0; accent-color: var(--green); }
.range-field { display: block; }
.range-field output { color: var(--ink); font-size: 9px; letter-spacing: 0; }
.range-field input { width: 100%; height: 4px; margin: 4px 0; accent-color: var(--green); }
.guide-footer-actions { display: flex; align-items: center; gap: 12px; padding-top: 3px; }
.guide-footer-actions .check-field { margin-right: auto; }

.instruction-card { display: grid; gap: 14px; padding: 18px; border: 1px solid #e3e8e4; border-radius: 7px; background: #fafbf9; }
.step { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 10px; }
.step > span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #c9d8d0; border-radius: 50%; color: var(--green); font-family: Georgia, serif; font-size: 12px; }
.step p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.step strong { color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column; gap: 4px; padding: 16px 8px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats strong { font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.stats span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }

.panel-footer { display: flex; flex-direction: column; gap: 14px; margin-top: auto; }
.snap-key { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.snap-key i { width: 9px; height: 9px; border: 2px solid #32b47b; border-radius: 50%; }
.snap-key strong { color: var(--ink); font-size: 10px; }

.map-wrap { position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; background: #dfe5df; }
.map-wrap.is-drawing .maplibregl-canvas { cursor: crosshair !important; }
.map-wrap.is-placing .maplibregl-canvas { cursor: copy !important; }

.map-toolbar { position: absolute; z-index: 4; top: 14px; left: 14px; display: flex; align-items: stretch; gap: 3px; min-height: 48px; padding: 5px; border: 1px solid rgba(99,61,34,.14); border-radius: 8px; background: rgba(255,255,255,.95); box-shadow: 0 8px 26px rgba(48,34,23,.16); backdrop-filter: blur(10px); }
.tool-button { display: grid; grid-template-rows: 22px 12px; place-items: center; min-width: 48px; padding: 3px 7px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; color: #6f6259; background: transparent; transition: 130ms ease; }
.tool-button:hover:not(:disabled) { color: var(--navy-dark); background: var(--navy-soft); }
.tool-button.is-active { color: var(--navy-dark); border-color: #b9c8ce; background: var(--navy-soft); }
.tool-button-primary { color: white; background: var(--orange); }
.tool-button-primary:hover:not(:disabled), .tool-button-primary.is-active { color: white; border-color: var(--orange-dark); background: var(--orange-dark); }
.tool-button:disabled { cursor: not-allowed; color: #9da5a9; background: transparent; opacity: .58; }
.tool-button > i:first-child { font-size: 15px; line-height: 1; }
.tool-button small { font-size: 8px; font-weight: 800; letter-spacing: .02em; }
.tool-divider { align-self: center; width: 1px; height: 30px; margin: 0 2px; background: #eadfd7; }

.status-legend { position: absolute; z-index: 3; right: 14px; bottom: 38px; display: grid; grid-template-columns: repeat(2, auto); gap: 6px 13px; padding: 10px 12px; border: 1px solid rgba(99,61,34,.13); border-radius: 7px; color: #6f6259; background: rgba(255,255,255,.93); box-shadow: 0 6px 18px rgba(48,34,23,.12); font-size: 9px; backdrop-filter: blur(8px); }
.status-legend[hidden] { display: none; }
.status-legend strong { grid-column: 1 / -1; color: var(--ink); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.status-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-dot { display: inline-block; width: 9px; height: 9px; border: 2px solid #19343f; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.85); }
.status-available { background: #36a269; }
.status-pending { background: #f5a623; }
.status-cold { background: #4f86c6; }
.status-sold { background: #8a5a9b; }
.status-tool-icon { color: #36a269; text-shadow: 0 0 0 1px white; }

.lot-status-popup { min-width: 170px; padding: 2px; }
.lot-status-popup strong { display: block; margin-bottom: 8px; color: var(--ink); font-family: Georgia, serif; font-size: 14px; }
.lot-status-options { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.lot-status-options button { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 7px; border: 1px solid #eadfd7; border-radius: 4px; cursor: pointer; color: #5f554e; background: white; font-size: 9px; }
.lot-status-options button:hover, .lot-status-options button.is-current { border-color: #8fa2a9; background: var(--navy-soft); }
.trinity-link-field { display: grid; gap: 5px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.trinity-link-field select { width: 100%; height: 32px; padding: 0 26px 0 8px; border: 1px solid #cfd9dd; border-radius: 4px; color: var(--navy-dark); background: white; font-size: 10px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.trinity-link-field select:focus { border-color: var(--orange); outline: 2px solid rgba(181,74,31,.15); }
.trinity-record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; margin-top: 9px; padding: 9px; border-radius: 5px; background: #f3f6f7; }
.trinity-record div { min-width: 0; }
.trinity-record .trinity-record-wide { grid-column: 1 / -1; }
.trinity-record span { display: block; margin-bottom: 2px; color: #718087; font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.trinity-record b { display: block; overflow: hidden; color: var(--ink); font-size: 9px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; }
.maplibregl-popup-content { border-radius: 7px; box-shadow: 0 8px 26px rgba(48,34,23,.2); }

.status-pill {
  position: absolute;
  z-index: 2;
  top: 76px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(18, 37, 31, 0.12);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(18, 37, 31, 0.12);
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.status-pill { display: none; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #91a29a; }
.status-pill.is-drawing i { background: #25a76e; box-shadow: 0 0 0 4px rgba(37, 167, 110, 0.14); }
.status-pill.is-transforming i { background: #d66d2e; box-shadow: 0 0 0 4px rgba(214,109,46,.15); }

.map-tip { position: absolute; z-index: 2; right: 14px; bottom: 10px; padding: 6px 8px; border-radius: 3px; background: rgba(255,255,255,.82); color: #627069; font-size: 9px; pointer-events: none; }

.maplibregl-ctrl-top-right { top: 12px; right: 10px; }
.maplibregl-ctrl-group { border-radius: 5px !important; box-shadow: 0 5px 18px rgba(24, 40, 34, 0.14) !important; }

/* High-contrast brand theme and a clearer three-step workspace. */
.app-shell { grid-template-rows: 76px 1fr; }
.topbar { border-top: 4px solid var(--navy); border-bottom-color: var(--line); }
.brand-mark span { border-color: var(--orange); }
.brand-mark span:nth-child(3) { background: rgba(181, 74, 31, 0.12); }
.save-state::before { background: var(--orange); }
.workspace { grid-template-columns: 380px 1fr; }
.panel { gap: 16px; padding: 24px 20px 20px; }
.eyebrow { color: var(--orange-dark); }
.panel-heading > p:last-child { margin-top: 10px; font-size: 12px; line-height: 1.5; }

.draw-card,
.transform-card,
.guide-card { border-color: #eadfd7; background: white; box-shadow: 0 3px 12px rgba(77, 48, 28, 0.05); }

.section-bar,
.transform-header,
.guide-card summary { color: white; background: var(--navy); }

.section-bar { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 7px 13px; }
.section-bar small { display: block; margin-bottom: 1px; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.section-bar h2 { margin: 0; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.section-number { display: grid; flex: 0 0 auto; place-items: center; width: 25px; height: 25px; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; color: white; font-family: Georgia, serif; font-size: 12px; font-weight: 500; }
.draw-card-body { display: grid; gap: 10px; padding: 13px; }
.drawing-actions { margin-top: 0; }
.default-status-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid #f0e3da; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.default-status-field select { min-width: 112px; height: 29px; padding: 0 25px 0 8px; border: 1px solid #e6d2c3; border-radius: 4px; color: var(--orange-deep); background: white; font-size: 9px; font-weight: 750; text-transform: none; }
.svg-import-button { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 10px; border: 1px solid #cfd9dd; border-radius: 5px; cursor: pointer; color: var(--navy-dark); background: #f4f7f8; text-align: left; }
.svg-import-button:hover:not(:disabled) { border-color: #91a5ad; background: var(--navy-soft); }
.svg-import-button:disabled { cursor: default; color: #7c898e; background: #f1f3f4; }
.svg-import-button > span:first-child { display: grid; flex: 0 0 auto; place-items: center; width: 25px; height: 25px; border-radius: 4px; color: white; background: var(--navy); font-size: 14px; }
.svg-import-button strong, .svg-import-button small { display: block; }
.svg-import-button strong { font-size: 9px; }
.svg-import-button small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 600; }

.button-primary { color: white; background: var(--orange); box-shadow: 0 3px 9px rgba(87,39,18,.2); }
.button-primary.is-active { background: var(--orange-dark); }
.button-success { background: var(--orange-dark); }
.button-secondary { color: var(--navy-dark); border-color: #cfd9dd; background: #f2f5f6; }
.button-primary:hover:not(:disabled), .button-success:hover:not(:disabled) { background: var(--orange-dark); box-shadow: 0 5px 13px rgba(87,39,18,.23); }
.button-secondary:hover:not(:disabled) { border-color: #9cabb1; background: #e7edef; }

.transform-header { justify-content: flex-start; min-height: 50px; padding: 8px 13px; }
.transform-header > div:not(.transform-selection-actions) { margin-right: auto; }
.transform-header p { margin: 0 0 1px; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.transform-header h2 { color: white; }
.transform-header .mini-button { color: var(--navy-dark); border-color: white; background: white; }
.transform-controls { border-top-color: #efc39f; }
.selection-summary { background: var(--orange-soft); }
.selection-summary > span { color: var(--orange-deep); }
.selection-summary i { border-color: var(--orange); }

.guide-card summary { min-height: 50px; padding-inline: 13px; }
.guide-card summary > span i { border-color: white; background: linear-gradient(135deg, transparent 48%, rgba(255,255,255,.34) 49%); }
.guide-card summary small { color: white; opacity: .82; }
.guide-card[open] summary { border-bottom-color: #efc39f; }
.upload-button { border-color: #b9c7cc; color: var(--navy-dark); background: #f7f9fa; }

.mini-button { color: var(--navy-dark); border-color: #cfd9dd; }
.instruction-card { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; border-color: #f0e0d4; background: var(--orange-pale); }
.step { grid-template-columns: 1fr; justify-items: center; gap: 6px; text-align: center; }
.step > span { border-color: #efb985; color: var(--orange-dark); background: white; }
.step p { margin: 0; font-size: 9px; line-height: 1.35; }
.stats { overflow: hidden; border: 1px solid #f0dfd2; border-radius: 7px; background: var(--orange-pale); }
.snap-key i { border-color: var(--orange); }
.status-pill.is-transforming i { background: var(--orange); box-shadow: 0 0 0 4px rgba(245,132,38,.16); }
.nudge-pad button { color: var(--orange-dark); }
.nudge-pad button:hover { border-color: var(--orange); background: var(--orange-soft); }

/* Eight-stage guided walkthrough. */
.workspace { grid-template-columns: 360px 1fr; }
.tutorial-panel { justify-content: flex-start; gap: 0; padding: 34px 30px 26px; overflow: hidden; background: #fbfcfc; }
.tutorial-screen { display: flex; flex: 1; min-height: 0; flex-direction: column; animation: tutorial-in 220ms ease both; }
.tutorial-screen h1 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; line-height: 1.08; }
.tutorial-overview-screen { gap: 14px; margin-right: -9px; padding-right: 9px; overflow-y: auto; scrollbar-color: #b8ccca transparent; scrollbar-width: thin; }
.tutorial-overview-screen .tutorial-lead { margin: 0; color: #45595e; font-size: 14px; line-height: 1.55; }
.tutorial-overview-section h2, .tutorial-suite-card h2 { margin: 0 0 9px; color: var(--navy-dark); font-family: Georgia, serif; font-size: 18px; font-weight: 650; }
.tutorial-benefit-list { display: grid; gap: 6px; }
.tutorial-benefit-list > div { display: grid; grid-template-columns: 30px 1fr; align-items: start; gap: 9px; padding: 9px 10px; border: 1px solid #d7e4e2; border-radius: 6px; background: #f1f7f6; }
.tutorial-benefit-list i { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: white; background: #286a64; font-size: 12px; }
.tutorial-benefit-list strong, .tutorial-benefit-list small { display: block; }
.tutorial-benefit-list strong { margin-bottom: 3px; color: #173f3b; font-size: 12.5px; }
.tutorial-benefit-list small { color: #45595e; font-size: 12px; line-height: 1.45; }
.tutorial-suite-card { padding: 12px 13px; border: 1px solid #ead8ca; border-radius: 7px; background: #fff7f0; }
.tutorial-suite-card p { margin: 0 0 9px; color: #45575b; font-size: 12px; line-height: 1.48; }
.tutorial-suite-card ul { display: grid; gap: 5px; margin: 0; padding-left: 18px; color: #354b50; font-size: 11.5px; line-height: 1.45; }
.tutorial-overview-screen .tutorial-reset-primary { flex: 0 0 auto; }
.tutorial-panel .eyebrow { font-size: 11px; }
.tutorial-lead { margin: 14px 0 22px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.tutorial-help { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 19px; padding: 12px 13px; border: 1px solid #cfe1de; border-radius: 7px; color: #315b58; background: #eef6f5; }
.tutorial-lead + .tutorial-help { margin-top: -5px; }
.tutorial-help > i { display: grid; flex: 0 0 auto; place-items: center; width: 18px; min-height: 20px; color: #4f817c; background: transparent; font-size: 15px; line-height: 1; }
.tutorial-help strong, .tutorial-help span { display: block; }
.tutorial-help strong { margin-bottom: 3px; color: #204e4a; font-size: 13px; }
.tutorial-help span { font-size: 13px; line-height: 1.48; }
.tutorial-help-emphasis { border-color: #adcfc9; background: #e5f2f0; box-shadow: 0 4px 12px rgba(39, 100, 94, .08); }
.tutorial-current-help { flex: 0 0 auto; margin: 14px 0 0; border-color: #adcfc9; background: #e8f3f1; box-shadow: 0 4px 12px rgba(39, 100, 94, .08); }
.tutorial-location-card, .tutorial-preview-card, .focused-lot-card, .tutorial-result { border: 1px solid #dce3e5; border-radius: 7px; background: white; box-shadow: 0 4px 14px rgba(22,45,54,.05); }
.tutorial-location-card { display: flex; align-items: center; gap: 13px; padding: 15px; }
.location-pin { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: white; background: var(--navy); font-size: 18px; }
.tutorial-location-card small, .tutorial-location-card strong, .tutorial-location-card div > span { display: block; }
.tutorial-location-card small { margin-bottom: 3px; color: #286a64; font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.tutorial-location-card strong { font-family: Georgia, serif; font-size: 16px; font-weight: 600; }
.tutorial-location-card div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.tutorial-screen > .tutorial-primary-action:first-of-type { margin-top: auto; }
.tutorial-primary-action { position: relative; display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 0 17px; border: 1px solid #286a64; border-radius: 7px; cursor: pointer; color: white; background: #286a64; box-shadow: 0 7px 18px rgba(28, 86, 81, .18); font-size: 14px; font-weight: 500; transition: 140ms ease; }
.tutorial-screen > .tutorial-primary-action:first-of-type::before { content: "Next Step"; position: absolute; bottom: calc(100% + 10px); left: 0; color: #315b58; font-size: 12px; font-weight: 850; letter-spacing: .04em; }
.tutorial-screen > .tutorial-reset-primary:first-of-type::before { content: "Start Over"; }
.tutorial-primary-action:hover:not(:disabled) { border-color: #1b514c; background: #1b514c; box-shadow: 0 9px 22px rgba(28, 86, 81, .24); transform: translateY(-1px); }
.tutorial-primary-action:disabled { cursor: default; border-color: #d5dddf; color: #839096; background: #edf1f2; }
.tutorial-sync-action:not(:disabled) { border-color: #315d78; background: #315d78; }
.tutorial-sync-action:hover:not(:disabled) { border-color: #23475d; background: #23475d; }
.tutorial-primary-action:not(:disabled) { background-image: linear-gradient(110deg, transparent 32%, rgba(255,255,255,.17) 46%, transparent 60%); background-size: 280% 100%; animation: tutorial-button-shimmer 8.2s ease-in-out infinite; }
.tutorial-is-complete .tutorial-primary-action,
.tutorial-is-complete .tutorial-capabilities > :is(div, button) { animation: none !important; }
.tutorial-primary-action:hover:not(:disabled) { animation-play-state: paused; }
.tutorial-task-action { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: center; gap: 9px; margin: 10px 0 4px; padding: 0 14px; border: 1px solid #78a8a2; border-radius: 6px; cursor: pointer; color: #245c57; background: #edf6f4; font-size: 12px; font-weight: 650; transition: 140ms ease; }
.tutorial-task-action:hover:not(:disabled) { border-color: #286a64; color: white; background: #286a64; }
.tutorial-task-action:disabled { cursor: default; border-color: #c8d8d5; color: #4d7772; background: #e9f2f1; }
.tutorial-task-action i { font-size: 12px; }
.tutorial-action-stack { margin-top: auto; }
.tutorial-action-stack::before { content: "Next Step"; display: block; margin-bottom: -5px; color: #315b58; font-size: 12px; font-weight: 850; letter-spacing: .04em; }
.tutorial-action-stack .tutorial-primary-action:first-child { margin-top: 16px; }
.tutorial-reset-action { display: flex; width: 100%; min-height: 38px; align-items: center; justify-content: center; gap: 8px; margin-top: 9px; border: 1px solid #b9c9cc; border-radius: 6px; cursor: pointer; color: #315b58; background: #f5f8f8; font-size: 12px; font-weight: 500; }
.tutorial-reset-action:hover { border-color: #78a29d; color: #204e4a; background: #e9f3f1; }
.tutorial-coordinates { display: block; margin-top: 11px; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
.tutorial-preview-card { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; padding: 15px; }
.tutorial-preview-card > i { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #9bc5bf; border-radius: 6px; color: #286a64; background: #e9f4f2; font-size: 17px; }
.tutorial-preview-card small, .tutorial-preview-card strong { display: block; }
.tutorial-preview-card small { margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.tutorial-preview-card strong { max-width: 160px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-preview-card label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.tutorial-preview-card input { margin: 0; accent-color: var(--orange); }
.tutorial-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tutorial-result { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 16px; }
.tutorial-result strong { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.tutorial-result span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.tutorial-result i { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: white; background: #26835c; font-style: normal; }
.tutorial-capabilities { display: grid; gap: 6px; margin-top: 11px; }
.tutorial-capabilities > :is(div, button) { display: grid; min-height: 40px; grid-template-columns: 24px 1fr; align-items: center; gap: 10px; padding: 7px 11px; border: 1px solid #dce5e6; border-radius: 6px; color: #647579; background: #f4f7f7; font-family: inherit; transition: 160ms ease; }
.tutorial-capabilities > :is(div, button) i { position: relative; display: grid; width: 22px; height: 22px; place-items: center; overflow: visible; border: 1px solid #c7d4d6; border-radius: 50%; color: #718287; background: white; font-size: 10px; }
.tutorial-capabilities > :is(div, button) span { font-size: 12px; font-weight: 650; text-align: left; }
.tutorial-capabilities > :is(div, button).is-current { border-color: #73a7a1; color: #204e4a; background: #e5f2f0; box-shadow: inset 3px 0 #286a64; }
.tutorial-capabilities > :is(div, button).is-current:not(.is-complete) {
  background-color: #e5f2f0;
  background-image: linear-gradient(110deg, transparent 34%, rgba(255,255,255,.4) 47%, transparent 60%);
  background-size: 280% 100%;
  animation: tutorial-substep-shimmer 7.5s ease-in-out infinite;
}
.tutorial-capabilities > :is(div, button).is-current i { border-color: #286a64; color: white; background: #286a64; }
.tutorial-capabilities > :is(div, button).is-complete { border-color: #bcd8cb; color: #2d6550; background: #edf7f1; }
.tutorial-capabilities > :is(div, button).is-complete i { border-color: #2f8a62; color: white; background: #2f8a62; }
.tutorial-capabilities > :is(div, button).is-completing i {
  animation: tutorial-check-in 480ms cubic-bezier(.22, 1, .36, 1) 220ms both;
}
.tutorial-capabilities > :is(div, button).is-completing i::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid transparent;
  border-top-color: #2f8a62;
  border-right-color: #2f8a62;
  border-radius: 50%;
  pointer-events: none;
  animation: tutorial-check-ring 700ms cubic-bezier(.2, .72, .25, 1) both;
}
.tutorial-capabilities > :is(div, button):not(.is-complete) { border-style: dashed; }
.tutorial-capabilities > button { width: 100%; grid-template-columns: 24px minmax(0, 1fr) auto; cursor: pointer; }
.tutorial-capabilities > button.is-current:not(:disabled)::after { content: "Click"; color: #286a64; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-capabilities > button:hover:not(:disabled) { border-color: #286a64; background: #dceeea; }
.tutorial-capabilities > button:disabled { cursor: default; opacity: 1; }
.tutorial-substeps { margin: -8px 0 14px; }
.tutorial-substeps > :is(div, button) { min-height: 36px; padding: 6px 10px; }
.tutorial-substeps > :is(div, button) i { width: 20px; height: 20px; font-size: 9px; }
.tutorial-substeps > :is(div, button) span { font-size: 11px; }
.tutorial-association-screen .tutorial-lead { margin-bottom: 14px; }
.tutorial-association-screen .tutorial-substeps { gap: 4px; margin-bottom: 10px; }
.tutorial-association-screen .tutorial-substeps > :is(div, button) { min-height: 32px; }
.tutorial-association-screen .focused-lot-card { padding-block: 12px; }
.tutorial-association-screen .tutorial-select-field { margin-top: 13px; }
.tutorial-context-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin: 0 0 14px; padding: 13px; border: 1px solid #d5e2df; border-left: 3px solid #b7683f; border-radius: 7px; color: #526468; background: #f7faf9; box-shadow: 0 4px 14px rgba(22,45,54,.05); opacity: 0; transform: translateY(9px); transition: opacity 420ms ease, transform 420ms cubic-bezier(.22, 1, .36, 1); }
.tutorial-context-note[hidden] { display: none; }
.tutorial-context-note.is-visible { opacity: 1; transform: none; }
.tutorial-context-note > i { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #8b4a2a; background: #f6e8dd; font-size: 12px; }
.tutorial-context-note > div { display: contents; }
.tutorial-context-note strong { align-self: center; color: #315b58; font-size: 12.5px; line-height: 1.35; }
.tutorial-context-note p { grid-column: 1 / -1; margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
#tutorial-association-context { row-gap: 4px; padding: 11px 12px; }
#tutorial-association-context p { margin-top: 0; font-size: 11.5px; line-height: 1.42; }
.tutorial-sync-progress { margin-bottom: 14px; padding: 13px; border: 1px solid #a9cbc6; border-radius: 7px; color: #315b58; background: linear-gradient(135deg, #f3faf8, #e7f3f1); box-shadow: 0 5px 16px rgba(39,100,94,.1); opacity: 1; transform: none; transition: opacity 220ms ease, transform 220ms ease; }
.tutorial-sync-progress[hidden] { display: none; }
.tutorial-sync-progress.is-dismissing { opacity: 0; transform: translateY(-5px); }
.tutorial-sync-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 800; }
.tutorial-sync-progress-heading span { display: flex; align-items: center; gap: 7px; }
.tutorial-sync-progress-heading i { color: #286a64; }
.tutorial-sync-progress-heading output { color: #286a64; font-size: 12px; font-variant-numeric: tabular-nums; }
.tutorial-sync-progress-track { height: 9px; margin-top: 10px; overflow: hidden; border: 1px solid #bdd7d3; border-radius: 999px; background: rgba(255,255,255,.85); }
.tutorial-sync-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #286a64, #58a89e 72%, #8ed2c8); box-shadow: 0 0 10px rgba(65,151,140,.42); transition: width 300ms cubic-bezier(.22, 1, .36, 1); }
.tutorial-sync-progress p { margin: 8px 0 0; color: #607276; font-size: 11px; line-height: 1.4; }
.focused-lot-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; }
.focused-lot-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.focused-lot-card strong { color: #286a64; font-family: Georgia, serif; font-size: 16px; }
.tutorial-select-field { display: grid; gap: 7px; margin-top: 17px; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-select-field select { width: 100%; height: 46px; padding: 0 34px 0 12px; border: 1px solid #cfd9dd; border-radius: 6px; color: var(--navy-dark); background: white; font-size: 13px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.tutorial-select-field.is-required > span { color: #286a64; }
.tutorial-select-field.is-required select { border: 2px solid #3f8c85; color: #173f3b; background-color: #f4fbfa; box-shadow: 0 0 0 4px rgba(63,140,133,.14), 0 5px 14px rgba(39,100,94,.1); outline: 0; }
.tutorial-select-field.is-required select:hover,
.tutorial-select-field.is-required select:focus { border-color: #286a64; box-shadow: 0 0 0 5px rgba(63,140,133,.2), 0 6px 16px rgba(39,100,94,.13); }
.community-select-field { margin: 0; }
.tutorial-field-instruction { display: flex; align-items: flex-start; gap: 7px; margin: 8px 2px 16px; color: #68797d; font-size: 11px; line-height: 1.4; }
.tutorial-field-instruction i { flex: 0 0 auto; margin-top: 2px; color: #527c78; font-size: 11px; }
.tutorial-field-instruction.is-valid { color: #2d6550; }
.tutorial-field-instruction.is-valid i { color: #2f8a62; }
#tutorial-community-instruction { font-size: 13px; line-height: 1.45; }
#tutorial-community-instruction i { font-size: 12px; }
#tutorial-community-instruction strong { color: #315b58; font-weight: 850; }
.tutorial-lot-selection-instruction { margin-bottom: 0; }
.map-wrap .status-legend { bottom: 18px; }
@keyframes tutorial-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
@keyframes tutorial-button-shimmer { 0% { background-position: 130% 0; } 11%, 100% { background-position: -130% 0; } }
@keyframes tutorial-substep-shimmer { 0% { background-position: 130% 0; } 12%, 100% { background-position: -130% 0; } }
@keyframes tutorial-check-ring {
  0% { opacity: 0; transform: rotate(-100deg) scale(.72); }
  18% { opacity: 1; }
  76% { opacity: 1; transform: rotate(245deg) scale(1.06); }
  100% { opacity: 0; transform: rotate(320deg) scale(1.14); }
}
@keyframes tutorial-check-in {
  0% { border-color: #8bbca6; color: transparent; background: #e4f3eb; transform: scale(.72); }
  58% { border-color: #2f8a62; color: white; background: #2f8a62; transform: scale(1.14); }
  100% { border-color: #2f8a62; color: white; background: #2f8a62; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-primary-action:not(:disabled) { animation: none; }
  .tutorial-capabilities > :is(div, button).is-current:not(.is-complete) { animation: none; }
  .tutorial-capabilities > :is(div, button).is-completing i,
  .tutorial-capabilities > :is(div, button).is-completing i::after { animation: none; }
  .tutorial-context-note { transition: none; transform: none; }
  .tutorial-sync-progress,
  .tutorial-sync-progress-track span { transition: none; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { min-height: 100%; height: auto; grid-template-rows: 62px auto; }
  .topbar { padding: 0 15px; }
  .save-state { display: none; }
  .button-secondary { padding-inline: 10px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto 64vh; }
  .panel { padding: 20px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .tutorial-panel { gap: 0; padding: 20px; overflow: visible; }
  .tutorial-screen { min-height: 520px; }
  .panel-heading h1 { font-size: 25px; }
  .instruction-card { display: none; }
  .guide-card { max-width: 100%; }
  .stats { position: absolute; top: 70px; right: 20px; width: 115px; border: 0; }
  .stats div { display: inline; padding: 0; text-align: right; }
  .stats div + div { display: none; }
  .stats span { margin-left: 5px; }
  .panel-footer { margin-top: 0; }
  .status-pill { top: 12px; max-width: calc(100% - 100px); overflow: hidden; text-overflow: ellipsis; }
  .map-toolbar { top: 10px; right: 10px; left: 10px; min-height: 42px; overflow-x: auto; }
  .tool-button { grid-template-rows: 24px; min-width: 38px; }
  .tool-button small { display: none; }
  .status-pill { top: 62px; max-width: calc(100% - 30px); }
  .status-legend { right: 10px; bottom: 34px; grid-template-columns: repeat(4, auto); }
  .status-legend strong { display: none; }
}
