/* ===== app-base.css ===== */
:root {
  --bg: #eef3f7;
  --panel: #fff;
  --panel-soft: #f7fafc;
  --line: #dbe5ec;
  --line-strong: #c5d3dd;
  --text: #102a43;
  --muted: #627d98;
  --accent: #0b6e99;
  --accent-2: #1296c7;
  --accent-soft: #e3f4fb;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --success: #16794b;
  --shadow: 0 12px 28px rgba(16, 42, 67, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --topbar: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

.grow {
  flex: 1;
}

.full {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  background: #102a43;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--panel);
  color: #102a43;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  font-size: 12px;
  color: #bcccdc;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 750;
  font-size: 13px;
  transition: 0.16s ease;
  white-space: nowrap;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: #085a7d;
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line-strong);
}

.topbar .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: rgba(255, 255, 255, 0.16);
  padding-inline: 11px;
  font-size: 18px;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.topbar {
  overflow: visible;
  position: relative;
  z-index: 1600;
}

.brand {
  flex: 0 1 auto;
}

.top-menu-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-start;
  margin-left: 10px;
}

.top-menu {
  position: relative;
}

.top-menu > summary {
  list-style: none;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.top-menu > summary::-webkit-details-marker {
  display: none;
}

.top-menu > summary::after {
  content: 'v';
  font-size: 9px;
  color: #9fb3c8;
}

.top-menu[open] > summary,
.top-menu > summary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.13);
}

.top-menu-panel {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: 250px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(3, 20, 33, 0.28);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
  z-index: 1700;
}

.top-menu-panel.wide {
  width: 290px;
}

.top-menu-item {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  position: relative;
}

.top-menu-item:hover,
.top-menu-item:focus {
  background: var(--accent-soft);
  outline: none;
}

.top-menu-item .mi {
  width: 18px;
  text-align: center;
  color: var(--accent);
  font-weight: 900;
}

.top-menu-item .sub {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.top-menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 3px;
}

.top-menu-panel .file-btn {
  justify-content: flex-start;
  overflow: hidden;
}

.top-menu-panel .file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.top-actions {
  flex-wrap: nowrap;
}

.boot-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 9px;
  color: #bcccdc;
  white-space: nowrap;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.boot-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.boot-status.ready::before {
  background: #34d399;
}

.boot-status.warn::before {
  background: #f59e0b;
}

.boot-status.error::before {
  background: #f87171;
}

.server-required {
  position: sticky;
  top: 0;
  z-index: 5000;
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffecb5;
  padding: 9px 16px;
  font-size: 12px;
  text-align: center;
}

.server-required.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .brand-subtitle {
    display: none;
  }

  .top-menu-bar {
    overflow-x: auto;
  }

  .top-menu > summary {
    padding: 0 8px;
  }

  .boot-status {
    display: none;
  }
}

@media (max-width: 760px) {
  .brand-copy {
    display: none;
  }

  .topbar {
    padding: 0 8px;
    gap: 5px;
  }

  .top-menu-bar {
    margin-left: 0;
  }

  .top-actions #undoBtn,
  .top-actions #redoBtn {
    display: none;
  }

  .account-trigger span:last-child {
    display: none;
  }
}

.project-strip {
  min-height: 66px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.project-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-title-input {
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  min-width: 240px;
  max-width: 560px;
  width: min(42vw, 560px);
  padding: 7px 4px;
  border-bottom: 2px solid transparent;
  outline: none;
}

.project-title-input:focus {
  border-color: var(--accent);
}

.status-pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #075985;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

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

.stat {
  padding: 2px 12px;
  border-left: 1px solid var(--line);
  min-width: 84px;
}

.stat strong {
  display: block;
  font-size: 14px;
}

.stat span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
}

.workspace {
  flex: 1;
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(275px, 330px) minmax(480px, 1fr) minmax(330px, 390px);
  gap: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  min-height: 680px;
  max-height: calc(100vh - 174px);
}

.tabs {
  height: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  padding: 0 6px;
}

.tab.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.08);
}

.tab-panel {
  display: none;
  padding: 16px;
  overflow: auto;
  min-height: 0;
}

.tab-panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2,
.inspector h2 {
  margin: 0;
  font-size: 17px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.subtle-row {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.mode-hint {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  padding: 8px 10px;
  border-radius: 8px;
  margin: 10px 0 12px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  padding: 7px 3px;
}

.text-btn.danger {
  color: var(--danger);
}

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

.list-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.list-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: 0.12s;
}

.list-row:hover {
  border-color: #a8c0cf;
}

.list-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.row-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf1f5;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 auto;
}

.row-number.instruction {
  background: #102a43;
  color: #fff;
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-title {
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mini-btn {
  border: 0;
  background: transparent;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.mini-btn:hover {
  background: #edf4f7;
  color: var(--text);
}

.mini-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 9px;
  min-height: 40px;
  padding: 8px 10px;
  outline: none;
  font-size: 13px;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  resize: vertical;
  line-height: 1.45;
}

.textarea.compact {
  min-height: 66px;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field > span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 850;
  color: var(--muted);
  margin-bottom: 5px;
}

.form-grid.two {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 10px;
}

.info-box {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.info-box strong {
  display: block;
  margin-bottom: 3px;
}

.scene-target-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: #eaf1f5;
  padding: 3px;
  border-radius: 10px;
  margin: 10px 0;
}

.seg {
  border: 0;
  background: transparent;
  border-radius: 8px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.seg.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(16, 42, 67, 0.08);
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}

.symbol-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  min-width: 0;
  padding: 7px;
  min-height: 92px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.symbol-card:hover {
  border-color: var(--accent);
  background: #f9fdff;
}

.symbol-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.symbol-card span {
  font-size: 9px;
  line-height: 1.2;
  color: var(--text);
  font-weight: 750;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 680px;
}

.map-toolbar {
  height: 48px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  background: var(--panel);
  z-index: 500;
}

.map-mode {
  font-size: 12px;
  font-weight: 850;
  color: var(--text);
}

.map-toolbar-actions {
  display: flex;
  gap: 5px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  font-weight: 900;
  color: var(--text);
}

.icon-btn:hover {
  background: #f4f8fa;
}

.icon-btn.danger {
  color: var(--danger);
}

.map {
  flex: 1;
  min-height: 620px;
  background: #dbe5ec;
}

.map-legend {
  position: absolute;
  z-index: 600;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  box-shadow: 0 5px 16px rgba(16, 42, 67, 0.12);
  font-size: 10px;
  font-weight: 750;
}

.legend-line {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 4px solid var(--accent);
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}

.legend-dot.control {
  background: var(--panel);
  border: 3px solid #d97706;
}

.legend-dot.instruction {
  background: #102a43;
}

.leaflet-control-attribution {
  font-size: 9px !important;
}

.leaflet-div-icon {
  background: transparent;
  border: 0;
}

.cp-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 4px solid #d97706;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.ins-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #102a43;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3);
  font-size: 10px;
  font-weight: 900;
}

.ins-marker.selected {
  background: var(--accent-2);
  transform: scale(1.13);
}

.right-panel {
  overflow: auto;
}

.right-info-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  font-size: 11px;
}

.right-info-table th,
.right-info-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
  text-align: left;
}

.right-info-table th {
  width: 82px;
  color: var(--muted);
  background: #f8fbfd;
  font-size: 9px;
  text-transform: uppercase;
}

.right-scene-table .scene-section {
  margin: 0;
  border: 0;
  padding: 0;
}

.right-scene-table .scene-head {
  margin-bottom: 4px;
}

.right-scene-table .scene-canvas {
  min-height: 110px;
  max-height: 150px;
}

.right-description-field {
  display: none !important;
}

.empty-state {
  margin: auto;
  text-align: center;
  padding: 34px 28px;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--text);
  font-size: 17px;
  margin: 9px 0 6px;
}

.empty-state p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: auto;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.inspector {
  padding: 16px;
  overflow: auto;
}

.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.eyebrow {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 900;
  color: var(--muted);
}

.distance-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 13px;
}

.distance-cards > div {
  padding: 9px 12px;
  background: #f8fbfd;
}

.distance-cards > div + div {
  border-left: 1px solid var(--line);
}

.distance-cards span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  font-weight: 900;
  color: var(--muted);
}

.distance-cards strong {
  font-size: 16px;
}

.scene-section,
.element-editor {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

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

.scene-head h3 {
  font-size: 13px;
  margin: 0;
}

.scene-head span {
  font-size: 10px;
  color: var(--muted);
}

.scene-canvas {
  width: 100%;
  aspect-ratio: 199/168;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background-image: linear-gradient(#f4f7f9 1px, transparent 1px), linear-gradient(90deg, #f4f7f9 1px, transparent 1px);
  background-size: 20px 20px;
}

.scene-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.scene-canvas [data-editable='1'] {
  cursor: move;
}

.scene-canvas [data-selected='1'] .selection-ring {
  display: block;
}

.scene-canvas.scene-drop-target {
  outline: 3px dashed #0b6e99;
  outline-offset: -3px;
}

.line-hit-target {
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
}

.line-selection-ring {
  stroke: #0b6e99;
  stroke-width: 6;
  stroke-opacity: 0.65;
  pointer-events: stroke;
}

.selection-ring {
  display: none;
  fill: none;
  stroke: #0b6e99;
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}

.element-fields {
  font-size: 12px;
}

.element-fields.muted {
  color: var(--muted);
  padding: 8px 0;
}

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

.element-grid .field {
  margin: 0;
}

.element-actions {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.add-text-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.add-text-row .input {
  flex: 1;
}

.footerbar {
  min-height: 34px;
  padding: 5px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.footer-note {
  margin-left: auto;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #102a43;
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  animation: toastin 0.15s ease;
}

.toast.error {
  background: #8f1d14;
}

.toast.success {
  background: #11633d;
}

@keyframes toastin {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.busy-overlay {
  position: absolute;
  inset: 48px 0 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  place-items: center;
  backdrop-filter: blur(2px);
}

.busy-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 800;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid #c9d9e4;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 7px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1250px) {
  .workspace {
    grid-template-columns: 300px minmax(440px, 1fr);
  }

  .right-panel {
    grid-column: 1/-1;
    max-height: none;
    min-height: 0;
  }

  .inspector {
    display: grid;
    grid-template-columns: minmax(290px, 0.75fr) 1fr 1fr;
    gap: 14px;
  }

  .inspector-head,
  .distance-cards,
  .form-grid,
  .inspector > .field,
  .inspector > .button-row {
    grid-column: 1;
  }

  .scene-section {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }

  .element-editor {
    grid-column: 1/-1;
  }

  .empty-state {
    padding: 30px;
  }

  .right-panel {
    overflow: visible;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar: unset;
  }

  .topbar {
    height: auto;
    min-height: 72px;
    padding: 10px 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .project-strip {
    padding: 9px 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .project-title-input {
    width: 100%;
    min-width: 0;
  }

  .stats-grid {
    width: 100%;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    padding: 8px;
  }

  .left-panel,
  .right-panel,
  .map-panel {
    max-height: none;
    min-height: 0;
  }

  .map-panel {
    order: -1;
  }

  .map {
    min-height: 500px;
  }

  .left-panel {
    overflow: visible;
  }

  .tab-panel {
    max-height: none;
  }

  .inspector {
    display: block;
  }

  .scene-section {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }

  .symbol-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 560px) {
  .brand-subtitle {
    white-space: normal;
  }

  .top-actions .btn {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(3) {
    border-top: 1px solid var(--line);
    padding-top: 5px;
  }

  .stat:nth-child(4) {
    border-top: 1px solid var(--line);
    padding-top: 5px;
  }

  .map {
    min-height: 430px;
  }

  .map-legend {
    gap: 7px;
    flex-wrap: wrap;
    right: 12px;
  }

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

  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .distance-cards strong {
    font-size: 14px;
  }
}

/* ===== Studio v2 ergonomic extensions ===== */
.tabs.five {
  grid-template-columns: repeat(4, 1fr);
}

.topbar .square {
  width: 40px;
  padding: 0;
}

.brand-copy {
  min-width: 0;
}

.workspace.left-collapsed {
  grid-template-columns: 0 minmax(520px, 1fr) minmax(330px, 390px);
}

.workspace.left-collapsed .left-panel {
  display: none;
}

.workspace.right-collapsed {
  grid-template-columns: minmax(275px, 330px) minmax(520px, 1fr) 0;
}

.workspace.right-collapsed .right-panel {
  display: none;
}

.workspace.left-collapsed.right-collapsed {
  grid-template-columns: 0 minmax(620px, 1fr) 0;
}

.coordinate-add {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 6px;
  margin-top: 9px;
}

.filter-row,
.roadbook-tools,
.symbol-browser-tools {
  display: grid;
  gap: 7px;
  margin: 9px 0;
}

.roadbook-tools,
.symbol-browser-tools {
  grid-template-columns: 1fr 0.8fr;
}

.input.small {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.list.dense {
  gap: 5px;
}

.list.dense .list-row {
  padding: 7px 8px;
}

.list-row .row-extra {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.stack-actions {
  display: grid;
  gap: 7px;
}

.wrap {
  flex-wrap: wrap;
}

.form-grid.two.equal {
  grid-template-columns: 1fr 1fr;
}

.setting-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0 12px;
  background: var(--panel-soft);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 7px 0;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.shortcut-list {
  display: grid;
  gap: 7px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
  font-size: 12px;
}

.shortcut-list > div span {
  margin-left: auto;
  color: var(--muted);
}

kbd {
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel);
  padding: 2px 6px;
  font:
    700 10px ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}

.toolbar-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  height: 34px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.toolbar-btn:hover {
  background: #f5f9fb;
}

.right-panel {
  overflow: visible;
}

.right-panel .inspector {
  overflow: visible;
}

.sticky-inspector-head {
  position: sticky;
  top: -16px;
  background: var(--panel);
  z-index: 3;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
}

.distance-cards.three {
  grid-template-columns: repeat(3, 1fr);
}

.distance-cards.three > div:last-child strong {
  font-size: 13px;
}

.footer-note {
  display: flex !important;
  gap: 18px;
  align-items: center;
}

.context-menu {
  position: absolute;
  z-index: 1000;
  min-width: 180px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.18);
}

.context-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: visible;
  padding-right: 0;
}

.compact-grid .symbol-card {
  min-height: 92px;
  position: relative;
  padding: 6px;
}

.symbol-card .symbol-thumb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
}

.symbol-card .symbol-thumb img {
  width: 40px;
  height: 40px;
  background: transparent;
}

.symbol-card .symbol-meta {
  font-size: 8px;
  color: var(--muted);
  line-height: 1.25;
}

.symbol-card .symbol-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  width: 100%;
}

.symbol-card .symbol-actions button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 3px 4px;
  font-size: 8px;
  font-weight: 800;
}

.symbol-card .symbol-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Tulip Studio ===== */
.svg-studio {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(5, 18, 30, 0.72);
  padding: 18px;
  backdrop-filter: blur(4px);
}

.svg-studio-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f1f5f8;
  border: 1px solid #7890a0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

.svg-topbar {
  height: 68px;
  flex: 0 0 auto;
  background: #102a43;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 18px;
  gap: 16px;
}

.svg-topbar h2 {
  margin: 1px 0 0;
  font-size: 18px;
}

.svg-topbar .eyebrow {
  color: #9fb3c8;
}

.svg-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.svg-top-actions .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.svg-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 184px minmax(420px, 1fr) 300px;
  gap: 1px;
  background: #cbd6de;
}

.svg-tools-panel,
.svg-properties-panel {
  background: var(--panel);
  min-width: 0;
  overflow: auto;
}

.svg-stage-panel {
  background: #dfe6eb;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.svg-tool {
  min-height: 54px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.svg-tool span {
  font-size: 9px;
  color: var(--muted);
}

.svg-tool:hover,
.svg-tool.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.svg-panel-section {
  padding: 11px;
  border-bottom: 1px solid var(--line);
}

.svg-panel-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}

.mini-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.svg-stage-toolbar {
  height: 46px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex: 0 0 auto;
}

.toolbar-separator {
  display: block;
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 3px;
}

.svg-doc-metrics {
  font-size: 10px;
  color: var(--muted);
  font-weight: 800;
}

.svg-stage-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 48px;
  background-color: #cbd4db;
  background-image:
    linear-gradient(45deg, #d8e0e5 25%, transparent 25%), linear-gradient(-45deg, #d8e0e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8e0e5 75%), linear-gradient(-45deg, transparent 75%, #d8e0e5 75%);
  background-size: 22px 22px;
  background-position:
    0 0,
    0 11px,
    11px -11px,
    -11px 0;
}

.svg-stage-wrap {
  width: max-content;
  height: max-content;
  margin: auto;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(17, 36, 51, 0.2);
}

.svg-editor-canvas {
  display: block;
  touch-action: none;
  user-select: none;
  overflow: visible;
}

.svg-editor-canvas #svgArtwork,
.svg-editor-canvas #svgArtwork * {
  pointer-events: visiblePainted;
}

.svg-editor-canvas #svgEditorOverlay {
  pointer-events: none;
}

.svg-editor-canvas #svgEditorOverlay [data-handle] {
  pointer-events: all;
}

.svg-editor-canvas.grid-on {
  background-image:
    linear-gradient(to right, rgba(16, 42, 67, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 42, 67, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

.svg-editor-canvas .editor-selection {
  fill: none;
  stroke: #0b6e99;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 3;
}

.svg-editor-canvas .editor-handle {
  fill: #fff;
  stroke: #0b6e99;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: nwse-resize;
}

.svg-editor-canvas .editor-rotate {
  fill: #fff;
  stroke: #d97706;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: grab;
}

.svg-editor-canvas .editor-node {
  fill: #fff;
  stroke: #7c3aed;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: move;
}

.svg-editor-canvas .editor-control {
  fill: #f5f3ff;
  stroke: #7c3aed;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: move;
}

.svg-editor-canvas .editor-control-line {
  stroke: #7c3aed;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 2;
}

.svg-statusbar {
  height: 28px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 10px;
  color: var(--muted);
  flex: 0 0 auto;
}

.svg-side-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}

.svg-side-tabs button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  min-height: 32px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.svg-side-tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.svg-side-panel {
  display: none;
  padding: 12px;
}

.svg-side-panel.active {
  display: block;
}

.svg-empty-props {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 18px 12px;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}

.color-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  padding: 3px;
}

.textarea.code {
  font:
    11px/1.35 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre;
}

.svg-layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.svg-layer-row {
  display: grid;
  grid-template-columns: 26px 26px 1fr 26px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
}

.svg-layer-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.svg-layer-row button {
  border: 0;
  background: transparent;
  width: 26px;
  height: 26px;
  border-radius: 5px;
}

.svg-layer-row button:hover {
  background: #e6edf2;
}

.svg-layer-row input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 10px;
  font-weight: 750;
}

