:root {
  color-scheme: light;
  font-family:
    Pretendard,
    "Noto Sans KR",
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #17221c;
  background: #e8eeea;
  font-synthesis: none;
  --ink: #17221c;
  --muted: #66746b;
  --paper: #fbfcfa;
  --paper-strong: #ffffff;
  --canvas: #f3f7f4;
  --line: #d5ded7;
  --green-950: #10251b;
  --green-850: #17432f;
  --green-700: #286447;
  --green-600: #347c58;
  --green-200: #bad7c5;
  --green-100: #dfede4;
  --blueprint: #1e6f78;
  --warning: #9a5b22;
  --error: #a33a32;
  --shadow: 0 14px 36px rgb(28 55 40 / 8%);
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -12%, rgb(255 255 255 / 95%), transparent 38rem),
    #e8eeea;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #82c8a1;
  outline-offset: 2px;
}

.app-header {
  min-height: 74px;
  padding: 11px clamp(15px, 2.7vw, 42px);
  display: grid;
  grid-template-columns: max-content max-content 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgb(30 73 52 / 10%);
  background: rgb(251 252 250 / 92%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--green-850);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 20px rgb(23 67 47 / 22%);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.02em;
}

.stage-heading {
  padding: 7px 16px 7px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #cfe0d5;
  border-radius: 999px;
  background: var(--green-100);
  justify-self: start;
}

.stage-number {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green-850);
  font-size: 0.72rem;
  font-weight: 850;
}

.stage-heading small,
.stage-heading strong {
  display: block;
}

.stage-heading small {
  color: var(--green-700);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.stage-heading strong {
  margin-top: 1px;
  font-size: 0.83rem;
}

.header-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d69344;
  box-shadow: 0 0 0 5px rgb(214 147 68 / 12%);
}

.section-tabs {
  min-height: 66px;
  padding: 9px clamp(15px, 2.7vw, 42px) 6px;
  border-bottom: 1px solid rgb(30 73 52 / 10%);
  background: var(--paper-strong);
}

.section-tablist {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.section-tab {
  min-width: max-content;
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d6e1d9;
  border-radius: 9px;
  background: #f8faf8;
  cursor: pointer;
}

.section-tab span {
  color: var(--green-600);
  font-size: 0.68rem;
  font-weight: 850;
}

.section-tab strong {
  color: var(--muted);
  font-size: 0.75rem;
}

.section-tab:hover {
  border-color: #bcd1c3;
  background: #f0f6f2;
}

.section-tab[aria-selected="true"] {
  border-color: #b7d0c0;
  background: var(--green-100);
  box-shadow: inset 0 -2px 0 var(--green-600);
}

.section-tab[aria-selected="true"] strong {
  color: var(--green-950);
}

.wizard-separator {
  flex: 0 0 24px;
  color: #8fa097;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.tab-order-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  text-align: right;
}

.workspace {
  max-width: 1920px;
  min-height: calc(100vh - 178px);
  margin: 0 auto;
  padding: clamp(12px, 1.4vw, 22px);
  display: grid;
  grid-template-columns: minmax(250px, .78fr) minmax(520px, 2fr) minmax(235px, .72fr);
  align-items: start;
  gap: clamp(11px, 1.1vw, 18px);
}

.panel {
  min-width: 0;
  border: 1px solid rgb(30 73 52 / 12%);
  border-radius: 19px;
  background: rgb(251 252 250 / 96%);
  box-shadow: var(--shadow);
}

.parameter-panel,
.progress-panel {
  padding: clamp(17px, 1.45vw, 24px);
}

.parameter-panel {
  align-self: stretch;
}

.panel-heading,
.drawing-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green-600);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  color: var(--green-950);
  font-size: clamp(1.05rem, 1.2vw, 1.28rem);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 7px;
  font-size: 0.85rem;
}

.contract-badge {
  padding: 5px 7px;
  border: 1px solid #e4c69e;
  border-radius: 999px;
  color: var(--warning);
  background: #fff7eb;
  font-size: 0.58rem;
  font-weight: 800;
  white-space: nowrap;
}

