:root {
  --bg-0: #000000;
  --bg-1: #1a1a1a;
  --bg-2: #242424;
  --panel: #1a1a1a;
  --panel-border: transparent;
  --text: #e0e0e0;
  --muted: #888888;
  --accent: #cc2222;
  --accent-2: #cc2222;
  --danger: #cc2222;
  --heading: #7777cc;
  --grid: transparent;
  --shadow: none;
  --row-even: #1e1e1e;
  --row-odd: #282828;
  --scrollbar-track: #2a2a2a;
  --scrollbar-thumb: #676b73;
  --scrollbar-thumb-hover: #7a7f88;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  letter-spacing: 0.04em;
  color: var(--text);
  background: #000000;
  overflow-x: hidden;
}

.backdrop {
  display: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1820px, 97vw);
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  background: #1a1a1a;
  border: none;
  border-radius: 0;
  padding: 12px 14px;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-help-tip {
  width: 18px;
  height: 18px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand h1 {
  margin: 0;
  line-height: 1;
  font-size: 1.15rem;
  color: var(--heading);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.brand-hint {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  font-size: 0.55rem;
  font-weight: 700;
  background: var(--row-odd);
  color: var(--muted);
  border-radius: 50%;
  vertical-align: middle;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.profile-drawer {
  margin-top: -2px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.inline-label {
  color: var(--muted);
  font-size: 0.88rem;
}

select,
input,
button {
  font: inherit;
}

select,
input[type="text"],
input[type="number"] {
  color: var(--text);
  background: #2a2a2a;
  border: none;
  border-radius: 0;
  padding: 7px 9px;
}

#carLibrarySelect {
  min-width: 260px;
  color-scheme: dark;
}

* {
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: none;
  border-radius: 0;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

#carSurfaceSelect {
  min-width: 118px;
}

select:focus,
input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.btn {
  border: none;
  border-radius: 0;
  background: #2a2a2a;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  transition: background 120ms ease;
}

.btn:hover {
  background: #333333;
}

.btn.subtle {
  border-color: transparent;
  background: #2a2a2a;
}

.btn.subtle:hover {
  background: #333333;
}

.btn.accent {
  border: none;
  background: var(--accent);
  color: #ffffff;
}

.btn.accent:hover {
  background: #dd3333;
}

.btn.danger {
  border: none;
  background: var(--accent);
  color: #ffffff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(780px, 1fr) 410px;
  gap: 14px;
  align-items: start;
}

.stage-panel,
.inspector {
  min-height: 0;
}

.stage-panel {
  min-height: 0;
}

.stage-collapsible {
  background: var(--panel);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.stage-collapsible > summary {
  cursor: pointer;
  padding: 11px 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-collapsible > summary::-webkit-details-marker {
  display: none;
}

.stage-collapsible > summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.stage-collapsible[open] > summary::before {
  content: "-";
}

.stage-collapsible + .stage-collapsible {
  margin-top: 14px;
}

.stage-collapsible > .panel-body {
  border-top: none;
  padding: 0;
}

.stage-panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-bottom: 1px solid #333333;
  padding: 12px;
  background: #111111;
}

.view-toggle,
.mode-toggle {
  display: inline-flex;
  background: #1a1a1a;
  border: none;
  border-radius: 0;
  padding: 4px;
  gap: 4px;
}

.view-btn,
.mode-btn {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  padding: 6px 10px;
  cursor: pointer;
}

.view-btn.active,
.mode-btn.active {
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
}

.wireframe-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 520px;
}

.wireframe-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.wire-bg {
  fill: #0a0a0a;
}

.wire-sheet-frame {
  fill: #111111;
  stroke: rgba(153, 229, 255, 0.38);
  stroke-width: 1.6;
}

.wire-sheet-image {
  opacity: 0.97;
  filter: saturate(0.88) contrast(1.1);
}

.wire-main {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wire-outline {
  stroke: rgba(153, 229, 255, 0.86);
  stroke-width: 3.4;
}

.wire-detail {
  stroke: rgba(149, 205, 224, 0.66);
  stroke-width: 2.1;
}

.wire-wheel {
  stroke: rgba(255, 188, 95, 0.88);
  stroke-width: 3.1;
}

.wire-subframe {
  stroke: rgba(186, 230, 243, 0.66);
  stroke-width: 2.2;
  stroke-dasharray: 6 4;
}

.wire-window {
  stroke: rgba(170, 224, 245, 0.78);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

.wire-struct {
  stroke: rgba(155, 211, 233, 0.6);
  stroke-width: 1.9;
}

.wire-chassis {
  stroke: rgba(136, 193, 216, 0.7);
  stroke-width: 2.1;
}

.wire-drivetrain {
  stroke: rgba(255, 188, 95, 0.72);
  stroke-width: 2.1;
  stroke-dasharray: 8 5;
}

.wire-hub {
  stroke: rgba(255, 188, 95, 0.64);
  stroke-width: 2;
  fill: rgba(255, 188, 95, 0.06);
}

.wire-label {
  fill: rgba(145, 201, 222, 0.95);
  stroke: none;
  font-size: 20px;
  letter-spacing: 0.16em;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

.wireframe-svg.view-transition {
  animation: viewSwitch 260ms ease;
}

@keyframes viewSwitch {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cards-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cards-layer.all-mode {
  position: relative;
  inset: auto;
  pointer-events: auto;
  overflow: visible;
  max-height: none;
  padding: 10px 10px 14px;
}

.wireframe-viewport.all-mode {
  flex: 0 0 auto;
  height: auto;
  overflow: visible;
  min-height: 0;
}

.wireframe-viewport.all-mode .wireframe-svg {
  display: none;
}

.setting-card {
  position: absolute;
  width: 304px;
  max-width: calc(100% - 20px);
  transform: translate(calc(-50% + var(--shift-x, 0px)), calc(-50% + var(--shift-y, 0px)));
  background: #1a1a1a;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 8px 7px;
  pointer-events: auto;
  animation: cardIn 240ms ease;
}

.setting-card.dragging {
  z-index: 6;
}

@keyframes cardIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.setting-card h3 {
  margin: -2px -2px 6px;
  padding: 5px 8px;
  font-size: 0.88rem;
  color: var(--heading);
  letter-spacing: 0.01em;
  border-radius: 0;
}

.card-drag-handle {
  cursor: grab;
  user-select: none;
  background: rgba(204, 34, 34, 0.1);
  border: none;
}

.setting-card.dragging .card-drag-handle,
.card-drag-handle:active {
  cursor: grabbing;
  background: rgba(204, 34, 34, 0.22);
}

body.dragging-card {
  cursor: grabbing;
}

body.dragging-card * {
  user-select: none !important;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(164px, 48%);
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.77rem;
  min-width: 0;
}

.tip-dot {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 0;
  border: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  color: #888888;
  cursor: help;
}

.field-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.field-input input,
.field-input select {
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.77rem;
  padding: 6px 7px;
  border-radius: 0;
}

.stepper {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 4px;
  align-items: center;
}

.step-btn {
  border: none;
  border-radius: 0;
  background: #2a2a2a;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  height: 28px;
  cursor: pointer;
}

.step-btn:hover {
  background: #333333;
}

.field-step-input {
  text-align: center;
}

.unit {
  color: var(--muted);
  font-size: 0.69rem;
  font-family: "JetBrains Mono", monospace;
  min-width: 42px;
  text-align: right;
}

.other-raw-list {
  margin-top: 10px;
  border-top: 1px dashed #333333;
  padding-top: 8px;
}

.other-raw-list h4 {
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.readonly-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 4px 0;
}

.readonly-field-row strong {
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.mini-btn {
  border: none;
  border-radius: 0;
  background: #2a2a2a;
  color: var(--text);
  padding: 5px 7px;
  font-size: 0.72rem;
  cursor: pointer;
}

.mini-btn:hover {
  background: #333333;
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--text);
  background: #2a2a2a;
  border: none;
  border-radius: 0;
  padding: 6px 8px;
  gap: 8px;
  min-width: 0;
}

.all-rbr-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.all-acc-section,
.all-sub-section,
.all-sub-sub-section {
  border: none;
  border-radius: 0;
  background: var(--row-even);
  box-shadow: none;
  overflow: hidden;
}

.all-sub-section {
  background: var(--row-even);
  margin: 8px 0;
}

.all-sub-sub-section {
  background: #222222;
  margin: 6px 0;
}

.all-acc-section > summary,
.all-sub-section > summary,
.all-sub-sub-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--heading);
  padding: 10px 12px;
}

.all-sub-section > summary {
  font-size: 0.93rem;
  padding: 9px 11px;
}

.all-sub-sub-section > summary {
  font-size: 0.86rem;
  padding: 8px 10px;
}

.all-acc-section > summary::-webkit-details-marker,
.all-sub-section > summary::-webkit-details-marker,
.all-sub-sub-section > summary::-webkit-details-marker {
  display: none;
}

.all-acc-section > summary::before,
.all-sub-section > summary::before,
.all-sub-sub-section > summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.all-acc-section[open] > summary::before,
.all-sub-section[open] > summary::before,
.all-sub-sub-section[open] > summary::before {
  content: "-";
}

.all-acc-body {
  border-top: none;
  padding: 10px;
}

.all-corner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}

.all-corner-card {
  border: none;
  border-radius: 0;
  background: var(--row-odd);
  padding: 8px;
}

.all-corner-card h4 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 0.84rem;
}

.inline-geometry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.78);
}

.empty-state.hidden {
  display: none;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel {
  background: var(--panel);
  border: none;
  border-radius: 0;
  padding: 11px;
  box-shadow: none;
}

.panel.collapsible {
  padding: 0;
}

.panel.collapsible > summary {
  cursor: pointer;
  padding: 11px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel.collapsible > summary::-webkit-details-marker {
  display: none;
}

.panel.collapsible > summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}

.panel.collapsible[open] > summary::before {
  content: "-";
}

.panel.collapsible > .panel-body {
  border-top: none;
  padding: 11px;
}

.summary-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.geo-title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--heading);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-head-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-grid.single-col {
  grid-template-columns: 1fr;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.symmetry-row {
  margin-top: 8px;
}

.symmetry-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 0;
  background: #2a2a2a;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.toggle-text {
  font-weight: 500;
}

.symmetry-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-pill {
  width: 42px;
  height: 22px;
  border-radius: 2px;
  border: 1px solid #555555;
  background: #1a1a1a;
  position: relative;
  flex: 0 0 auto;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.toggle-pill::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: #888888;
  transition: transform 120ms ease, background 120ms ease;
}

.symmetry-toggle input:checked + .toggle-pill {
  background: rgba(204, 34, 34, 0.34);
  border-color: var(--accent);
}

.symmetry-toggle input:checked + .toggle-pill::before {
  transform: translateX(20px);
  background: var(--accent);
}

.symmetry-toggle input:disabled + .toggle-pill {
  opacity: 0.42;
}

.symmetry-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  line-height: 1.45;
}