.gradient-preview {
  height: 70px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}

.layer-actions {
  margin-bottom: 8px;
}

@media (max-width: 1250px) {
  .workspace {
    grid-template-columns: 285px minmax(430px, 1fr) 330px;
  }

  .svg-workspace {
    grid-template-columns: 160px minmax(360px, 1fr) 270px;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .left-panel,
  .right-panel,
  .map-panel {
    max-height: none;
    min-height: 0;
  }

  .left-panel {
    order: 1;
  }

  .map-panel {
    order: 2;
    min-height: 620px;
  }

  .right-panel {
    order: 3;
  }

  .workspace.left-collapsed,
  .workspace.right-collapsed,
  .workspace.left-collapsed.right-collapsed {
    display: flex;
  }
  .svg-studio {
    padding: 6px;
  }

  .svg-workspace {
    grid-template-columns: 140px minmax(320px, 1fr);
  }

  .svg-properties-panel {
    grid-column: 1/-1;
    max-height: 280px;
  }

  .svg-studio-shell {
    overflow: auto;
  }

  .svg-stage-panel {
    min-height: 560px;
  }
}

.top-menu-section-title {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.tulip-waypoint-live {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
}

.tulip-waypoint-live-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.tulip-waypoint-live-head strong,
.tulip-waypoint-live-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tulip-waypoint-live-canvas {
  height: 132px;
}

.tulip-waypoint-live-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
  background: #f7fafc;
}

@media (max-width: 680px) {
  .project-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }

  .topbar {
    height: auto;
    min-height: 72px;
    padding-block: 10px;
    align-items: flex-start;
  }

  .brand-subtitle {
    display: none;
  }

  .coordinate-add,
  .roadbook-tools,
  .symbol-browser-tools {
    grid-template-columns: 1fr;
  }

  .svg-workspace {
    display: block;
    overflow: auto;
  }

  .svg-tools-panel {
    display: flex;
    overflow: auto;
  }

  .tool-grid {
    grid-template-columns: repeat(7, 70px);
    min-width: max-content;
  }

  .svg-panel-section {
    min-width: 150px;
  }

  .svg-stage-panel {
    min-height: 520px;
  }

  .svg-properties-panel {
    max-height: none;
  }

  .svg-topbar {
    height: auto;
    align-items: flex-start;
  }

  .svg-top-actions {
    justify-content: flex-end;
  }
}

/* ===== Tulip Studio ===== */
body.studio-open {
  overflow: hidden;
}

.tulip-studio {
  position: fixed;
  inset: 0;
  z-index: 4900;
  background: rgba(5, 18, 30, 0.72);
  padding: 18px;
  backdrop-filter: blur(4px);
}

.tulip-studio-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f1f5f8;
  border: 1px solid #7890a0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

.tulip-topbar {
  height: 68px;
  flex: 0 0 auto;
  background: #102a43;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 18px;
  gap: 16px;
}

.tulip-topbar h2 {
  margin: 1px 0 0;
  font-size: 18px;
}

.tulip-topbar .eyebrow {
  color: #9fb3c8;
}

.tulip-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tulip-top-actions .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.tulip-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 210px minmax(560px, 1fr) 318px;
  gap: 1px;
  background: #cbd6de;
}

.tulip-tools-panel,
.tulip-properties-panel {
  background: var(--panel);
  min-width: 0;
  overflow: auto;
}

.tulip-stage-panel {
  background: #dfe6eb;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tulip-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.tulip-tools-panel .svg-panel-section {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfdfe;
  padding: 9px;
  margin: 0;
}

.tulip-tools-panel .svg-panel-section h3 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #486581;
}

.tulip-tool-grid {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tulip-tools-panel .svg-tool {
  min-height: 54px;
}

.tulip-tools-panel .check-row {
  margin: 6px 0;
}

.tulip-tools-panel .field {
  margin-bottom: 8px;
}

.tulip-tools-panel .stack-actions {
  grid-template-columns: 1fr 1fr;
}

.tulip-tools-panel .stack-actions .btn {
  min-height: 31px;
  padding: 4px 6px;
  font-size: 9px;
}

.tulip-stage-toolbar {
  min-height: 46px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  flex: 0 0 auto;
  gap: 8px;
}

.tulip-stage-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background-color: #cbd4db;
  background-image:
    linear-gradient(45deg, #d8e0e5 25%, transparent 25%), linear-gradient(-45deg, #d8e0e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8e0e5 75%), linear-gradient(-45deg, transparent 75%, #d8e0e5 75%);
  background-size: 22px 22px;
  background-position:
    0 0,
    0 11px,
    11px -11px,
    -11px 0;
}

.tulip-stage-scenes {
  display: grid;
  grid-template-columns: minmax(360px, 3fr) minmax(280px, 2fr);
  gap: 18px;
  align-items: start;
  justify-content: center;
  width: 100%;
}

.tulip-stage-scene {
  min-width: 0;
}

.tulip-stage-scene-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 8px;
  color: #102a43;
}

.tulip-stage-scene-head h3 {
  margin: 0;
  font-size: 12px;
}

.tulip-stage-scene-head span {
  font-size: 9px;
  font-weight: 800;
  color: #486581;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
}

.tulip-stage-wrap {
  width: min(600px, 100%);
  aspect-ratio: 600/505;
  margin: auto;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(17, 36, 51, 0.2);
}

.tulip-info-stage-wrap {
  width: min(600px, 100%);
  aspect-ratio: 600/505;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(17, 36, 51, 0.16);
}

.tulip-info-stage-wrap .scene-canvas {
  height: 100%;
  border: 0;
  border-radius: 0;
}

.tulip-info-stage-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tulip-editor-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  overflow: visible;
  background: #fff;
}

.tulip-editor-canvas.grid-on {
  background-image:
    linear-gradient(to right, rgba(16, 42, 67, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 42, 67, 0.07) 1px, transparent 1px);
  background-size: 10px 10px;
}

.tulip-selection {
  fill: none;
  stroke: #0b6e99;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.tulip-handle {
  fill: #fff;
  stroke: #0b6e99;
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}

.tulip-rotate {
  fill: #fff;
  stroke: #d97706;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  cursor: grab;
  pointer-events: all;
}

.tulip-node {
  fill: #fff;
  stroke: #7c3aed;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: move;
  pointer-events: all;
}

.tulip-control {
  fill: #f5f3ff;
  stroke: #7c3aed;
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
  cursor: move;
  pointer-events: all;
}

.tulip-control-line {
  stroke: #7c3aed;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 2;
  pointer-events: none;
}

.tulip-side-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}

.tulip-side-tabs button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  min-height: 32px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.tulip-side-tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.tulip-side-panel {
  display: none;
  padding: 12px;
}

.tulip-side-panel.active {
  display: block;
}

.tulip-prop-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  margin-bottom: 10px;
}

.tulip-prop-title strong {
  font-size: 13px;
}

.tulip-prop-title span {
  font-size: 9px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 6px;
}

.tulip-layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tulip-layer-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
}

.tulip-layer-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tulip-layer-row button {
  border: 0;
  background: transparent;
  min-height: 27px;
  border-radius: 5px;
}

.tulip-layer-row .layer-name {
  text-align: left;
  font-size: 10px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-source {
  font-size: 8px;
  font-weight: 900;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 4px;
  background: #eef3f7;
}

.tulip-waypoint-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.tulip-waypoint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.tulip-waypoint-table th,
.tulip-waypoint-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 5px;
  text-align: left;
  vertical-align: top;
}

.tulip-waypoint-table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  z-index: 1;
}

.tulip-waypoint-table tr.active {
  background: var(--accent-soft);
}

.tulip-waypoint-table tr {
  cursor: pointer;
}

.tulip-waypoint-table button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.tulip-waypoint-row {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 7px;
  text-align: left;
  font-size: 10px;
}

.tulip-waypoint-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tulip-waypoint-row strong,
.tulip-waypoint-row span {
  display: block;
}

.tulip-waypoint-row span {
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}

.tulip-waypoint-mini-layout {
  margin-top: 6px;
  height: 86px;
  border: 1px solid var(--line);
  background: #fff;
}

.tulip-waypoint-mini-layout svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tulip-symbol-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.tulip-symbol-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  padding: 6px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tulip-symbol-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tulip-symbol-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.tulip-symbol-card span {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
}

.osm-panel-intro {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding: 8px 9px;
  background: var(--accent-soft);
  border-radius: 7px;
  margin-bottom: 12px;
}

.osm-result {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 9px;
  padding: 10px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
}

.osm-result strong,
.osm-result span {
  display: block;
}

.osm-result strong {
  font-size: 11px;
  color: var(--text);
  margin-bottom: 3px;
}

.osm-object-meta {
  margin-top: 10px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font:
    10px/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--muted);
  word-break: break-word;
}

.danger.btn-secondary {
  color: var(--danger);
  border-color: #efc2be;
}

.danger.btn-secondary:hover {
  background: var(--danger-soft);
}

@media (max-width: 1250px) {
  .tulip-workspace {
    grid-template-columns: 185px minmax(500px, 1fr) 280px;
  }

  .tulip-stage-scenes {
    grid-template-columns: minmax(300px, max-content) minmax(220px, 300px);
    gap: 12px;
  }

  .tulip-tools-panel {
    padding: 8px;
  }

  .tulip-tools-panel .stack-actions,
  .creator-pro-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .tulip-studio {
    padding: 6px;
  }

  .tulip-workspace {
    grid-template-columns: 170px minmax(330px, 1fr);
  }

  .tulip-properties-panel {
    grid-column: 1/-1;
    max-height: 300px;
  }

  .tulip-studio-shell {
    overflow: auto;
  }

  .tulip-stage-panel {
    min-height: 570px;
  }

  .tulip-stage-scenes {
    grid-template-columns: 1fr;
  }

  .tulip-info-stage-wrap {
    max-width: 360px;
    margin: 0 auto;
  }
}

.top-menu-section-title {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.tulip-waypoint-live {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
}

.tulip-waypoint-live-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.tulip-waypoint-live-head strong,
.tulip-waypoint-live-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tulip-waypoint-live-canvas {
  height: 132px;
}

.tulip-waypoint-live-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
  background: #f7fafc;
}

@media (max-width: 680px) {
  .tulip-workspace {
    display: block;
    overflow: auto;
  }

  .tulip-tools-panel {
    display: flex;
    overflow: auto;
    flex-direction: row;
  }

  .tulip-tool-grid {
    grid-template-columns: repeat(6, 70px);
    min-width: max-content;
  }

  .tulip-tools-panel .svg-panel-section {
    min-width: 150px;
  }

  .tulip-stage-panel {
    min-height: 520px;
  }

  .tulip-properties-panel {
    max-height: none;
  }

  .tulip-topbar {
    height: auto;
    align-items: flex-start;
  }

  .tulip-top-actions {
    justify-content: flex-end;
  }

  .tulip-symbol-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* v3 ergonomic canvas */
.tulip-stage-scroll {
  display: grid;
  place-items: center;
}

.tulip-stage-wrap {
  align-self: center;
  justify-self: center;
}

.tulip-studio-shell.canvas-max .tulip-tools-panel,
.tulip-studio-shell.canvas-max .tulip-properties-panel {
  display: none;
}

.tulip-studio-shell.canvas-max .tulip-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.tulip-studio-shell.canvas-max .tulip-stage-panel {
  grid-column: 1;
  min-height: 0;
}

.tulip-symbol-card[draggable='true'],
.symbol-card[draggable='true'] {
  cursor: grab;
}

.tulip-symbol-card[draggable='true']:active,
.symbol-card[draggable='true']:active {
  cursor: grabbing;
}

.elevation-card {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.elevation-card canvas {
  width: 100%;
  display: block;
  border-radius: 6px;
  background: linear-gradient(#f8fbfd, #edf3f6);
}

.section-head.compact {
  margin-bottom: 4px;
}

.section-head.compact h3 {
  margin: 0;
  font-size: 0.88rem;
}

.section-head.compact span {
  font-size: 0.75rem;
  color: var(--muted);
}

.smart-audit {
  margin-top: 8px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--muted);
  padding: 8px;
  background: #f5f8fa;
  border-radius: 7px;
}

.command-palette {
  position: fixed;
  z-index: 5000;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  padding: 10px;
  background: var(--panel);
  border: 1px solid #8599a6;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.command-palette.hidden {
  display: none;
}

.command-palette #commandResults {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-height: 330px;
  overflow: auto;
}

.command-palette #commandResults button {
  border: 0;
  background: #f4f7f9;
  text-align: left;
  padding: 10px;
  border-radius: 7px;
  cursor: pointer;
}

.command-palette #commandResults button:hover,
.command-palette #commandResults button:focus {
  background: #e6eff4;
  outline: 2px solid var(--accent);
}

.personal-library-status a {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 4px;
}

/* ===== Tulip Studio Advanced P0 (features 67-85) ===== */
.svg-side-tabs {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 32px;
}

.svg-operation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.svg-operation-grid .btn {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 9px;
}

.svg-operation-grid .wide {
  grid-column: 1/-1;
}

.svg-mini-note {
  font-size: 9px;
  line-height: 1.35;
  color: var(--muted);
  margin-top: 6px;
}

.svg-selection-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  padding: 0 6px;
  margin-left: 5px;
}

.svg-layer-row.multi-selected {
  outline: 2px solid rgba(124, 58, 237, 0.35);
  outline-offset: 1px;
}

.svg-editor-canvas .editor-selection-secondary {
  fill: none;
  stroke: #7c3aed;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 2;
}

.svg-node-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.svg-gradient-stops {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0;
}

.svg-gradient-stop {
  display: grid;
  grid-template-columns: 52px 42px 1fr 28px;
  gap: 4px;
  align-items: center;
}

.svg-gradient-stop input[type='number'] {
  min-width: 0;
}

.svg-gradient-stop input[type='color'] {
  width: 42px;
  height: 28px;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.svg-gradient-stop button {
  height: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
}

.svg-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.svg-compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 6px;
  min-width: 0;
}

.svg-compare-card strong {
  display: block;
  font-size: 9px;
  margin-bottom: 5px;
}

.svg-compare-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: repeating-conic-gradient(#eef2f5 0 25%, #fff 0 50%) 50%/14px 14px;
  border-radius: 5px;
}

.svg-history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 280px;
  overflow: auto;
}

.svg-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  font-size: 9px;
}

.svg-history-row small {
  display: block;
  color: var(--muted);
}

.svg-history-row .button-row {
  gap: 3px;
}

.svg-history-row button {
  font-size: 8px;
  padding: 3px 5px;
}

.svg-meta-status {
  padding: 7px;
  border-radius: 7px;
  background: #f5f8fa;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  margin: 6px 0;
}

.svg-duplicate-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}

.svg-duplicate-hit {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  font-size: 9px;
}

.svg-trace-row {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 5px;
  align-items: end;
}

.svg-studio input[type='file'].inline-file {
  font-size: 9px;
  max-width: 100%;
}

.svg-danger {
  border-color: #b91c1c !important;
  color: #991b1b !important;
}

.svg-success {
  border-color: #15803d !important;
  color: #166534 !important;
}

/* ===== User Administration P0 ===== */
.account-trigger {
  display: flex !important;
  align-items: center;
  gap: 7px;
  width: auto !important;
  padding: 0 10px !important;
}

.account-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  font-size: 10px;
}

.account-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: rgba(5, 18, 30, 0.68);
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(4px);
}

.account-modal.hidden {
  display: none;
}

.account-shell {
  width: min(1180px, 100%);
  height: min(820px, calc(100vh - 36px));
  background: #f5f8fa;
  border: 1px solid #7890a0;
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-head {
  min-height: 64px;
  background: #102a43;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 18px;
}

.account-head h2 {
  margin: 1px 0 0;
  font-size: 18px;
}

.account-head .eyebrow {
  color: #9fb3c8;
}

.account-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.account-nav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.account-nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.account-nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.account-content {
  overflow: auto;
  padding: 18px;
}

.account-panel {
  display: none;
}

.account-panel.active {
  display: block;
}

.osm-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.osm-status-cell {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}
.osm-status-cell span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.osm-status-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
@media (max-width: 780px) {
  .osm-status-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.account-login-card {
  max-width: 480px;
  margin: 36px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.account-profile-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 560px);
  gap: 20px;
  align-items: start;
}

.profile-picture-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.profile-picture {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  margin: 0 auto 10px;
  background: #eaf1f5;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 34px;
  font-weight: 900;
  color: #486581;
}

.profile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.account-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.account-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.account-meta-grid > div {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}

.account-meta-grid span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  font-weight: 850;
  text-transform: uppercase;
}

.account-meta-grid strong {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.ua-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ua-user-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 1.1fr);
  gap: 12px;
  min-height: 520px;
}

.ua-user-list,
.ua-user-detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
}

.ua-user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.ua-user-row:hover,
.ua-user-row.selected {
  background: var(--accent-soft);
}

.ua-user-row strong {
  display: block;
  font-size: 12px;
}

.ua-user-row small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
}

.ua-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ua-badge {
  font-size: 8px;
  font-weight: 900;
  padding: 3px 5px;
  border-radius: 999px;
  background: #eaf1f5;
  color: #486581;
}

.ua-badge.disabled {
  background: #fde8e8;
  color: #a61b1b;
}

.ua-badge.admin {
  background: #fff4d6;
  color: #9a6700;
}

.ua-detail-inner {
  padding: 14px;
}

.ua-role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.ua-project-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.ua-rights-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.ua-right-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
}

.ua-login-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow: auto;
}

.ua-login-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  font-size: 10px;
  padding: 6px 8px;
  background: #f8fbfd;
  border-radius: 7px;
}

.preferences-json {
  font:
    10px/1.35 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  background: #102a43;
  color: #e6edf2;
  border-radius: 8px;
  padding: 10px;
}

.danger-zone {
  border-color: #ef9a9a !important;
}

.danger-zone h3 {
  color: var(--danger);
}