.contract-badge.is-ready {
  border-color: var(--green-200);
  color: var(--green-700);
  background: #eef7f1;
}

.panel-description {
  margin: 13px 0 15px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.definition-notice {
  margin: 0 0 16px;
  padding: 12px 13px;
  border: 1px solid #e4d2b8;
  border-radius: 11px;
  color: #775027;
  background: #fff9f0;
}

.definition-notice strong {
  font-size: 0.7rem;
}

.definition-notice p {
  margin: 4px 0 0;
  font-size: 0.63rem;
  line-height: 1.5;
}

.definition-notice.is-ready {
  border-color: var(--green-200);
  color: var(--green-850);
  background: #f0f8f3;
}

.definition-notice.is-error {
  border-color: #e4b9b5;
  color: #7f2d27;
  background: #fff3f2;
}

#parameter-form {
  display: grid;
  gap: 12px;
}

.parameter-field {
  display: grid;
  gap: 6px;
}

.parameter-field label {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.parameter-field label span {
  color: var(--green-950);
  font-size: 0.72rem;
  font-weight: 750;
}

.parameter-field label small {
  max-width: 52%;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.35;
  text-align: right;
}

.pending-control {
  height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border: 1px dashed #c7d1c9;
  border-radius: 9px;
  background: #f5f7f5;
}

.readonly-control {
  height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c7d1c9;
  border-radius: 9px;
  color: var(--green-950);
  background: #f5f7f5;
}

.readonly-control output {
  flex: 1;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 720;
}

.readonly-control span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.parameter-control {
  height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bfcfc4;
  border-radius: 9px;
  background: var(--paper-strong);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.parameter-control:focus-within {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgb(52 124 88 / 10%);
}

.parameter-control.has-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgb(163 58 50 / 9%);
}

.parameter-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--green-950);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 720;
}

.parameter-control span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.field-error {
  color: var(--error);
  font-size: 0.58rem;
  line-height: 1.4;
}

.configuration-card {
  padding: 11px;
  display: grid;
  gap: 10px;
  border: 1px solid #d6ded8;
  border-radius: 12px;
  background: rgb(255 255 255 / 70%);
}

.configuration-heading,
.form-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.configuration-heading strong,
.form-section-heading strong {
  color: var(--green-950);
  font-size: 0.72rem;
}

.configuration-heading small,
.form-section-heading small {
  color: var(--muted);
  font-size: 0.54rem;
  text-align: right;
}

.segmented-choice {
  padding: 3px;
  display: grid;
  gap: 3px;
  border: 1px solid #d1dbd4;
  border-radius: 9px;
  background: #eef2ef;
}

.ventilation-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.utility-choice {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-choice button {
  min-height: 34px;
  padding: 5px 6px;
  display: grid;
  place-content: center;
  gap: 1px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 0.6rem;
  font-weight: 760;
  line-height: 1.15;
  text-align: center;
}

.segmented-choice button small {
  font-size: 0.48rem;
  font-weight: 650;
}

.segmented-choice button:hover {
  color: var(--green-850);
  background: rgb(255 255 255 / 68%);
}

.segmented-choice button.is-selected {
  color: #fff;
  background: var(--green-700);
  box-shadow: 0 2px 6px rgb(33 85 59 / 18%);
}

.inline-model-note {
  padding: 12px;
  border: 1px dashed #bfcfc4;
  border-radius: 10px;
  color: var(--green-850);
  background: #f5f8f6;
}

.inline-model-note strong {
  font-size: 0.7rem;
}

.inline-model-note p,
.utility-editor-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.45;
}

.utility-side-card + .utility-side-card {
  margin-top: 2px;
}

.utility-editor-side-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.utility-axis-x {
  --utility-axis-color: #2870ad;
  --utility-axis-soft: #eaf4fd;
}

.utility-axis-y {
  --utility-axis-color: #bd6427;
  --utility-axis-soft: #fff1e5;
}

