:root {
  --sans: "Segoe UI", Arial, sans-serif;
  --disp: "Segoe UI", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
}

.desktop-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn.icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

.btn.icon:disabled {
  cursor: default;
  opacity: 0.35;
}

.btn.icon:disabled:hover {
  border-color: var(--line);
  background: var(--panel-2);
}

.view-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 92px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111317;
}

.view-mode-toggle button {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--ink-faint);
  background: transparent;
  font: 700 11px var(--sans);
  cursor: pointer;
}

.view-mode-toggle button:hover { color: white; }

.view-mode-toggle button.on {
  color: white;
  background: #2877d4;
  box-shadow: 0 3px 10px rgba(40, 119, 212, 0.3);
}

#projectStatus {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
}

#projectStatus.saved {
  color: var(--good);
}

#projectStatus.error {
  color: #ff7d72;
}

.stage-wrap {
  position: relative;
}

.stage-wrap.mode-3d #viewLabel,
.stage-wrap.mode-3d #viewSeg,
.stage-wrap.mode-3d #planTitle,
.stage-wrap.mode-3d #zoomOut,
.stage-wrap.mode-3d #zoomVal,
.stage-wrap.mode-3d #zoomIn,
.stage-wrap.mode-3d .zoom-control,
.stage-wrap.mode-3d #precisionPanel { display: none; }

#threePanel {
  position: absolute;
  inset: 53px 0 0;
  z-index: 24;
  display: none;
  overflow: hidden;
  background: #f4f0e7;
}

#threePanel.show {
  display: block;
}

#threeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.three-floating {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(18, 21, 26, 0.86);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.three-floating.controls {
  top: 14px;
  right: 14px;
  justify-content: flex-end;
}

.three-floating.help {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 13px;
  color: #c3c8d0;
  font-size: 11px;
  pointer-events: none;
}

.three-floating .btn {
  padding: 7px 11px;
  font-size: 11px;
}

.three-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: white;
  background: rgba(18, 21, 26, 0.86);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  pointer-events: none;
}

.three-badge span {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
}

.seed-modal {
  width: min(760px, calc(100vw - 48px));
}

.seed-modal .modal-head {
  align-items: flex-start;
}

.seed-modal .modal-head h2 {
  line-height: 24px;
}

.seed-mark {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(67, 146, 237, 0.55);
  border-radius: 9px;
  color: #81b9f6;
  background: rgba(40, 119, 212, 0.13);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
}

.seed-subtitle {
  max-width: 570px;
  margin-top: 3px;
  color: var(--ink-dim);
  font-size: 11px;
  line-height: 1.45;
}

.seed-modal .modal-body {
  display: block;
  padding: 22px;
}

.seed-modal label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

#seedCode {
  width: 100%;
  min-height: 190px;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  padding: 14px;
  color: #dbe7f5;
  background: #14171b;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#seedCode:focus {
  border-color: #4392ed;
  box-shadow: 0 0 0 3px rgba(67, 146, 237, 0.14);
}

#seedCode::placeholder {
  color: #646d78;
}

.seed-status {
  min-height: 19px;
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 11px;
}

.seed-status.success {
  color: var(--good);
}

.seed-status.warning {
  color: #f2bd5b;
}

.seed-status.error {
  color: #ff7d72;
}

.seed-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid #3c4652;
  color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  line-height: 1.5;
}

.seed-modal .modal-foot {
  align-items: center;
}

.seed-spacer {
  flex: 1;
}

.seed-modal .btn.danger {
  border-color: #d95858;
  color: white;
  background: #b43d3d;
}

@media (max-width: 1280px) {
  #projectStatus,
  .hdr-stat {
    display: none;
  }

  header {
    gap: 10px;
    padding: 0 12px;
  }
}
