:root {
  --ink: #203539;
  --muted: #7a8888;
  --accent: #d77741;
  --accent-dark: #b75a2b;
  --line: #e4e8e6;
  --cream: #f7f8f5;
  --navy: #20383c;
  --green: #719889;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  font-size: 13px;
  background: #f4f6f4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  padding: 8px 12px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #edf2ef;
  border-color: #bdccc6;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.topbar {
  height: 83px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 36px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f6f5ec;
  text-decoration: none;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.6px;
  min-width: 194px;
}
.brand-mark {
  font-size: 42px;
  color: #e7a779;
  font-weight: 400;
  line-height: 1;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 2px;
  margin-top: 5px;
  color: #adbfbc;
  font-weight: 500;
}
.document-title {
  padding-left: 25px;
  border-left: 1px solid #486064;
  flex: 1;
  min-width: 0;
}
.document-title strong {
  display: block;
  color: #f0f5ef;
  font-size: 14px;
  font-weight: 500;
}
.document-title span {
  display: block;
  font-size: 10px;
  color: #a6b9b6;
  margin-top: 5px;
}
.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.file-actions button {
  background: transparent;
  color: #e5eeea;
  border-color: transparent;
  font-size: 12px;
  padding: 9px 12px;
}
.file-actions button:hover {
  background: #354e51;
}
.primary,
.file-actions .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.primary:hover,
.file-actions .primary:hover {
  background: var(--accent-dark);
}
.primary span {
  margin-left: 15px;
}
.file-actions .help-button {
  border: 1px solid #617571;
  border-radius: 50%;
  padding: 0;
  width: 25px;
  height: 25px;
  margin-left: 7px;
}
.workspace {
  display: grid;
  grid-template-columns: 200px minmax(400px, 1fr) 270px;
  height: calc(100dvh - 83px);
  min-height: 600px;
}
.toolbox {
  background: var(--cream);
  border-right: 1px solid var(--line);
  padding: 25px 13px 15px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.rail-heading {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.3px;
  color: #8a9792;
  display: flex;
  justify-content: space-between;
  padding: 0 8px 10px;
}
.rail-heading span {
  font-weight: 400;
  font-size: 8px;
  letter-spacing: 0;
}
.tools {
  display: grid;
  gap: 3px;
}
.tools h4 {
  margin: 14px 8px 4px;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8a9792;
}
.tool {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 11px;
  border: 1px solid transparent;
  background: transparent;
  padding: 9px 10px;
  font-size: 12px;
  position: relative;
}
.tool svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool .tool-shortcut {
  margin-left: auto;
  color: #8e9995;
  font-size: 9px;
}
.tool.active {
  background: #e8eeea;
  border-color: #d2ddd6;
  font-weight: 600;
}
.tool.active:before {
  content: '';
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  background: var(--green);
  border-radius: 3px;
}
.tool.active svg {
  color: #497867;
}
.rail-footer {
  margin-top: auto;
  padding: 18px 8px 0;
  color: #6e8378;
  font-size: 10px;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #799f88;
  margin-right: 6px;
}
.rail-footer small {
  display: block;
  font-size: 9px;
  color: #97a29b;
  margin: 4px 0 0 12px;
}
.drawing-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.canvas-toolbar {
  height: 54px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 8px;
}
.history-controls,
.view-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.history-controls button {
  font-size: 20px;
  line-height: 20px;
  padding: 4px 8px;
  border: 0;
  background: none;
}
.history-controls .play {
  font-size: 11px;
  font-weight: 600;
  min-width: 64px;
  padding: 7px 12px;
  border: 1px solid #d2ddd6;
  background: #f3f7f4;
}
.history-controls .play.paused {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.divider {
  height: 20px;
  width: 1px;
  background: var(--line);
  margin: 0 6px;
}
.switch-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  white-space: nowrap;
}
.switch-label select {
  height: 28px;
  padding: 3px 6px;
}
input[type='checkbox'] {
  accent-color: #678875;
  width: 13px;
  height: 13px;
}
.canvas-container {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #edf1ef;
}
.canvas-badge {
  position: absolute;
  left: 22px;
  top: 14px;
  z-index: 1;
  background: #f7f9f6e8;
  padding: 8px 11px;
  border: 1px solid #dde5df;
  border-radius: 5px;
  font-size: 8px;
  letter-spacing: 1.3px;
  pointer-events: none;
  color: #648075;
}
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#canvas.probe {
  cursor: crosshair;
}
.canvas-bottom {
  position: absolute;
  bottom: 16px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.scale-pill {
  background: #fffffff0;
  border: 1px solid #dce4df;
  box-shadow: 0 3px 8px #173b2910;
  display: flex;
  align-items: center;
  border-radius: 7px;
  color: #596e66;
  font-size: 10px;
  padding: 9px 12px;
  gap: 9px;
  min-width: 0;
}
.scale-icon {
  font-size: 16px;
  color: #879f93;
}
.time-pill {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.canvas-status {
  height: 33px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  color: #87968e;
  font-size: 9px;
  flex-shrink: 0;
}
.canvas-status #tool-hint {
  flex: 1;
  color: #698477;
}
.canvas-status #coordinates {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.inspector {
  background: #fff;
  border-left: 1px solid var(--line);
  overflow: auto;
  padding: 0 20px 20px;
}
.inspector-tabs {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.tiny-tag {
  font-size: 8px;
  letter-spacing: 1.3px;
  font-weight: 500;
  background: #eff3ef;
  padding: 4px 7px;
  color: #719082;
  border-radius: 4px;
}
#controls {
  padding: 18px 0 6px;
}
.inspector h3 {
  font-size: 11px;
  font-weight: 650;
  margin: 0;
}
label.field {
  display: block;
  color: #7a8b82;
  font-size: 10px;
  line-height: 1.5;
  margin-bottom: 14px;
}
label.field output {
  float: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
input[type='range'] {
  display: block;
  width: 100%;
  margin: 6px 0 0;
  accent-color: #678875;
}
select {
  height: 32px;
  border: 1px solid #dde5df;
  background: #fcfdfb;
  border-radius: 5px;
  padding: 6px 8px;
  color: #3d554a;
}
label.field select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.check-row {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #647c6c;
  margin: 10px 0;
}
.small-actions {
  display: flex;
  gap: 6px;
  margin: 4px 0 14px;
}
.small-actions button {
  flex: 1;
  font-size: 10px;
  padding: 7px 4px;
}
.probe-readout {
  font-size: 10px;
  line-height: 1.7;
  color: #4f6a5d;
  background: #f5f8f4;
  border: 1px solid #e3eae4;
  border-radius: 6px;
  padding: 9px 10px;
  margin: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}
.probe-readout b {
  color: var(--accent-dark);
}
.notes {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.notes p {
  font-size: 10px;
  color: #7b8b84;
  line-height: 1.75;
  margin: 8px 0 0;
}
.notes b {
  color: #436454;
  font-weight: 600;
}
dialog {
  border: 1px solid #d9e1d9;
  border-radius: 14px;
  box-shadow: 0 20px 100px #152b3850;
  padding: 30px;
  color: var(--ink);
  max-width: min(580px, 92vw);
  width: 580px;
}
dialog::backdrop {
  background: #1d333963;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 23px;
  font-weight: 550;
  letter-spacing: -0.6px;
  margin: 8px 0;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 1.7px;
  color: #77917e;
  font-weight: 600;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.icon-close {
  border: 0;
  background: none;
  font-size: 24px;
  padding: 0 4px;
  color: #84978c;
}
.help-copy p {
  margin: 12px 0;
  font-size: 11px;
  line-height: 1.7;
  color: #7a8982;
}
.help-copy b {
  color: #436454;
}
.shortcut-list {
  display: grid;
  grid-template-columns: 1fr auto;
  font-size: 10px;
  line-height: 2.5;
  border-top: 1px solid #ddd;
  padding-top: 12px;
}
.shortcut-list dd {
  font-family: monospace;
  color: #718b78;
}
#toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(15px);
  padding: 12px 20px;
  background: #233b34;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px #0002;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 20;
  font-size: 12px;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 220px minmax(400px, 1fr) 300px;
  }
  .toolbox {
    padding-left: 20px;
    padding-right: 20px;
  }
  .inspector {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 65px minmax(350px, 1fr) 242px;
  }
  .toolbox {
    padding: 20px 8px;
  }
  .rail-heading,
  .tool span,
  .tools h4,
  .rail-footer {
    display: none;
  }
  .tool {
    padding: 10px 12px;
  }
  .tool.active:before {
    left: -9px;
  }
  .topbar {
    gap: 18px;
    padding: 0 16px;
  }
  .brand {
    min-width: 165px;
  }
  .document-title {
    padding-left: 16px;
  }
  .file-actions {
    gap: 2px;
  }
  .file-actions button {
    padding: 8px;
  }
  .canvas-toolbar {
    padding: 0 7px;
  }
}
@media (max-width: 780px) {
  .workspace {
    grid-template-columns: 54px minmax(270px, 1fr);
    height: auto;
    min-height: calc(100dvh - 109px);
    grid-template-rows: minmax(420px, 70dvh) auto;
  }
  .inspector {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .topbar {
    height: 109px;
    flex-wrap: wrap;
    gap: 5px 20px;
    padding: 11px 13px;
  }
  .brand {
    font-size: 19px;
    min-width: 145px;
  }
  .brand-mark {
    font-size: 34px;
  }
  .brand small {
    font-size: 6px;
  }
  .file-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .toolbox {
    padding: 12px 3px;
  }
  .tool {
    padding: 10px 11px;
  }
  .tool svg {
    width: 19px;
    height: 19px;
  }
  .canvas-toolbar {
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px;
  }
  .canvas-status #coordinates {
    display: none;
  }
  .canvas-bottom {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .canvas-badge {
    left: 10px;
    top: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