.utility-axis-radius {
  --utility-axis-color: #7b55a3;
  --utility-axis-soft: #f4edfb;
}

.utility-axis-key {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.utility-axis-key span {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid color-mix(in srgb, var(--utility-axis-color) 34%, white);
  border-radius: 7px;
  color: var(--utility-axis-color);
  background: var(--utility-axis-soft);
  font-size: 0.5rem;
  font-weight: 730;
  text-align: center;
}

.utility-axis-key b {
  font-size: 0.62rem;
  font-weight: 900;
}

.utility-input-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.utility-input-field {
  min-width: 0;
  padding: 7px;
  display: grid;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--utility-axis-color) 28%, white);
  border-radius: 8px;
  background: var(--utility-axis-soft);
}

.utility-input-field.is-selected {
  border-color: var(--utility-axis-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--utility-axis-color) 18%, transparent);
}

.utility-input-field > label {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.utility-list-marker {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--utility-axis-color);
  font-size: 0.56rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.utility-input-field > label > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.utility-input-field label strong {
  color: var(--utility-axis-color);
  font-size: 0.55rem;
}

.utility-input-field label small {
  color: var(--muted);
  font-size: 0.44rem;
}

.utility-dimension-control {
  height: 34px;
  padding-inline: 8px;
}

.utility-dimension-control input {
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}

.lane-width-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.lane-width-item {
  min-width: 0;
}

.lane-width-item > label {
  margin: 0 0 4px;
  display: block;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
}

.lane-width-control {
  height: 36px;
}

.pending-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #89928c;
  background: transparent;
  font-size: 0.69rem;
}

.pending-control span {
  color: var(--muted);
  font-size: 0.6rem;
}

.drawing-panel {
  overflow: hidden;
}

.drawing-heading {
  min-height: 72px;
  padding: 16px 19px 13px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.layer-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  color: var(--muted);
  font-size: 0.59rem;
}

.layer-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dimension-layout-toolbar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7faf8;
}

.dimension-layout-toolbar-row,
.layout-editor-actions,
.layout-part-choice {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dimension-layout-toolbar-row {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.dimension-layout-toolbar button {
  min-width: max-content;
  padding: 6px 9px;
  border: 1px solid #cddbd2;
  border-radius: 7px;
  color: var(--green-850);
  background: white;
  font-size: 0.58rem;
  font-weight: 760;
  cursor: pointer;
}

.dimension-layout-toolbar button:hover {
  border-color: var(--green-600);
  background: var(--green-100);
}

.dimension-layout-toolbar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dimension-layout-toolbar .layout-primary-button,
.dimension-layout-toolbar button[aria-pressed="true"] {
  border-color: var(--green-600);
  color: white;
  background: var(--green-700);
}

.layout-storage-status {
  min-width: max-content;
  margin-right: auto;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
}

.layout-storage-status.is-error {
  color: var(--error);
}

.layout-storage-status.is-success {
  color: var(--green-700);
}

.layout-snap-control {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
}

.dimension-layout-editor {
  margin-top: 8px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(330px, 1.8fr);
  align-items: center;
  gap: 8px 12px;
  border-top: 1px dashed #cbd8cf;
}

.dimension-layout-editor[hidden] {
  display: none;
}

.layout-selection-heading span,
.layout-selection-heading strong {
  display: block;
}

.layout-selection-heading span {
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 750;
}

.layout-selection-heading strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout-offset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 5px;
}

.layout-offset-grid label {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 43px;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 700;
}

.layout-offset-grid input {
  width: 43px;
  min-width: 0;
  padding: 4px;
  border: 1px solid #cbd8cf;
  border-radius: 5px;
  color: var(--ink);
  background: white;
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.layout-editor-actions {
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.layout-editor-help {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.52rem;
  line-height: 1.45;
}

#layout-collision-status {
  margin-left: 5px;
  color: var(--green-700);
  font-weight: 800;
}

#layout-collision-status.has-collision {
  color: var(--error);
}

#section-svg.is-layout-editing [data-layout-key] {
  cursor: move;
  outline: none;
}

