:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #12141b;
  --panel-strong: #181c25;
  --ink: #f4efe7;
  --muted: #a8adba;
  --line: rgba(255, 255, 255, 0.13);
  --blue: #69d5ff;
  --green: #74e0a3;
  --coral: #ff7f73;
  --gold: #f1c96a;
  --lavender: #b8a7ff;
  --sprite-bg: #171a20;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(105, 213, 255, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #090a0f 0%, var(--bg) 54%, #050607 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input,
textarea {
  border-radius: var(--radius);
}

button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
}

button:hover:not(:disabled) {
  border-color: rgba(105, 213, 255, 0.52);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #061017;
}

button.ghost {
  background: transparent;
}

button.danger {
  border-color: rgba(179, 83, 67, 0.45);
  color: var(--coral);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  padding: 0.7rem 0.75rem;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
}

.loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
}

.landing-page,
.route-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.route-page {
  position: relative;
}

.landing-page {
  min-height: 100svh;
  overflow: hidden;
}

.landing-hero,
.route-panel {
  width: min(1080px, 100%);
  display: grid;
  gap: 1.5rem;
}

.landing-hero {
  width: min(340px, 78vw);
  min-height: auto;
  align-items: center;
}

.landing-hero.results-ready {
  position: relative;
}

.shared-results-entry {
  position: absolute;
  top: clamp(-14rem, -22svh, -13rem);
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(300px, 78vw);
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  transition: filter 180ms ease, transform 180ms ease;
}

.shared-results-entry:hover:not(:disabled),
.shared-results-entry:focus-visible {
  border-color: transparent;
  background: transparent;
  transform: translateX(-50%) translateY(-2px);
}

.shared-results-entry:hover:not(:disabled) {
  filter:
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.68))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.24));
}

.shared-results-entry img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.dev-preview-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(18, 20, 27, 0.82);
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  font-weight: 800;
}

.dev-preview-toggle:hover:not(:disabled),
.dev-preview-toggle:focus-visible {
  border-color: rgba(105, 213, 255, 0.5);
  color: var(--ink);
}

.dev-preview-toggle.active {
  border-color: rgba(255, 127, 115, 0.58);
  background: rgba(255, 127, 115, 0.14);
  color: var(--ink);
}

.dev-reset-button {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  border-color: rgba(255, 127, 115, 0.36);
  background: rgba(18, 20, 27, 0.82);
  color: var(--coral);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  font-weight: 800;
}

.dev-preview-toggle + .dev-reset-button {
  bottom: 3.8rem;
}

.dev-reset-button:hover:not(:disabled),
.dev-reset-button:focus-visible {
  border-color: rgba(255, 127, 115, 0.68);
  color: var(--ink);
}

.landing-hero h1,
.route-panel h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.landing-hero p,
.route-panel p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.25rem, 1vw, 0.5rem);
  align-items: end;
  width: 100%;
}

.identity-option {
  --sprite-scale: 1;
  --sprite-hover-scale: 1;
  --sprite-stage-height: clamp(202px, 34svh, 256px);
  --sprite-height: clamp(217px, 36.6svh, 275px);
  display: grid;
  align-items: end;
  min-height: var(--sprite-stage-height);
  padding: 0;
  border: 0;
  text-align: center;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  isolation: isolate;
}

.identity-option:hover:not(:disabled) {
  border-color: transparent;
  transform: none;
}

.sprite-stage {
  position: relative;
  display: grid;
  place-items: end center;
  width: 100%;
  min-height: inherit;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
}

.identity-option[data-partner="a"] {
  --sprite-stage-height: clamp(202px, 34svh, 256px);
  --sprite-height: clamp(217px, 36.6svh, 275px);
}

.identity-option[data-partner="b"] {
  --sprite-stage-height: clamp(190px, 31.5svh, 238px);
  --sprite-height: clamp(206px, 34.2svh, 259px);
}

.identity-sprite {
  position: absolute;
  bottom: 0;
  width: auto;
  height: var(--sprite-height);
  max-width: min(38vw, 300px);
  max-height: none;
  object-fit: contain;
  object-position: bottom center;
  image-rendering: auto;
  filter:
    drop-shadow(0 0 13px rgba(105, 213, 255, 0.24))
    drop-shadow(0 24px 38px rgba(0, 0, 0, 0.56));
  transition: opacity 160ms ease, transform 220ms ease, filter 220ms ease;
  transform-origin: bottom center;
}

.identity-option:hover .identity-sprite,
.identity-option:focus-visible .identity-sprite {
  filter:
    drop-shadow(0 0 20px rgba(105, 213, 255, 0.42))
    drop-shadow(0 30px 44px rgba(0, 0, 0, 0.7));
}

.identity-option[data-partner="a"] .identity-sprite {
  transform: translateX(5%) rotate(1deg) scaleX(-1) scale(var(--sprite-scale));
}

