:root {
  --ink: #f7f8ff;
  --muted: #aeb8dc;
  --paper: #070914;
  --panel: #111827;
  --panel-2: #0c1222;
  --line: rgba(255, 255, 255, 0.14);
  --teal: #16f2d0;
  --teal-dark: #049b8d;
  --coral: #ff5c8a;
  --gold: #ffd166;
  --green: #7cff6b;
  --rose: #ff4fd8;
  --blue: #3ba7ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 5%, rgba(22, 242, 208, 0.23), transparent 29%),
    radial-gradient(circle at 86% 12%, rgba(255, 79, 216, 0.17), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(59, 167, 255, 0.16), transparent 36%),
    linear-gradient(180deg, #080a16 0%, var(--paper) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar,
.library-head,
.stage-top,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 8px 0 22px;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  line-height: 1.15;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--coral);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.soft-copy {
  color: var(--muted);
  margin-bottom: 0;
}

.top-actions,
.timer-actions,
.player-actions,
.badge-row,
.tool-tabs,
.control-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.back-button,
.favorite-button,
.chip-button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 0 15px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  background: var(--teal);
  border-color: var(--teal-dark);
  color: #fff;
  box-shadow: 0 8px 0 var(--teal-dark);
}

.primary-button:hover,
.ghost-button:hover,
.back-button:hover,
.favorite-button:hover,
.chip-button:hover {
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 var(--teal-dark);
}

.ghost-button.danger {
  color: var(--coral);
  border-color: rgba(217, 79, 53, 0.45);
}

.back-button {
  margin-bottom: 16px;
}

.favorite-button.is-active {
  background: #ffe8a3;
  border-color: var(--gold);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.stat-strip,
.daily-panel,
.session-card,
.practice-stage,
.history-list,
dialog {
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  padding: 0;
  background: var(--line);
}

.stat {
  background: var(--panel);
  padding: 18px;
  min-height: 112px;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.daily-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  min-height: 140px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.is-earned {
  color: var(--green);
  border-color: rgba(47, 125, 68, 0.35);
  background: rgba(47, 125, 68, 0.08);
}

.control-row {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.search-wrap {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-wrap input,
.prompt-wrap textarea,
.session-card textarea,
.mini-input,
.submodality-grid input,
.decision-board textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-wrap input {
  min-height: 48px;
  padding: 0 13px;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.segmented button,
.tool-tabs button {
  white-space: nowrap;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.segmented button.is-active,
.tool-tabs button.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.library-head {
  margin: 4px 0 12px;
}

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.journey-section {
  margin: 22px 0 18px;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.journey-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 16px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--journey-accent) 24%, transparent), transparent 38%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.97), rgba(7, 11, 24, 0.95));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.journey-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--journey-accent);
  box-shadow: 0 0 26px var(--journey-accent);
}

.journey-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.journey-card .card-copy {
  flex: 0;
  margin-bottom: 12px;
}

.journey-emoji {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--journey-accent) 50%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--journey-accent) 18%, transparent);
  font-size: 1.45rem;
}

.journey-meter {
  height: 8px;
  margin: 4px 0 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.journey-meter div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--journey-accent), #fff);
  transition: width 220ms ease;
}

.journey-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  flex: 1;
}

.journey-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(5, 10, 22, 0.42);
}

.journey-steps li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted);
  font-weight: 900;
}

.journey-steps li strong {
  display: block;
  margin-bottom: 2px;
}

.journey-steps li p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.journey-steps li.is-next {
  border-color: color-mix(in srgb, var(--journey-accent) 70%, transparent);
  background: color-mix(in srgb, var(--journey-accent) 13%, rgba(5, 10, 22, 0.55));
}

.journey-steps li.is-next > span,
.journey-steps li.is-done > span {
  color: #061014;
  background: var(--journey-accent);
}

.journey-steps li.is-done {
  opacity: 0.72;
}

.journey-card button:disabled {
  cursor: default;
  opacity: 0.75;
  transform: none;
  box-shadow: none;
}

.exercise-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 246px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  overflow: hidden;
}

.exercise-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--accent, var(--teal));
}

.exercise-card h3 {
  padding-right: 26px;
}

.exercise-card .favorite-mark {
  position: absolute;
  right: 12px;
  top: 12px;
  color: var(--gold);
  font-weight: 900;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 12px;
}