.profile-car-info {
  margin-top: 10px;
  border: none;
  border-radius: 0;
  background: var(--row-even);
  padding: 8px 9px;
}

.profile-car-info.hidden {
  display: none;
}

.profile-car-info-title {
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.profile-car-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  line-height: 1.35;
  margin-bottom: 4px;
}

.profile-car-info-row:last-child {
  margin-bottom: 0;
}

.profile-car-info-key {
  color: var(--muted);
}

.profile-car-info-value {
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  text-align: right;
}

.profile-car-info-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.geometry-readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.geo-card {
  border: none;
  border-radius: 0;
  background: var(--row-odd);
  padding: 7px 8px;
}

.geo-card h3 {
  margin: 0 0 5px;
  font-size: 0.74rem;
  color: var(--heading);
  letter-spacing: 0.02em;
}

.geo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

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

.geo-row strong {
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  font-weight: 600;
}

.geo-meta {
  grid-column: 1 / -1;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.stat {
  border: none;
  border-radius: 0;
  background: var(--row-odd);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat .value {
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

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

.map-editor {
  border: none;
  border-radius: 0;
  background: var(--row-even);
  padding: 8px;
  min-height: 214px;
  overflow: auto;
}

.map-editor-inline {
  min-height: 0;
  margin-top: 2px;
  padding: 6px;
}

.map-editor-content {
  display: grid;
  gap: 8px;
}

.map-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.map-table {
  width: 100%;
  border-collapse: collapse;
}

.map-table th,
.map-table td {
  border-bottom: 1px solid #333333;
  border-right: 2px solid var(--accent);
  padding: 4px;
  font-size: 0.74rem;
}

.map-table th:last-child,
.map-table td:last-child {
  border-right: none;
}

.map-table th {
  color: var(--text);
  text-align: left;
  position: sticky;
  top: -8px;
  background: #222222;
}

.map-table td {
  color: var(--muted);
}

.map-table tr:nth-child(even) td {
  background: var(--row-even);
}

.map-table tr:nth-child(odd) td {
  background: var(--row-odd);
}

.map-table input {
  width: 100%;
  font-size: 0.74rem;
  padding: 5px 6px;
  font-family: "JetBrains Mono", monospace;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 0.66rem;
  border: 1px solid #555555;
  color: var(--muted);
}

.tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  max-width: 340px;
  padding: 8px 9px;
  border-radius: 0;
  border: none;
  border-top: 3px solid var(--accent);
  background: #1a1a1a;
  box-shadow: none;
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 90ms ease, transform 90ms ease;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.guide-panel {
  margin-top: 2px;
}

.guide-intro {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.guide-section {
  border: none;
  border-radius: 0;
  background: var(--row-even);
  margin-bottom: 8px;
  overflow: hidden;
}

.guide-section summary {
  cursor: pointer;
  padding: 9px 11px;
  font-weight: 600;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-section summary::-webkit-details-marker {
  display: none;
}

.guide-section summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  color: var(--accent);
}

.guide-section[open] summary::before {
  content: "-";
}

.guide-content {
  border-top: none;
  padding: 10px 11px 11px;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.guide-content p {
  margin: 0 0 8px;
}

.guide-content ul,
.guide-content ol {
  margin: 0 0 0 18px;
  padding: 0;
}

.guide-content li {
  margin-bottom: 5px;
}

code {
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
}

.guide-content h4 {
  margin: 14px 0 6px;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

.guide-content dl {
  margin: 0 0 8px;
}

.guide-content dt {
  font-weight: 600;
  color: var(--heading);
  margin-top: 6px;
}

.guide-content dd {
  margin: 2px 0 0 18px;
  color: var(--text);
}

.profile-car-info-row[data-tip] {
  cursor: help;
}

@media (max-width: 2000px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .inspector {
    min-height: 0;
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: min(96vw, 96vw);
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .toolbar-group {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .setting-card {
    width: 270px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr) minmax(148px, 54%);
  }

  .all-corner-grid,
  .inline-geometry-grid {
    grid-template-columns: 1fr;
  }

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

  .geometry-readouts {
    grid-template-columns: 1fr;
  }
}

.feedback-panel {
  margin-top: 2px;
}

/* Feedback section */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.feedback-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text);
}

.feedback-optional {
  color: var(--muted);
  font-size: 0.75rem;
}

.feedback-label input,
.feedback-label textarea {
  background: var(--bg-0);
  border: 1px solid #333;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 0;
  resize: vertical;
}

.feedback-label input:focus,
.feedback-label textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-item {
  background: var(--bg-0);
  padding: 10px 12px;
}

.feedback-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.feedback-item-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--heading);
}

.feedback-item-date {
  font-size: 0.72rem;
  color: var(--muted);
}

.feedback-item-text {
  font-size: 0.82rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-reply {
  background: var(--bg-1);
  padding: 8px 10px;
  margin: 6px 0 0 18px;
}

.feedback-reply-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
}

.feedback-reply-btn:hover {
  color: var(--heading);
}

.feedback-reply-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-reply-form input,
.feedback-reply-form textarea {
  background: var(--bg-0);
  border: 1px solid #333;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  padding: 6px 8px;
  border-radius: 0;
  resize: vertical;
}

.feedback-reply-form input:focus,
.feedback-reply-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-reply-actions {
  display: flex;
  gap: 6px;
}

.feedback-reply-actions .btn {
  font-size: 0.75rem;
  padding: 4px 10px;
}

.feedback-item-pending {
  border-left: 3px solid var(--accent);
}

.feedback-pending-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  margin-left: 6px;
  letter-spacing: 0.04em;
}

.feedback-admin-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.feedback-admin-actions .btn {
  font-size: 0.75rem;
  padding: 3px 10px;
}

.feedback-delete-btn {
  color: var(--muted);
}

.feedback-delete-btn:hover {
  color: var(--accent);
}

.feedback-admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.feedback-signin-btn {
  font-size: 0.82rem;
}

.feedback-signout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}

.feedback-signout-btn:hover {
  color: var(--text);
}

.feedback-submitted-notice {
  font-size: 0.82rem;
  color: var(--heading);
  padding: 8px 0;
  margin: 0;
}

.feedback-empty {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 8px 0;
}

/* ========================================================================
   3D Model Viewer
   ======================================================================== */

.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.viewer-cam-group {
  background: transparent;
  padding: 0;
  gap: 2px;
}

.viewer-cam-group .view-btn {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  padding: 4px 8px;
  background: #2a2a2a;
}

.viewer-cam-group .view-btn:hover {
  color: #fff;
  background: #2a2a2a;
}

.viewer-cam-group .view-btn.active {
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.model-viewer-body {
  padding: 0 !important;
}

.model-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  background: #111;
  border-bottom: 1px solid #333;
}

.viewer-wireframe-copy-btn {
  font-size: 0.7rem;
  padding: 4px 8px;
  line-height: 1.2;
}

.viewer-crossline-mode-btn {
  font-size: 0.7rem;
  padding: 4px 8px;
  line-height: 1.2;
  background: #232323;
}

.viewer-crossline-mode-btn.active {
  background: #ffbf3f;
  color: #111;
  border-color: #111;
}

.viewer-toolbar-toggle {
  font-size: 0.75rem;
  padding: 5px 8px;
  background: transparent;
}

.viewer-toolbar-toggle .toggle-text {
  font-size: 0.75rem;
}

.viewer-toolbar-toggle .toggle-pill {
  width: 36px;
  height: 19px;
}

.viewer-toolbar-toggle .toggle-pill::before {
  width: 13px;
  height: 13px;
}

.viewer-toolbar-toggle input:checked + .toggle-pill::before {
  transform: translateX(17px);
}

.model-viewer-layout {
  display: flex;
  position: relative;
}

.component-list-sidebar {
  width: 180px;
  flex-shrink: 0;
  background: #111;
  border-right: 1px solid #2a2a2a;
  overflow-y: auto;
  max-height: 560px;
  font-size: 0.75rem;
}

.component-list-sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 2px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7777cc;
  font-weight: 600;
}