.account-status-line {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.account-status-line.error {
  color: #b42318;
  font-weight: 700;
}
.account-status-line.success {
  color: #18794e;
  font-weight: 700;
}

.account-admin-only.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .account-body {
    grid-template-columns: 1fr;
  }

  .account-nav {
    flex-direction: row;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .account-nav button {
    white-space: nowrap;
  }

  .account-profile-grid,
  .ua-user-layout {
    grid-template-columns: 1fr;
  }

  .account-meta-grid {
    grid-template-columns: 1fr;
  }
}

.account-profile-grid .button-row,
.account-profile-grid .btn.full {
  margin-top: 8px;
}
.account-profile-grid .profile-picture-card .btn {
  width: 100%;
  margin-top: 7px;
}
.account-login-history-list {
  max-height: none;
}
.account-login-history-list .ua-login-row {
  grid-template-columns: 180px minmax(0, 1fr);
}
.account-global-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.account-global-settings-grid .v5-card {
  margin: 0;
}
.account-global-settings-actions {
  margin-top: 10px;
}
.quality-inline-card {
  display: grid;
  gap: 12px;
}
.quality-inline-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.review-badge.auto_error {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #e6b1b1 !important;
}

.tulip-status-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  width: 100%;
}
.tulip-status-actions > .btn {
  flex: 1 1 0;
  min-width: 0;
}
.tulip-text-card,
.tulip-font-controls {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.font-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(90px, 0.7fr) minmax(110px, 1fr) minmax(110px, 1fr);
  gap: 8px;
  width: 100%;
}
.font-control-grid .field,
.font-control-grid .input {
  min-width: 0;
  width: 100%;
}
@media (max-width: 900px) {
  .font-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 780px) {
  .account-global-settings-grid {
    grid-template-columns: 1fr;
  }
  .account-login-history-list .ua-login-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Server Projects v4.2 ===== */
.project-trigger {
  position: relative;
}

.project-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fb3c8;
  display: inline-block;
}

.project-sync-dot.dirty {
  background: #d97706;
}

.project-sync-dot.saved {
  background: #22c55e;
}

.project-sync-dot.locked {
  background: #ef4444;
}

.projects-modal {
  position: fixed;
  inset: 0;
  z-index: 6800;
  background: rgba(5, 18, 30, 0.68);
  display: grid;
  place-items: center;
  padding: 18px;
  backdrop-filter: blur(4px);
}

.projects-modal.hidden {
  display: none;
}

.projects-shell {
  width: min(1320px, 100%);
  height: min(880px, calc(100vh - 36px));
  background: #f4f7f9;
  border: 1px solid #7890a0;
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.projects-head {
  min-height: 66px;
  background: #102a43;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 10px 18px;
}

.projects-head h2 {
  margin: 1px 0 0;
  font-size: 18px;
}

.projects-head .eyebrow {
  color: #9fb3c8;
}

.projects-head-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.projects-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1px;
  background: #cbd6de;
}

.projects-sidebar,
.projects-detail {
  background: var(--panel);
  min-width: 0;
  overflow: auto;
}

.projects-sidebar {
  display: flex;
  flex-direction: column;
}

.projects-toolbar {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.projects-filters {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}

.projects-filters button {
  border: 0;
  background: #f4f7f9;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.projects-filters button.active {
  background: var(--accent);
  color: #fff;
}

.project-list {
  display: flex;
  flex-direction: column;
}

.project-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.project-row:hover,
.project-row.selected {
  background: var(--accent-soft);
}

.project-row strong {
  display: block;
  font-size: 12px;
}

.project-row small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}

.project-row-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.project-badge {
  font-size: 8px;
  font-weight: 900;
  border-radius: 999px;
  background: #eaf1f5;
  padding: 3px 6px;
  color: #486581;
}

.project-badge.ready {
  background: #dcfce7;
  color: #166534;
}

.project-badge.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.project-badge.lock {
  background: #fff4d6;
  color: #92400e;
}

.projects-detail {
  padding: 16px;
}

.project-detail-empty {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.project-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.project-detail-head h2 {
  margin: 0;
  font-size: 19px;
}

.project-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.project-detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  padding: 11px;
  min-width: 0;
}

.project-card.wide {
  grid-column: 1/-1;
}

.project-card h3 {
  font-size: 12px;
  margin: 0 0 8px;
}

.project-version-list,
.project-comment-list,
.project-audit-list,
.project-acl-list,
.project-share-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 230px;
  overflow: auto;
}

.project-mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
}

.project-mini-row strong {
  display: block;
  font-size: 10px;
}

.project-mini-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.project-mini-actions {
  display: flex;
  gap: 3px;
}

.project-mini-actions button {
  min-height: 27px;
  padding: 3px 6px;
  font-size: 8px;
}

.project-lock-banner {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4d6;
  color: #8a4b08;
  font-size: 10px;
  margin-bottom: 9px;
}

.project-lock-banner.mine {
  background: #ecfdf5;
  color: #166534;
}

.project-diff {
  font:
    10px/1.4 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: #102a43;
  color: #e6edf2;
  border-radius: 8px;
  padding: 9px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

.project-inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: end;
}

.project-inline-form.three {
  grid-template-columns: 1fr 140px auto;
}

.project-workflow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.project-readonly {
  opacity: 0.62;
  pointer-events: none;
}

.project-sync-status {
  font-size: 9px;
  color: #bcccdc;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 950px) {
  .projects-body {
    grid-template-columns: 1fr;
  }

  .projects-sidebar {
    max-height: 310px;
  }

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

  .project-card.wide {
    grid-column: auto;
  }
}

/* v4.2 project detail renderer */
.project-row {
  display: block;
  width: 100%;
  border: 0;
  background: var(--panel);
  text-align: left;
}

.project-row > span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}

.project-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.project-badges i {
  font-style: normal;
  font-size: 8px;
  font-weight: 900;
  border-radius: 999px;
  background: #eaf1f5;
  padding: 3px 6px;
  color: #486581;
}

.project-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-actionbar,
.project-diff-controls,
.project-comment-add,
.project-acl-add {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.project-meta-grid > div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.project-meta-grid span,
.project-meta-grid strong {
  display: block;
}

.project-meta-grid span {
  font-size: 8px;
  color: var(--muted);
  text-transform: uppercase;
}

.project-meta-grid strong {
  font-size: 10px;
  margin-top: 2px;
}

.project-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 11px;
}

.project-section h3 {
  margin: 0 0 9px;
  font-size: 12px;
}

.project-release-list,
.project-version-list,
.project-comment-list,
.project-share-list,
.project-acl-list,
.project-audit-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
}

.project-release-list > div,
.project-version-row,
.project-comment-row,
.project-share-list > div,
.project-acl-list > div,
.project-audit-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
}

.project-release-list span,
.project-version-row span,
.project-comment-row span,
.project-audit-list span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  margin-top: 2px;
}

.project-comment-row p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.project-comment-row.resolved {
  opacity: 0.58;
}

.project-diff-viewer {
  font:
    10px/1.45 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: #102a43;
  color: #e6edf2;
  border-radius: 8px;
  padding: 9px;
  min-height: 74px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

.project-sync-dot.saving {
  animation: projectPulse 1s infinite;
}

@keyframes projectPulse {
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 850px) {
  .project-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== Route/Roadbook/Tulip Pro v4.2 ===== */
.advanced-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfdfe;
  margin: 10px 0;
  padding: 0;
}

.advanced-card > summary {
  cursor: pointer;
  padding: 10px 11px;
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  list-style: none;
}

.advanced-card > summary::-webkit-details-marker {
  display: none;
}

.advanced-card > summary:after {
  content: 'v';
  float: right;
  color: var(--muted);
}

.advanced-card[open] > summary {
  border-bottom: 1px solid var(--line);
}

.advanced-card .advanced-body {
  padding: 10px;
}

.studio-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
  margin: 10px 0;
  padding: 10px;
}

.studio-card .card-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
}

/* Roadbook Studio workflow cards: every primary card in Route and Roadbook can be collapsed. */
.collapsible-card > .card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.collapsible-card > .card-title .card-collapse-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font: 900 13px/1 system-ui;
  cursor: pointer;
  flex: 0 0 auto;
}

.collapsible-card.is-collapsed > :not(.card-title) {
  display: none !important;
}
.collapsible-card.is-collapsed > .card-title {
  margin-bottom: 0;
}

/* Visual point cards in the right column. The map tile is the same configured OSM source used by the main map. */
.right-side-list .right-list-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: stretch;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  min-width: 0;
}

.right-side-list .right-list-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft) inset;
}

.point-osm-preview {
  position: relative;
  width: 104px;
  min-height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #dbe5ec;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.point-osm-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.point-osm-preview .osm-mini-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  border: 0;
  user-select: none;
  pointer-events: none;
}
.point-osm-preview .osm-mini-viewport {
  position: absolute;
  inset: 0;
  width: 104px;
  height: 72px;
  max-width: none;
  border: 0;
  user-select: none;
  pointer-events: none;
}
.point-osm-preview svg {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.point-card-main {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 3px 2px;
  min-width: 0;
  cursor: pointer;
  color: var(--text);
}
.point-card-main strong {
  display: block;
  font-size: 11px;
  line-height: 1.25;
}
.point-card-main span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.point-card-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}
.point-card-actions .mini-btn {
  width: 28px;
  height: 28px;
  padding: 0;
}

.workflow-rule-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}
.workflow-subsection {
  display: grid;
  gap: 8px;
}
.workflow-subsection + .workflow-subsection {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.workflow-subsection h4 {
  margin: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.studio-topbar > .top-menu-bar,
.v5-head > .top-menu-bar {
  flex: 0 1 auto;
  margin-left: 0;
  min-width: 0;
}
.studio-topbar > .top-menu-bar .top-menu > summary,
.v5-head > .top-menu-bar .top-menu > summary {
  min-height: 34px;
  padding: 0 8px;
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.22);
}

/* Shared map zoom readout used in the Route and Roadbook workflow cards. */
.zoom-readout {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.mini-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mini-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.route-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

.route-filter-grid .check-row {
  margin: 3px 0;
}

.route-alt-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.route-alt-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #fff;
}

.route-alt-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.route-alt-row strong {
  font-size: 10px;
}

.route-alt-row small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 2px;
}

.route-quality {
  font-size: 9px;
  font-weight: 900;
  border-radius: 999px;
  padding: 3px 6px;
  background: #eaf1f5;
}

.route-warning {
  background: #fff4d8;
  color: #8a4b08;
}

.route-good {
  background: #e8f7ef;
  color: #166534;
}

.geocode-results,
.poi-results,
.avoid-zone-list,
.section-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow: auto;
  margin-top: 7px;
}

.geocode-row,
.poi-row,
.avoid-zone-row,
.section-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: var(--panel);
  font-size: 10px;
}

.geocode-row button,
.poi-row button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
}

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

.route-analysis-grid > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
}

.route-analysis-grid span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.route-analysis-grid strong {
  font-size: 11px;
}

.map-draw-banner {
  position: absolute;
  z-index: 850;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #102a43;
  color: #fff;
  border-radius: 9px;
  padding: 8px 11px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-size: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.map-draw-banner.hidden {
  display: none;
}

.map-draw-banner button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 6px;
  padding: 4px 7px;
}

.roadbook-bulkbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 3;
  border: 1px solid #a7c7d8;
  background: #eef9fd;
  border-radius: 9px;
  padding: 7px;
  margin-bottom: 8px;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.roadbook-bulkbar.active {
  display: flex;
}

.roadbook-bulkbar strong {
  font-size: 10px;
}

.roadbook-bulkbar .input {
  width: auto;
  min-height: 30px;
  font-size: 10px;
  padding: 4px 6px;
}

.list-row.multi-selected {
  border-color: #7c3aed;
  background: #f7f3ff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.22);
}

.list-row[draggable='true'] {
  cursor: grab;
}

.list-row.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.provenance-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 5px;
  font-size: 8px;
  font-weight: 900;
  background: #eaf1f5;
  color: #486581;
}

.provenance-badge.manual {
  background: #e8f7ef;
  color: #166534;
}

.provenance-badge.auto {
  background: #fff4d8;
  color: #8a4b08;
}

.checkpoint-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
  background: #fbfdfe;
  margin: 8px 0;
}

.section-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.section-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.creator-pro-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.creator-pro-actions .btn {
  min-height: 32px;
  padding: 4px 6px;
  font-size: 9px;
}

.tulip-selection-secondary {
  fill: none;
  stroke: #7c3aed;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 2;
  pointer-events: none;
}

.tulip-layer-row.multi-selected {
  outline: 2px solid rgba(124, 58, 237, 0.35);
}

.tulip-osm-preview path {
  pointer-events: none;
}

.tulip-safe-area {
  display: none;
  fill: none;
  stroke: #e11d48;
  stroke-width: 0.8;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.tulip-compare-overlay {
  pointer-events: none;
}

.tulip-provenance {
  font:
    9px/1.35 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  background: #102a43;
  color: #e6edf2;
  border-radius: 7px;
  padding: 7px;
  white-space: pre-wrap;
  max-height: 150px;
  overflow: auto;
}

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

.template-grid button {
  min-height: 31px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
}

.route-segment-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.route-drag-hint {
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
}

.osm-ignore-rule {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  margin: 4px 0;
}

.safearea-on .tulip-safe-area {
  display: block;
}

.tulip-info-live {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

.tulip-info-live .scene-head {
  margin-bottom: 8px;
}

.tulip-info-preview {
  height: 142px;
  min-height: 0;
}

.tulip-info-preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tulip-top-actions [hidden] {
  display: none !important;
}

.top-menu-section-title {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.tulip-waypoint-live {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
}

.tulip-waypoint-live-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.tulip-waypoint-live-head strong,
.tulip-waypoint-live-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tulip-waypoint-live-canvas {
  height: 132px;
}

.tulip-waypoint-live-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
  background: #f7fafc;
}

@media (max-width: 680px) {
  .mini-grid-3,
  .mini-grid-4,
  .route-analysis-grid {
    grid-template-columns: 1fr 1fr;
  }

  .route-filter-grid {
    grid-template-columns: 1fr;
  }

  .roadbook-bulkbar {
    position: static;
  }
}
/* Roadbook Studio scope guards */
.inspector .checkpoint-card,
.inspector .creator-fields,
.inspector .element-editor,
.inspector .form-grid.two,
.inspector #summaryTulip,
.inspector label:has(#summaryTulip),
.inspector #moveInstructionBackBtn,
.inspector #moveInstructionForwardBtn,
.inspector [data-open-tab='symbols'],
.inspector #cloneTulipToInfoBtn,
.inspector #clearInfoSceneBtn,
.inspector #autoTulipOsmBtn {
  display: none !important;
}

.studio-topbar {
  height: var(--topbar) !important;
  padding: 0 22px !important;
  gap: 20px !important;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.studio-topbar .brand {
  flex: 1 1 auto;
  min-width: 220px;
}

.studio-topbar .brand-copy {
  min-width: 0;
}

.studio-topbar .brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.studio-topbar .top-actions {
  flex: 0 1 auto;
  max-width: 58vw;
}

.studio-topbar .btn-secondary,
.studio-topbar .icon-btn,
.v5-head .btn-secondary,
.v5-head .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.studio-topbar .btn-primary,
.v5-head .btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}
.svg-library-overview {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.svg-library-row {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  padding: 8px;
  text-align: left;
  display: grid;
  gap: 2px;
  cursor: pointer;
}
.svg-library-row strong {
  font-size: 12px;
}
.svg-library-row span {
  font-size: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.svg-studio,
.tulip-studio {
  padding: 0 !important;
}
.svg-studio-shell,
.tulip-studio-shell {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
}
.v5-modal {
  padding: 24px !important;
}
.v5-modal > .v5-shell {
  width: min(980px, calc(100vw - 48px)) !important;
  height: auto !important;
  max-width: 980px !important;
  max-height: min(780px, calc(100vh - 48px)) !important;
  border-radius: 16px !important;
}
#v5OfflineModal > .v5-shell,
#v5ProdModal > .v5-shell {
  max-width: 1120px !important;
}
.roadbook-right-list.hidden {
  display: none !important;
}
.roadbook-right-list {
  padding: 14px;
  overflow: auto;
  min-height: 0;
}
body[data-active-tab='route'] .tab-panel[data-panel='roadbook'] {
  display: block !important;
}
.tab[data-tab='roadbook'] {
  display: none !important;
}

body[data-active-tab='route'] .tab-panel[data-panel='roadbook'].left-roadbook-panel-merged {
  display: none !important;
}
.left-waypoint-workflow-merged {
  display: none !important;
}
.auto-waypoint-card .auto-waypoint-subsection {
  margin: 0;
}
.route-action-info {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.route-action-elevation {
  margin-top: 10px;
}
.left-waypoint-card-merged {
  display: none !important;
}
.right-waypoint-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.right-waypoint-tools .roadbook-bulkbar {
  margin: 0;
  display: none;
}
.right-waypoint-tools .roadbook-bulkbar.active {
  display: flex;
}
.right-waypoint-tools .roadbook-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}
.right-waypoint-tools .advanced-card {
  margin: 0;
}
.right-waypoint-tools .mode-hint {
  margin: 0;
  font-size: 12px;
}
.right-waypoint-tools .button-row {
  gap: 6px;
}
.right-side-list {
  display: grid;
  gap: 8px;
}
.right-wp-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.right-wp-row.selected,
.right-sp-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.right-sp-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: grab;
  text-align: left;
  width: 100%;
}
.right-sp-row:active {
  cursor: grabbing;
}
.right-sp-row.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.right-sp-row small,
.right-wp-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.right-mini-tulip svg {
  width: 100%;
  aspect-ratio: 199 / 168;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-top: 7px;
}
body[data-active-tab='route'] #emptyInspector,
body[data-active-tab='route'] #instructionInspector,
body[data-active-tab='roadbook'] #emptyInspector,
body[data-active-tab='roadbook'] #instructionInspector {
  display: none !important;
}
body[data-active-tab='route'] #roadbookRightPanel,
body[data-active-tab='roadbook'] #roadbookRightPanel {
  display: block !important;
}
body[data-active-tab='route'] .workspace.show-waypoint-detail #emptyInspector,
body[data-active-tab='roadbook'] .workspace.show-waypoint-detail #emptyInspector {
  display: none !important;
}
body[data-active-tab='route'] .workspace.show-waypoint-detail #instructionInspector:not(.hidden),
body[data-active-tab='roadbook'] .workspace.show-waypoint-detail #instructionInspector:not(.hidden) {
  display: block !important;
}
body[data-active-tab='route'] .tab-panel[data-panel='route'] #controlPointList,
body[data-active-tab='roadbook'] .tab-panel[data-panel='roadbook'] #instructionList {
  display: none !important;
}
.map-panel > #instructionInspector.map-tulip-overlay {
  position: absolute;
  left: 50%;
  top: 72px;
  right: auto;
  width: min(820px, calc(100% - 24px));
  max-height: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  z-index: 720;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}