.tag {
  border: 1px solid rgba(33, 33, 33, 0.11);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.card-copy {
  color: var(--muted);
  margin-bottom: 16px;
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.player-shell {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 16px;
}

.session-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.session-card {
  padding: 16px;
}

.session-card.compact {
  display: grid;
  gap: 12px;
}

.mini-meter {
  height: 8px;
  margin-top: 16px;
  border-radius: 99px;
  background: #ebe4d7;
  overflow: hidden;
}

.mini-meter div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 220ms ease;
}

.step-list {
  display: grid;
  gap: 6px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}

.step-pill {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 253, 250, 0.8);
  text-align: left;
}

.step-pill span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eee6d8;
  color: var(--muted);
  font-weight: 900;
}

.step-pill.is-active {
  border-color: var(--teal);
  background: rgba(8, 127, 122, 0.08);
}

.step-pill.is-active span:first-child {
  background: var(--teal);
  color: #fff;
}

.practice-stage {
  min-height: 720px;
  padding: 22px;
}

.step-body {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

#stepText {
  font-size: 1.24rem;
  max-width: 820px;
}

.prompt-wrap {
  display: none;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.prompt-wrap.is-active {
  display: grid;
}

.prompt-wrap textarea,
.session-card textarea,
.decision-board textarea {
  resize: vertical;
  padding: 10px 12px;
  min-height: 72px;
}

.range-line {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.83rem;
}

input[type="range"] {
  accent-color: var(--teal);
}

.tool-zone {
  min-height: 230px;
  margin-top: 16px;
}

.tool-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.tool-card h3 {
  margin-bottom: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(220px, 1fr);
  gap: 16px;
  align-items: center;
}

.body-tool {
  display: grid;
  grid-template-columns: minmax(180px, 270px) minmax(220px, 1fr);
  gap: 18px;
  align-items: center;
}

.body-figure {
  position: relative;
  height: 290px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at center 42%, rgba(255, 255, 255, 0.96) 0 10%, transparent 22%),
    linear-gradient(180deg, #f8f6f2, #ebe1d1);
  overflow: hidden;
}

.body-core {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 94px;
  height: 240px;
  transform: translateX(-50%);
}

.body-core::before,
.body-core::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 33, 33, 0.18);
  border: 2px solid rgba(33, 33, 33, 0.46);
}

.body-core::before {
  top: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.body-core::after {
  top: 48px;
  width: 86px;
  height: 152px;
  border-radius: 40% 40% 44% 44%;
}

.spin-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130px;
  height: 68px;
  border: 10px solid var(--spin-color, var(--coral));
  border-left-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--spin-angle, 0deg));
  animation: spinOrbit var(--spin-speed, 1.7s) linear infinite;
}

.spin-orbit::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 17px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid var(--spin-color, var(--coral));
}

.body-figure.is-paused .spin-orbit {
  animation-play-state: paused;
}

@keyframes spinOrbit {
  to {
    transform: translate(-50%, -50%) rotate(calc(var(--spin-angle, 0deg) + 360deg));
  }
}

.control-stack {
  display: grid;
  gap: 12px;
}

.control-stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.swatch.is-active {
  box-shadow: 0 0 0 3px var(--ink);
}

.timeline-tool {
  display: grid;
  gap: 16px;
}

.timeline-stage {
  position: relative;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fbf8f2, #edf7f6);
  overflow: hidden;
}

.timeline-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 20px;
  transform: translateY(-50%) rotate(var(--timeline-tilt, 0deg));
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal));
  border-radius: 999px;
}

.timeline-line::before,
.timeline-line::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
}

.timeline-line::before {
  left: -28px;
  border-right: 36px solid var(--coral);
}

.timeline-line::after {
  right: -28px;
  border-left: 36px solid var(--teal);
}

.person-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 122px;
  transform: translate(-50%, -50%);
}

.person-dot::before,
.person-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(33, 33, 33, 0.32);
}

