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

:root {
  --blue:   #185FA5;
  --green:  #0F6E56;
  --amber:  #854F0B;
  --pink:   #993556;
  --bg:     #f7f8fa;
  --card:   #ffffff;
  --text:   #1a1a2e;
  --muted:  #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 20px;
}

.page { max-width: 1100px; margin: 0 auto; }

/* ---- Header ---- */
.page-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.header-icon {
  width: 48px; height: 48px; background: var(--blue);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; color: #fff; flex-shrink: 0;
}
.page-header h1 { font-size: 20px; font-weight: 600; color: var(--text); }
.subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- Layout ---- */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---- Diagram panel ---- */
.diagram-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.diagram-wrap {
  display: flex; justify-content: center;
}
.car-diagram {
  position: relative;
  width: 280px;
  /* height is set by the SVG aspect ratio via padding trick */
}
.car-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Direction labels */
.dir-label {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.dir-top    { top: -18px; left: 50%; transform: translateX(-50%); }
.dir-bottom { bottom: -18px; left: 50%; transform: translateX(-50%); }
.dir-left   { left: -36px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.dir-right  { right: -36px; top: 50%; transform: translateY(-50%) rotate(90deg); }

/* ---- Dots ---- */
.dot {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transform: translate(-50%, -50%);
  transition: transform .15s, box-shadow .15s;
  z-index: 10;
  line-height: 1;
}
.dot:hover, .dot.active {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.6), 0 2px 8px rgba(0,0,0,.25);
  z-index: 20;
}
.dot-externo      { background: var(--blue); }
.dot-topo         { background: var(--green); }
.dot-compartimento{ background: var(--amber); }
.dot-interior     { background: var(--pink); }

/* ---- Tooltip ---- */
.tooltip {
  display: none;
  position: absolute;
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  max-width: 200px;
  pointer-events: none;
  z-index: 100;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.tooltip-num { font-size: 10px; opacity: .6; margin-bottom: 2px; }
.tooltip-title { font-weight: 600; margin-bottom: 4px; }
.tooltip-desc { opacity: .8; }

/* ---- Detail panel ---- */
.detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  align-items: flex-start;
}
.detail-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  width: 100%; color: var(--muted);
  padding: 40px 0;
  gap: 14px;
}
.detail-empty p { font-size: 14px; line-height: 1.6; }
.detail-icon { opacity: .4; }

.detail-content { width: 100%; }
.detail-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 600; color: #fff;
  margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .05em;
}
.detail-title {
  font-size: 20px; font-weight: 600;
  margin-bottom: 10px; color: var(--text);
}
.detail-desc {
  font-size: 14px; color: var(--muted);
  line-height: 1.7; margin-bottom: 20px;
}
.detail-tips { border-top: 1px solid var(--border); padding-top: 16px; }
.detail-tips h4 { font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.tip-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--text); margin-bottom: 8px;
}
.tip-icon {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0;
  margin-top: 1px;
}

/* ---- Legend ---- */
.legend {
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  margin-bottom: 20px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.leg-group { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.leg-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ---- Points list ---- */
.points-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
.point-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.point-item:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(24,95,165,.1);
}
.point-item.active {
  border-color: var(--blue);
  background: #eef4fc;
}
.point-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.point-info { display: flex; flex-direction: column; gap: 2px; }
.point-info strong { font-size: 13px; font-weight: 600; color: var(--text); }
.point-info span { font-size: 12px; color: var(--muted); line-height: 1.4; }