.map-panel > #instructionInspector.map-tulip-overlay::after {
  display: none;
}
.map-panel > #instructionInspector.map-tulip-overlay .inspector-head,
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-map-info,
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table tr,
.map-panel > #instructionInspector.map-tulip-overlay .element-editor {
  pointer-events: auto;
}
.map-panel > #instructionInspector.map-tulip-overlay .inspector-head {
  width: min(360px, calc(100vw - 42px));
  margin: 0 auto 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 42, 67, 0.22);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.14);
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-map-info {
  width: min(420px, calc(100vw - 42px));
  margin: 0 auto 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(16, 42, 67, 0.2);
  border-radius: 8px;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.12);
  font-size: 11px;
  line-height: 1.35;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-map-info span,
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-map-info small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table {
  display: block;
  margin-top: 0;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table tbody {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table tr {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border: 1px solid rgba(16, 42, 67, 0.24);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.16);
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table th,
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table td {
  display: block;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table th {
  font-size: 10px;
  color: var(--muted);
}
.map-panel > #instructionInspector.map-tulip-overlay .scene-canvas {
  min-height: 150px;
  max-height: 210px;
  background: rgba(255, 255, 255, 0.12);
}
.map-panel > #instructionInspector.map-tulip-overlay .tulip-popup-row {
  transform: translateY(2px);
}
.map-panel > #instructionInspector.map-tulip-overlay .info-popup-row {
  transform: translateY(18px);
}
.workspace.show-waypoint-detail .map-panel > #instructionInspector.map-tulip-overlay:not(.hidden) {
  display: block !important;
}
.right-panel > #emptyInspector,
.right-panel > #instructionInspector {
  display: none !important;
}
.cp-marker,
.ins-marker {
  min-width: 32px;
  height: 24px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
}
/* v5.6.0 Roadbook visual overlays. Tulip is a transparent geographic window
   over the OSM map; Extra info remains an independent adjacent popup. */
.scene-row-relocated {
  display: none !important;
}
.roadbook-map-popup {
  position: absolute;
  z-index: 650;
  width: min(330px, 42%);
  max-height: 62%;
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(16, 42, 67, 0.28);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 42, 67, 0.22);
  pointer-events: auto;
}
.roadbook-map-popup.hidden {
  display: none !important;
}
.roadbook-map-popup-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.roadbook-map-popup-body {
  padding: 8px;
}
.roadbook-map-popup .scene-head {
  margin-bottom: 6px;
}
.roadbook-map-popup .scene-canvas {
  min-height: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.roadbook-map-popup .scene-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
}
.roadbook-map-popup.tulip {
  width: min(390px, 46%);
  height: min(330px, 48%);
  max-height: none;
  overflow: hidden;
  background: transparent !important;
  border: 2px solid rgba(11, 110, 153, 0.86);
  border-radius: 10px;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.roadbook-map-popup.tulip .roadbook-map-popup-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  background: transparent !important;
  border: 0;
  padding: 5px 6px;
  pointer-events: none;
  text-shadow:
    0 1px 2px #fff,
    0 0 5px #fff;
}
.roadbook-map-popup.tulip .roadbook-map-popup-head strong {
  display: none !important;
}
.roadbook-map-popup.tulip .roadbook-map-popup-head .icon-btn {
  pointer-events: auto;
  background: transparent !important;
  border: 1px solid rgba(16, 42, 67, 0.42);
  text-shadow: 0 1px 3px #fff;
}
.roadbook-map-popup.tulip .roadbook-map-popup-body {
  position: absolute;
  inset: 0;
  padding: 0;
  background: transparent !important;
}
.roadbook-map-popup.tulip .scene-section {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
}
.roadbook-map-popup.tulip .scene-head {
  display: none !important;
}
.roadbook-map-popup.tulip .scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
}
.roadbook-map-popup.tulip .scene-canvas svg {
  width: 100%;
  height: 100%;
  background: transparent !important;
  aspect-ratio: auto !important;
}
.roadbook-map-popup.tulip .map-aligned-tulip-svg {
  overflow: hidden;
}
.roadbook-map-popup.tulip.without-osm-map,
.roadbook-map-popup.tulip.without-osm-map .roadbook-map-popup-body,
.roadbook-map-popup.tulip.without-osm-map .scene-section,
.roadbook-map-popup.tulip.without-osm-map .scene-canvas {
  background: #fff !important;
}
.roadbook-map-popup.tulip.without-osm-map {
  box-shadow: 0 12px 32px rgba(16, 42, 67, 0.22) !important;
}
.roadbook-map-popup.info {
  width: min(300px, 38%);
}
@media (max-width: 850px) {
  .roadbook-map-popup.tulip {
    width: min(320px, 62%);
    height: min(270px, 42%);
  }
  .roadbook-map-popup.info {
    width: min(260px, 44%);
  }
}

/* v5.6.0 viewport-fit and OSM overlay editing */
@media (min-width: 981px) {
  html,
  body {
    height: 100%;
    overflow: hidden !important;
  }
  .app-shell {
    height: 100dvh;
    min-height: 0 !important;
    overflow: hidden;
  }
  .workspace {
    min-height: 0 !important;
    overflow: hidden;
    height: auto;
  }
  .left-panel,
  .right-panel,
  .map-panel {
    min-height: 0 !important;
    max-height: none !important;
    height: 100%;
    overflow: hidden;
  }
  .left-panel .tab-panel.active,
  .right-panel {
    min-height: 0;
    overflow: auto;
  }
  .map {
    min-height: 0 !important;
  }
}
.right-close-btn {
  font-size: 22px;
  line-height: 1;
  width: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
}
.right-del-btn {
  min-width: 48px !important;
  padding: 0 10px !important;
  font-weight: 800;
}
.overlay-target-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 7px;
}
.overlay-target-switch .active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.overlay-target-hint {
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
  margin: 0 0 9px;
}
.roadbook-map-popup.scene-target-active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(11, 110, 153, 0.18);
}
.roadbook-map-popup.tulip .scene-canvas {
  pointer-events: auto !important;
}
.roadbook-map-popup.tulip .scene-canvas svg {
  pointer-events: auto;
}
.roadbook-map-popup.tulip .scene-canvas svg .map-route-geometry {
  pointer-events: none;
}
.roadbook-map-popup.info {
  overflow: hidden;
  background: transparent !important;
  border: 1px solid rgba(16, 42, 67, 0.34);
  box-shadow: none !important;
}
.roadbook-map-popup.info .roadbook-map-popup-head {
  position: relative;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
}
.roadbook-map-popup.info .roadbook-map-popup-body {
  padding: 0;
}
.roadbook-map-popup.info .scene-section {
  margin: 0;
  border: 0;
  background: transparent;
}
.roadbook-map-popup.info .scene-head {
  display: none !important;
}
.roadbook-map-popup.info .scene-canvas {
  min-height: 210px;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  pointer-events: auto;
}
.roadbook-map-popup.info .scene-canvas svg {
  background: transparent !important;
}

/* v5.12 static presentation helpers: keep markup free of inline style attributes. */
.instruction-eta {
  color: var(--muted);
}
.autofill-username-proxy {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* v5.13.8: errors in the footer status bar remain visible until dismissed. */
#toastArea {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.toast.persistent {
  max-width: min(760px, 72vw);
}
.toast.persistent > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 4px;
  opacity: 0.85;
}
.toast-close:hover,
.toast-close:focus-visible {
  opacity: 1;
}

/* ===== v5.7.0.css ===== */
/* Roadbook Studio v5.7.0 - performance/UX layer */
.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--line, #d7e0e6);
}
.workflow-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line, #d7e0e6);
  background: var(--panel-soft, #f6f8fa);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
}
.workflow-step > span {
  grid-row: 1/3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dfe8ef;
  font-weight: 800;
}
.workflow-step strong {
  font-size: 12px;
}
.workflow-step small {
  font-size: 10px;
  color: var(--muted, #66788a);
}
.workflow-step.active,
.workflow-step:hover {
  border-color: #0b6e99;
  background: #eef8fc;
}
.workflow-step.active > span {
  background: #0b6e99;
  color: #fff;
}
.roadbook-review-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0 0 8px;
}
.roadbook-review-toolbar select {
  min-width: 130px;
  flex: 1;
}
.review-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  background: #eef2f6;
  color: #415466;
}
.review-badge.reviewed {
  background: #fff4d8;
  color: #8a4b08;
}
.review-badge.approved {
  background: #e7f6ec;
  color: #18733a;
}
.review-badge.stale {
  background: #fde8e7;
  color: #a12622;
}
.right-list-virtual-gap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 6px;
  color: var(--muted, #66788a);
  font-size: 10px;
  border: 1px dashed var(--line, #d7e0e6);
  border-radius: 8px;
  background: var(--panel-soft, #f6f8fa);
  cursor: pointer;
}
.osm-preview-lazy {
  display: grid;
  place-items: center;
  min-height: 96px;
  background: linear-gradient(135deg, #eef2f4, #f8fafb);
  border-radius: 8px;
  color: #738391;
  font-size: 10px;
  overflow: hidden;
}
.osm-preview-lazy.loaded {
  display: block;
  background: transparent;
}
.symbol-grid-footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  padding: 8px;
}
.symbol-card[data-unused='1'] {
  opacity: 0.66;
}
.image-studio-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}
.image-preview {
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e9eef2;
  display: grid;
  place-items: center;
  overflow: auto;
}
.image-preview canvas {
  max-width: 100%;
  max-height: 60vh;
  background: transparent;
}
.asset-usage-list {
  max-height: 160px;
  overflow: auto;
  font-size: 11px;
}
.quality-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.v5-q-item[data-clickable='1'] {
  cursor: pointer;
}
.v5-q-item[data-clickable='1']:hover {
  background: var(--accent-soft, #eef8fc);
}
.paper-dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.paper-preview-wrap {
  transform-origin: top left;
}
.undo-delete-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #102a43;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.undo-delete-bar button {
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 850px) {
  .workflow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .image-studio-grid {
    grid-template-columns: 1fr;
  }
}
/* v5.6.0 overlay interaction */
.scene-canvas.drop-active {
  outline: 3px solid rgba(11, 110, 153, 0.55);
  outline-offset: -3px;
}
.roadbook-map-popup [data-element-index] {
  cursor: move;
}
.roadbook-map-popup .selection-ring {
  pointer-events: none;
}

html.tr3-auth-required body > :not(#tr3RequiredLogin) {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}
#tr3RequiredLogin {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  background: rgba(9, 25, 40, 0.86);
  backdrop-filter: blur(8px);
}
.tr3-login-gate-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  color: #102a43;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 14px;
}
.tr3-login-gate-card.tr3-payment-gate {
  width: min(680px, calc(100vw - 32px));
}
.tr3-quick-start {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 25, 40, 0.52);
  backdrop-filter: blur(3px);
}
.tr3-quick-start-card {
  position: relative;
  width: min(520px, 100%);
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  color: #102a43;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.tr3-quick-start-card h2 {
  margin: 0 36px 14px 0;
  font-size: 1.25rem;
}
.tr3-quick-start-card ol {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  counter-reset: quick-start;
}
.tr3-quick-start-card li {
  display: grid;
  grid-template-columns: 30px 82px 1fr;
  align-items: start;
  gap: 8px;
  counter-increment: quick-start;
}
.tr3-quick-start-card li::before {
  content: counter(quick-start);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f5fa;
  color: #0b6e99;
  font-weight: 800;
}
.tr3-quick-start-card li span {
  display: block;
  color: #52606d;
  font-size: 0.9rem;
  line-height: 1.4;
}
.tr3-quick-start-card .tr3-menu-path {
  margin-bottom: 3px;
  color: #0b6e99;
  font-weight: 800;
}
.tr3-quick-start-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #52606d;
  font-size: 1.5rem;
  cursor: pointer;
}
.tr3-quick-start-go {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #0b7fab;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.tr3-quick-start-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  color: #334e68;
  font-weight: 700;
}
.tr3-quick-start-option input {
  width: 18px;
  height: 18px;
}
.tr3-quick-start-error {
  min-height: 1.2em;
  margin-top: 6px;
  color: #b42318;
  font-size: 0.85rem;
  font-weight: 700;
}
@media (max-width: 480px) {
  .tr3-quick-start-card li {
    grid-template-columns: 30px 1fr;
  }
  .tr3-quick-start-card li span {
    grid-column: 2;
  }
}
.tr3-login-gate-card h1 {
  margin: 0;
  font-size: 1.4rem;
}
.tr3-login-gate-card label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
.tr3-login-gate-card input {
  padding: 11px 12px;
  border: 1px solid #bcccdc;
  border-radius: 10px;
}
.tr3-login-gate-card button {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: #0b7fab;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
#tr3GateError {
  min-height: 1.2em;
  color: #b42318;
  font-weight: 700;
}

/* v5.6.2 locked waypoint: lock controls routing persistence, never dragability. */
.ins-marker.locked {
  min-width: 32px;
  padding: 0 3px;
  border-color: #9a6700;
  box-shadow: 0 0 0 2px rgba(154, 103, 0, 0.18);
}

/* ===== v5.9.css ===== */
/* Roadbook Studio v5.9 - Route workflow and editable OSM path vertices. */
.stats-grid .stat:has(#routeZoomLabel) {
  min-width: 72px;
}
#routeZoomLabel {
  font-variant-numeric: tabular-nums;
}
.path-vertex {
  cursor: grab;
  vector-effect: non-scaling-stroke;
}
.path-vertex:hover,
.path-vertex.is-selected {
  fill: #d32f2f !important;
  stroke: #fff !important;
}
.path-vertex:active {
  cursor: grabbing;
}
.path-point-help {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted, #5f6b75);
  line-height: 1.35;
}
.path-point-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.7);
}