.identity-option[data-partner="b"] .identity-sprite {
  transform: translateX(-5%) rotate(-1deg) scale(var(--sprite-scale));
  filter:
    drop-shadow(0 0 13px rgba(255, 127, 115, 0.28))
    drop-shadow(0 24px 38px rgba(0, 0, 0, 0.56));
}

.identity-option[data-partner="b"]:hover .identity-sprite,
.identity-option[data-partner="b"]:focus-visible .identity-sprite {
  filter:
    drop-shadow(0 0 20px rgba(255, 127, 115, 0.42))
    drop-shadow(0 30px 44px rgba(0, 0, 0, 0.7));
}

.identity-option strong {
  display: block;
  font-size: 1.18rem;
}

.identity-option small {
  color: var(--muted);
}

.landing-actions,
.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wait-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.wait-panel {
  max-width: 760px;
}

.results-page {
  min-height: 100vh;
}

.results-content {
  display: grid;
  gap: 1rem;
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 3vw, 2rem) 2rem;
}

.confirmation-panel {
  max-width: 760px;
}

.shared-review-panel {
  display: grid;
  gap: 1.1rem;
}

.shared-review-header,
.shared-review-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.shared-review-header > div {
  flex: 1;
  min-width: 0;
}

.shared-review-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1;
}

.shared-review-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.shared-review-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.shared-review-kicker .eyebrow {
  margin: 0;
  white-space: nowrap;
}

.shared-review-progress {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 360px;
}

.shared-review-progress button {
  width: 24px;
  height: 5px;
  min-height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.shared-review-progress button.active {
  background: var(--blue);
}

.shared-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.shared-scene-card {
  display: grid;
  gap: 0.7rem;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 1rem;
}

.shared-scene-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.shared-scene-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.shared-scene-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.priority-venn {
  --overlap: clamp(190px, 22vw, 310px);
  --circle-width: calc((100% + var(--overlap)) / 2);
  position: relative;
  min-height: 360px;
  padding: clamp(0.9rem, 2vw, 1.2rem);
  overflow: visible;
}

.priority-venn-base,
.priority-venn-outline {
  position: absolute;
  border-radius: var(--radius);
  pointer-events: none;
}

.priority-venn-base {
  inset: 0;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.priority-venn-outline {
  top: clamp(0.7rem, 1.6vw, 1rem);
  bottom: clamp(0.7rem, 1.6vw, 1rem);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
}

.priority-venn-outline.left {
  left: clamp(0.7rem, 1.6vw, 1rem);
  width: var(--circle-width);
}

.priority-venn-outline.right {
  right: clamp(0.7rem, 1.6vw, 1rem);
  width: var(--circle-width);
}

.priority-venn-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--overlap)) minmax(0, 1fr);
  gap: clamp(0.6rem, 2vw, 1rem);
  min-height: 328px;
}

.priority-column {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 0.8rem clamp(0.65rem, 1.4vw, 1rem);
}

.priority-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-content: start;
}

.priority-column:nth-child(2) .priority-chip-list {
  justify-content: center;
}

.priority-review-chip {
  position: relative;
  width: auto;
  max-width: 100%;
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: var(--panel);
  padding: 0.4rem 0.65rem;
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}

.priority-review-chip.shared {
  font-weight: 800;
  text-align: center;
}

.priority-review-chip:hover:not(:disabled),
.priority-review-chip:focus-visible {
  border-color: rgba(255, 255, 255, 0.48);
}

.priority-note-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 0.45rem);
  z-index: 5;
  display: grid;
  gap: 0.6rem;
  width: min(270px, 72vw);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: #202832;
  padding: 0.75rem;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
}

.priority-column:nth-child(3) .priority-note-popover {
  right: 0;
  left: auto;
}

.priority-note-section,
.priority-note-section span {
  display: block;
}

.priority-note-section strong {
  display: block;
  margin-bottom: 0.25rem;
}

.priority-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar.static {
  position: static;
}

.private-exercise {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  max-width: 1520px;
  height: 100vh;
  min-height: 0;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
  overflow: hidden;
}

.exercise-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 0.85rem;
  min-height: 0;
  overflow: hidden;
}

.category-card-list,
.exercise-main {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

@supports not selector(::-webkit-scrollbar) {
  .category-card-list,
  .exercise-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  }
}

.category-card-list::-webkit-scrollbar,
.exercise-main::-webkit-scrollbar {
  width: 10px;
}

.category-card-list::-webkit-scrollbar-button,
.exercise-main::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

.category-card-list::-webkit-scrollbar-track,
.exercise-main::-webkit-scrollbar-track {
  background: transparent;
}

.category-card-list::-webkit-scrollbar-thumb,
.exercise-main::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  background-clip: content-box;
}

