:root {
  color: #1f2933;
  background: #f4f7fb;
  --lightText: #FFFFFF;
  --darkText: #000000;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button {
  font: inherit;
}

code {
  white-space: pre-wrap;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2563eb;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
}

.hero p,
.section-heading p,
.controls p,
.notes {
  color: #52616f;
}

.panel {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid #d8e2ee;
  border-radius: 24px;
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 18px 45px rgb(15 23 42 / 0.08);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.jaw-button {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 10px 18px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.jaw-button:hover {
  transform: translateY(-1px);
}

.jaw-button.is-active {
  border-color: #2563eb;
  color: #fff;
  background: #2563eb;
}

.arch-view {
  display: grid;
  grid-template-columns: repeat(16, minmax(58px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tooth-card {
  min-width: 58px;
  min-height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(15 23 42 / 0.22);
  border-radius: 999px 999px 18px 18px;
  color: var(--toothTextColor, var(--darkText));
  text-align: center;
  box-shadow: inset 0 -16px 30px rgb(255 255 255 / 0.22);
}

.tooth-card strong,
.tooth-card span {
  display: block;
}

.tooth-card strong {
  font-size: 1.18rem;
}

.tooth-card span {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.78;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.result-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.result-list div {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.result-list dt {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

.result-list dd {
  margin: 0;
}

.notes {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.legend-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #f8fafc;
}

.swatch {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(15 23 42 / 0.2);
  border-radius: 12px;
}

.legend-item strong,
.legend-item span {
  display: block;
}

.legend-item span {
  color: #64748b;
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .controls,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
  }
}