/* v5.9 UX pass: route help, fullscreen studios, Tulip/OSM controls. */
.option-explained {
  align-content: start;
}
.option-help {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted, #5f6b75);
  font-weight: 500;
}
.option-help-block {
  margin: 5px 0 9px;
}
.option-check > span {
  display: grid;
  gap: 2px;
}
.option-check small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted, #5f6b75);
  font-weight: 500;
}
.option-help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.option-help-grid p {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  line-height: 1.4;
}
.tulip-font-controls {
  display: grid;
  grid-template-columns: minmax(210px, 2.2fr) minmax(82px, 0.65fr) minmax(112px, 0.9fr) minmax(105px, 0.85fr);
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel, #fff) 92%, var(--accent-soft, #eef7fb));
}
.tulip-icon-card .symbol-grid {
  max-height: none;
}
.tulip-text-card,
.tulip-icon-card {
  overflow: visible;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table {
  display: none !important;
}
.tulip-popup-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  margin-right: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #486581;
}
.tulip-popup-meta span {
  display: flex;
  gap: 3px;
  align-items: baseline;
  white-space: nowrap;
}
.tulip-popup-meta b {
  font-size: 11px;
  color: #102a43;
  font-variant-numeric: tabular-nums;
}
.roadbook-map-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
#tulipStudio {
  position: fixed !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1200 !important;
}
#tulipStudio > .tulip-studio-shell {
  position: absolute !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body.tulip-studio-open {
  overflow: hidden;
}
.tulip-studio-live-canvas {
  width: calc(600px * var(--tulip-studio-zoom, 1));
  height: calc(505px * var(--tulip-studio-zoom, 1));
  min-width: 0;
  min-height: 0;
  transform-origin: top left;
  background-color: #fff;
  background-image:
    linear-gradient(rgba(38, 77, 99, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 77, 99, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}
.tulip-studio-live-canvas.grid-hidden {
  background-image: none;
}
.tulip-studio-live-canvas > svg {
  display: block;
  width: 100%;
  height: 100%;
}
.tulip-layer-row {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.tulip-layer-row:hover,
.tulip-layer-row.active {
  background: var(--soft, #eef5f8);
  color: var(--primary, #08749b);
}
.tulip-symbol-item {
  display: grid;
  gap: 4px;
  place-items: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.tulip-symbol-item:hover,
.tulip-symbol-item:focus-visible {
  border-color: var(--primary, #08749b);
  outline: 2px solid color-mix(in srgb, var(--primary, #08749b) 25%, transparent);
}
.tulip-symbol-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.tulip-symbol-item span {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.tulip-studio-live-canvas [data-editable='1'] {
  pointer-events: auto;
}
#v5PaperModal {
  position: fixed !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
#v5PaperModal > .v5-paper-shell {
  position: absolute !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
.v5-paper-validation {
  flex: 1;
  min-width: 180px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.v5-paper-validation.is-error {
  color: #b42318;
}
.v5-paper-validation.is-warning {
  color: #9a6700;
}
.v5-paper-summary {
  font-variant-numeric: tabular-nums;
}
.v5-paper-preview-frame {
  color-scheme: light;
}
.v5-paper-shell button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
@media (max-width: 700px) {
  .v5-paper-shell > .v5-actions {
    flex-wrap: wrap;
  }
  .v5-paper-summary,
  .v5-paper-validation {
    width: 100%;
    flex-basis: 100%;
  }
}
@media (max-width: 760px) {
  .tulip-font-controls,
  .option-help-grid {
    grid-template-columns: 1fr;
  }
  .tulip-popup-meta {
    gap: 4px;
    font-size: 9px;
  }
}

/* v5.9 refinement: denser text controls and My Projects aligned with Roadbook Studio cards. */
.place-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 9px;
}
.place-search-results:empty {
  display: none;
}
.place-search-results {
  margin-top: 6px;
}
.font-control-grid {
  display: grid !important;
  grid-template-columns: minmax(220px, 2fr) minmax(90px, 0.7fr) minmax(120px, 1fr) minmax(110px, 0.9fr) !important;
  gap: 10px !important;
  align-items: end;
}
.font-control-grid .field {
  margin: 0;
}
.font-control-grid .field > span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.font-control-grid .input {
  width: 100%;
  min-height: 36px;
}
.tulip-bulk-osm-card {
  display: grid;
  gap: 9px;
}
.tulip-bulk-progress,
.bulk-tulip-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.bulk-tulip-progress-track,
.tulip-bulk-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line, #d7e0e8);
}
#bulkTulipsProgressBar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent, #0b6e99);
  transition: width 0.18s ease;
}
#bulkTulipsProgressText {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #5f6b75);
  font-variant-numeric: tabular-nums;
}
.tulip-inspector-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.tulip-inspector-heading {
  min-width: 0;
}
.tulip-inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}
.tulip-inspector-meta span {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  color: var(--muted);
}
.tulip-inspector-meta strong {
  color: var(--text, #17212b);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.tulip-header-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}
.tulip-status-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
}
.tulip-status-actions .btn {
  white-space: nowrap;
}
.project-list {
  display: grid;
  gap: 9px;
}
.project-row.studio-card {
  display: grid;
  width: 100%;
  gap: 5px;
  margin: 0 !important;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.project-row.studio-card:hover {
  border-color: var(--accent, #0b6e99) !important;
}
.project-row.studio-card.selected {
  outline: 2px solid color-mix(in srgb, var(--accent, #0b6e99) 35%, transparent);
  border-color: var(--accent, #0b6e99) !important;
}
.project-row.studio-card > strong {
  font-size: 14px;
}
.project-row.studio-card > span {
  font-size: 11px;
  color: var(--muted);
}
.project-detail-inner {
  display: grid;
  gap: 10px;
}
.project-detail-inner > .studio-card {
  margin: 0;
}
.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.project-badges i {
  font-style: normal;
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
/* Both Tulip editors are true viewport shells. */
#tr3TulipLibraryModal {
  position: fixed !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: unset !important;
}
#tr3TulipLibraryModal > .tl-shell {
  position: absolute !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}
.account-login-form {
  display: grid;
  gap: 10px;
}
@media (max-width: 900px) {
  .font-control-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .tulip-inspector-header {
    align-items: stretch;
  }
  .tulip-header-actions {
    justify-items: start;
  }
}
@media (max-width: 600px) {
  .font-control-grid,
  .place-search-row {
    grid-template-columns: 1fr !important;
  }
  .tulip-inspector-header {
    display: grid;
  }
  .tulip-status-actions {
    flex-wrap: wrap !important;
  }
}

/* v5.9 refinement: cleaner Tulip font controls and Paper Studio settings bars. */
.font-control-grid {
  grid-template-columns: minmax(240px, 1.8fr) minmax(90px, 0.55fr) minmax(120px, 0.8fr) minmax(110px, 0.75fr) !important;
  align-items: end !important;
}
.font-control-grid .tulip-font-preview {
  grid-column: 1/-1;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: 9px;
  background: var(--panel, #fff);
  overflow: hidden;
  white-space: nowrap;
}
.font-family-field select {
  font-size: 13px;
}
.v5-paper-settings-card {
  box-shadow: 0 2px 10px rgba(16, 42, 67, 0.06);
}
.v5-paper-setting-bars {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.v5-paper-setting-bar {
  display: flex !important;
  align-items: center !important;
  border-left: 4px solid transparent !important;
}
.v5-paper-setting-bar.active {
  border-left-color: var(--accent, #0b6e99) !important;
}
.v5-paper-settings-head h3 {
  margin: 0;
}
.v5-paper-settings-card.is-collapsed .v5-paper-settings-head {
  margin-bottom: 0 !important;
}

/* v5.9 refinement: search spacing, compact Tulip text styling and bulk Tulip action. */
.place-search-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
  margin: 14px 0 8px !important;
  align-items: stretch;
}
.place-search-row .input {
  min-height: 38px;
}
.place-search-row .btn {
  min-width: 76px;
  height: 100%;
}
.tulip-bulk-action-head {
  align-items: center;
}
.tulip-bulk-action-head > p {
  margin: 0;
  max-width: 42ch;
  line-height: 1.45;
}
.tulip-bulk-action-head > .btn {
  flex: 0 0 auto;
}
.font-control-grid {
  grid-template-columns: minmax(240px, 1.7fr) minmax(90px, 0.55fr) minmax(250px, 1.45fr) !important;
}
.font-style-field {
  display: grid;
  gap: 5px;
}
.font-style-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.font-style-row > label {
  display: grid;
  gap: 3px;
}
.font-style-row small {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted, #5f6b75);
}
@media (max-width: 900px) {
  .font-control-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .font-style-field {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .font-control-grid {
    grid-template-columns: 1fr !important;
  }
  .font-style-field {
    grid-column: auto;
  }
  .font-style-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* v5.9 */
.project-list {
  display: grid !important;
  gap: 10px !important;
  padding: 10px !important;
}
.project-row.studio-card {
  display: grid !important;
  width: 100% !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 12px !important;
  text-align: left !important;
  color: inherit !important;
  cursor: pointer !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--panel, #fff) !important;
  box-shadow: 0 2px 7px rgba(16, 42, 67, 0.05) !important;
}
.project-row.studio-card:hover,
.project-row.studio-card.selected {
  border-color: var(--accent) !important;
  background: var(--accent-soft, #eef7fb) !important;
}
.project-detail > .studio-card {
  margin-bottom: 10px !important;
}
.account-nav {
  display: none !important;
}
.account-body {
  grid-template-columns: minmax(0, 1fr) !important;
}
.tulip-text-card .tulip-font-controls {
  margin-top: 0;
}
.review-lock-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
}
.osm-active-use {
  font-weight: 900;
}
.osm-active-use.yes {
  color: #16794b;
}
.osm-active-use.no {
  color: #9a6700;
}
/* v5.9: Text card has no nested visual card; only the requested font controls remain. */
.tulip-text-card .tulip-font-controls {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
/* v5.11.3 — Tulip text controls use all available card width without horizontal overflow. */
.tulip-text-card {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}
.tulip-text-card .tulip-font-controls,
.tulip-text-card .font-control-grid,
.tulip-text-card .font-style-row {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.tulip-text-card .font-control-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.7fr) minmax(72px, 0.55fr) minmax(0, 1.25fr) !important;
  gap: 8px !important;
}
.tulip-text-card .font-control-grid > *,
.tulip-text-card .font-control-grid .field,
.tulip-text-card .font-style-row > * {
  min-width: 0 !important;
  max-width: 100% !important;
}
.tulip-text-card select,
.tulip-text-card input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.tulip-text-card .font-style-row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
}
@media (max-width: 1180px) {
  .tulip-text-card .font-control-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* v5.11.3 — one combined shortcuts page. */
.shortcut-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.shortcut-list > div,
.shortcut-list > label {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.5fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.shortcut-list > div:last-child,
.shortcut-list > label:last-child {
  border-bottom: 0;
}
.shortcut-list-editable .input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .shortcut-list > div,
  .shortcut-list > label {
    grid-template-columns: 1fr;
  }
}

/* v5.11.3 — personal account navigation is visible again; admin-only items are still permission-gated in JS. */
.account-nav {
  display: flex !important;
}
.account-body {
  grid-template-columns: 190px minmax(0, 1fr) !important;
}
/* Keep all Text controls within the available Tulip card width. */
.tulip-text-card {
  min-width: 0 !important;
  overflow: hidden !important;
}
.tulip-text-card .font-control-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.7fr) minmax(72px, 0.55fr) minmax(105px, 0.75fr) minmax(105px, 0.75fr) !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
}
.tulip-text-card .font-control-grid > * {
  min-width: 0 !important;
}
.tulip-text-card .font-control-grid select,
.tulip-text-card .font-control-grid input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
@media (max-width: 1050px) {
  .tulip-text-card .font-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  .account-body {
    grid-template-columns: 1fr !important;
  }
  .account-nav {
    flex-direction: row !important;
    overflow-x: auto !important;
  }
  .tulip-text-card .font-control-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
/* v5.11.3 — review state and route locking are independent and stay visually paired. */
.tulip-status-actions {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
}
.tulip-status-actions > .btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}

.locked-route-head {
  display: grid;
  gap: 2px;
  padding: 2px 2px 8px;
}
.locked-route-head strong {
  font-size: 14px;
}
.locked-route-head small {
  color: var(--muted);
}
.locked-route-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  cursor: grab;
}
.locked-route-row.dragging {
  opacity: 0.45;
}
.locked-route-row.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.locked-route-row .osm-preview-lazy {
  min-height: 82px;
  border-radius: 8px;
  overflow: hidden;
}
.locked-route-row .point-card-main {
  min-width: 0;
  text-align: left;
}
.locked-route-row .point-card-main span,
.locked-route-row .point-card-main small {
  display: block;
  color: var(--muted);
}
body[data-active-tab='route'] #roadbookRightPanel .right-waypoint-control-card,
body[data-active-tab='route'] #roadbookRightPanel .osm-control-card {
  display: none;
}
@media (max-width: 720px) {
  .locked-route-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

.quality-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.22fr);
  gap: 12px;
  align-items: start;
}
.quality-options-card,
.quality-errors-card {
  display: grid;
  gap: 12px;
}
.quality-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.quality-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 7px;
}
.quality-counts > div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  text-align: center;
}
.quality-counts span {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 850;
}
.quality-counts strong {
  font-size: 18px;
}
.quality-filter-field {
  margin: 0;
  max-width: 280px;
}
.quality-primary-actions {
  order: -1;
  margin-bottom: 0;
}
.quality-errors-card .v5-q-list {
  max-height: calc(100vh - 270px);
  overflow: auto;
}
.route-selection-defaults {
  margin-top: 8px;
}
.route-default-note {
  margin: 6px 0 0;
}
@media (max-width: 900px) {
  .quality-dashboard {
    grid-template-columns: 1fr;
  }
  .quality-top-row {
    grid-template-columns: 1fr;
  }
  .quality-counts {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* v5.11.10 responsive Tulip/Controle alignment */
.tulip-text-card {
  container-type: inline-size;
  overflow: visible !important;
}
.tulip-text-card .font-control-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(88px, 0.65fr) minmax(118px, 0.9fr) !important;
  gap: 12px !important;
  align-items: end !important;
}
.tulip-text-card .font-control-grid .field {
  display: grid !important;
  grid-template-rows: auto minmax(42px, auto);
  gap: 6px !important;
  margin: 0 !important;
  min-width: 0 !important;
}
.tulip-text-card .font-control-grid .field > span {
  display: block !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}
.tulip-text-card .font-control-grid .input {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
}
@container (max-width:520px) {
  .tulip-text-card .font-control-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .tulip-text-card .font-family-field {
    grid-column: 1/-1 !important;
  }
}
@container (max-width:340px) {
  .tulip-text-card .font-control-grid {
    grid-template-columns: 1fr !important;
  }
  .tulip-text-card .font-family-field {
    grid-column: auto !important;
  }
}
.route-avoid-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.route-avoid-options .option-check {
  margin: 0;
  align-items: flex-start;
}
@media (max-width: 700px) {
  .route-avoid-options {
    grid-template-columns: 1fr;
  }
}
.quality-dashboard {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  container-type: inline-size;
}
.quality-options-card,
.quality-errors-card {
  min-width: 0 !important;
  overflow: hidden !important;
}
.quality-card-title {
  margin: 0 !important;
}
.quality-card-title h3 {
  margin: 0 !important;
}
.quality-primary-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  order: initial !important;
}
.quality-primary-actions .btn {
  width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
}
.quality-counts {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
.quality-counts > div {
  min-width: 0 !important;
  padding: 10px 8px !important;
}
.quality-counts span {
  white-space: normal !important;
  line-height: 1.2 !important;
}
.quality-counts strong {
  display: block !important;
  margin-top: 3px !important;
  font-size: 20px !important;
}
.quality-status-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}
.quality-status-panel .v5-q-score {
  font-size: 34px;
  line-height: 1;
  min-width: 52px;
  text-align: center;
}
.quality-status-copy {
  min-width: 0;
}
.quality-status-copy > strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
.quality-status-copy .account-status-line {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.quality-filter-field {
  max-width: none !important;
  margin: 0 !important;
}
.quality-errors-card .v5-q-list {
  max-height: 460px !important;
  overflow: auto !important;
  min-width: 0;
}
.v5-q-item {
  min-width: 0 !important;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr) auto !important;
}
.v5-q-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}
@container (max-width:430px) {
  .quality-primary-actions {
    grid-template-columns: 1fr !important;
  }
  .quality-counts {
    grid-template-columns: 1fr 1fr 1fr !important;
  }
  .quality-status-panel {
    grid-template-columns: 1fr !important;
  }
  .quality-status-panel .v5-q-score {
    text-align: left;
  }
}

/* v5.12.26 locked waypoint persistence and off-road routing connectors */
.ins-marker.locked {
  background: #c62828 !important;
  border-color: #8e0000 !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.2) !important;
}
.locked-route-row {
  grid-template-columns: 110px minmax(0, 1fr);
}
.locked-waypoint-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.locked-waypoint-name {
  width: 100%;
  font-weight: 700;
  border-color: transparent;
  background: var(--soft, #f4f8fa);
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.locked-waypoint-name:hover {
  border-color: var(--line-strong, #9fb3bf);
  background: var(--panel, #fff);
}
.locked-waypoint-name:focus {
  border-color: var(--accent, #0b6e99);
  background: var(--panel, #fff);
  box-shadow: 0 0 0 3px rgba(11, 110, 153, 0.15);
}
.route-waypoint-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.route-waypoint-filter {
  width: auto;
  min-width: 132px;
}
.route-waypoint-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.route-lock-toggle {
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.locked-route-row.is-unlocked {
  cursor: default;
}
.locked-route-row.is-unlocked .osm-preview-lazy {
  opacity: 0.82;
}
.locked-waypoint-score b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1080px) {
  .route-waypoint-head {
    grid-template-columns: 1fr;
  }
  .route-waypoint-filter {
    width: 100%;
  }
}
.poi-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.poi-row-main {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.poi-row-main strong,
.poi-row-main small {
  display: block;
}

/* ===== app-overrides.css ===== */
.route-primary-action {
  margin: 2px 0 7px;
  min-height: 42px;
  font-weight: 800;
}
.route-head-metrics {
  flex: 0 0 auto;
}
.route-calc-status {
  margin: 0 0 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--panel-soft, #f4f7f9);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.route-calc-status[data-state='busy'] {
  color: #8a5a00;
  background: #fff8df;
  border-color: #ead38e;
}
.route-calc-status[data-state='success'] {
  color: #12663b;
  background: #ecf8f0;
  border-color: #a9d9ba;
}
.route-calc-status[data-state='error'] {
  color: #a52222;
  background: #fff0f0;
  border-color: #e6b1b1;
}
.map-panel > #instructionInspector.map-tulip-overlay {
  left: 50%;
  top: 18px;
  width: min(920px, calc(100% - 32px));
  max-height: min(760px, calc(100% - 36px));
  transform: translateX(-50%);
  padding: 12px;
  overflow: auto;
  background: rgba(248, 251, 253, 0.985);
  border: 1px solid rgba(16, 42, 67, 0.22);
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(16, 42, 67, 0.28);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.map-panel > #instructionInspector.map-tulip-overlay .inspector-head {
  width: auto;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #fff;
  box-shadow: none;
  border-radius: 10px;
  position: sticky;
  top: 0;
  z-index: 4;
  gap: 10px;
}
.map-panel > #instructionInspector.map-tulip-overlay .inspector-head > .button-row {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.map-panel > #instructionInspector.map-tulip-overlay .inspector-head .icon-btn {
  width: auto;
  min-width: 44px;
  padding: 0 10px;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-map-info {
  width: auto;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #f5f8fa;
  box-shadow: none;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table tbody {
  display: contents;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table tr {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table th,
.map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table td {
  border: 0;
  padding: 7px 8px;
}
.map-panel > #instructionInspector.map-tulip-overlay > .form-grid,
.map-panel > #instructionInspector.map-tulip-overlay > .checkpoint-card,
.map-panel > #instructionInspector.map-tulip-overlay > .field,
.map-panel > #instructionInspector.map-tulip-overlay > .creator-fields,
.map-panel > #instructionInspector.map-tulip-overlay > .button-row.wrap,
.map-panel > #instructionInspector.map-tulip-overlay > .element-editor,
.map-panel > #instructionInspector.map-tulip-overlay > #tulipCompletenessBar {
  display: none !important;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table {
  margin: 0;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table tbody {
  gap: 10px;
}
.map-panel > #instructionInspector.map-tulip-overlay .right-scene-table tr {
  transform: none !important;
  padding: 9px;
  background: #fff;
  box-shadow: none;
  border-radius: 10px;
}
.map-panel > #instructionInspector.map-tulip-overlay .scene-canvas {
  min-height: 230px;
  max-height: none;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.map-panel > #instructionInspector.map-tulip-overlay .scene-canvas svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 199/168;
  background: #fff;
}
.map-panel > #instructionInspector.map-tulip-overlay .tulip-osm-background {
  pointer-events: none;
}
#tulipAlignmentStatus[data-state='exact'] {
  color: #16794b;
}
#tulipAlignmentStatus[data-state='fallback'] {
  color: #9a6700;
}
.popup-recalc-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
}
@media (max-width: 760px) {
  .map-panel > #instructionInspector.map-tulip-overlay {
    width: calc(100% - 16px);
    top: 8px;
    max-height: calc(100% - 16px);
  }
  .map-panel > #instructionInspector.map-tulip-overlay .right-scene-table tbody {
    grid-template-columns: 1fr;
  }
  .map-panel > #instructionInspector.map-tulip-overlay .waypoint-meta-table {
    grid-template-columns: 1fr;
  }
  .popup-recalc-btn {
    display: none;
  }
}

.tulip-auto-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tulip-osm-auto-menu {
  position: relative;
}
.tulip-osm-auto-menu > summary {
  list-style: none;
  cursor: pointer;
}
.tulip-osm-auto-menu > summary::-webkit-details-marker {
  display: none;
}
.tulip-osm-auto-panel {
  position: absolute;
  z-index: 2500;
  top: calc(100% + 6px);
  left: 0;
  min-width: 245px;
  padding: 12px;
  border: 1px solid var(--border, #ccd6dd);
  border-radius: 10px;
  background: var(--surface, #fff);
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.18);
  display: grid;
  gap: 8px;
}
.tulip-osm-auto-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.tulip-osm-auto-panel small {
  color: var(--muted, #627d98);
  line-height: 1.35;
}
.tulip-osm-auto-panel .full {
  width: 100%;
}
.osm-control-card .tulip-auto-bar {
  display: block;
  margin: 0 !important;
}
.osm-control-card .tulip-osm-auto-inline {
  position: static;
  z-index: auto;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tulip-osm-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tulip-osm-inline-head strong {
  font-size: 13px;
}
.symbol-grid {
  display: block !important;
}
.symbol-category-accordion {
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  overflow: hidden;
}
.symbol-category-accordion > .symbol-category-head {
  display: block;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
  background: var(--panel-soft);
}
.symbol-category-accordion > .symbol-category-head::marker {
  color: var(--accent);
}
.symbol-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
}
.symbol-category-accordion:not([open]) .symbol-category-grid {
  display: none;
}
.studio-card,
.setting-card,
.info-box,
.account-card,
.v5-card {
  background: #f0f7fc !important;
}
.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
.tab-panel[data-panel='route'] > .section-head p,
.tab-panel[data-panel='route'] > .route-calc-status,
.tab-panel[data-panel='route'] #mapModeHint {
  display: none !important;
}
.roadbook-right-list > .section-head p {
  display: none;
}
.roadbook-map-popup.tulip .roadbook-map-popup-head strong {
  display: block !important;
  background: rgba(255, 255, 255, 0.78);
  padding: 2px 6px;
  border-radius: 5px;
}
.right-waypoint-control-card {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
}
.right-waypoint-control-card .roadbook-review-toolbar {
  margin: 0;
}
.roadbook-right-list {
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
}
.right-side-list {
  flex: 1 1 auto;
  min-height: 180px;
  overflow: auto;
}
.selected-waypoint-details {
  flex: 0 0 auto;
  margin-top: 8px;
}
.selected-waypoint-details h3 {
  margin: 0 0 6px;
}
.selected-waypoint-details small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.lock-status {
  border: 0;
  cursor: pointer;
  margin-top: 4px;
}
#roadbookProDetails,
.roadbook-tools,
#popupRecalculateRouteBtn,
#deleteInstructionBtn,
#backToWaypointListBtn,
#maneuverType {
  display: none !important;
}
.roadbook-map-popup.tulip .roadbook-map-popup-head,
.roadbook-map-popup.info .roadbook-map-popup-head {
  position: relative !important;
  inset: auto !important;
  display: flex !important;
  min-height: 34px;
  background: rgba(255, 255, 255, 0.86) !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 7px 9px !important;
  text-shadow: none !important;
}
.roadbook-map-popup.tulip .roadbook-map-popup-body {
  top: 34px !important;
}
.roadbook-map-popup.tulip .roadbook-map-popup-head strong,
.roadbook-map-popup.info .roadbook-map-popup-head strong {
  display: block !important;
  background: transparent !important;
  padding: 0 !important;
}
.studio-card,
.setting-card,
.info-box,
.account-card,
.v5-card {
  background: #e8f3fb !important;
}
.point-card-actions button:nth-child(3) {
  display: none !important;
}
.point-card-main .review-badge {
  cursor: pointer;
}
.right-side-list {
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  padding-right: 5px;
}
.roadbook-right-list {
  min-height: 0;
  height: 100%;
}
.tab-panel[data-panel='route'] > .route-calc-status {
  display: none !important;
}
.tab-panel[data-panel='route'] > .route-calc-status[data-state='error'] {
  display: block !important;
  color: #a52222 !important;
  background: #ffe8e8 !important;
  border-color: #d92d20 !important;
  font-weight: 800;
}
.route-primary-action.route-calculation-failed {
  background: #c62828 !important;
  border-color: #a61f1f !important;
  color: #fff !important;
}
.right-waypoint-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.right-waypoint-control-head h3 {
  margin: 0;
  font-size: 13px;
}
.right-waypoint-control-card .right-waypoint-collapse {
  flex: 0 0 auto;
}
.right-waypoint-control-card.nav-collapsed .right-waypoint-control-body {
  display: none;
}
.right-waypoint-control-body {
  margin-top: 8px;
}
body[data-active-tab] #roadbookRightPanel:not(.hidden) {
  display: flex !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
.right-panel {
  overflow: hidden !important;
  min-height: 0 !important;
}
.right-side-list {
  height: 0 !important;
  min-height: 0 !important;
  flex: 1 1 0 !important;
  align-content: start;
}
.right-list-row.routing-error {
  background: #ffdada !important;
  border-color: #c62828 !important;
  box-shadow:
    inset 5px 0 0 #c62828,
    0 0 0 1px rgba(198, 40, 40, 0.2) !important;
}
.right-list-row.routing-error .point-card-main {
  background: transparent !important;
}
.right-list-row.routing-error .point-card-main > strong {
  color: #9f1d1d !important;
}
.osm-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
}
.osm-type-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.osm-type-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.osm-element-list {
  display: grid;
  gap: 5px;
  margin: 9px 0;
  max-height: 220px;
  overflow: auto;
}
.osm-element-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  touch-action: pan-y;
  transition:
    transform 0.16s,
    opacity 0.16s;
}
.osm-element-row small {
  color: var(--muted);
}
.osm-element-row.swiping {
  opacity: 0.65;
}
.osm-element-row button {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

/* v5.9 refinement: Route is a two-column workflow; Tulip owns the review column. */
.map-toolbar-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
body[data-active-tab='route'] #workspace {
  grid-template-columns: minmax(275px, 330px) minmax(520px, 1fr) minmax(300px, 360px) !important;
}
body[data-active-tab='route'] #rightPanel {
  display: flex !important;
}
body[data-active-tab='route'] #mapTulipPopup,
body[data-active-tab='route'] #mapInfoPopup {
  display: none !important;
}
body[data-active-tab='symbols'] #rightPanel {
  display: flex;
}
body[data-active-tab='symbols'] #roadbookRightPanel:not(.hidden) {
  display: flex !important;
}
.right-waypoint-navigation {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.right-waypoint-navigation .btn {
  min-width: 0;
  padding-left: 7px;
  padding-right: 7px;
}
#osmElementList {
  display: none !important;
}
@media (max-width: 1080px) {
  body[data-active-tab='route'] #workspace {
    grid-template-columns: minmax(240px, 295px) minmax(380px, 1fr) minmax(270px, 320px) !important;
  }
  .right-waypoint-navigation {
    grid-template-columns: 1fr;
  }
}

.route-avoid-options {
  grid-template-columns: 1fr !important;
}
.shortcut-reference-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.shortcut-reference-grid > div {
  grid-template-columns: minmax(145px, 0.65fr) 1fr;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 10px;
}
.shortcut-reference-grid kbd {
  display: inline-block;
  min-width: 28px;
  text-align: center;
}
.framework-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.framework-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) 100px 1fr;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  align-items: center;
}
.framework-row a {
  color: var(--accent);
  font-weight: 700;
}
.legal-disclaimer {
  line-height: 1.55;
}
.i18n-editor-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
}
.i18n-key-list {
  width: 100%;
  min-height: 360px;
}
.i18n-editor-host {
  min-height: 360px;
}
@media (max-width: 820px) {
  .shortcut-reference-grid {
    grid-template-columns: 1fr;
  }
  .framework-row,
  .i18n-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* v5.12.4 complete-site i18n */
.i18n-source-preview {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.i18n-editor-grid .check-row {
  align-self: end;
  min-height: 42px;
}
.i18n-editor-grid #v5I18nCoverage {
  margin: 4px 0 8px;
}
.i18n-editor-grid .i18n-key-list {
  font-family: inherit;
}

/* v5.12.26: Route keeps a dedicated persistent locked-waypoint column. */
body[data-active-tab='route'] #roadbookRightPanel {
  display: flex !important;
}
body[data-active-tab='route'] #roadbookRightPanel .right-waypoint-tools,
body[data-active-tab='route'] #roadbookRightPanel .right-waypoint-control-card,
body[data-active-tab='route'] #roadbookRightPanel .osm-control-card {
  display: none !important;
}
body[data-active-tab='route'] #roadbookRightWpList {
  height: auto !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}