.sidebar-group-title .tip-dot {
  color: #6868aa;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 3px 8px 3px 14px;
  cursor: pointer;
  color: #999;
  font-family: "JetBrains Mono", monospace;
  transition: color 0.12s, background 0.12s;
}

.sidebar-item-text {
  min-width: 0;
  flex: 1;
}

.sidebar-item .tip-dot {
  color: #666;
  flex: 0 0 auto;
}

.sidebar-item:hover {
  color: #fff;
  background: #1a1a1a;
}

.sidebar-item:hover .tip-dot {
  color: #aaa;
}

.sidebar-item.highlighted {
  color: #cc2222;
}

.sidebar-item.panel-open {
  color: #cc2222;
}

.threejs-container {
  flex: 1;
  position: relative;
  min-height: 400px;
  max-height: 560px;
  background: #000;
  overflow: hidden;
}

.threejs-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.viewer-3d-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 5;
}

.model-hover-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(0,0,0,0.88);
  color: #fff;
  padding: 2px 7px;
  border-radius: 0;
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
  z-index: 100;
  border: 1px solid #333;
}

.wireframe-handle-layer {
  position: absolute;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

.wireframe-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #111;
  background: #49b8ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
}

.wireframe-handle:active {
  cursor: grabbing;
}

.wireframe-handle::after {
  content: attr(data-label);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: #f4f4f4;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 4px;
  border: 1px solid #333;
  opacity: 0;
  transition: opacity 0.12s;
  pointer-events: none;
}

