:root {
  color-scheme: light;
  --ink: #18252b;
  --muted: #64747b;
  --line: #d9e2e5;
  --panel: #ffffff;
  --page: #f5f7f2;
  --green: #2f9c68;
  --yellow: #d49626;
  --red: #ce4a3d;
  --teal: #357989;
  --blue: #436fbd;
  --shadow: 0 10px 28px rgba(30, 49, 56, .1);
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(214, 232, 226, .9), transparent 42%),
    radial-gradient(ellipse at 88% 8%, rgba(232, 236, 220, .7), transparent 38%),
    var(--page);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 8px clamp(14px, 3vw, 32px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--teal);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.05;
}

.tabs,
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tab,
.preset,
.reset {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  border-radius: 8px;
  min-height: 32px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: .9rem;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.tab:hover,
.preset:hover,
.reset:hover {
  transform: translateY(-1px);
  border-color: #9fb4bb;
}

.tab.is-active,
.preset.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

main {
  height: calc(100dvh - var(--header-h));
  padding: 0 clamp(12px, 3vw, 32px) 12px;
  overflow: hidden;
}

.page {
  display: none;
  height: 100%;
}

.page.is-active {
  display: grid;
}

.fit-page.is-active {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 0;
}

.stage-column {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.toolbar {
  margin-bottom: 0;
}

.reset {
  margin-left: auto;
  color: var(--teal);
  font-weight: 800;
}

.adjustment-tray {
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px 11px;
  border: 1px solid rgba(35, 61, 65, .1);
  border-radius: 14px;
  background: rgba(255, 254, 250, .76);
  box-shadow: 0 8px 26px rgba(24, 43, 45, .055);
  backdrop-filter: blur(16px);
}

.adjustment-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.adjustment-heading-row h2 {
  margin: 0;
  color: #26383c;
  font-size: .82rem;
  font-weight: 750;
  letter-spacing: -.015em;
}

.baseline-label {
  color: #718084;
  font-size: .62rem;
  font-weight: 700;
  white-space: nowrap;
}

.adjustment-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 8px;
}

.fit-control {
  display: block;
  min-width: 0;
  padding: 7px 8px 6px;
  border: 1px solid rgba(35, 61, 65, .08);
  border-radius: 9px;
  background: rgba(246, 249, 245, .88);
}

.fit-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.fit-control strong,
.fit-control output {
  font-size: .57rem;
  line-height: 1;
  white-space: nowrap;
}

.fit-control strong {
  overflow: hidden;
  color: #42565a;
  font-weight: 750;
  text-overflow: ellipsis;
}

.fit-control output {
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.fit-control input[type="range"] {
  display: block;
  width: 100%;
  height: 12px;
  margin: 0;
  accent-color: var(--teal);
  cursor: ew-resize;
}

.fit-control:focus-within {
  border-color: rgba(29, 111, 114, .3);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 111, 114, .07);
}

.fit-stage,
.insight-panel,
.benefits-hero,
.benefit-grid article,
.compare-band {
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.fit-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.stage-copy {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px 0;
}

.stage-copy h2 {
  margin-bottom: 0;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
}

.stage-copy p {
  max-width: 320px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.fit-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 21% 18%, rgba(255, 255, 255, .96), transparent 28%),
    radial-gradient(circle at 70% 36%, rgba(230, 239, 224, .85), transparent 34%),
    linear-gradient(180deg, #edf7f5 0%, #fbfbf5 62%, #e8efe9 100%);
  touch-action: none;
}

.fit-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  max-width: calc(100% - 24px);
  border: 1px solid rgba(120, 152, 161, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: #38515a;
  font-size: .74rem;
  font-weight: 800;
  padding: 6px 10px;
  pointer-events: none;
}

.insight-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0;
  min-height: 0;
  padding: 12px 14px;
  overflow: hidden;
}

.score-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.score-row h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.score-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(47, 156, 104, .13);
  flex: 0 0 auto;
}

.score-dot.yellow {
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(212, 150, 38, .14);
}

.score-dot.red {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(206, 74, 61, .14);
}