.osm-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.osm-mode-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--panel);
  cursor: pointer;
}
.osm-mode-option input {
  margin-top: 3px;
}
.osm-mode-option strong,
.osm-mode-option small {
  display: block;
}
.osm-mode-option small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}
.osm-mode-option:has(input:checked) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.osm-mode-note {
  margin-top: 8px;
}
@media (max-width: 900px) {
  .osm-mode-grid {
    grid-template-columns: 1fr;
  }
}
.osm-server-dialog > .osm-server-shell {
  width: min(760px, calc(100vw - 48px));
  max-width: 760px;
  max-height: calc(100vh - 48px);
}
@media (max-width: 720px) {
  .osm-server-dialog > .osm-server-shell {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

/* 5.13.8 Tulip-tab workflow: destructive bulk action above creation; Text/Icon panels collapsed by default. */
.tulip-bulk-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.tulip-bulk-action-stack .btn {
  width: 100%;
}
.tulip-side-accordion-body {
  padding-top: 4px;
}
.tulip-side-accordion .grow {
  flex: 1;
  min-width: 0;
}
.top-menu-panel.file-menu-panel {
  width: min(620px, calc(100vw - 24px));
}
.file-transfer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.file-transfer-grid > section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: var(--panel-soft);
}
.file-transfer-grid .top-menu-section-title {
  padding: 3px 9px 7px;
}
.file-transfer-grid .top-menu-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  column-gap: 10px;
  width: 100%;
  min-width: 0;
}
.file-transfer-grid .top-menu-item .mi {
  width: auto;
  text-align: left;
}
.file-transfer-grid .file-format-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.file-transfer-grid .top-menu-item .sub {
  margin-left: 0;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .top-menu-panel.file-menu-panel {
    width: min(330px, calc(100vw - 24px));
  }
  .file-transfer-grid {
    grid-template-columns: 1fr;
  }
}

/* v6.1 - right-column OSM/Tulip preview is an explicit navigation target. */
.point-osm-preview.waypoint-preview-navigation {
  cursor: pointer;
}
.point-osm-preview.waypoint-preview-navigation:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.point-osm-preview .point-osm-tulip-context {
  pointer-events: none;
}

/* v6.1 route/elevation spacing and corrected elevation card */
.tab-panel[data-panel='route'] .auto-waypoint-card {
  margin-bottom: 10px !important;
}
.tab-panel[data-panel='route'] .elevation-card {
  margin-top: 0 !important;
  padding: 14px 14px 16px !important;
  display: grid;
  gap: 10px;
}
.tab-panel[data-panel='route'] .elevation-card > .card-title {
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.elevation-profile-status {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -5px;
}

.review-badge.automated {
  background: #e8f1ff;
  color: #245a9b;
  border-color: #b8cff0;
}

/* v6.2.0: route cards stay informative even before route/elevation data exists. */
.tab-panel[data-panel='route'] .auto-waypoint-card,
.tab-panel[data-panel='route'] .elevation-card {
  min-height: 118px !important;
}
.tab-panel[data-panel='route'] .auto-waypoint-card.is-collapsed,
.tab-panel[data-panel='route'] .elevation-card.is-collapsed {
  min-height: 0 !important;
}
.route-card-summary {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.elevation-profile-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

/* The four main editor tabs share one visual rhythm for headings and cards. */
.tab-panel:is([data-panel='route'], [data-panel='symbols'], [data-panel='control'], [data-panel='settings'])
  > .section-head {
  margin-bottom: 14px;
}
.tab-panel:is([data-panel='route'], [data-panel='symbols'], [data-panel='control'], [data-panel='settings'])
  > .section-head
  p {
  display: block !important;
}
.tab-panel:is([data-panel='route'], [data-panel='symbols'], [data-panel='settings']) > .studio-card,
.tab-panel[data-panel='control'] .quality-dashboard > .studio-card {
  margin: 0 0 10px !important;
  padding: 10px !important;
  border-radius: 8px;
}
.tab-panel[data-panel='route'] .elevation-card {
  padding: 10px !important;
}
.tab-panel[data-panel='control'] .quality-dashboard {
  gap: 0 !important;
}
.tab-panel:is([data-panel='route'], [data-panel='symbols'], [data-panel='control'], [data-panel='settings'])
  .collapsible-card.is-collapsed {
  min-height: 0 !important;
}
/* OSM view: Extra info must not reintroduce the blue studio-card background. */
.roadbook-map-popup.info.osm-map-active {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(1px);
}
.roadbook-map-popup.info.osm-map-active .roadbook-map-popup-body,
.roadbook-map-popup.info.osm-map-active .scene-section,
.roadbook-map-popup.info.osm-map-active .scene-canvas,
.roadbook-map-popup.info.osm-map-active .studio-card,
.roadbook-map-popup.info.osm-map-active .info-box,
.roadbook-map-popup.info.osm-map-active .v5-card {
  background: transparent !important;
}
.roadbook-map-popup.info.osm-map-active .roadbook-map-popup-head {
  background: rgba(255, 255, 255, 0.82) !important;
}
/* About > Version release history. */
.release-notes-card {
  margin-top: 12px;
}
.release-notes-readable {
  max-height: 420px;
  overflow: auto;
  padding-right: 8px;
}
.release-notes-readable h3 {
  margin: 14px 0 7px;
  font-size: 16px;
}
.release-notes-readable h4 {
  margin: 12px 0 6px;
  font-size: 14px;
}
.release-notes-readable h5 {
  margin: 10px 0 5px;
  font-size: 13px;
}
.release-notes-readable p {
  margin: 5px 0;
  line-height: 1.45;
}
.release-notes-readable ul {
  margin: 5px 0 10px 20px;
  padding: 0;
}
.release-notes-readable li {
  margin: 3px 0;
  line-height: 1.4;
}

/* v6.3.5: Tulip and information overlay use identical background modes.
   OSM visible: transparent; OSM hidden: opaque white. */
.roadbook-map-popup.info.osm-map-active,
.roadbook-map-popup.info.osm-map-active .roadbook-map-popup-head,
.roadbook-map-popup.info.osm-map-active .roadbook-map-popup-body,
.roadbook-map-popup.info.osm-map-active .scene-section,
.roadbook-map-popup.info.osm-map-active .scene-canvas {
  background: transparent !important;
  backdrop-filter: none !important;
}
.roadbook-map-popup.info.without-osm-map,
.roadbook-map-popup.info.without-osm-map .roadbook-map-popup-head,
.roadbook-map-popup.info.without-osm-map .roadbook-map-popup-body,
.roadbook-map-popup.info.without-osm-map .scene-section,
.roadbook-map-popup.info.without-osm-map .scene-canvas {
  background: #fff !important;
  backdrop-filter: none !important;
}

/* v6.3.9: consistent control typography in the application shell. */
.account-trigger,
.account-trigger span:last-child {
  font-size: 13px;
}
.boot-status {
  font-size: 11px;
}
#fitRouteBtn {
  width: auto;
  min-width: 34px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}
.smart-select-card > summary,
.advanced-card > summary {
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
/* Collapsible explanation of the minimum score under the route options. */
.option-explain {
  margin: 8px 0 4px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.option-explain > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text, inherit);
}
.option-explain h4 {
  margin: 10px 0 2px;
  font-size: 12px;
  color: var(--text, inherit);
}
.option-explain p {
  margin: 6px 0;
}
.option-explain ul {
  margin: 4px 0;
  padding-left: 18px;
}
.option-explain li {
  margin: 2px 0;
}
.stat span {
  white-space: nowrap;
}
@media (min-width: 1200px) {
  .stats-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(max-content, 1fr);
  }
}

/* v6.5.0: one save-state indicator and a visible Save action next to the project title. */
.status-pill[data-state='saved'] {
  background: #dcfce7;
  color: #166534;
}
.status-pill[data-state='saving'],
.status-pill[data-state='dirty'] {
  background: #fff4d8;
  color: #8a4b08;
}
.status-pill[data-state='error'] {
  background: #fee2e2;
  color: #991b1b;
}
.status-pill[data-state='readonly'] {
  background: #e2e8f0;
  color: #334155;
}
.status-pill[data-state='saved']::before,
.status-pill[data-state='saving']::before,
.status-pill[data-state='dirty']::before,
.status-pill[data-state='error']::before {
  content: '';
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill[data-state='saving']::before {
  animation: tr3-save-pulse 1s ease-in-out infinite;
}
@keyframes tr3-save-pulse {
  50% {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .status-pill[data-state='saving']::before {
    animation: none;
  }
}
.project-strip .strip-save {
  min-height: 34px;
  padding: 6px 16px;
  font-size: 13px;
  white-space: nowrap;
}
.project-strip .strip-save:disabled {
  opacity: 0.55;
  cursor: default;
}
.account-avatar-mini:empty {
  display: none;
}
/* v6.5.0: menu badges are up to four letters wide; keep the labels aligned in one column. */
.top-menu-item .mi {
  width: 30px;
  flex: none;
  text-align: left;
}
.top-menu-item .sub {
  text-align: right;
}

/* v6.5.0: repair dialog for icons that are missing from the catalogue. */
.missing-assets-shell {
  width: min(760px, 100%);
}
.missing-asset-list {
  display: grid;
  gap: 12px;
  max-height: 50vh;
  overflow: auto;
  padding-right: 4px;
}
.missing-asset-row > span {
  font-weight: 500;
}

/* v6.5.0: explanatory text inside a card (Info tab). */
.studio-card .card-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.studio-card .card-note:last-child {
  margin-bottom: 0;
}

/* v6.5.0: sign-in screen with password reset. */
.tr3-login-gate-card p {
  margin: 0;
  color: #52606d;
  line-height: 1.45;
}
.tr3-gate-field {
  display: grid;
  gap: 6px;
}
.tr3-gate-field > label {
  font-weight: 700;
}
.tr3-gate-password {
  display: flex;
  gap: 6px;
}
.tr3-gate-password input {
  flex: 1;
  min-width: 0;
}
.tr3-login-gate-card .tr3-gate-reveal {
  background: #eef2f6;
  color: #243b53;
  padding: 0 12px;
  font-weight: 700;
}
.tr3-login-gate-card .tr3-gate-link {
  background: none;
  color: #0b6e99;
  padding: 2px 0;
  font-weight: 700;
  justify-self: center;
  text-decoration: underline;
}
.tr3-login-gate-card .tr3-gate-leave {
  background: #52606d;
}
.tr3-payment-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  padding: 12px;
  border-radius: 10px;
  background: #eef6fa;
}
.tr3-payment-summary strong {
  text-align: right;
}
.tr3-pay-days {
  font-weight: 700;
  color: #0b6e99 !important;
}
.tr3-pay-consent {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 9px !important;
  font-weight: 600 !important;
}
.tr3-pay-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}
.tr3-pay-period {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.tr3-pay-period legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  font-weight: 800;
}
.tr3-pay-period label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bcccdc;
  border-radius: 10px;
  cursor: pointer;
}
.tr3-pay-period input {
  width: 18px;
  height: 18px;
  padding: 0;
}
.tr3-pay-method {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-radius: 10px;
  background: #f4f7fa;
}
.tr3-pay-account {
  margin: 0;
  padding: 12px;
  border: 1px solid #c8d6e0;
  border-radius: 10px;
  color: #102a43 !important;
  text-align: center;
  font-weight: 800;
}
@media (max-width: 520px) {
  .tr3-pay-period {
    grid-template-columns: 1fr;
  }
}
.bezier-control-line {
  stroke: #397fa4;
  stroke-width: 0.8;
  stroke-dasharray: 2 2;
  pointer-events: none;
}
.bezier-control-handle {
  fill: #fff;
  stroke: #1976a3;
  stroke-width: 1.2;
  cursor: crosshair;
}
.transform-anchor {
  fill: #fff;
  stroke: #d32f2f;
  stroke-width: 1.2;
  pointer-events: none;
}
.rotation-handle {
  fill: #fff;
  stroke: #7b1fa2;
  stroke-width: 1.2;
  cursor: grab;
}
.tr3-login-gate-card button:disabled {
  opacity: 0.6;
  cursor: default;
}
.tr3-gate-notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: #e6f6ec;
  color: #14532d;
  line-height: 1.45;
}
.tr3-gate-notice[hidden] {
  display: none;
}
.tr3-gate-checks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #829ab1;
}
.tr3-gate-checks li::before {
  content: '○ ';
}
.tr3-gate-checks li.ok {
  color: #166534;
}
.tr3-gate-checks li.ok::before {
  content: '✓ ';
}