.category-card-list::-webkit-scrollbar-thumb:hover,
.exercise-main::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.36);
  background-clip: content-box;
}

.exercise-character {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 218px;
  padding: 0.25rem 0 0;
  overflow: hidden;
}

.exercise-character img {
  width: min(82%, 205px);
  max-height: 212px;
  object-fit: contain;
  object-position: bottom center;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  transition: color 160ms ease;
}

.icon-button:hover:not(:disabled) {
  background: transparent;
  transform: none;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: filter 160ms ease, stroke 160ms ease;
}

.home-button {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--ink);
  z-index: 1;
}

.instructions-button {
  position: absolute;
  top: 0;
  right: 0;
  color: var(--ink);
  z-index: 1;
}

.home-button:hover:not(:disabled),
.home-button:focus-visible,
.instructions-button:hover:not(:disabled),
.instructions-button:focus-visible {
  color: #fff;
  background: transparent;
  transform: none;
}

.home-button:hover:not(:disabled) svg,
.home-button:focus-visible svg,
.instructions-button:hover:not(:disabled) svg,
.instructions-button:focus-visible svg {
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.86))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.34));
}

.category-card-list {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding-right: 0.3rem;
}

.category-nav {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
  min-height: 0;
  overflow: hidden;
}

.category-nav-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 0.75rem;
  text-align: left;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.category-nav-toggle:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
  transform: none;
}

.category-toggle-icon {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--muted);
  transition: border-color 160ms ease, transform 160ms ease;
}

.category-nav-toggle:hover:not(:disabled) .category-toggle-icon,
.category-nav-toggle:focus-visible .category-toggle-icon {
  border-top-color: var(--ink);
}

.category-nav-toggle[aria-expanded="true"] .category-toggle-icon {
  transform: rotate(180deg);
}

.category-nav-toggle strong,
.category-nav-toggle small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-nav-toggle small {
  color: var(--muted);
  margin-top: 0.12rem;
}

.category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  min-height: 66px;
  padding: 0.7rem;
  text-align: left;
  background: var(--panel-strong);
}

.category-card.active {
  border-color: var(--blue);
  background: rgba(47, 111, 143, 0.09);
}

.category-card strong,
.category-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-card small {
  color: var(--muted);
  margin-top: 0.12rem;
}

.status-badge {
  border-radius: 999px;
  padding: 0.24rem 0.5rem;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.not-started {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.status-badge.in-progress {
  background: rgba(156, 106, 22, 0.15);
  color: var(--gold);
}

.status-badge.complete {
  background: rgba(57, 115, 90, 0.13);
  color: var(--green);
}

.exercise-main {
  min-width: 0;
  align-self: stretch;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding: 1.1rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 13, 0.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.brand p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 760px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.1rem;
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 3vw, 2rem) 2rem;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 0.9rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.panel-header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.panel-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-body {
  padding: 1rem;
}

.main-panel {
  min-width: 0;
}

.choice-tile {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 1rem;
}

.choice-tile h3 {
  margin: 0;
  font-size: 1rem;
}

.choice-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.overview-intro,
.overview-steps,
.overview-status {
  display: grid;
  gap: 0.65rem;
}

.overview-title {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.overview-steps h3,
.overview-status h3 {
  margin: 0;
  font-size: 1rem;
}

.overview-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 840px;
  font-size: 1.05rem;
  line-height: 1.5;
}

.overview-actions {
  justify-content: flex-end;
}

.instruction-grid,
.category-intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.instruction-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-strip span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  padding: 0.45rem 0.65rem;
  color: var(--muted);
}

.status-strip strong {
  color: var(--ink);
}

.person-mini {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 0.5rem;
}

.person-mini img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  object-position: bottom center;
}

.person-mini strong,
.person-mini span {
  display: block;
}

.person-mini span {
  color: var(--muted);
  font-size: 0.88rem;
}

.segmented {
  display: grid;
  gap: 0.35rem;
}

.segmented.horizontal {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.segmented button {
  width: 100%;
  text-align: left;
}

.segmented button.active {
  border-color: var(--blue);
  background: rgba(47, 111, 143, 0.1);
  color: var(--ink);
}

.nav-list {
  display: grid;
  gap: 0.35rem;
}

.nav-list button {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
}

.nav-list button.active {
  border-color: var(--green);
  background: rgba(57, 115, 90, 0.1);
}

.nav-list small {
  color: var(--muted);
}

.category-list {
  display: grid;
  gap: 0.45rem;
}

.category-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.category-row input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
}

.category-row button {
  padding: 0.35rem 0.5rem;
  min-height: 32px;
}

.category-row strong,
.item-option strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-row span,
.item-option span,
.mini {
  color: var(--muted);
  font-size: 0.86rem;
}

td .mini {
  display: block;
  margin-top: 0.2rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-title p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.flow-actions {
  justify-content: flex-end;
}

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

.item-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  min-height: 76px;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.item-option input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
}