.tuner {
  position: relative;
  height: 24px;
  margin: 8px 0 6px;
}

.tuner-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #9bbc5d 38%, var(--yellow) 64%, var(--red));
}

.tuner-needle {
  position: absolute;
  top: 1px;
  left: 20%;
  width: 6px;
  height: 22px;
  border-radius: 999px;
  background: #18252b;
  box-shadow: 0 3px 8px rgba(24, 37, 43, .25);
  transform: translateX(-50%);
  transition: left .2s ease, background .2s ease;
}

.tuner-needle.yellow {
  background: #8f5e06;
}

.tuner-needle.red {
  background: var(--red);
}

.insight-block {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
  min-height: 0;
}

.insight-block h3 {
  margin-bottom: 6px;
  font-size: .88rem;
}

#signal-list {
  display: grid;
  gap: 5px;
  padding-left: 0;
  margin: 0;
  color: #34474e;
  line-height: 1.3;
  list-style: none;
  max-height: 7.5rem;
  overflow: auto;
}

#signal-list li {
  margin: 0;
}

.signal-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfa;
  color: #34474e;
  cursor: pointer;
  padding: 6px 8px;
  text-align: left;
  font-size: .78rem;
  line-height: 1.3;
}

.signal-button:hover,
.signal-button:focus,
.signal-button.is-active {
  border-color: #93adb6;
  background: #edf7f5;
  outline: none;
}

.signal-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.signal-detail h3 {
  margin-bottom: 4px;
  font-size: .95rem;
}

.signal-detail h4 {
  margin: 8px 0 4px;
  font-size: .78rem;
}

.signal-detail p,
.signal-detail li {
  color: #34474e;
  font-size: .78rem;
  line-height: 1.35;
}

#detail-summary {
  margin-bottom: 0;
}

.signal-detail ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.contact-tag {
  border: 1px solid #bdd0d6;
  border-radius: 999px;
  background: #f7fbfb;
  color: #244750;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 8px;
}

.contact-tag:hover,
.contact-tag:focus {
  border-color: var(--teal);
  background: #e4f1ee;
  outline: none;
}

.detail-note {
  margin: 8px 0 0;
  padding: 8px;
  border-left: 3px solid var(--teal);
  background: #f7fbfb;
  border-radius: 0 6px 6px 0;
  font-size: .74rem !important;
}

.experiment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(29, 111, 114, .14);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(232, 244, 238, .9), rgba(246, 248, 241, .92));
}

.experiment-card .eyebrow { margin-bottom: 2px; }

.experiment-card h4 {
  margin: 0 0 3px;
  color: #243f41;
  font-size: .78rem;
}

.experiment-card p:not(.eyebrow) {
  margin: 0;
  color: #53686b;
  font-size: .68rem;
  line-height: 1.4;
}

.experiment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.experiment-actions button {
  border: 1px solid rgba(29, 111, 114, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  color: #285456;
  cursor: pointer;
  font-size: .62rem;
  font-weight: 800;
  padding: 5px 8px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.experiment-actions button:hover,
.experiment-actions button:focus {
  border-color: var(--teal);
  background: #fff;
  outline: none;
  transform: translateY(-1px);
}

.panel-footer {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.angle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 0;
}

.angle-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 6px;
  background: #f9fbfa;
  text-align: center;
}

.angle-grid span {
  display: block;
  font-size: 1rem;
  font-weight: 900;
}

.angle-grid p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.15;
}

.angle-grid small {
  display: block;
  min-height: 1.9em;
  margin-top: 3px;
  color: #718084;
  font-size: .55rem;
  font-weight: 700;
  line-height: 1.12;
}

.angle-help {
  margin: 7px 0 0;
  color: #53676b;
  font-size: .64rem;
  line-height: 1.35;
}

.disclaimer {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
}

.benefits-page.is-active {
  gap: 14px;
  align-content: start;
  overflow: auto;
  padding-bottom: 8px;
}