/* v6.5.0: fetch or retry the elevation profile. */
#fillElevationBtn {
  margin-top: 8px;
  width: 100%;
}
#fillElevationBtn[hidden] {
  display: none;
}
/* Highlight toggle in the tulip view's waypoint list; highlighted waypoints stand out in Paper Studio. */
.review-badge.highlight-status {
  cursor: pointer;
  border: 1px solid transparent;
}
.review-badge.highlight-status.off {
  background: transparent;
  color: #7a8794;
  border-color: #d5dde5;
}
.review-badge.highlight-status.on {
  background: #ffe9cc;
  color: #a24a00;
  border-color: #f5a35c;
}
.right-list-row.highlighted {
  box-shadow: inset 3px 0 0 #f26b1d;
}
/* Version history in Mijn projecten. */
.project-version-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}
.project-version-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.project-version-row:hover {
  border-color: #9db8d3;
}
.project-version-row.selected {
  border-color: #1d5f8a;
  box-shadow: 0 0 0 2px rgba(29, 95, 138, 0.15);
}
.project-version-row i {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  background: #e3f4e8;
  color: #1a7a3c;
  border-radius: 999px;
  padding: 1px 7px;
}
.project-version-row .muted {
  font-size: 11px;
}
.project-version-more {
  margin-top: 4px;
}
.project-version-detail {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}
.project-version-detail h4 {
  margin: 0 0 4px;
  font-size: 14px;
}
.project-version-detail p {
  margin: 4px 0;
  font-size: 12px;
}
.project-version-detail .small {
  font-size: 11px;
}
/* Routecontrole & extra's card (route-insights). */
.insight-block {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.insight-block:first-of-type {
  border-top: 0;
}
.insight-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  justify-content: space-between;
  margin-bottom: 4px;
}
.insight-head strong {
  font-size: 12px;
}
.insight-head .input {
  flex: 1;
  min-width: 120px;
  max-width: none;
}
.insight-result {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}
.insight-summary {
  font-weight: 700;
  color: var(--text, #12263f);
}
.insight-sub {
  font-weight: 800;
  font-size: 11px;
  margin-top: 6px;
  color: var(--text, #12263f);
}
.insight-issue {
  all: unset;
  cursor: pointer;
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text, #12263f);
}
.insight-issue.warning {
  border-left: 3px solid #e0a100;
}
.insight-issue.error {
  border-left: 3px solid #c62828;
}
.insight-issue:hover {
  border-color: #9db8d3;
}
.insight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}
.insight-row-main {
  all: unset;
  cursor: pointer;
  display: grid;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}
.insight-row-main:hover {
  background: #eef4fa;
}
.insight-row-main small {
  color: var(--muted);
  font-size: 11px;
}
/* 6.5.0: the organisation's logo in every studio header (set as --tr3-logo by the page; Admin → Logo changes it). */
.brand-mark {
  width: 64px !important;
  height: 48px !important;
  flex: none;
  background: #fff var(--tr3-logo, none) center/88% auto no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.brand-version {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.72;
  letter-spacing: 0.02em;
  margin-top: 1px;
  white-space: nowrap;
}
.logo-admin-preview {
  display: grid;
  place-items: center;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  margin: 8px 0;
}
.logo-admin-preview img {
  max-width: 100%;
  max-height: 100%;
}
.logo-admin-dark {
  background: #102a43;
}
.tr3-gate-logo {
  height: 96px;
  width: 100%;
  align-self: stretch;
  margin: 0 auto 6px;
  background: var(--tr3-logo, none) center/contain no-repeat;
}
.tr3-gate-version {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #6b7c8f;
}
.logo-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  max-width: 520px;
  width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(15, 34, 54, 0.35);
}
.logo-dialog::backdrop {
  background: rgba(15, 34, 54, 0.45);
}
.logo-dialog-card {
  padding: 16px 18px;
  display: grid;
  gap: 6px;
}
.logo-admin-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.account-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.osm-problem {
  font-size: 12px;
  line-height: 1.35;
  padding: 7px 9px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid #f0b4b4;
  border-left: 3px solid #c62828;
  background: #fff5f5;
  color: #7a1d1d;
  white-space: pre-wrap;
  word-break: break-word;
}
.service-check {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
}
.service-check.ok {
  border-left: 4px solid #1a9b4b;
}
.service-check.fail {
  border-left: 4px solid #c62828;
  background: #fff7f7;
}
.service-check span {
  word-break: break-word;
}
.service-check small {
  color: var(--muted);
}
/* An error toast shows its whole message (e.g. the server's reason), over several lines if needed. */
.toast.persistent.error > span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.toast.persistent.error {
  max-width: min(900px, 92vw);
}
.osm-control-card .osm-problem {
  margin-top: 8px;
}
/* Text on a placed icon (traffic sign) in the Tulip element editor */
.icon-text-fields {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #ccd5df);
}
.icon-text-head {
  font-weight: 700;
  font-size: 13px;
}
.icon-text-fields textarea {
  min-height: 34px;
  resize: vertical;
}
.icon-text-locked {
  display: block;
  margin-top: 3px;
  color: #9a3412;
  font-size: 11px;
}
.icon-text-hint {
  font-size: 11px;
  opacity: 0.7;
}
.icon-text-fields .btn {
  justify-self: start;
}
.tulip-sign-text-card {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #9cc3e6;
  border-radius: 8px;
  background: #f3f8fd;
}
.tulip-sign-text-card .sign-text-title {
  margin: 0 0 6px;
  font-size: 13px;
}
.tulip-sign-text-card .sign-text-title small {
  font-weight: 400;
  opacity: 0.7;
  font-size: 11px;
}
.tulip-sign-text-card .icon-text-fields {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.tulip-sign-text-card .icon-text-head {
  font-size: 12px;
  margin-top: 6px;
}
.icon-size-control {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.icon-size-control .btn {
  padding: 2px 10px;
  min-height: 0;
}
.icon-size-control input[type='range'] {
  width: 100%;
}
.icon-size-control .icon-size-value {
  grid-column: 1/-1;
  opacity: 0.7;
}
.scene-canvas .resize-handle {
  fill: #fff;
  stroke: #0b6e99;
  stroke-width: 1.4;
  cursor: nwse-resize;
}
/* The words on an icon in the icon cards of the Tulip tab */
.symbol-card .symbol-text {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  color: #0b4f8a;
  background: #eef4fb;
  border-radius: 4px;
  padding: 1px 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* OpenStreetMap Info: which traffic lights, signs and landmark categories go on the tulip */
.osm-settings-scroll {
  max-height: 390px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 3px 7px 3px 2px;
  border: 1px solid var(--border, #ccd5df);
  border-radius: 8px;
  background: #fff;
}
.osm-scope-grid,
.osm-landmark-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.osm-scope-grid {
  margin: 0;
}
.osm-settings-section-title {
  margin: 10px 0 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #ccd5df);
  font-size: 11px;
  font-weight: 900;
}
.osm-landmark-list {
  margin-top: 0;
}
.osm-scope-field {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 48%) !important;
  gap: 7px !important;
  margin: 0 !important;
  align-items: center;
  align-content: center;
}
.osm-scope-field > span {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.15;
}
.osm-scope-field.osm-setting-important > span {
  font-weight: 900;
  color: var(--text, #243b53);
}
.osm-scope-field select {
  width: 100%;
  min-width: 0;
  min-height: 34px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  font-size: 12px !important;
}
@media (max-width: 560px) {
  .osm-scope-field {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 48%) !important;
  }
}
/* Help → Handleiding: part 1 of docs/HANDLEIDING.md */
.howto-manual {
  max-width: 860px;
  margin: 0 auto;
  padding: 4px 8px 24px;
  line-height: 1.55;
  font-size: 14px;
  color: var(--text, #102a43);
}
.howto-manual h3 {
  font-size: 22px;
  margin: 4px 0 12px;
}
.howto-manual h4 {
  font-size: 17px;
  margin: 26px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #d9e2ec);
}
.howto-manual h5 {
  font-size: 14px;
  margin: 16px 0 6px;
}
.howto-manual p {
  margin: 6px 0;
}
.howto-manual ul,
.howto-manual ol {
  margin: 6px 0 10px;
  padding-left: 22px;
}
.howto-manual li {
  margin: 3px 0;
}
.howto-manual code {
  background: #eef2f6;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 12px;
}
.howto-manual pre {
  background: #f5f7fa;
  border-radius: 6px;
  padding: 8px;
  overflow: auto;
}
.howto-manual hr {
  border: 0;
  border-top: 1px solid var(--border, #d9e2ec);
  margin: 18px 0;
}
/* Direction arrows on the route line (route-builder renderRouteArrows) */
.route-dir-arrow {
  pointer-events: none;
}
.route-dir-arrow svg {
  display: block;
  overflow: visible;
}
.route-dir-arrow path {
  fill: #fff;
  stroke: #0b3a57;
  stroke-width: 1.3;
  stroke-linejoin: round;
}
/* Crosshair on the exact spot of a junction or roadworks finding (route-insights showSpot) */
.issue-crosshair {
  cursor: pointer;
}
.issue-crosshair svg {
  display: block;
  overflow: visible;
  animation: issue-crosshair-in 0.6s ease-out;
}
.issue-crosshair circle,
.issue-crosshair path {
  fill: none;
  stroke: #d62828;
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff);
}
.issue-crosshair circle.dot {
  fill: #d62828;
  stroke: none;
}
@keyframes issue-crosshair-in {
  0% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .issue-crosshair svg {
    animation: none;
  }
}

/* 6.6.0: the right-click menu on the map has its own close button (top right). */
.context-menu .context-menu-close {
  width: auto;
  margin: 0 0 2px auto;
  padding: 2px 9px;
  font-size: 17px;
  line-height: 1.1;
  text-align: center;
  color: var(--muted, #5b6b7c);
}
.context-menu .context-menu-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.file-formats-shell {
  width: min(1180px, 96vw);
  height: min(900px, 94vh);
  max-width: none;
}
.file-formats-body {
  padding: 22px;
  overflow: auto;
  background: var(--bg);
}
.file-formats-loading,
.file-formats-error {
  min-height: 240px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}
.format-guide-content {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.format-guide-content > .eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.format-guide-content > h1 {
  margin: 4px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}
.format-guide-content > h2 {
  margin: 24px 0 9px;
  font-size: 17px;
}
.format-guide-content p {
  margin: 5px 0 10px;
}
.format-guide-content > .sub {
  max-width: 900px;
  color: var(--muted);
}
.format-guide-content .counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
}
.format-guide-content .count,
.format-guide-content .note {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 12px;
}
.format-guide-content .count b {
  display: block;
  font-size: 20px;
}
.format-guide-content .count small {
  color: var(--muted);
}
.format-guide-content .recommend {
  border-left: 4px solid var(--accent);
}
.format-guide-content .tools {
  position: sticky;
  top: -22px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--panel);
  box-shadow: 0 4px 12px rgba(16, 42, 67, 0.08);
}
.format-guide-content .tools input,
.format-guide-content .tools select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 6px 9px;
}
.format-guide-content .tools input {
  flex: 1 1 230px;
}
.format-guide-content .tools button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
}
.format-guide-content .scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: var(--panel);
  max-height: 52vh;
}
.format-guide-content table {
  width: 100%;
  min-width: 1400px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}
.format-guide-content th,
.format-guide-content td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.format-guide-content th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #102a43;
  color: #fff;
  white-space: nowrap;
}
.format-guide-content tbody tr:nth-child(even) {
  background: var(--panel-soft);
}
.format-guide-content tbody tr:hover {
  background: var(--accent-soft);
}
.format-guide-content td:first-child {
  font-weight: 850;
}
.format-guide-content .category {
  display: inline-block;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  font-size: 10px;
  white-space: nowrap;
}
.format-guide-content .good {
  color: var(--success);
  font-weight: 800;
}
.format-guide-content .warn {
  color: #8a5b12;
}
.format-guide-content .bad {
  color: var(--danger);
}
.format-guide-content .minitable {
  min-width: 720px;
}
.format-guide-content .source a {
  color: var(--accent);
}
.format-guide-content footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 720px) {
  .file-formats-body {
    padding: 14px;
  }
  .format-guide-content .counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .format-guide-content .tools {
    top: -14px;
  }
  .format-guide-content > h1 {
    font-size: 20px;
  }
}