.item-option.selected {
  border-color: rgba(47, 111, 143, 0.55);
  background: rgba(47, 111, 143, 0.07);
}

.ideal-writing textarea {
  min-height: 220px;
}

.starter-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.starter-prompt {
  max-width: 100%;
  min-height: 36px;
  border-color: rgba(116, 224, 163, 0.26);
  border-radius: 999px;
  background: rgba(116, 224, 163, 0.08);
  color: var(--ink);
  text-align: left;
  font-size: 0.9rem;
}

.starter-prompt:hover:not(:disabled) {
  border-color: rgba(116, 224, 163, 0.55);
  background: rgba(116, 224, 163, 0.13);
}

.chip-zone {
  display: grid;
  gap: 0.75rem;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 0.9rem;
  transition: border-color 160ms ease, background 160ms ease;
}

.chip-zone.drag-over {
  border-color: var(--blue);
  background: rgba(105, 213, 255, 0.08);
}

.kept-zone {
  min-height: 218px;
  gap: 0.55rem;
  padding-top: 0.75rem;
}

.available-zone {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chip-zone-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.chip-zone-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.chip-zone-header span {
  color: var(--muted);
  font-size: 0.88rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: start;
}

.item-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem 0.45rem 0.35rem 0.7rem;
  cursor: grab;
}

.item-chip.kept {
  border-color: rgba(105, 213, 255, 0.45);
  background: rgba(105, 213, 255, 0.1);
}

.item-chip.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chip-label {
  min-width: 0;
  overflow-wrap: anywhere;
  cursor: grab;
}

.chip-action {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
}

.chip-empty {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
}

.details-list {
  display: grid;
  gap: 0.75rem;
}

.detail-card {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 0.9rem;
}

.non-negotiable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.non-negotiable-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.non-negotiable-check {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.non-negotiable-check input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.profile-section,
.profile-list,
.summary-box {
  display: grid;
  gap: 0.8rem;
}

.profile-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  padding: 0.9rem;
}

.profile-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}

.profile-card h3 {
  margin: 0;
  font-size: 1rem;
}

.profile-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.note-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

textarea.compact {
  min-height: 74px;
}

.custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.available-zone .custom-row {
  align-self: end;
  margin-top: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  min-height: 32px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.pill button {
  min-height: 24px;
  padding: 0 0.25rem;
  border: 0;
  color: var(--coral);
  background: transparent;
}

.progress {
  display: grid;
  gap: 0.35rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  margin: 1rem 0;
}

.match-choice {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 1rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  overflow-wrap: anywhere;
}

.match-choice.selected {
  border-color: var(--green);
  background: rgba(57, 115, 90, 0.1);
}

.versus {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
}

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue);
  color: #061017;
  font-weight: 700;
}

.signal {
  display: inline-flex;
  min-width: 74px;
  justify-content: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.signal.green {
  background: rgba(57, 115, 90, 0.13);
  color: var(--green);
}

.signal.yellow {
  background: rgba(156, 106, 22, 0.15);
  color: var(--gold);
}

.signal.red {
  background: rgba(179, 83, 67, 0.14);
  color: var(--coral);
}

.signal.unknown {
  background: rgba(107, 91, 149, 0.13);
  color: var(--lavender);
}

.empty {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 1.25rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.empty.chip-empty {
  border: 0;
  background: transparent;
  padding: 0;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  z-index: 30;
}

@media (max-width: 980px) {
  .topbar,
  .workspace,
  .private-exercise {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: start;
  }

  .private-exercise {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .exercise-rail {
    max-height: none;
    overflow: visible;
  }

  .category-card-list,
  .exercise-main {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }

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

  .main-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .sidebar,
  .grid.two,
  .grid.three,
  .instruction-grid,
  .category-intro-grid,
  .matchup,
  .profile-card-head,
  .identity-grid,
  .wait-grid,
  .landing-actions,
  .route-header {
    grid-template-columns: 1fr;
  }

  .landing-actions,
  .route-header {
    display: grid;
    align-items: start;
  }

  .identity-option {
    min-height: min(640px, 70svh);
  }

  .landing-page .identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .landing-page .identity-option {
    min-height: var(--sprite-stage-height);
  }

  .landing-page .identity-option[data-partner="a"] {
    --sprite-stage-height: clamp(140px, 44vw, 210px);
    --sprite-height: clamp(151px, 47.3vw, 226px);
  }

  .landing-page .identity-option[data-partner="b"] {
    --sprite-stage-height: clamp(128px, 40vw, 194px);
    --sprite-height: clamp(139px, 43.5vw, 211px);
  }

  .landing-page .identity-sprite {
    max-width: 46vw;
  }

  .match-choice {
    min-height: 118px;
  }

  .versus {
    min-height: 24px;
  }

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