#section-svg.is-layout-editing [data-layout-key] input,
#section-svg.is-layout-editing [data-layout-key] output,
#section-svg.is-layout-editing [data-layout-key] .svg-dim-control {
  pointer-events: none;
  user-select: none;
}

.layout-input-drag-surface {
  fill: transparent;
  pointer-events: none;
}

.layout-line-drag-surface {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

#section-svg.is-layout-editing .layout-input-drag-surface {
  cursor: move;
  pointer-events: all;
}

#section-svg.is-layout-editing .layout-line-drag-surface {
  pointer-events: stroke;
}

#section-svg.is-layout-editing [data-layout-orientation="horizontal"] .layout-line-drag-surface {
  cursor: ns-resize;
}

#section-svg.is-layout-editing [data-layout-orientation="vertical"] .layout-line-drag-surface {
  cursor: ew-resize;
}

#section-svg.is-layout-editing [data-layout-key].is-layout-selected {
  filter: drop-shadow(0 0 3px rgb(227 155 45 / 80%));
}

#section-svg.is-layout-editing [data-layout-key].is-layout-selected .dimension-line {
  stroke: #d77a18;
  stroke-width: 2.6;
}

#section-svg [data-layout-key].has-layout-collision foreignObject .svg-dim-control,
#section-svg foreignObject[data-layout-key].has-layout-collision .svg-dim-control {
  border-color: var(--error);
  stroke: var(--error);
  background: #fff1ef;
}

.key-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a7b5ac;
}

.key-dot.current {
  background: var(--green-600);
}