.person-dot::before {
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.person-dot::after {
  top: 36px;
  width: 58px;
  height: 82px;
  border-radius: 42% 42% 48% 48%;
}

.timeline-label {
  position: absolute;
  font-weight: 900;
  color: var(--ink);
}

.timeline-label.past {
  right: 22px;
  top: 32px;
}

.timeline-label.present {
  left: 50%;
  top: calc(50% + 68px);
  transform: translateX(-50%);
}

.timeline-label.future {
  left: 22px;
  bottom: 28px;
}

.movie-screen {
  position: relative;
  min-height: 200px;
  border: 8px solid #222;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.15) 1px, transparent 1px),
    linear-gradient(135deg, #f9f4e7, #d8edf0);
  background-size: 18px 18px, auto;
  overflow: hidden;
  transition: filter 200ms ease, transform 200ms ease;
}

.movie-screen.is-small {
  transform: scale(0.78);
}

.movie-screen.is-gray {
  filter: grayscale(1);
}

.movie-screen.is-bright {
  filter: saturate(1.45) brightness(1.14);
}

.movie-screen.is-whiteout::after {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  animation: whiteFlash 500ms ease both;
}

@keyframes whiteFlash {
  from {
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.movie-scene {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(33, 33, 33, 0.25);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  padding: 16px;
}

.voice-board,
.decision-board,
.hand-board,
.word-board {
  display: grid;
  gap: 12px;
}

.voice-grid,
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.chip-button.is-active {
  background: var(--ink);
  color: #fff;
}

.hand-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.hand {
  min-height: 130px;
  border: 2px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  font-weight: 900;
}

.hand.left {
  background: rgba(184, 69, 95, 0.1);
  border-color: rgba(184, 69, 95, 0.35);
}

.hand.right {
  background: rgba(8, 127, 122, 0.1);
  border-color: rgba(8, 127, 122, 0.35);
}

.merge-arrow {
  color: var(--muted);
  font-weight: 900;
}

.hand-stage.is-merged .hand.left,
.hand-stage.is-merged .hand.right {
  animation: mergeHands 700ms ease both;
}

@keyframes mergeHands {
  50% {
    transform: translateX(var(--merge-shift, 0));
  }
  100% {
    background: rgba(193, 139, 19, 0.15);
    border-color: var(--gold);
  }
}

.submodality-grid {
  display: grid;
  gap: 8px;
}

.sub-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
}

.sub-row.header {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.sub-row input {
  min-height: 38px;
  padding: 0 9px;
}

.timer-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.timer-ring {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 56%, transparent 57%),
    conic-gradient(var(--teal) var(--timer-deg, 0deg), #e8dfd0 0deg);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
}

.history-list {
  box-shadow: none;
  padding: 10px;
  max-height: 60vh;
  overflow: auto;
}

.history-item {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
}

.history-item:last-child {
  border-bottom: 0;
}

dialog {
  width: min(760px, calc(100% - 28px));
  border: 1px solid var(--line);
  padding: 18px;
}

dialog::backdrop {
  background: rgba(33, 33, 33, 0.32);
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.72);
}

.stat-strip,
.daily-panel,
.session-card,
.practice-stage,
.history-list,
dialog {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.93), rgba(8, 13, 26, 0.95));
  border-color: var(--line);
}

.stat {
  background: linear-gradient(135deg, rgba(22, 242, 208, 0.09), rgba(255, 79, 216, 0.07));
}

.daily-panel {
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(8, 13, 26, 0.96));
}

.primary-button {
  color: #061014;
  background: linear-gradient(135deg, var(--teal), #66ffe9);
  border-color: rgba(102, 255, 233, 0.65);
  box-shadow: 0 8px 0 rgba(4, 155, 141, 0.82);
}

.ghost-button,
.back-button,
.favorite-button,
.chip-button {
  color: var(--ink);
  background: rgba(12, 18, 34, 0.86);
  border-color: rgba(255, 255, 255, 0.2);
}

.ghost-button:hover,
.back-button:hover,
.favorite-button:hover,
.chip-button:hover {
  border-color: rgba(22, 242, 208, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 242, 208, 0.12);
}

.ghost-button.danger {
  color: #ff95ae;
  border-color: rgba(255, 92, 138, 0.48);
}

.favorite-button.is-active,
.chip-button.is-active,
.segmented button.is-active,
.tool-tabs button.is-active {
  color: #061014;
  background: linear-gradient(135deg, var(--gold), #fff0a8);
  border-color: rgba(255, 209, 102, 0.8);
}

.search-wrap input,
.prompt-wrap textarea,
.session-card textarea,
.mini-input,
.submodality-grid input,
.decision-board textarea {
  background: rgba(5, 10, 22, 0.84);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.17);
}

.search-wrap input:focus,
.prompt-wrap textarea:focus,
.session-card textarea:focus,
.mini-input:focus,
.submodality-grid input:focus,
.decision-board textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 242, 208, 0.13);
}

.segmented button,
.tool-tabs button,
.badge,
.tag {
  background: rgba(12, 18, 34, 0.86);
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.16);
}

