/* ---------------------------------------------------------------------------
   components.css — the clay component kit.

   Everything here is real DOM: gradients, layered shadows, inset highlights
   and rounded geometry do the modelling. No WebGL is used for interface text
   or controls.
   --------------------------------------------------------------------------- */

/* ===== Typography ========================================================= */

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss-700);
}

.title-hero {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--moss-900);
}

.title-screen {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--moss-900);
}

.title-section {
  font-size: var(--text-md);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--moss-900);
}

.body-text {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-muted);
}

.body-text strong {
  color: var(--moss-900);
  font-weight: 800;
}

.caption {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

.numeric {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ===== Buttons ============================================================ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--moss-900);
  background: linear-gradient(180deg, var(--cream-raised), var(--cream-deep));
  box-shadow: var(--shadow-raised);
  transition:
    transform var(--spring-duration) var(--spring-ease),
    box-shadow var(--spring-duration) var(--ease-out),
    filter 160ms var(--ease-out);
  user-select: none;
  touch-action: manipulation;
}

.btn::after {
  /* Clay top-light: a soft sheen sitting just inside the top edge. */
  content: '';
  position: absolute;
  inset: 3px 6px auto 6px;
  height: 42%;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.btn:hover {
  filter: brightness(1.02);
}

.btn:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: var(--shadow-pressed);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}