.wireframe-handle:hover::after {
  opacity: 1;
}

.wireframe-handle.hidden {
  display: none;
}

.wireframe-handle.role-crossline {
  background: #ffbf3f;
  border-color: #111;
}

.wireframe-handle.mode-add {
  background: #54cf8f;
}

.wireframe-handle.mode-remove {
  background: #ff6b6b;
}

.wireframe-handle.role-push-pull {
  width: 14px;
  height: 14px;
  border-color: #0f2a3a;
  background: #49b8ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 10px rgba(73, 184, 255, 0.35);
}

.model-floating-panel {
  position: absolute;
  background: rgba(20,20,20,0.94);
  border: 1px solid #333;
  border-radius: 0;
  width: 250px;
  z-index: 200;
  font-size: 0.75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.model-panel-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px;
  background: #222;
  border-bottom: 1px solid #333;
  border-radius: 0;
  cursor: grab;
}

.model-panel-title-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.model-panel-titlebar .model-panel-title-text {
  color: #7777cc;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-panel-titlebar .tip-dot {
  color: #6868aa;
}

.model-panel-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}

.model-panel-close:hover {
  color: #cc2222;
}

.model-panel-body {
  padding: 5px 7px;
}

.model-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}

.model-panel-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #aaa;
  flex: 1;
  font-size: 0.72rem;
}

.model-panel-row label .tip-dot {
  color: #666;
}

.model-panel-row .stepper {
  display: flex;
  align-items: center;
  gap: 1px;
}

.model-panel-row .stepper button {
  background: #2a2a2a;
  border: 1px solid #333;
  color: #ccc;
  width: 18px;
  height: 20px;
  cursor: pointer;
  font-size: 11px;
  border-radius: 0;
  padding: 0;
  font-family: "JetBrains Mono", monospace;
}

.model-panel-row .stepper button:hover {
  background: #3a3a3a;
}

.model-panel-row .stepper input {
  background: #2a2a2a;
  border: 1px solid #333;
  color: #fff;
  width: 56px;
  height: 20px;
  text-align: center;
  font-size: 0.7rem;
  border-radius: 0;
  font-family: "JetBrains Mono", monospace;
}

.model-panel-row .unit {
  color: #666;
  font-size: 0.62rem;
  margin-left: 3px;
  width: 28px;
  text-align: right;
}