.badge.is-earned {
  color: var(--green);
  border-color: rgba(124, 255, 107, 0.36);
  background: rgba(124, 255, 107, 0.09);
}

.exercise-card {
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(8, 13, 26, 0.94)),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent, var(--teal)) 32%, transparent), transparent 34%);
  border-color: rgba(255, 255, 255, 0.13);
}

.exercise-card::before {
  box-shadow: 0 0 22px var(--accent, var(--teal));
}

.card-copy,
.soft-copy,
.mini-count {
  color: var(--muted);
}

.mini-meter,
.step-pill span:first-child {
  background: rgba(255, 255, 255, 0.09);
}

.step-pill {
  background: rgba(12, 18, 34, 0.8);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--ink);
}

.step-pill.is-active {
  background: linear-gradient(90deg, rgba(22, 242, 208, 0.2), rgba(59, 167, 255, 0.09));
  border-color: rgba(22, 242, 208, 0.75);
}

.tool-card {
  background: rgba(6, 11, 24, 0.86);
  border-color: rgba(255, 255, 255, 0.14);
}

.body-figure,
.timeline-stage,
.movie-screen {
  background:
    radial-gradient(circle at center, rgba(22, 242, 208, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(12, 18, 34, 0.95), rgba(4, 7, 17, 0.95));
}

.body-core::before,
.body-core::after,
.person-dot::before,
.person-dot::after {
  background: rgba(247, 248, 255, 0.16);
  border-color: rgba(247, 248, 255, 0.36);
}

.movie-scene {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.2);
}

.hand {
  background: rgba(12, 18, 34, 0.78);
}

.timer-ring {
  background:
    radial-gradient(circle at center, var(--panel-2) 0 56%, transparent 57%),
    conic-gradient(var(--rose) var(--timer-deg, 0deg), rgba(255, 255, 255, 0.12) 0deg);
}

.memory-recall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(22, 242, 208, 0.08));
}

.memory-recall[hidden] {
  display: none;
}

.memory-recall p {
  margin: 4px 0;
  color: var(--ink);
}

.memory-recall span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dictation-wrap {
  position: relative;
  width: 100%;
}

.dictation-wrap > textarea,
.dictation-wrap > input[type="text"] {
  padding-right: 52px;
}

.dictation-button {
  position: absolute;
  right: 7px;
  top: 7px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(22, 242, 208, 0.45);
  border-radius: 999px;
  background: rgba(22, 242, 208, 0.12);
  color: var(--ink);
}

.dictation-button.is-listening {
  color: #061014;
  background: var(--teal);
  box-shadow: 0 0 0 7px rgba(22, 242, 208, 0.16);
}

.voice-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  border: 1px solid rgba(22, 242, 208, 0.28);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(6, 11, 24, 0.92);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.voice-status.is-active {
  color: var(--ink);
  border-color: rgba(22, 242, 208, 0.68);
  box-shadow: 0 0 28px rgba(22, 242, 208, 0.2);
}

.voice-stop {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--coral);
  color: #fff;
  font-weight: 900;
}

.history-prompts {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

/* Softer typography pass: still clear, less shouty. */
h1 {
  font-weight: 700;
}

h2,
h3,
strong,
.stat strong,
.timer-ring,
.mini-count,
.step-pill span:first-child,
.journey-steps li > span,
.favorite-mark {
  font-weight: 700;
}

.eyebrow,
.primary-button,
.ghost-button,
.back-button,
.favorite-button,
.chip-button,
.segmented button,
.tool-tabs button,
.badge,
.tag,
.search-wrap,
.range-line,
.control-stack label,
.memory-recall span,
.voice-status {
  font-weight: 650;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 16px;
  }

  .workbench,
  .player-shell,
  .control-row,
  .tool-grid,
  .body-tool {
    grid-template-columns: 1fr;
  }

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .practice-stage {
    min-height: auto;
  }

  .step-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .topbar,
  .library-head,
  .stage-top,
  .dialog-head,
  .card-foot,
  .hand-stage {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .library-head,
  .stage-top,
  .dialog-head {
    display: grid;
  }

  .top-actions,
  .player-actions,
  .timer-actions {
    width: 100%;
  }

  .top-actions > *,
  .player-actions > *,
  .timer-actions > * {
    flex: 1;
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

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

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

  .sub-row {
    grid-template-columns: 1fr;
  }

  .sub-row.header {
    display: none;
  }

  #stepText {
    font-size: 1.05rem;
  }
}