.btn--primary {
  color: #4a2a13;
  background: linear-gradient(180deg, #f7bd8f 0%, var(--peach) 55%, var(--peach-deep) 100%);
  box-shadow:
    0 2px 3px rgba(150, 84, 40, 0.25),
    0 16px 28px -10px rgba(180, 100, 50, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(150, 84, 40, 0.22);
}

.btn--moss {
  color: #f4f8e9;
  background: linear-gradient(180deg, #94b062 0%, var(--moss-500) 52%, var(--moss-700) 100%);
  box-shadow:
    0 2px 3px rgba(41, 69, 44, 0.24),
    0 16px 28px -10px rgba(56, 84, 40, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -3px 0 rgba(41, 69, 44, 0.24);
}

.btn--lavender {
  color: #fbf7ff;
  background: linear-gradient(180deg, #c4a4f0 0%, var(--lavender) 52%, var(--lavender-deep) 100%);
  box-shadow:
    0 2px 3px rgba(74, 49, 105, 0.24),
    0 16px 28px -10px rgba(112, 76, 168, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -3px 0 rgba(74, 49, 105, 0.24);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--lg {
  min-height: 58px;
  font-size: var(--text-lg);
  padding-inline: var(--space-6);
}

.btn__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

/* Round, icon-only clay button. */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--cream-raised), var(--cream-deep));
  box-shadow: var(--shadow-raised);
  transition:
    transform var(--spring-duration) var(--spring-ease),
    box-shadow var(--spring-duration) var(--ease-out);
  touch-action: manipulation;
}

.icon-btn::after {
  content: '';
  position: absolute;
  inset: 3px 5px auto 5px;
  height: 40%;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.icon-btn:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: var(--shadow-pressed);
}

.icon-btn > img,
.icon-btn > svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.icon-btn--lg {
  width: 56px;
  height: 56px;
}

.icon-btn--lg > img,
.icon-btn--lg > svg {
  width: 30px;
  height: 30px;
}

.icon-btn--flush {
  background: transparent;
  box-shadow: none;
}

.icon-btn--lg.icon-btn--flush > img,
.icon-btn--lg.icon-btn--flush > svg {
  width: 40px;
  height: 40px;
}

.icon-btn--flush::after {
  display: none;
}

/* Notification dot on the bell. */
.icon-btn__dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 2.5px var(--cream-raised);
  z-index: 2;
}

/* Heart toggle: outline when off, filled clay red when on. */
.heart-btn[aria-pressed='true'] {
  background: linear-gradient(180deg, #ffd9d1, #f6a596);
  box-shadow:
    0 2px 3px rgba(150, 60, 48, 0.2),
    0 10px 18px -8px rgba(190, 80, 65, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.heart-btn .heart-fill {
  fill: transparent;
  transition: fill var(--spring-duration) var(--ease-out);
}

.heart-btn[aria-pressed='true'] .heart-fill {
  fill: #ef6250;
}

/* ===== Cards ============================================================== */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--cream-raised) 0%, #fdf2df 100%);
  box-shadow: var(--shadow-soft);
  padding: var(--space-5);
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain);
  background-size: var(--grain-size) var(--grain-size);
  opacity: 0.1;
  mix-blend-mode: multiply;
}

.card > * {
  position: relative;
}

.card--tight {
  padding: var(--space-4);
}

.card--flat {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 4px 14px rgba(58, 68, 44, 0.07);
}

.card--sunk {
  background: linear-gradient(180deg, #f2e7d3, #f8f0e0);
  box-shadow: var(--shadow-sunk);
}

.card--moss {
  background: linear-gradient(165deg, #e9f0d9 0%, #dbe7c3 100%);
}

.card--lavender {
  background: linear-gradient(165deg, #f0e8fc 0%, #e2d5f6 100%);
}

/* A tappable card keeps the whole surface as the hit target. */
.card--action {
  display: block;
  width: 100%;
  text-align: left;
  transition:
    transform var(--spring-duration) var(--spring-ease),
    box-shadow var(--spring-duration) var(--ease-out);
}

.card--action:active {
  transform: scale(0.982) translateY(1px);
  box-shadow:
    0 4px 12px rgba(58, 68, 44, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ===== Chips ============================================================== */

.chip-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: var(--space-2) var(--space-3);
  scroll-padding-inline: var(--app-gutter);
}

.chip-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--moss-900);
  background: linear-gradient(180deg, var(--cream-raised), #f3e8d4);
  box-shadow:
    0 4px 12px rgba(58, 68, 44, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  white-space: nowrap;
  transition:
    transform var(--spring-duration) var(--spring-ease),
    box-shadow var(--spring-duration) var(--ease-out),
    background var(--spring-duration) var(--ease-out),
    color var(--spring-duration) var(--ease-out);
  touch-action: manipulation;
}

.chip > img {
  width: 19px;
  height: 19px;
}

.chip:active {
  transform: scale(0.96);
}

.chip[aria-pressed='true'] {
  color: #f6faee;
  background: linear-gradient(180deg, #93af61, var(--moss-700));
  box-shadow:
    0 2px 3px rgba(41, 69, 44, 0.2),
    0 10px 18px -8px rgba(56, 84, 40, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chip[aria-pressed='true'] > img {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Small static label chips (used inside cards). */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--moss-700);
  background: rgba(183, 201, 144, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tag--lavender {
  color: var(--lavender-ink);
  background: rgba(222, 208, 245, 0.75);
}

.tag--peach {
  color: #8c4a1d;
  background: rgba(251, 224, 203, 0.9);
}

.tag--sky {
  color: #2b5f72;
  background: rgba(207, 230, 239, 0.85);
}

/* ===== Progress =========================================================== */

.progress {
  position: relative;
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #e6d9c1, #f0e5d1);
  box-shadow: var(--shadow-sunk);
  overflow: hidden;
}

.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #a4bf72 0%, var(--moss-500) 60%, var(--moss-700) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: width 520ms var(--ease-out);
}

.progress--lavender .progress__fill {
  background: linear-gradient(180deg, #c9aef2 0%, var(--lavender) 60%, var(--lavender-deep) 100%);
}

.progress--peach .progress__fill {
  background: linear-gradient(180deg, #f8c69d 0%, var(--peach) 60%, var(--peach-deep) 100%);
}

.progress--sm {
  height: 9px;
}

/* Circular streak ring. */
.ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
}

.ring__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring__track {
  fill: none;
  stroke: #e8dbc3;
  stroke-width: 9;
}

.ring__value {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 700ms var(--ease-out);
}

.ring__center {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0;
  text-align: center;
  line-height: 1;
}

.ring__number {
  font-size: 25px;
  font-weight: 900;
  color: var(--moss-900);
  letter-spacing: -0.03em;
}

.ring__label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ===== Lesson rows ======================================================== */

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.lesson-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  /* No block padding on the row: the primary control supplies it, so its hit
     area is the full height of the row rather than an inset band. */
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--cream-raised), #fbf0dc);
  box-shadow:
    0 5px 14px rgba(58, 68, 44, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition:
    transform var(--spring-duration) var(--spring-ease),
    box-shadow var(--spring-duration) var(--ease-out);
}

/* The primary control fills the row; its hit area is stretched over the whole
   surface so the row reads as one tap target, while secondary actions stay
   above it in the stacking order. */
.lesson-row__main {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding-block: 13px;
  align-self: stretch;
  text-align: left;
  background: none;
  touch-action: manipulation;
}

.lesson-row__main::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.lesson-row__main:focus-visible {
  outline: none;
}

.lesson-row__main:focus-visible::after {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

.lesson-row:has(.lesson-row__main:not(:disabled):active) {
  transform: scale(0.985);
  box-shadow: var(--shadow-pressed);
}

.lesson-row__main:disabled {
  cursor: not-allowed;
}

.lesson-row__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 15px;
  font-size: var(--text-base);
  font-weight: 900;
  color: var(--moss-900);
  background: linear-gradient(180deg, #f1e6d1, #e6d8bd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 3px 7px rgba(58, 68, 44, 0.12);
}

.lesson-row__badge svg {
  width: 22px;
  height: 22px;
}

.lesson-row__text {
  min-width: 0;
  flex: 1;
  padding-right: var(--space-1);
}

.lesson-row__title {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--moss-900);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-row__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-muted);
}

.lesson-row__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.lesson-row__cue {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  opacity: 0.5;
}

/* -- completed -- */
.lesson-row--complete {
  background: linear-gradient(180deg, #eef4e0, #e3ecce);
}

.lesson-row--complete .lesson-row__badge {
  color: #f4f8e9;
  background: linear-gradient(180deg, #94b062, var(--moss-700));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 7px rgba(56, 84, 40, 0.3);
}

.lesson-row--complete .lesson-row__title {
  color: var(--moss-700);
}

/* -- active -- */
.lesson-row--active {
  background: linear-gradient(180deg, #fff9ec, #fdeeda);
  box-shadow:
    0 0 0 2.5px var(--peach),
    0 10px 22px -8px rgba(180, 100, 50, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.lesson-row--active .lesson-row__badge {
  color: #4a2a13;
  background: linear-gradient(180deg, #f9c99f, var(--peach));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 3px 7px rgba(180, 100, 50, 0.32);
}

/* -- locked -- */
.lesson-row--locked {
  background: linear-gradient(180deg, #f4ece0, #ece2d2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

.lesson-row--locked .lesson-row__title,
.lesson-row--locked .lesson-row__meta {
  color: #9aa093;
}

.lesson-row--locked .lesson-row__badge {
  color: #a7ac9d;
  background: linear-gradient(180deg, #e9e0d0, #ded4c1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* An inline "explore" affordance inside a lesson row. */
.lesson-row__side {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 800;
  color: #fbf7ff;
  background: linear-gradient(180deg, #c4a4f0, var(--lavender-deep));
  box-shadow:
    0 6px 12px -5px rgba(112, 76, 168, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform var(--spring-duration) var(--spring-ease);
}

.lesson-row__side:active {
  transform: scale(0.94);
}

/* ===== Slider ============================================================= */

.slider {
  position: relative;
  padding-top: 34px;
}

.slider__input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  touch-action: pan-y;
  cursor: pointer;
}

/* Track — a sunk clay channel with a lavender fill driven by --fill. */
.slider__input::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(90deg, var(--lavender-deep) 0%, var(--lavender) var(--fill, 50%), rgba(0, 0, 0, 0) var(--fill, 50%)),
    linear-gradient(180deg, #e6d9c1, #f2e8d6);
  box-shadow: var(--shadow-sunk);
}

.slider__input::-moz-range-track {
  height: 14px;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(90deg, var(--lavender-deep) 0%, var(--lavender) var(--fill, 50%), rgba(0, 0, 0, 0) var(--fill, 50%)),
    linear-gradient(180deg, #e6d9c1, #f2e8d6);
  box-shadow: var(--shadow-sunk);
}

.slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -8px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fffaf0 0%, #f0e2c9 100%);
  box-shadow:
    0 2px 3px rgba(58, 68, 44, 0.2),
    0 8px 16px -5px rgba(58, 68, 44, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -2px 0 rgba(150, 130, 100, 0.2);
  transition: transform var(--spring-duration) var(--spring-ease);
}

.slider__input::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #fffaf0 0%, #f0e2c9 100%);
  box-shadow:
    0 2px 3px rgba(58, 68, 44, 0.2),
    0 8px 16px -5px rgba(58, 68, 44, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.slider__input:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

/* The value bubble that tracks the thumb. */
.slider__bubble {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 900;
  color: #fbf7ff;
  background: linear-gradient(180deg, #c4a4f0, var(--lavender-deep));
  box-shadow:
    0 6px 14px -6px rgba(112, 76, 168, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  pointer-events: none;
}

.slider__bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
  background: var(--lavender-deep);
}

.slider__scale {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink-muted);
}

/* ===== Bottom navigation ================================================== */

.bottom-nav {
  position: absolute;
  z-index: 30;
  left: calc(var(--space-3) + var(--safe-left));
  right: calc(var(--space-3) + var(--safe-right));
  bottom: calc(var(--space-3) + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  gap: 2px;
  height: var(--nav-height);
  padding: 6px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.97), rgba(246, 236, 218, 0.97));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.7) inset,
    0 12px 26px -10px rgba(58, 68, 44, 0.45),
    0 2px 4px rgba(58, 68, 44, 0.08);
}

.bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 44px;
  border-radius: var(--radius-lg);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  text-decoration: none;
  transition:
    background var(--spring-duration) var(--ease-out),
    color var(--spring-duration) var(--ease-out),
    transform var(--spring-duration) var(--spring-ease);
}

.bottom-nav__item img {
  width: 26px;
  height: 26px;
  transition: transform var(--spring-duration) var(--spring-ease), filter 200ms var(--ease-out);
  filter: grayscale(0.55) opacity(0.62);
}

.bottom-nav__item:active {
  transform: scale(0.94);
}

.bottom-nav__item[aria-current='page'] {
  color: var(--moss-900);
  background: linear-gradient(180deg, #e7efd7, #dae6c1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 4px 10px -4px rgba(56, 84, 40, 0.35);
}

.bottom-nav__item[aria-current='page'] img {
  filter: none;
  transform: translateY(-1px) scale(1.06);
}

/* ===== Floating dock (screen-specific controls above the nav) ============= */

.dock {
  position: absolute;
  z-index: 25;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-4) + 6px);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(244, 233, 214, 0.96));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    0 10px 24px -10px rgba(58, 68, 44, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* ===== Sticky action bar ================================================== */

.action-bar {
  position: absolute;
  z-index: 25;
  left: calc(var(--app-gutter) + var(--safe-left));
  right: calc(var(--app-gutter) + var(--safe-right));
  bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--space-4) + 6px);
}

/* ===== Screen header ====================================================== */

.screen-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-inline: calc(var(--app-gutter) + var(--safe-left)) calc(var(--app-gutter) + var(--safe-right));
  padding-top: calc(var(--safe-top) + var(--space-3));
  padding-bottom: var(--space-2);
  flex: 0 0 auto;
}

.screen-header__title {
  flex: 1;
  text-align: center;
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--moss-900);
  letter-spacing: -0.01em;
}

/* ===== Scene frame ======================================================== */

.scene {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.scene__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

/* Shown only when WebGL is unavailable or a model fails to load. */
.scene__fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: var(--space-4);
  text-align: center;
}

.scene--fallback .scene__fallback {
  display: grid;
}

.scene--fallback .scene__canvas {
  visibility: hidden;
}

.scene__fallback-art {
  width: 128px;
  height: 128px;
  margin: 0 auto var(--space-3);
}

/* Contact shadow beneath a diorama, drawn in CSS so it costs nothing. */
.scene__contact {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 62%;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(58, 68, 44, 0.26), rgba(58, 68, 44, 0));
  pointer-events: none;
}

/* ===== Floating label over a scene ======================================== */

.scene-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--moss-900);
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(246, 236, 218, 0.94));
  box-shadow:
    0 8px 18px -8px rgba(58, 68, 44, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  pointer-events: none;
  white-space: nowrap;
}

.scene-label__swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(180deg, #c4a4f0, var(--lavender-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ===== Toast ============================================================== */

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 88px);
  transform: translate(-50%, 12px);
  max-width: min(320px, calc(100vw - 48px));
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 800;
  text-align: center;
  color: var(--cream-raised);
  background: linear-gradient(180deg, #38583a, var(--moss-900));
  box-shadow: 0 14px 28px -12px rgba(41, 69, 44, 0.8);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms var(--ease-out),
    transform 320ms var(--spring-ease);
}

.toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== Dialog ============================================================= */

.dialog {
  width: min(340px, calc(100vw - 40px));
  padding: var(--space-5);
  border: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--cream-raised), #fbf0dc);
  box-shadow: 0 30px 60px -20px rgba(41, 69, 44, 0.6);
  color: var(--ink);
}

.dialog::backdrop {
  background: rgba(41, 69, 44, 0.32);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.dialog__title {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--moss-900);
  margin-bottom: var(--space-2);
}

/* ===== Tooltip ============================================================ */

.tooltip-host {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 230px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  color: var(--cream-raised);
  background: var(--moss-900);
  box-shadow: 0 10px 20px -10px rgba(41, 69, 44, 0.8);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 160ms var(--ease-out),
    transform 220ms var(--spring-ease),
    visibility 0s linear 200ms;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--moss-900);
}

/* Tooltips open on hover *and* on focus, so they are never hover-only. */
.tooltip-host:hover .tooltip,
.tooltip-host:focus-within .tooltip,
.tooltip-host .tooltip--open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

/* ===== Info button ======================================================== */

.info-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -11px;
  border-radius: 50%;
  color: var(--ink-muted);
}

.info-btn svg {
  width: 22px;
  height: 22px;
}

/* ===== Divider ============================================================ */

.divider {
  height: 1px;
  border: 0;
  margin: var(--space-4) 0;
  background: linear-gradient(90deg, rgba(41, 69, 44, 0), var(--line), rgba(41, 69, 44, 0));
}