.svg-stage {
  position: relative;
  min-height: 455px;
  height: clamp(470px, calc(100vh - 285px), 720px);
  overflow: hidden;
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgb(30 73 52 / 4.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(30 73 52 / 4.5%) 1px, transparent 1px),
    linear-gradient(rgb(30 73 52 / 2.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(30 73 52 / 2.5%) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 10px 10px, 10px 10px;
}

.svg-camera-toolbar {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #c7d5cc;
  border-radius: 9px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 4px 12px rgb(28 55 40 / 12%);
  backdrop-filter: blur(4px);
}

.svg-camera-toolbar button {
  min-width: 30px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #c4d2c9;
  border-radius: 6px;
  color: var(--green-900);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.svg-camera-toolbar button:hover,
.svg-camera-toolbar button:focus-visible {
  border-color: var(--green-600);
  background: var(--green-050);
}

.svg-camera-toolbar output {
  min-width: 48px;
  color: var(--green-800);
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

#section-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#section-svg.is-camera-panning {
  cursor: grabbing;
}

#section-svg foreignObject input,
#section-svg foreignObject output {
  user-select: text;
}

.centerline,
.datum-line {
  stroke: #8da095;
  stroke-width: 1;
  stroke-dasharray: 8 7;
}

.datum-line {
  stroke-dasharray: 3 4;
}

.section-layer {
  color: #8aa096;
  opacity: 0.18;
  transition: opacity 160ms ease;
}

.section-layer:not(.is-active) {
  pointer-events: none;
}

.section-layer.is-active {
  color: var(--green-700);
  opacity: 1;
}

.section-layer[data-layer="road"] {
  opacity: 1;
}

.section-layer[data-layer="road"]:not(.is-active) > :not(.persistent-centerlines) {
  opacity: 0.18;
}

.persistent-centerlines {
  opacity: 1;
}

.section-layer[data-layer="clearance"].is-active {
  color: #72529a;
}

.section-layer[data-layer="ventilation"].is-active {
  color: #426b9b;
}

.section-layer[data-layer="utility"].is-active {
  color: #9a6333;
}

.section-layer[data-layer="lining"].is-active {
  color: #247666;
}

.section-layer[data-layer="drainage"].is-active {
  color: #347997;
}

.layer-line,
.fan-mark,
.lane-mark {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.layer-line.heavy {
  stroke-width: 4;
}

.layer-line.dashed {
  stroke-dasharray: 9 7;
}

.layer-fill {
  fill: currentColor;
  fill-opacity: 0.09;
  stroke: currentColor;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.road-slab {
  fill-opacity: 0.16;
}

.lane-mark {
  stroke-width: 1.4;
}

.dimension-preview {
  display: none;
}

.section-layer.is-active .dimension-preview {
  display: block;
}

#section-svg.has-section-model > .concept-reference {
  display: none;
}

.section-layer:not(.is-active) .road-dimension,
.section-layer:not(.is-active) .road-callout,
.section-layer:not(.is-active) .clearance-dimension,
.section-layer:not(.is-active) .clearance-envelope-label,
.section-layer:not(.is-active) .utility-axis-grid,
.section-layer:not(.is-active) .ventilation-status-object {
  display: none;
}

.road-layer-shape {
  stroke: currentColor;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.road-pavement-shape {
  fill: rgb(40 100 71 / 22%);
}

.road-filter-shape {
  fill: rgb(30 111 120 / 15%);
  stroke: var(--blueprint);
}

.road-top-line,
.road-lane-boundary {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.road-lane-boundary {
  stroke-width: 1.1;
  stroke-dasharray: 5 4;
}

.road-model-centerline {
  stroke-width: 1.2;
  stroke-dasharray: 9 6;
  vector-effect: non-scaling-stroke;
}

.road-model-centerline.road-center {
  stroke: var(--green-700);
}

.road-model-centerline.tunnel-center {
  stroke: var(--blueprint);
}

.center-point {
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.center-point.road-center {
  fill: var(--paper-strong);
  stroke: var(--green-700);
}

.center-point.tunnel-center {
  fill: var(--paper-strong);
  stroke: var(--blueprint);
}

.centerline-head {
  color: var(--green-700);
}

.centerline-head.tunnel-center {
  color: var(--blueprint);
}

.centerline-head circle {
  fill: var(--paper-strong);
  stroke: currentColor;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.centerline-head text {
  fill: currentColor !important;
  font-size: 7.5px !important;
  font-weight: 850;
  letter-spacing: -0.3px;
}

.centerline-name {
  fill: var(--green-850) !important;
  font-size: 9px !important;
  font-weight: 800;
}

.centerline-name.tunnel-center {
  fill: var(--blueprint) !important;
}

.road-side-label,
.derived-value-label {
  font-weight: 750;
}

.road-side-label {
  fill: var(--muted) !important;
  font-size: 9px !important;
}

.derived-value-label {
  fill: var(--blueprint) !important;
  font-size: 9px !important;
}

.road-dimension {
  color: var(--green-700);
}

.svg-dim-control {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 50px;
  padding: 6px 7px 5px;
  display: grid;
  grid-template-rows: max-content 1fr;
  align-items: center;
  gap: 1px;
  border: 1px solid var(--green-600);
  border-radius: 7px;
  color: var(--green-950);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 3px 8px rgb(28 55 40 / 10%);
  font-family: inherit;
}

.svg-dim-control.has-error {
  border-color: var(--error);
  background: #fff3f2;
}

.svg-dim-label,
.svg-dim-control b {
  font-size: 9px;
  white-space: nowrap;
}

.clearance-envelope {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-dasharray: 10 7;
  vector-effect: non-scaling-stroke;
}

.clearance-envelope-label {
  fill: currentColor !important;
  font-size: 10px !important;
  font-weight: 850;
}

.clearance-points circle {
  fill: var(--paper-strong);
  stroke: #5c338d;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.clearance-dimension {
  color: #5c338d;
}

.clearance-dimension .dimension-line {
  stroke-width: 2;
}

.clearance-dimension .extension-line {
  stroke-width: 1.5;
  stroke-dasharray: 5 3;
  opacity: 0.95;
}

.clearance-dimension .dimension-leader {
  stroke-width: 1.7;
}

.clearance-dimension .dimension-tick {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.clearance-width-chain-dimension {
  color: #315f4b;
}

.clearance-width-chain-control {
  border-color: #4f806a;
}

.clearance-haunch-dimensions .dimension-line {
  stroke-width: 1.7;
}

.clearance-haunch-dimensions .dimension-leader {
  stroke-dasharray: 3 2;
}

.svg-dim-label {
  overflow: hidden;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
}

.svg-dim-value {
  display: grid;
  grid-template-columns: 38px max-content;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.svg-dim-control b {
  color: var(--muted);
}

.svg-dim-control input {
  width: 38px;
  min-width: 38px;
  padding: 2px 1px;
  border: 0;
  border-bottom: 1px solid #a9bdb0;
  border-radius: 0;
  outline: 0;
  color: var(--green-950);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
}

.svg-dim-control output {
  width: 38px;
  min-width: 38px;
  padding: 2px 1px;
  color: var(--green-950);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.clearance-dim-control {
  border-color: #8c70ae;
}

.clearance-dim-control.is-derived {
  background: rgb(250 247 255 / 96%);
}

.utility-profile {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.utility-guide-circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  opacity: 0.72;
  vector-effect: non-scaling-stroke;
}

.utility-side-label {
  fill: currentColor !important;
  font-size: 8px !important;
  font-weight: 820;
}

.utility-axis-dimension {
  cursor: pointer;
  outline: none;
}

.utility-side:not(.is-editor-side) .utility-axis-grid {
  display: none;
}

.utility-axis-extension,
.utility-axis-rail-segment,
.utility-axis-end-tick,
.utility-axis-chain-guide {
  fill: none;
  stroke: var(--utility-axis-color);
  stroke-width: 1.35;
  opacity: 0.72;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.utility-axis-y-chain-guide {
  stroke: #bd6427;
}

.utility-axis-chain-guide {
  stroke: #2870ad;
  stroke-width: 1.15;
  opacity: 0.42;
}

.utility-axis-extension {
  opacity: 0.48;
}

.utility-axis-end-tick {
  stroke-width: 1.8;
  opacity: 0.94;
}

.utility-dimension-marker {
  pointer-events: all;
}

.utility-marker-label-bg {
  fill: rgb(248 250 247 / 98%);
  stroke: var(--utility-axis-color);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.utility-marker-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.utility-dimension-marker text {
  fill: var(--utility-axis-color) !important;
  font-size: 6px !important;
  font-weight: 900;
  pointer-events: none;
}

.utility-axis-dimension:hover .utility-marker-label-bg,
.utility-axis-dimension:focus-visible .utility-marker-label-bg,
.utility-axis-dimension.is-selected .utility-marker-label-bg {
  fill: var(--utility-axis-soft);
  stroke-width: 2.3;
}

.utility-axis-dimension.is-selected .utility-axis-rail-segment,
.utility-axis-dimension.is-selected .utility-axis-end-tick {
  stroke-width: 2.6;
  opacity: 1;
}

.utility-axis-dimension:hover .utility-line-marker text,
.utility-axis-dimension:focus-visible .utility-line-marker text,
.utility-axis-dimension.is-selected .utility-line-marker text {
  font-weight: 950;
}

.svg-model-status {
  box-sizing: border-box;
  height: 56px;
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid #6f8eb2;
  border-radius: 9px;
  color: #294c72;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 3px 8px rgb(28 55 40 / 10%);
  font-family: inherit;
}

.svg-model-status strong {
  font-size: 10px;
}

.svg-model-status small {
  color: #64748b;
  font-size: 8px;
}

.svg-dim-control input::-webkit-inner-spin-button,
.svg-dim-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.svg-dim-control input:focus {
  border-bottom-color: var(--green-600);
}

.dimension-line,
.extension-line,
.dimension-leader {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.dimension-line {
  marker-start: url(#dimension-arrow);
  marker-end: url(#dimension-arrow);
}

.extension-line {
  stroke-dasharray: 3 3;
  opacity: 0.7;
}

.dimension-leader {
  opacity: 0.9;
}

.dimension-box {
  fill: var(--paper-strong);
  stroke: currentColor;
  stroke-width: 1;
}

#section-svg text {
  fill: var(--ink);
  font-family: inherit;
  font-size: 11px;
}

.axis-label {
  fill: var(--muted) !important;
  font-size: 10px !important;
}

.drawing-empty-state {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  min-width: min(360px, calc(100% - 28px));
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(30 73 52 / 13%);
  border-radius: 11px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 7px 18px rgb(31 57 42 / 9%);
  backdrop-filter: blur(8px);
}

.empty-icon {
  width: 38px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green-200);
  border-radius: 7px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.drawing-empty-state strong,
.drawing-empty-state small {
  display: block;
}

.drawing-empty-state strong {
  font-size: 0.7rem;
}

.drawing-empty-state small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
}

.drawing-footer {
  min-height: 39px;
  padding: 9px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.59rem;
}

.progress-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-list li {
  border-top: 1px solid var(--line);
}

.progress-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.progress-list button {
  width: 100%;
  padding: 11px 3px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.progress-list button:hover {
  background: #f2f7f3;
}

.progress-number {
  color: var(--green-600);
  font-size: 0.66rem;
  font-weight: 850;
}

.progress-list strong,
.progress-list small {
  display: block;
}

.progress-list strong {
  font-size: 0.7rem;
}

.progress-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.54rem;
}

.progress-state {
  color: #9aa69e;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.progress-list li.is-active button {
  margin: 6px 0;
  padding-inline: 8px;
  border-radius: 9px;
  background: var(--green-100);
}

.progress-list li.is-active .progress-state {
  color: var(--green-700);
}

.next-decision {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #cfdad2;
  border-radius: 12px;
  background: #f3f7f4;
}

.next-decision p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.5;
}

.app-footer {
  min-height: 40px;
  padding: 0 clamp(15px, 2.7vw, 42px) 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 0.59rem;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(235px, 0.76fr) minmax(480px, 1.7fr);
  }

  .progress-panel {
    grid-column: 1 / -1;
  }

  .progress-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .app-header {
    grid-template-columns: max-content max-content;
    justify-content: start;
  }

  .header-status {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .parameter-panel {
    grid-row: 2;
    grid-column: auto;
  }

  .drawing-panel {
    grid-row: 1;
  }

  .progress-panel {
    grid-row: 3;
    grid-column: auto;
  }

  .svg-stage {
    height: 430px;
    min-height: 430px;
  }

  .dimension-layout-editor {
    grid-template-columns: 1fr;
  }

  .layout-offset-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
}

@media (max-width: 580px) {
  .app-header {
    padding-block: 10px;
    align-items: start;
  }

  .brand-copy small {
    display: none;
  }

  .stage-heading {
    padding-right: 10px;
  }

  .stage-heading small {
    display: none;
  }

  .stage-number {
    width: 30px;
    height: 30px;
  }

  .section-tabs {
    padding-inline: 10px;
  }

  .tab-order-note {
    text-align: left;
  }

  .workspace {
    padding: 10px;
  }

  .panel {
    border-radius: 15px;
  }

  .drawing-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dimension-layout-toolbar {
    padding-inline: 8px;
  }

  .layout-offset-grid {
    grid-template-columns: 1fr 1fr;
  }

  .layer-key {
    justify-content: flex-start;
  }

  .svg-stage {
    min-height: 340px;
    height: 340px;
    overflow: hidden;
  }

  #section-svg {
    width: 100%;
    min-width: 0;
  }

  .svg-camera-toolbar {
    top: 6px;
    right: 6px;
  }

  .svg-camera-toolbar button {
    min-width: 28px;
    min-height: 28px;
    padding-inline: 6px;
  }

  .svg-camera-toolbar output {
    min-width: 42px;
  }

  .drawing-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-list {
    grid-template-columns: 1fr 1fr;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
