/* Interactive topo viewer — desktop sidebar, mobile bottom sheet. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #101114;
  color: #e8eaf0;
  font: 15px/1.45 system-ui, -apple-system, sans-serif;
}
.hidden { display: none !important; }

#topo-viewer, .v-app { height: 100%; }
.v-app { display: flex; }

.v-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
  background: #000;
  cursor: grab;
}
.v-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.v-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-orientation: from-image;
  user-select: none; -webkit-user-drag: none;
  pointer-events: none;
}
.v-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.v-stage svg .layer-lines, .v-stage svg .layer-selection,
.v-stage svg .layer-markers, .v-stage svg .layer-annotations { pointer-events: none; }
.v-stage svg .layer-hits path, .v-stage svg .layer-hits circle { pointer-events: all; }

.v-panel {
  width: 320px;
  flex-shrink: 0;
  background: #191b20;
  border-left: 1px solid #30343d;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.v-head {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 1px solid #30343d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.v-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: auto; }
.v-export {
  background: #262a33;
  border: 1px solid #3a3f4b;
  color: #e8eaf0;
  font: inherit;
  font-size: 13px;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.v-export:hover { background: #2e3340; }
.v-export:disabled { opacity: 0.6; cursor: default; }
.v-approach {
  border-bottom: 1px solid #30343d;
  background: rgba(255, 255, 255, 0.03);
  padding: 0 16px;
}
.v-approach summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: #c3c9d4;
  list-style-position: inside;
}
.v-approach summary:hover { color: #e8eaf0; }
.v-approach[open] { padding-bottom: 12px; }
.v-approach a { color: #5b9bff; text-decoration: none; }
.v-approach a:hover { text-decoration: underline; }
.v-info-label {
  color: #9aa1b0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 10px;
}
.v-detail {
  padding: 12px 16px;
  border-bottom: 1px solid #30343d;
  background: rgba(22, 115, 255, 0.08);
}
.v-detail-head { display: flex; align-items: center; gap: 8px; }
.v-meta { color: #9aa1b0; font-size: 13px; margin-top: 4px; }
.v-desc { margin: 8px 0 0; font-size: 14px; }

.v-list { overflow-y: auto; flex: 1; padding: 6px; }
.v-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.v-item:hover { background: #22252c; }
.v-item.selected { background: rgba(22, 115, 255, 0.2); }
.v-item:focus-visible { outline: 2px solid #1673ff; }
.v-item.variation { padding-left: 30px; }
.v-item.variation .v-num { background: none; border-color: #9aa1b0; color: #9aa1b0; border-radius: 10px; width: 28px; font-size: 10px; }
.v-num {
  background: #111;
  border: 1.5px solid #fff;
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.v-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-grade { color: #9aa1b0; }

.v-report {
  margin: 8px 12px 12px;
  align-self: flex-start;
  background: none;
  border: none;
  color: #6b7280;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.v-report:hover { color: #9aa1b0; }
.v-report:disabled { text-decoration: none; cursor: default; }

@media (max-width: 720px) {
  .v-app { flex-direction: column; }
  .v-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #30343d;
    max-height: 42%;
  }
  .v-head { padding: 10px 14px; font-size: 15px; }
}