/* 7.0.12 Tulip view: the name of the clicked icon at the bottom of the Tulip or Extra info. */
.roadbook-map-popup .tulip-selected-name {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 7;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 42, 67, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 7.0.12 Controle: the finding that was clicked, and its elements and message in red on the tulip.
   The message sits at the bottom: Extra info can cover the top left of a large tulip. */
.roadbook-map-popup.has-scene-issue .tulip-selected-name {
  bottom: 52px;
}
.scene-canvas.has-scene-issue {
  outline: 3px solid #d32f2f;
  outline-offset: -3px;
}
.scene-canvas [data-issue='1'] .selection-ring {
  display: block;
  stroke: #d32f2f;
  stroke-width: 2.5;
  stroke-dasharray: none;
  fill: rgba(211, 47, 47, 0.12);
}
.scene-canvas [data-issue='1'] {
  filter: drop-shadow(0 0 1.5px #d32f2f) drop-shadow(0 0 2px #d32f2f);
}
.scene-issue-banner {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #d32f2f;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}
.scene-issue-banner span {
  flex: 1;
  min-width: 0;
}
.scene-issue-banner button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

/* 7.0.12 Help → Handleiding: all documentation, with a table of contents and search. */
.howto-modal .v5-shell {
  width: min(1240px, calc(100vw - 48px)) !important;
  max-width: 1240px !important;
  height: calc(100vh - 48px) !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
}
.howto-modal .v5-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.howto-modal .v5-head h2 {
  margin: 0;
  flex: 0 0 auto;
}
.howto-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.howto-search input {
  flex: 1;
  min-width: 120px;
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong, #bcccdc);
  border-radius: 8px;
  font: inherit;
  color: #102a43;
  background: #fff;
}
#v5HowToHits {
  font-size: 12px;
  color: inherit;
  opacity: 0.85;
  white-space: nowrap;
  min-width: 70px;
}
.howto-body {
  display: grid !important;
  grid-template-columns: 270px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden !important;
}
.howto-toc {
  overflow: auto;
  border-right: 1px solid var(--line, #d9e2ec);
  padding: 12px 10px 24px;
  background: #f7f9fb;
  font-size: 13px;
}
.howto-toc-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #627d98);
}
.howto-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.howto-toc li {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.howto-toc li.level-1 {
  margin-top: 10px;
  font-weight: 800;
}
.howto-toc li.level-2 {
  padding-left: 12px;
}
.howto-toc li.folded {
  display: none;
}
.howto-toc a {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}
.howto-toc a:hover {
  background: rgba(11, 110, 153, 0.08);
}
.howto-toc a.current {
  background: rgba(11, 110, 153, 0.14);
  color: #0b4f6c;
}
.howto-toc a[aria-expanded]::before {
  content: '\25B8\00A0';
}
.howto-toc a[aria-expanded='true']::before {
  content: '\25BE\00A0';
}
.howto-toc-hits {
  font-size: 11px;
  font-weight: 800;
  color: #8a5a00;
  background: #fff3c4;
  border-radius: 999px;
  padding: 0 6px;
}
.howto-toc-hits:empty {
  display: none;
}
.howto-toc.searching li.folded:not(.no-hits) {
  display: flex;
}
.howto-toc.searching li.no-hits a {
  opacity: 0.45;
}
.howto-body .howto-manual {
  overflow: auto;
  max-width: none;
  margin: 0;
  padding: 12px 28px 40px;
}
.howto-manual h6 {
  font-size: 13px;
  margin: 14px 0 4px;
}
.howto-manual section.level-1 > h3 {
  font-size: 24px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 3px solid #0b6e99;
}
.manual-table {
  overflow-x: auto;
  margin: 8px 0 14px;
}
.manual-table table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 60%;
}
.manual-table th,
.manual-table td {
  border: 1px solid var(--line, #d9e2ec);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
.manual-table th {
  background: #f0f4f8;
  color: #102a43;
  font-weight: 800;
}
.howto-manual mark.manual-hit {
  background: #ffe58a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.howto-manual mark.manual-hit.current {
  background: #ff9f1a;
  box-shadow: 0 0 0 2px #ff9f1a;
}
.manual-format-guide .counts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.manual-format-guide .count {
  border: 1px solid var(--line, #d9e2ec);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
}
.manual-format-guide .note {
  border-left: 4px solid #0b6e99;
  background: #f5f9fc;
  padding: 8px 12px;
  margin: 10px 0;
  border-radius: 6px;
}
.manual-format-guide .good {
  color: #1f7a3f;
  font-weight: 700;
}
.manual-format-guide .warn {
  color: #9a6700;
  font-weight: 700;
}
.manual-format-guide .bad {
  color: #b42318;
  font-weight: 700;
}
@media (max-width: 760px) {
  .howto-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .howto-toc {
    max-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid var(--line, #d9e2ec);
  }
  .howto-modal .v5-head {
    flex-wrap: wrap;
  }
}
/* 7.0.12 Fit in the Tulip view: on while the tulip fills the map window. */
#fitRouteBtn.active {
  background: #0b6e99;
  border-color: #0b6e99;
  color: #fff;
}

/* 7.0.12 Mijn projecten: the filter tabs never shrink into a scrolling strip; they wrap if the column is narrow. */
.projects-filters {
  flex: 0 0 auto;
  flex-wrap: wrap;
  overflow: visible;
}
.projects-filters button {
  min-height: 0;
  padding: 5px 11px;
  font-size: 11px;
  line-height: 1.3;
}

/* 7.0.12 Objecten: geometric shapes and their line and fill. */
.shape-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.shape-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 12px;
}
.shape-glyph {
  font-size: 16px;
  line-height: 1;
  width: 18px;
  text-align: center;
}
.shape-style {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin-top: 8px;
}
.shape-style .field {
  margin: 0;
  display: grid;
  gap: 3px;
}
.shape-style .field span {
  font-size: 11px;
}
.shape-style input[type='color'] {
  width: 42px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line-strong, #bcccdc);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.shape-style input[type='number'] {
  width: 70px;
}
.shape-fill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
}
.shape-fill input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* 7.0.12 Landschap: route coloured per street by its landscape score (button above the map, legend below it). */
/* Landschap and OSM map share one look: icon + word, green while switched on. */
.map-toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
.map-toolbar-toggle svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-toolbar-toggle.active {
  background: #1b7f3b;
  border-color: #1b7f3b;
  color: #fff;
}
.scenic-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.scenic-legend[hidden] {
  display: none;
}
.scenic-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.scenic-chip i {
  display: inline-block;
  width: 18px;
  height: 5px;
  border-radius: 3px;
  box-shadow: 0 0 0 1.5px #fff;
}

/* Admin -> Mail (assets/v5-mail.*.js) */
.mail-admin-dialog [hidden] {
  display: none !important;
}
.mail-admin-shell {
  width: min(1100px, 96vw);
}
.mail-admin-shell .v5-body {
  min-height: 60vh;
}
.mail-admin-shell > .account-nav {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.mail-admin-shell > .account-nav button {
  flex: 1 1 0;
  min-width: max-content;
  margin: 0;
}
.mail-admin-shell .button-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.mail-admin-shell .button-row .btn {
  width: auto;
}
.mail-preview-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line, #d9e2ec);
  border-radius: 8px;
  background: #fff;
}
/* Admin -> Dashboard (assets/v5-dashboard.*.js) */
.v5-modal > .v5-shell.dash-shell {
  width: min(1320px, calc(100vw - 32px)) !important;
  max-width: 1320px !important;
  height: calc(100vh - 32px) !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
}
.dash-shell .v5-body {
  flex: 1 1 auto;
  overflow: auto;
  display: grid;
  gap: 12px;
  align-content: start;
}
.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.dash-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dash-chip {
  border: 1px solid var(--line-strong, #bcccdc);
  background: var(--panel, #fff);
  color: var(--text, #102a43);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.dash-chip[aria-pressed='true'] {
  background: var(--accent, #0b6e99);
  border-color: var(--accent, #0b6e99);
  color: #fff;
}
.dash-updated {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted, #627d98);
}
.dash-toolbar .btn {
  width: auto;
}
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.dash-kpi {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 12px 14px;
  border: 1px solid var(--line, #d9e2ec);
  border-left: 4px solid var(--accent, #0b6e99);
  border-radius: 10px;
  background: var(--panel, #fff);
}
.dash-kpi strong {
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dash-kpi span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #627d98);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dash-kpi small {
  font-size: 11px;
  color: var(--muted, #627d98);
}
.dash-kpi.live {
  border-left-color: var(--success, #1b7f3b);
}
.dash-kpi.live strong {
  color: var(--success, #1b7f3b);
}
.dash-kpi.bad {
  border-left-color: #c53030;
}
.dash-bad {
  color: #c53030;
  font-weight: 800;
}
.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}
.dash-chart {
  margin: 0;
  display: grid;
  gap: 6px;
}
.dash-chart figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.dash-chart figcaption span,
.dash-chart-axis {
  font-size: 11px;
  color: var(--muted, #627d98);
}
.dash-chart svg {
  width: 100%;
  height: 140px;
  display: block;
}
.dash-chart rect {
  fill: var(--accent, #0b6e99);
}
.dash-chart rect:hover {
  fill: var(--success, #1b7f3b);
}
.dash-chart-axis {
  display: flex;
  justify-content: space-between;
}
.dash-table-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.dash-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dash-table-head h3 {
  margin: 0;
}
.dash-table-head h3 small {
  font-size: 12px;
  color: var(--muted, #627d98);
  font-weight: 700;
}
.dash-table-tools {
  display: flex;
  gap: 6px;
}
.dash-table-tools .btn {
  width: auto;
}
.dash-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #627d98);
}
.dash-table-scroll {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line, #d9e2ec);
  border-radius: 8px;
  background: var(--panel, #fff);
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-soft, #f0f4f8);
  text-align: left;
  white-space: nowrap;
}
.dash-table th button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  color: var(--text, #102a43);
  padding: 7px 8px;
  cursor: pointer;
  width: 100%;
  text-align: inherit;
}
.dash-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--line, #d9e2ec);
  vertical-align: top;
}
.dash-table td small {
  display: block;
  color: var(--muted, #627d98);
}
.dash-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dash-table th.num button {
  text-align: right;
}
.dash-table tbody tr:hover {
  background: #f7fbfe;
}
.dash-actions {
  white-space: nowrap;
  text-align: right;
}
.dash-actions .btn {
  width: auto;
  min-height: 28px;
  padding: 2px 10px;
}
.dash-more {
  justify-self: start;
  width: auto;
}
.dash-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  background: #eaf1f5;
  color: #486581;
}
.dash-badge.ok {
  background: #e3f9e5;
  color: #1b7f3b;
}
.dash-badge.warn {
  background: #fff4d6;
  color: #9a6700;
}
.dash-badge.err {
  background: #fde8e8;
  color: #a61b1b;
}
.dash-live {
  color: var(--success, #1b7f3b);
  font-weight: 800;
}
@media (max-width: 599.98px) {
  .v5-modal > .v5-shell.dash-shell {
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
  }
  .dash-updated {
    margin-left: 0;
    flex-basis: 100%;
  }
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-kpi strong {
    font-size: 20px;
  }
  .dash-charts {
    grid-template-columns: 1fr;
  }
}
.admin-refund-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.admin-refund-form .input {
  width: 110px;
}

/* ==========================================================================================
   Responsive layout (7.1.2)
   From 2200 px wide the studio is the standard desktop web app: everything above this block
   applies unchanged. Below 2200 px the layout is fully responsive in five tiers:
     1600-2199  three columns, fluid side panels, the app fills the window
     1200-1599  three columns, narrower side panels
      900-1199  sidebar and map side by side, waypoint list full width below; the page scrolls
      600-899   one column: map, sidebar, list
        < 600   phone: two-row header, menus as full-width sheets, swipeable statistics,
                dialogs full screen
   Tab-specific desktop rules above use !important, so the tiers below do too where needed.
   ========================================================================================== */
@media (max-width: 2199.98px) {
  :root {
    --rwd-gap: clamp(8px, 0.6vw, 12px);
    --rwd-left: clamp(270px, 17vw, 340px);
    --rwd-right: clamp(290px, 19vw, 380px);
  }
  .workspace,
  body[data-active-tab] #workspace {
    gap: var(--rwd-gap);
    padding: var(--rwd-gap);
    grid-template-columns: var(--rwd-left) minmax(0, 1fr) var(--rwd-right) !important;
  }
  .workspace.left-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) var(--rwd-right) !important;
  }
  .workspace.right-collapsed {
    grid-template-columns: var(--rwd-left) minmax(0, 1fr) 0 !important;
  }
  .workspace.left-collapsed.right-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 0 !important;
  }
  .project-title-input {
    min-width: 0;
    width: min(36vw, 560px);
  }
  /* Title and description of the waypoint list on their own lines; the filter wraps below. */
  .route-waypoint-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .route-waypoint-head .route-waypoint-filter {
    width: 100%;
  }
  .route-waypoint-head > div > strong,
  .route-waypoint-head > div > small {
    display: block;
  }
  .stat strong,
  .stat span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Dialogs never larger than the window. */
  .v5-modal > .v5-shell,
  .account-shell,
  .projects-shell {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 1599.98px) {
  :root {
    --rwd-left: clamp(250px, 19vw, 290px);
    --rwd-right: clamp(260px, 21vw, 320px);
  }
  .project-strip {
    padding-inline: 16px;
  }
  .stat {
    padding-inline: 9px;
    min-width: 0;
  }
}

/* --- 900-1199: two columns, the waypoint list below; the page scrolls ---------------------- */
@media (max-width: 1199.98px) {
  html,
  body {
    height: auto !important;
    overflow: visible !important;
  }
  .app-shell {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }
  .workspace,
  body[data-active-tab] #workspace,
  .workspace.left-collapsed,
  .workspace.right-collapsed,
  .workspace.left-collapsed.right-collapsed {
    display: grid !important;
    grid-template-columns: var(--rwd-left) minmax(0, 1fr) !important;
    grid-template-areas: 'left map' 'right right';
    overflow: visible !important;
  }
  .workspace > .left-panel {
    grid-area: left;
  }
  .workspace > .map-panel {
    grid-area: map;
  }
  .workspace > .right-panel {
    grid-area: right;
    grid-column: 1 / -1;
  }
  /* The first screen holds sidebar and map; the list follows when you scroll. */
  .workspace > .left-panel,
  .workspace > .map-panel {
    height: calc(100dvh - var(--topbar) - 92px) !important;
    min-height: 480px !important;
    max-height: none !important;
  }
  .workspace > .left-panel .tab-panel.active {
    overflow: auto;
    min-height: 0;
  }
  .workspace > .right-panel,
  body[data-active-tab] #roadbookRightPanel:not(.hidden) {
    height: auto !important;
    min-height: 320px !important;
    max-height: 70dvh !important;
  }
  .map {
    min-height: 0 !important;
  }
  .workspace.left-collapsed > .left-panel,
  .workspace.right-collapsed > .right-panel {
    display: none !important;
  }
  .workspace.left-collapsed {
    grid-template-areas: 'map map' 'right right';
  }
  .brand-subtitle,
  .boot-status {
    display: none;
  }
  .project-strip {
    flex-wrap: wrap;
  }
  /* Statistics on their own full-width row. */
  .stats-grid {
    flex: 1 1 100%;
  }
}

/* --- 600-899: one column, map first -------------------------------------------------------- */
@media (max-width: 899.98px) {
  :root {
    --topbar: 64px;
  }
  /* One header row: logo, menus, account. Menus never scroll sideways (that would clip them). */
  .topbar {
    height: auto;
    min-height: var(--topbar);
    padding: 8px 12px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
  }
  .brand-copy {
    display: none;
  }
  .top-menu-bar {
    margin-left: 0;
    overflow: visible;
    flex: 1 1 auto;
    flex-wrap: wrap;
  }
  .top-actions {
    width: auto;
    margin-left: auto;
  }
  .project-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px;
    gap: 8px;
  }
  .project-title-wrap {
    flex-wrap: wrap;
  }
  .project-title-input {
    flex: 1 1 220px;
    width: auto;
  }
  /* In the column layout the 420 px basis above would become a height. */
  .stats-grid {
    flex: 0 0 auto;
  }
  /* The wide File menu becomes a sheet; the others stay within the window. */
  .top-menu-panel {
    max-width: calc(100vw - 16px);
  }
  .top-menu-panel.file-menu-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    width: auto;
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
    margin-top: 6px;
  }
  .workspace,
  body[data-active-tab] #workspace,
  .workspace.left-collapsed,
  .workspace.right-collapsed,
  .workspace.left-collapsed.right-collapsed {
    display: flex !important;
    flex-direction: column;
  }
  .workspace > .map-panel {
    order: 1;
    height: 62dvh !important;
    min-height: 360px !important;
  }
  .workspace > .left-panel {
    order: 2;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  .workspace > .left-panel .tab-panel.active {
    overflow: visible;
    max-height: none;
  }
  .workspace > .right-panel {
    order: 3;
  }
  .workspace.left-collapsed > .left-panel,
  .workspace.right-collapsed > .right-panel {
    display: flex !important;
  }
  .account-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .account-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .account-nav > button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* --- below 600: phone ---------------------------------------------------------------------- */
@media (max-width: 599.98px) {
  .topbar {
    padding: 6px 8px;
  }
  .brand-mark,
  .brand img {
    width: 38px;
    height: 38px;
  }
  /* Row 1: logo and account; row 2: the menus over the full width. */
  .top-menu-bar {
    order: 3;
    flex: 1 1 100%;
    gap: 2px;
  }
  .top-menu > summary {
    padding: 0 9px;
  }
  .account-trigger span:last-child {
    display: none;
  }
  /* A menu opens as a sheet over the full width, below its row, scrolling if it is long. */
  .top-menu-panel,
  .top-menu-panel.wide,
  .top-menu-panel.file-menu-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    width: auto;
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
    margin-top: 6px;
  }
  .file-transfer-grid {
    grid-template-columns: 1fr;
  }
  /* Title on its own row; save state and Save side by side below it. */
  .project-title-input {
    font-size: 16px;
    flex-basis: 100%;
  }
  .project-title-wrap .strip-save {
    margin-left: auto;
  }
  /* Statistics: one swipeable row instead of five squeezed columns. */
  .stats-grid {
    display: flex !important;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
    width: 100%;
  }
  .stats-grid .stat {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 2px 10px;
    border-top: 0 !important;
  }
  .workspace > .map-panel {
    height: 56dvh !important;
    min-height: 300px !important;
  }
  .workspace,
  body[data-active-tab] #workspace {
    padding: 6px;
    gap: 6px;
  }
  .form-grid.two,
  .form-grid.two.equal {
    grid-template-columns: 1fr;
  }
  /* Dialogs full screen. */
  .v5-modal,
  .account-modal,
  .projects-modal {
    padding: 0 !important;
  }
  .v5-modal > .v5-shell,
  .account-shell,
  .projects-shell {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
}

/* OpenStreetMap Info in the Tulip tab (7.1.2): presets, one tile per layer with three buttons
   (Alle blue, Route green, Geen grey), landmark categories folded away. */
.osm-info-card .osm-settings-scroll {
  max-height: none;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  gap: 10px;
}
.osm-preset-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.osm-preset-btn {
  display: grid;
  gap: 2px;
  align-content: start;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.osm-preset-btn strong {
  font-size: 13px;
}
.osm-preset-btn small {
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted);
}
.osm-preset-btn:hover {
  border-color: var(--accent);
}
.osm-preset-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.osm-preset-btn.active small {
  color: #d9eef7;
}
.osm-layer-grid {
  display: grid;
  gap: 6px;
}
.osm-layer-tile {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.osm-layer-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.osm-layer-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: break-word;
}
/* A layer that is off looks off. */
.osm-layer-tile:has(.scope-none.active) .osm-layer-icon,
.osm-layer-tile:has(.scope-none.active) .osm-layer-name,
.osm-landmark-row:has(.scope-none.active) > span {
  opacity: 0.45;
}
.osm-scope-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}
.osm-scope-btn {
  min-height: 28px;
  padding: 0 7px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.osm-scope-btn:first-child {
  border-left: 0;
}
.osm-scope-btn:hover {
  color: var(--text);
  background: #fff;
}
.osm-scope-btn.active.scope-all {
  background: var(--accent);
  color: #fff;
}
.osm-scope-btn.active.scope-route {
  background: var(--success);
  color: #fff;
}
.osm-scope-btn.active.scope-intelligent {
  background: var(--accent);
  color: #fff;
}
.osm-scope-btn.active.scope-none {
  background: #829ab1;
  color: #fff;
}
.osm-scope-btn:focus-visible,
.osm-preset-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.osm-landmarks {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.osm-landmarks > summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  padding: 8px;
  cursor: pointer;
  list-style: none;
}
.osm-landmarks > summary::-webkit-details-marker {
  display: none;
}
.osm-landmarks > summary::after {
  content: '▾';
  color: var(--muted);
  transition: transform 0.15s;
}
.osm-landmarks[open] > summary::after {
  transform: rotate(180deg);
}
.osm-landmark-count {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
  /* Under the name, so a long name keeps its line in the narrow panel. */
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
}
.osm-landmarks > summary > .osm-layer-icon {
  grid-row: 1 / span 2;
}
.osm-landmarks > summary::after {
  grid-column: 3;
  grid-row: 1 / span 2;
}
.osm-landmarks[open] > .osm-landmark-all {
  margin: 0 8px 8px;
  background: var(--panel-soft);
}
.osm-landmarks .osm-landmark-list {
  display: grid;
  gap: 4px;
  padding: 0 8px 8px;
}
.osm-landmark-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 3px 0 3px 4px;
  border-top: 1px solid var(--line);
}
.osm-landmark-row > span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.osm-landmark-row.osm-setting-important > span {
  color: var(--text);
  font-weight: 800;
}
.osm-map-toggle .osm-layer-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
/* One card for the OSM choices and both ways to make tulips: step 1 choose, step 2 make. */
.osm-info-card .osm-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.osm-info-card .osm-step-nr {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}
/* Map toolbar: the Tulip tab shows "Kaart achter tulip" where the other tabs show Landschap. */
.map-toolbar #tulipMapBackgroundToggle {
  display: none;
}
.map-toolbar #tulipMapBackgroundToggle .osm-layer-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}
body[data-active-tab='symbols'] .map-toolbar #tulipMapBackgroundToggle {
  display: inline-flex;
}
body[data-active-tab='symbols'] .map-toolbar #scenicColorBtn {
  display: none;
}
#osmCardBody {
  margin-bottom: 14px;
}
.osm-make-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--panel);
}
.osm-make-group + .osm-make-group {
  margin-top: 8px;
}
.osm-make-one {
  border-left-color: var(--success);
}
.osm-make-head {
  display: grid;
  gap: 1px;
}
.osm-make-head strong {
  font-size: 13px;
}
.osm-make-head small {
  font-size: 11px;
  color: var(--muted);
}
.osm-make-one.is-empty .osm-make-head small {
  font-style: italic;
}
