.dental-chart-shell {
  position: relative;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  border-radius: 16px;
  padding: 14px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    rgba(7, 21, 36, 0.4);
}

.dental-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.dental-chart-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #eef5ff);
}

.dental-chart-meta {
  margin-top: 4px;
  color: var(--muted, #a7bed8);
  font-size: 12px;
}

.dental-dentition-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dental-mode-btn,
.dental-btn-clear,
.dental-btn-done {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #eef5ff);
  padding: 7px 12px;
  cursor: pointer;
}

.dental-mode-btn.active {
  border-color: var(--accent, #6ef3c5);
  color: var(--accent, #6ef3c5);
  box-shadow: 0 0 0 1px rgba(110, 243, 197, 0.24) inset;
}

.dental-chart-body {
  display: grid;
  gap: 14px;
}

.dental-mouth-section {
  display: grid;
  gap: 8px;
}

.dental-mouth-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.dental-mouth-heading-copy {
  display: grid;
  gap: 4px;
}

.dental-mouth-title {
  color: var(--muted, #a7bed8);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dental-mouth-subtitle,
.dental-swipe-hint {
  color: var(--muted, #a7bed8);
  font-size: 12px;
}

.dental-reference-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dental-reference-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dental-reference-btn,
.dental-reference-pill {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #eef5ff);
  cursor: pointer;
}

.dental-reference-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.dental-reference-pill {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.dental-reference-pill.active {
  border-color: var(--accent, #6ef3c5);
  color: var(--accent, #6ef3c5);
  box-shadow: 0 0 0 1px rgba(110, 243, 197, 0.22) inset;
}

.dental-mouth-stage {
  position: relative;
  border-radius: 20px;
  padding: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(26, 51, 78, 0.58), rgba(8, 18, 34, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dental-mouth-stage.is-image-stage {
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.96)),
    rgba(255, 255, 255, 0.96);
  border-color: rgba(172, 194, 214, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 18px 34px rgba(2, 10, 20, 0.2);
  touch-action: pan-y;
}

.dental-reference-slider {
  gap: 12px;
}

.dental-reference-slider .natcat-slider-controls {
  margin-top: -2px;
}

.dental-reference-slider .natcat-slider-dot.is-active {
  box-shadow: 0 0 0 1px rgba(110, 243, 197, 0.22) inset;
}

.dental-mouth-svg {
  width: 100%;
  height: auto;
  display: block;
}

.dental-image-svg {
  overflow: visible;
}

.dental-image-background {
  pointer-events: none;
}

.dental-mouth-surface {
  fill: rgba(8, 16, 29, 0.8);
  stroke: rgba(159, 193, 229, 0.16);
  stroke-width: 2;
}

.dental-mouth-opening {
  fill: rgba(5, 11, 21, 0.86);
  stroke: rgba(145, 172, 204, 0.08);
  stroke-width: 2;
}

.dental-mouth-palate {
  fill: rgba(124, 53, 68, 0.48);
}

.dental-mouth-tongue {
  fill: rgba(172, 87, 104, 0.52);
}

.dental-mouth-gum {
  fill: rgba(191, 96, 121, 0.72);
  stroke: rgba(247, 202, 213, 0.22);
  stroke-width: 2;
}

.dental-mouth-midline {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 2;
  stroke-dasharray: 7 8;
}

.dental-mouth-label {
  fill: rgba(225, 237, 252, 0.78);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dental-mouth-label-midline {
  font-size: 15px;
  text-transform: uppercase;
}

.dental-svg-tooth {
  cursor: pointer;
}

.dental-image-tooth {
  cursor: pointer;
}

.dental-svg-hit {
  fill: rgba(255, 255, 255, 0.001);
  stroke: none;
}

.dental-image-hotspot {
  fill: rgba(110, 243, 197, 0.02);
  stroke: rgba(110, 243, 197, 0);
  stroke-width: 10;
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

.dental-image-highlight {
  fill: rgba(110, 243, 197, 0.1);
  stroke: rgba(110, 243, 197, 0.92);
  stroke-width: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.dental-svg-tooth-shape {
  fill: rgba(240, 247, 253, 0.98);
  stroke: rgba(119, 147, 173, 0.54);
  stroke-width: 1.6;
  filter: drop-shadow(0 4px 10px rgba(3, 7, 14, 0.38));
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.dental-svg-tooth-highlight {
  fill: rgba(255, 255, 255, 0.42);
  opacity: 0.85;
  pointer-events: none;
}

.dental-svg-tooth:hover .dental-svg-tooth-shape,
.dental-svg-tooth.is-focus .dental-svg-tooth-shape {
  fill: rgba(252, 253, 255, 1);
  stroke: var(--accent-2, #8ac5ff);
  filter: drop-shadow(0 0 10px rgba(138, 197, 255, 0.24));
}

.dental-image-tooth:hover .dental-image-hotspot,
.dental-image-tooth.is-focus .dental-image-hotspot {
  fill: rgba(138, 197, 255, 0.08);
  stroke: rgba(138, 197, 255, 0.36);
}

.dental-image-tooth:hover .dental-image-highlight,
.dental-image-tooth.is-focus .dental-image-highlight {
  opacity: 1;
  fill: rgba(138, 197, 255, 0.14);
  stroke: rgba(138, 197, 255, 0.95);
}

.dental-svg-tooth.has-selection .dental-svg-tooth-shape {
  stroke: var(--accent, #6ef3c5);
  filter: drop-shadow(0 0 12px rgba(110, 243, 197, 0.22));
}

.dental-image-tooth.has-selection .dental-image-hotspot {
  fill: rgba(110, 243, 197, 0.1);
  stroke: rgba(110, 243, 197, 0.36);
}

.dental-image-tooth.has-selection .dental-image-highlight {
  opacity: 1;
  fill: rgba(110, 243, 197, 0.14);
  stroke: rgba(110, 243, 197, 1);
}

.dental-svg-tooth-label {
  fill: rgba(235, 244, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.dental-svg-badge-shape {
  fill: color-mix(in srgb, var(--status-color, #9db4d0) 28%, rgba(10, 20, 35, 0.9));
  stroke: color-mix(in srgb, var(--status-color, #9db4d0) 70%, rgba(255, 255, 255, 0.2));
  stroke-width: 1.3;
}

.dental-svg-badge-text {
  fill: var(--text, #eef5ff);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.dental-svg-note-dot {
  fill: rgba(255, 240, 140, 0.95);
  stroke: rgba(66, 56, 12, 0.55);
  stroke-width: 1.2;
}

.dental-svg-note-text {
  fill: rgba(39, 30, 7, 0.88);
  font-size: 8px;
  font-weight: 800;
  pointer-events: none;
}

.dental-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dental-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted, #a7bed8);
  font-size: 12px;
}

.dental-legend-swatch,
.dental-status-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--status-color, #9db4d0);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--status-color, #9db4d0) 22%, transparent);
}

.dental-legend-code {
  color: var(--text, #eef5ff);
  font-weight: 700;
}

.dental-popover {
  position: absolute;
  z-index: 20;
  width: min(310px, calc(100vw - 48px));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  border-radius: 14px;
  padding: 12px;
  background: var(--panel, rgba(18, 36, 58, 0.96));
  box-shadow: 0 22px 40px rgba(2, 10, 20, 0.42);
  display: grid;
  gap: 10px;
}

.dental-popover.hidden {
  display: none;
}

.dental-popover-head {
  display: grid;
  gap: 4px;
}

.dental-popover-head strong {
  font-size: 16px;
}

.dental-popover-head span {
  color: var(--muted, #a7bed8);
  font-size: 12px;
}

.dental-popover-statuses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dental-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.dental-status-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.dental-popover-note {
  display: grid;
  gap: 6px;
}

.dental-popover-note span {
  color: var(--muted, #a7bed8);
  font-size: 12px;
}

.dental-popover-note textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text, #eef5ff);
  padding: 9px 10px;
  font: inherit;
}

.dental-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dental-btn-done {
  border-color: var(--accent, #6ef3c5);
  color: var(--accent, #6ef3c5);
}

.dental-empty-copy {
  color: var(--muted, #a7bed8);
  font-size: 12px;
}

@media (max-width: 720px) {
  .dental-mouth-stage {
    padding: 8px;
  }

  .dental-mouth-stage.is-image-stage {
    padding: 8px;
  }

  .dental-reference-slider {
    gap: 10px;
  }

  .dental-mouth-label {
    font-size: 15px;
  }

  .dental-mouth-label-midline {
    font-size: 12px;
  }

  .dental-svg-tooth-label {
    font-size: 11px;
  }

  .dental-image-highlight {
    stroke-width: 5;
  }

  .dental-mouth-heading {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .dental-popover-statuses {
    grid-template-columns: 1fr;
  }
}