.benefits-hero {
  min-height: 200px;
  padding: clamp(22px, 4vw, 48px);
  background:
    linear-gradient(90deg, rgba(14, 30, 34, .84), rgba(14, 30, 34, .36)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520' viewBox='0 0 1200 520'%3E%3Crect width='1200' height='520' fill='%23dceee7'/%3E%3Ccircle cx='210' cy='360' r='96' fill='none' stroke='%233a5f68' stroke-width='16'/%3E%3Ccircle cx='650' cy='360' r='96' fill='none' stroke='%233a5f68' stroke-width='16'/%3E%3Cpath d='M210 360 L405 360 L330 235 L525 235 L650 360 L405 360 L525 235' fill='none' stroke='%231d3036' stroke-width='18' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M347 189 C393 128 470 118 542 152' fill='none' stroke='%23ca6f47' stroke-width='28' stroke-linecap='round'/%3E%3Cpath d='M542 152 L602 230 L670 214' fill='none' stroke='%23ca6f47' stroke-width='24' stroke-linecap='round'/%3E%3Ccircle cx='323' cy='164' r='30' fill='%23ca6f47'/%3E%3Cpath d='M430 254 L405 360 L506 360' fill='none' stroke='%23ca6f47' stroke-width='24' stroke-linecap='round'/%3E%3Cpath d='M430 254 L338 360 L266 360' fill='none' stroke='%23ca6f47' stroke-width='22' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.benefits-hero h2 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
}

.benefits-hero p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255, 255, 255, .86);
  font-size: 1.02rem;
  line-height: 1.5;
}

.benefits-hero .eyebrow {
  color: #9ee4d8;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.benefit-grid article,
.compare-band {
  padding: 18px;
}

.benefit-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e4f1ee;
  color: var(--teal);
  font-weight: 900;
  margin-bottom: 10px;
}

.benefit-grid h3,
.compare-band h3 {
  margin-bottom: 6px;
}

.benefit-grid p,
.compare-row p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.compare-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.compare-row strong {
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  main {
    height: auto;
    min-height: calc(100dvh - var(--header-h));
    overflow: visible;
    padding-bottom: 20px;
  }

  .app-header {
    align-items: start;
    flex-direction: column;
    height: auto;
    padding-block: 12px;
  }

  .fit-page.is-active {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }

  .stage-column {
    grid-template-rows: auto auto auto;
  }

  .adjustment-grid {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    padding-bottom: 3px;
  }

  .adjustment-grid .fit-control {
    flex: 0 0 170px;
  }

  .fit-stage {
    min-height: 420px;
  }

  .fit-scene {
    height: 420px;
    min-height: 380px;
  }

  .insight-panel {
    display: block;
    overflow: visible;
  }

  #signal-list {
    max-height: none;
  }

  .signal-detail {
    overflow: visible;
  }

  .detail-columns {
    grid-template-columns: 1fr;
  }

  .benefit-grid,
  .compare-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  main {
    padding-inline: 10px;
  }

  .app-header {
    padding-inline: 14px;
  }

  .tab,
  .preset,
  .reset {
    flex: 1 1 auto;
    min-width: 108px;
  }

  .reset {
    margin-left: 0;
  }

  .stage-copy {
    display: block;
    padding: 12px 12px 0;
  }

  .stage-copy h2 {
    margin-bottom: 6px;
  }

  .fit-scene {
    height: 360px;
    min-height: 320px;
  }

  .scene-hint {
    font-size: .7rem;
    border-radius: 8px;
  }

  .benefit-grid,
  .compare-row,
  .angle-grid {
    grid-template-columns: 1fr;
  }

  .benefits-hero {
    min-height: 280px;
  }
}

/* Refined studio theme */
:root {
  --ink: #172126;
  --muted: #66777c;
  --line: rgba(35, 61, 65, .12);
  --panel: #fffefa;
  --page: #eef1eb;
  --green: #32a875;
  --yellow: #dda43f;
  --red: #d75e4e;
  --teal: #1d6f72;
  --blue: #356cc8;
  --shadow: 0 22px 55px rgba(24, 43, 45, .09), 0 2px 8px rgba(24, 43, 45, .04);
  --header-h: 78px;
}

body {
  background:
    radial-gradient(circle at 8% -10%, rgba(177, 211, 197, .46), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(239, 215, 172, .26), transparent 30%),
    linear-gradient(145deg, #f4f5ef 0%, #e9eee9 100%);
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", sans-serif;
}

.app-header {
  padding-inline: clamp(18px, 3.2vw, 42px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(29, 111, 114, .2);
  border-radius: 11px;
  background: rgba(255, 255, 255, .62);
  box-shadow: inset 0 1px 0 #fff, 0 5px 16px rgba(32, 72, 71, .08);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--teal);
  border-radius: 50%;
}

.brand-mark::before { left: 5px; }
.brand-mark::after { right: 5px; }

.brand-mark span:first-child {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 15px;
  height: 10px;
  border-left: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: skewX(-28deg);
}

.brand-mark span:last-child {
  position: absolute;
  left: 15px;
  top: 8px;
  width: 7px;
  border-top: 2px solid #d07d4f;
  transform: rotate(-8deg);
}

.eyebrow {
  color: var(--teal);
  font-size: .62rem;
  letter-spacing: .14em;
}

h1 {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 750;
  letter-spacing: -.035em;
}

.tabs {
  padding: 4px;
  border: 1px solid rgba(35, 61, 65, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  backdrop-filter: blur(14px);
}

.tab,
.preset,
.reset {
  border-color: transparent;
  background: transparent;
  border-radius: 9px;
  color: #4f6064;
  font-weight: 650;
  transition: transform .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}

.tab {
  padding-inline: 14px;
}

.tab.is-active {
  border-color: transparent;
  background: #1d2b30;
  box-shadow: 0 5px 14px rgba(23, 33, 38, .16);
}

main {
  padding: 0 clamp(18px, 3.2vw, 42px) 20px;
}

.fit-page.is-active {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 365px);
  gap: 16px;
}

.stage-column {
  gap: 10px;
}

.toolbar {
  padding: 3px;
  border: 1px solid rgba(35, 61, 65, .1);
  border-radius: 11px;
  background: rgba(255, 255, 255, .48);
  width: max-content;
  max-width: 100%;
}

.preset,
.reset {
  min-height: 34px;
  padding-inline: 12px;
  font-size: .78rem;
}

.preset.is-active {
  background: #fff;
  border-color: rgba(35, 61, 65, .08);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(23, 45, 45, .08);
}

.reset {
  margin-left: 10px;
  color: var(--teal);
}

.fit-stage,
.insight-panel,
.benefits-hero,
.benefit-grid article,
.compare-band {
  border-color: rgba(35, 61, 65, .1);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.fit-stage {
  position: relative;
  background: #f9faf5;
}

.stage-copy {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  align-items: flex-start;
  padding: 22px 112px 22px 24px;
  pointer-events: none;
}

.stage-copy h2 {
  max-width: 480px;
  margin: 3px 0 0;
  color: #17272b;
  font-size: clamp(1.35rem, 2.25vw, 2.15rem);
  font-weight: 720;
  letter-spacing: -.04em;
  line-height: 1.04;
}

.stage-copy > p {
  max-width: 275px;
  padding-top: 7px;
  color: #63767a;
  font-size: .75rem;
  line-height: 1.5;
}

.stage-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--teal);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.stage-kicker span {
  width: 15px;
  height: 1px;
  background: var(--teal);
}

.fit-stage {
  display: block;
}

.fit-scene {
  isolation: isolate;
  background:
    radial-gradient(circle at 58% 47%, rgba(255, 255, 255, .94) 0%, rgba(241, 247, 240, .68) 36%, transparent 61%),
    linear-gradient(145deg, #eef5ef 0%, #f7f5ea 100%);
  transition: filter .24s ease, opacity .24s ease;
}

.fit-scene::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 83, 79, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 83, 79, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 100%);
  pointer-events: none;
}

.fit-scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  box-shadow: inset 0 0 90px rgba(58, 89, 80, .08);
  pointer-events: none;
}

.fit-scene canvas {
  position: relative;
  z-index: 1;
  cursor: grab;
  filter: saturate(.96) contrast(1.02);
}

.fit-scene.is-dragging canvas { cursor: grabbing; }

.scene-status {
  position: absolute;
  z-index: 3;
  top: 102px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #53706e;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(50, 168, 117, .12);
  animation: status-pulse 2.8s ease-out infinite;
}

@keyframes status-pulse {
  0%, 45% { box-shadow: 0 0 0 0 rgba(50, 168, 117, .28); }
  75%, 100% { box-shadow: 0 0 0 7px rgba(50, 168, 117, 0); }
}

.view-controls {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 7px;
}

.view-controls button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid rgba(38, 73, 75, .13);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  color: #315c5d;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(32, 58, 57, .08);
  backdrop-filter: blur(12px);
  transition: transform .2s ease, background .2s ease;
}

.view-controls button:hover {
  transform: translateY(-2px);
  background: #fff;
}

.view-controls button[aria-pressed="true"] {
  border-color: rgba(29, 111, 114, .22);
  background: #1d6f72;
  color: #fff;
  box-shadow: 0 7px 18px rgba(29, 111, 114, .22);
}

.view-controls svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.view-controls .play-icon {
  fill: currentColor;
  stroke: none;
}

.view-controls .pause-icon { display: none; }
.view-controls button[aria-pressed="true"] .play-icon { display: none; }
.view-controls button[aria-pressed="true"] .pause-icon { display: block; }

.scene-hint {
  left: 50%;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-color: rgba(38, 73, 75, .12);
  background: rgba(255, 255, 255, .76);
  color: #6c7d80;
  font-size: .65rem;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(30, 59, 57, .08);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.scene-hint strong { color: #2e5152; }

.mouse-icon {
  position: relative;
  width: 13px;
  height: 18px;
  border: 1.5px solid #507071;
  border-radius: 7px;
  flex: 0 0 auto;
}

.mouse-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 1px;
  height: 4px;
  background: #507071;
}

.insight-panel {
  padding: 18px 18px 14px;
  background: rgba(255, 254, 250, .9);
  backdrop-filter: blur(18px);
}

.score-row {
  gap: 13px;
}

.score-row h2 {
  font-size: 1.15rem;
  font-weight: 720;
  letter-spacing: -.025em;
}

.score-orbit {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(47, 156, 104, .15);
  border-radius: 50%;
  background: rgba(47, 156, 104, .07);
  flex: 0 0 auto;
}

.score-dot {
  width: 10px;
  height: 10px;
  box-shadow: none;
}

.score-dot.yellow,
.score-dot.red { box-shadow: none; }

.tuner {
  height: 28px;
  margin: 11px 0 8px;
}

.tuner-track {
  top: 11px;
  height: 5px;
  opacity: .84;
}

.tuner-needle {
  top: 2px;
  width: 3px;
  height: 23px;
}

.insight-block {
  border-color: rgba(35, 61, 65, .1);
  padding-top: 11px;
  margin-top: 9px;
}

.insight-block h3 {
  color: #293a3f;
  font-size: .78rem;
  letter-spacing: .02em;
}

.signal-prompt {
  margin: -2px 0 7px;
  color: #748387;
  font-size: .64rem;
  line-height: 1.3;
}

#signal-list { gap: 6px; }

.signal-button {
  position: relative;
  border-color: rgba(35, 61, 65, .09);
  border-radius: 9px;
  background: rgba(246, 249, 245, .82);
  color: #475b60;
  padding: 8px 10px 8px 13px;
  font-size: .72rem;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.signal-button::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.signal-button:hover { transform: translateX(2px); }

.signal-button.is-active {
  border-color: rgba(29, 111, 114, .23);
  background: #edf5f1;
  color: #213c3f;
}

.signal-button.is-active::before { background: var(--teal); }

.signal-detail h3 {
  font-size: 1.1rem;
  letter-spacing: -.02em;
}

.signal-detail h4 {
  color: #304448;
  font-size: .71rem;
  letter-spacing: .02em;
}

.signal-detail p,
.signal-detail li {
  color: #617176;
  font-size: .72rem;
  line-height: 1.48;
}

.contact-tag {
  border-color: rgba(29, 111, 114, .16);
  background: #f2f7f4;
  color: #315557;
  font-size: .66rem;
  letter-spacing: .01em;
}

.detail-note {
  border-left-width: 2px;
  background: #f1f6f3;
  color: #40575b !important;
}

.angle-grid div {
  border-color: rgba(35, 61, 65, .08);
  border-radius: 9px;
  background: #f5f7f2;
}

.angle-grid span {
  color: #263b3e;
  font-variant-numeric: tabular-nums;
}

.disclaimer { font-size: .64rem; }

.benefits-page.is-active { gap: 16px; }

.benefits-hero {
  min-height: 255px;
  overflow: hidden;
  border: none;
  background:
    linear-gradient(95deg, rgba(14, 37, 39, .92) 0%, rgba(14, 37, 39, .67) 53%, rgba(14, 37, 39, .16) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='520' viewBox='0 0 1200 520'%3E%3Crect width='1200' height='520' fill='%23cfe3d9'/%3E%3Ccircle cx='210' cy='360' r='96' fill='none' stroke='%233a5f68' stroke-width='16'/%3E%3Ccircle cx='650' cy='360' r='96' fill='none' stroke='%233a5f68' stroke-width='16'/%3E%3Cpath d='M210 360 L405 360 L330 235 L525 235 L650 360 L405 360 L525 235' fill='none' stroke='%231d3036' stroke-width='18' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M347 189 C393 128 470 118 542 152' fill='none' stroke='%23ca6f47' stroke-width='28' stroke-linecap='round'/%3E%3Cpath d='M542 152 L602 230 L670 214' fill='none' stroke='%23ca6f47' stroke-width='24' stroke-linecap='round'/%3E%3Ccircle cx='323' cy='164' r='30' fill='%23ca6f47'/%3E%3Cpath d='M430 254 L405 360 L506 360' fill='none' stroke='%23ca6f47' stroke-width='24' stroke-linecap='round'/%3E%3Cpath d='M430 254 L338 360 L266 360' fill='none' stroke='%23ca6f47' stroke-width='22' stroke-linecap='round'/%3E%3C/svg%3E");
}

.benefits-hero h2 {
  letter-spacing: -.045em;
}

.benefit-grid article,
.compare-band {
  background: rgba(255, 254, 250, .86);
}

.benefit-grid article {
  transition: transform .22s ease, box-shadow .22s ease;
}

.benefit-grid article:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(24, 43, 45, .1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 980px) {
  :root { --header-h: 76px; }

  .fit-page.is-active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    height: auto;
  }

  .stage-column {
    grid-template-rows: auto auto;
  }

  .insight-panel {
    display: block;
    min-width: 0;
    overflow: visible;
  }

  .fit-stage { min-height: 540px; }
  .fit-scene { height: 540px; }
  .toolbar { width: 100%; }
}

@media (max-width: 640px) {
  main { padding-inline: 10px; }
  .app-header { padding-inline: 14px; }
  .brand-mark { display: none; }
  .tabs { width: 100%; }
  .toolbar { padding: 4px; }
  .adjustment-tray { padding: 10px; }
  .adjustment-heading-row { align-items: start; }
  .baseline-label { padding-top: 2px; }
  .preset, .reset { min-width: 92px; }
  .fit-stage { min-height: 465px; }
  .fit-scene { height: 465px; min-height: 420px; }
  .stage-copy { display: block; padding: 18px 98px 18px 18px; }
  .stage-copy > p { max-width: 265px; padding-top: 7px; }
  .scene-status { top: 188px; left: 18px; }
  .view-controls { top: 16px; right: 16px; }
  .scene-hint span:last-child { white-space: nowrap; }
  .insight-panel { padding: 16px; }
}

/* Desktop information dock */
@media (min-width: 981px) {
  .fit-page.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(295px, 340px);
    grid-template-rows: minmax(0, 1fr) 205px;
    gap: 14px;
  }

  .stage-column {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .insight-panel {
    grid-column: 2;
    grid-row: 1;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 16px;
  }

  .insight-panel .insight-block {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .insight-panel #signal-list {
    flex: 1 1 auto;
    max-height: none;
  }

  .detail-dock {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(210px, .9fr) minmax(310px, 1.3fr) minmax(220px, .9fr) minmax(215px, .85fr);
    gap: 12px;
    min-height: 0;
    padding: 13px 14px;
    overflow: hidden;
    border: 1px solid rgba(35, 61, 65, .1);
    border-radius: 16px;
    background: rgba(255, 254, 250, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .detail-dock .signal-detail,
  .detail-dock .dock-actions {
    display: contents;
  }

  .detail-overview,
  .detail-evidence,
  .detail-dock .experiment-card,
  .detail-dock .panel-footer {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .detail-overview,
  .detail-evidence {
    padding-right: 10px;
    border-right: 1px solid rgba(35, 61, 65, .09);
  }

  .detail-overview h3 {
    margin: 1px 0 4px;
    color: #263b3e;
    font-size: 1rem;
  }

  .detail-overview .detail-note {
    display: none;
  }

  .detail-evidence .detail-columns {
    margin-top: 0;
    gap: 8px;
  }

  .detail-dock .signal-detail p,
  .detail-dock .signal-detail li {
    font-size: .65rem;
    line-height: 1.32;
  }

  .detail-dock .signal-detail ul {
    gap: 1px;
  }

  .detail-dock .signal-detail h4 {
    margin: 4px 0 3px;
    font-size: .68rem;
  }

  .detail-evidence h4:first-child {
    margin-top: 0;
  }

  .detail-dock .experiment-card {
    align-self: stretch;
    margin: 0;
    padding: 10px;
  }

  .detail-dock .panel-footer {
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  .detail-dock .angle-grid {
    gap: 4px;
  }

  .detail-dock .angle-grid div {
    padding: 5px 3px;
  }

  .detail-dock .angle-help {
    margin-top: 6px;
  }

  .detail-dock .disclaimer {
    margin-top: 5px;
    font-size: .57rem;
  }

  .fit-stage .stage-copy h2 {
    font-size: clamp(1.25rem, 1.7vw, 1.75rem);
  }

  .fit-stage .scene-status {
    top: 88px;
  }
}

@media (max-width: 980px) {
  .stage-column {
    grid-template-rows: auto auto auto;
  }

  .detail-dock {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(35, 61, 65, .1);
    border-radius: 16px;
    background: rgba(255, 254, 250, .9);
    box-shadow: var(--shadow);
  }

  .detail-dock .signal-detail {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 14px;
    overflow: visible;
  }

  .detail-dock .dock-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr);
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .detail-dock .signal-detail,
  .detail-dock .dock-actions {
    display: block;
  }

  .detail-dock .experiment-card,
  .detail-dock .panel-footer {
    margin-top: 12px;
  }
}

/* Unified fit controls and posture signal */
.fit-top-area {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.fit-control-band {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.score-card {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid rgba(35, 61, 65, .1);
  border-radius: 14px;
  background: rgba(255, 254, 250, .82);
  box-shadow: 0 8px 26px rgba(24, 43, 45, .055);
  backdrop-filter: blur(16px);
}

.score-card .tuner {
  margin-bottom: 0;
}

.insight-panel > .insight-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

@media (min-width: 981px) {
  .fit-page.is-active {
    grid-template-rows: auto minmax(0, 1fr) 205px;
  }

  .fit-top-area {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .fit-control-band {
    grid-template-columns: minmax(0, 1fr) minmax(295px, 340px);
    gap: 14px;
    align-items: stretch;
  }

  .fit-control-band .adjustment-tray,
  .fit-control-band .score-card {
    height: 100%;
  }

  .score-card {
    display: grid;
    align-content: center;
    padding-inline: 16px;
  }

  .stage-column {
    grid-column: 1;
    grid-row: 2;
    grid-template-rows: minmax(0, 1fr);
  }

  .insight-panel {
    grid-column: 2;
    grid-row: 2;
    display: block;
  }

  .detail-dock {
    grid-row: 3;
  }
}

@media (max-width: 980px) {
  .fit-control-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-column {
    grid-template-rows: minmax(0, 1fr);
  }
}
