:root {
  --ink: #17211e;
  --muted: #65746f;
  --paper: #ffffff;
  --wash: #f5faf8;
  --line: #dce7e2;
  --mint: #dff8ef;
  --mint-strong: #b9eddd;
  --teal: #0d8f86;
  --coral: #ff6f59;
  --coral-soft: #fff0ec;
  --amber: #f2b84b;
  --amber-soft: #fff8e8;
  --violet: #7567e8;
  --shadow: 0 14px 34px rgba(31, 54, 47, 0.08);
}

:root[data-theme="dark"],
[data-theme="dark"] {
  --ink: #edf7f3;
  --muted: #a8b9b3;
  --paper: #17211e;
  --wash: #101816;
  --line: #2a3935;
  --mint: #153f37;
  --mint-strong: #22675b;
  --teal: #75dbc9;
  --coral: #ff8a73;
  --coral-soft: #33211d;
  --amber: #f0c36b;
  --amber-soft: #2c2415;
  --violet: #9f95ff;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background: linear-gradient(135deg, #f7fcfa 0%, #eef8f4 54%, #fff7f2 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #101816 0%, #13231f 58%, #211612 100%);
}

button, textarea, input { font: inherit; }
button { cursor: default; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.06; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.25; }

.app-shell {
  min-height: 100dvh;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .mobile-nav {
  background: rgba(23, 33, 30, 0.94);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--mint), var(--coral-soft));
  color: var(--teal);
  font-weight: 950;
}

.brand strong { display: block; font-size: 20px; }
.brand span, .subtitle, .muted { color: var(--muted); font-size: 13px; line-height: 1.46; }
.subtitle,
.app-footer span {
  overflow-wrap: anywhere;
}
.sidebar-note {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

[data-theme="dark"] .sidebar-note,
[data-theme="dark"] .card,
[data-theme="dark"] .mini-item,
[data-theme="dark"] .argument-block,
[data-theme="dark"] .field,
[data-theme="dark"] .tool-drawer,
[data-theme="dark"] .mobile-entry-card,
[data-theme="dark"] .privacy-toggle,
[data-theme="dark"] .ghost,
[data-theme="dark"] .chip,
[data-theme="dark"] .action-link {
  background: rgba(23, 33, 30, 0.94);
}

.main { min-width: 0; padding: 24px; }
.topbar {
  max-width: 1180px;
  margin: 0 auto 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  display: none;
}

.page.active { display: block; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
}

.card, .poster {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero, .poster {
  border-color: #c6eee2;
  background: linear-gradient(135deg, #e6fff6 0%, #fff 58%, #fff2ed 100%);
}

[data-theme="dark"] .hero,
[data-theme="dark"] .poster {
  border-color: #22675b;
  background: linear-gradient(135deg, #142d28 0%, #17211e 60%, #2a1815 100%);
}

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions, .top-actions, .duration-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-motion-card {
  border: 1px solid #bfe8dc;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  padding: 14px;
  display: grid;
  gap: 9px;
}

.hero-motion-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-motion {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.16;
  font-weight: 950;
  letter-spacing: 0;
}

.hero-brief {
  color: #36544d;
  font-size: 14px;
  font-weight: 850;
}

.hero-duration {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.hero-duration > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.hero-help {
  border: 1px solid rgba(13, 143, 134, 0.15);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.56);
  padding: 10px 12px;
}

.hero-help summary {
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.hero-help p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.train-flow {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.flow-step {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-family: inherit;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.flow-step:hover,
.flow-step:focus-visible {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 111, 89, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.flow-step.active {
  border-color: #9ce3d0;
  background: var(--mint);
  color: var(--teal);
}

.flow-step.current {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: #8f2f1f;
  box-shadow: 0 0 0 3px rgba(255, 111, 89, 0.14);
}

.app-toast {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #16332d;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast[data-tone="success"] {
  background: #0d5f55;
}

.app-toast[data-tone="warning"] {
  background: #7a4a08;
}

.action-status {
  min-height: 20px;
  margin-top: 8px;
}

.mode-status {
  margin: -4px 0 16px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #a6e5d2;
  border-radius: 999px;
  background: #f1fcf8;
  color: var(--teal);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.35;
}

.mode-status.inline {
  margin: 0;
  border-radius: 13px;
}

.mode-status.hero-status {
  margin: 0;
  border-radius: 13px;
  background: #fff8e8;
  border-color: #f0d28e;
  color: #68470f;
  box-shadow: 0 8px 18px rgba(242, 184, 75, 0.16);
}

.mode-status[data-tone="success"] {
  border-color: #9ce3d0;
  background: var(--mint);
}

.mode-status[data-tone="warning"] {
  border-color: #e9bc56;
  background: var(--amber-soft);
  color: #68470f;
}

.nav { display: grid; gap: 8px; align-content: start; }
.nav-button {
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #52615c;
  text-align: left;
  font-weight: 900;
}

[data-theme="dark"] .nav-button {
  color: #a8b9b3;
}

.nav-button span:first-child {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #697570;
}

.nav-button.active {
  color: var(--teal);
  background: #f0fbf7;
  border-color: #c5eee1;
}

[data-theme="dark"] .nav-button.active {
  background: #122c27;
  border-color: #235b51;
}

.nav-button.active span:first-child { background: var(--mint); color: var(--teal); }

.primary, .secondary, .ghost, .chip, .action-link {
  min-height: 42px;
  border-radius: 13px;
  padding: 8px 12px;
  font-weight: 900;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
}

.primary {
  border: 0;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 22px rgba(255, 111, 89, 0.22);
}

.secondary {
  border: 1px solid #a6e5d2;
  color: var(--teal);
  background: #f1fcf8;
}

[data-theme="dark"] .secondary {
  border-color: #286f62;
  background: #10231f;
}

.ghost, .chip, .action-link {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.chip {
  min-height: 34px;
  border-radius: 999px;
  font-size: 12px;
}

.chip.active { border-color: #9ce3d0; color: var(--teal); background: var(--mint); }
.wide { width: 100%; min-height: 50px; }

.timer-options, .rating-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.timer-options.compact {
  grid-template-columns: repeat(5, minmax(72px, 1fr));
}

.rating-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timer-options .chip, .rating-row .chip {
  width: 100%;
}

.tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--mint);
  color: var(--teal);
  font-size: 11px;
  font-weight: 950;
}

.tag.soft { background: #f2f5f4; color: #596661; }
.tag.soon { background: #f5ead1; color: #6c4b0f; }
.motion-text { font-size: 19px; font-weight: 850; line-height: 1.35; }

.is-spotlight {
  animation: spotlightPulse 1.8s ease;
}

@keyframes spotlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 111, 89, 0.28), var(--shadow); }
  45% { box-shadow: 0 0 0 6px rgba(255, 111, 89, 0.16), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}

.note, .notice {
  border: 1px solid #c6eee2;
  border-radius: 15px;
  background: #f5fffb;
  padding: 12px;
  color: #36544d;
  font-size: 13px;
  line-height: 1.5;
}

[data-theme="dark"] .note {
  border-color: #24584f;
  background: #11231f;
  color: #cfe7df;
}

.notice { border-color: #f0d28e; background: var(--amber-soft); color: #644817; }

[data-theme="dark"] .notice {
  border-color: #7a612a;
  color: #f2d591;
}

.textarea, .input, .select {
  width: 100%;
  border: 1px solid #cadbd4;
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  line-height: 1.45;
}

.textarea { min-height: 116px; resize: vertical; }
.input { min-height: 44px; }
.select { min-height: 40px; width: auto; }
.compact-select {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 11px;
}
.compact-textarea { min-height: 78px; }
.custom-motion { display: grid; gap: 10px; }

[data-theme="dark"] .textarea,
[data-theme="dark"] .input,
[data-theme="dark"] .select {
  border-color: #2a3935;
  background: #101816;
}

.control-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wide-field { grid-column: 1 / -1; }

.field {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.framing-detail {
  gap: 7px;
  padding: 0;
  overflow: hidden;
}

.framing-detail summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.framing-detail summary::-webkit-details-marker { display: none; }

.framing-detail summary::after {
  content: '+';
  color: var(--teal);
  font-size: 16px;
  line-height: 1;
}

.framing-detail[open] summary::after { content: '-'; }

.framing-detail span {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  padding: 0 12px 12px;
}

.mini-list, .argument-list { display: grid; gap: 10px; }
.mini-item, .argument-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.mini-item.preview-only {
  border-style: dashed;
  background: #fffdf7;
}

[data-theme="dark"] .mini-item.preview-only {
  background: #1f1b12;
}

.listen-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--wash);
}

.listen-controls .ghost {
  min-height: 36px;
  padding: 6px 10px;
}

.disabled-card {
  opacity: 0.78;
  background: linear-gradient(135deg, #fbfdfc 0%, #f4f8f6 100%);
}

.disabled-card .secondary,
.disabled-card button {
  pointer-events: none;
}

[data-theme="dark"] .disabled-card {
  background: linear-gradient(135deg, #17211e 0%, #121a18 100%);
}

.security-note {
  border-color: #d6ebe4;
  background: #fbfffd;
}

.security-note h3 {
  color: var(--teal);
}

.argument-block {
  border-left: 4px solid #24b47e;
  background: #f3fff9;
}
.argument-block.opp {
  border-left-color: #e35d5b;
  background: #fff7f6;
}
.argument-block.selected {
  border-color: #9ce3d0;
  box-shadow: 0 0 0 3px rgba(13, 143, 134, 0.08);
}
.argument-block.opp.selected {
  border-color: #f3b1aa;
  box-shadow: 0 0 0 3px rgba(227, 93, 91, 0.08);
}

.argument-block summary::-webkit-details-marker { display: none; }
.argument-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}
.argument-number {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #20a66f;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
}
.argument-block.opp .argument-number { background: #dc5552; }
.argument-summary strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}
.argument-summary small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}
.cmci { display: grid; gap: 7px; }
.cmci-cell {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(22, 86, 79, 0.08);
  border-left: 3px solid #bfdad3;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.42;
}
.cmci-cell strong {
  display: inline-block;
  margin-bottom: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #edf5f2;
  color: #315b55;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}
.cmci-cell.claim { border-left-color: #2f8f83; }
.cmci-cell.mechanism { border-left-color: #6f8f86; }
.cmci-cell.comparative { border-left-color: #9b8a64; }
.cmci-cell.impact { border-left-color: #b76f5d; }
.mechanism-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.mechanism-steps li::marker {
  color: var(--teal);
  font-weight: 950;
}

.tool-drawer {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.tool-drawer summary {
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  list-style: none;
  font-weight: 950;
}

.tool-drawer summary::-webkit-details-marker { display: none; }
.tool-drawer summary span { color: var(--muted); font-size: 12px; }
.drawer-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.advanced-panel {
  padding: 0;
}
.advanced-panel > summary {
  padding: 16px;
}
.advanced-panel > .mini-list,
.advanced-panel > .grid,
.advanced-panel > .note,
.advanced-panel > .textarea,
.advanced-panel > .muted {
  margin-inline: 16px;
}
.advanced-panel > .mini-list,
.advanced-panel > .grid {
  margin-bottom: 16px;
}
.advanced-panel > .textarea {
  width: calc(100% - 32px);
}

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

.saved-case-columns ol {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.action-link { text-align: left; }

.focused { text-align: center; align-content: center; }

.practice-card {
  gap: 10px;
  align-content: start;
  text-align: left;
}

.practice-layout {
  display: grid;
  gap: 10px;
}

.practice-script {
  text-align: left;
}

.practice-timer-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--wash);
  padding: 12px;
}

.practice-timer-strip > div:first-child {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.practice-timer-strip .muted {
  font-weight: 950;
}

.practice-timer-strip .timer-options.compact {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
}

.timer {
  width: 104px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 8px solid var(--mint);
  border-top-color: var(--coral);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
}

[data-theme="dark"] .timer,
[data-theme="dark"] .score,
[data-theme="dark"] .badge {
  background: #101816;
}

.timer strong { font-size: clamp(26px, 6vw, 42px); }
.score {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 950;
}

.self-review {
  display: grid;
  gap: 10px;
  border: 1px solid #c6eee2;
  border-radius: 15px;
  background: #f5fffb;
  padding: 12px;
  text-align: left;
}

.self-review[hidden] {
  display: none;
}

.post-timer-review {
  display: grid;
  gap: 10px;
}

.post-timer-review[hidden] {
  display: none;
}

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

.input-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.outcome-panel {
  opacity: 0.72;
  box-shadow: none;
}

.outcome-panel.is-ready {
  opacity: 1;
  border-color: #9ce3d0;
  box-shadow: 0 0 0 3px rgba(13, 143, 134, 0.08), var(--shadow);
}

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

.library-segmented {
  display: none;
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
}

.library-primary {
  grid-column: 1 / -1;
  gap: 14px;
}

.library-tools {
  display: grid;
  gap: 10px;
}

.library-search {
  min-height: 52px;
  font-size: 15px;
}

.library-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.library-filter-chips .chip {
  min-height: 34px;
  padding: 7px 11px;
}

.library-motion-list {
  gap: 12px;
}

.library-list-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.library-list-controls .secondary {
  min-height: 38px;
}

.motion-card {
  gap: 9px;
}

.motion-card-text {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.motion-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.motion-card-meta span {
  border-radius: 999px;
  background: var(--wash);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 950;
  text-transform: capitalize;
}

.motion-card-clash {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.motion-card .primary {
  justify-self: start;
}

.library-secondary {
  grid-column: 1;
  box-shadow: none;
}

.library-secondary summary span:first-child {
  color: var(--ink);
  font-size: 16px;
}

.library-favorites-entry {
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-style: dashed;
  box-shadow: none;
  background: var(--wash);
}

.library-favorites-entry h2 {
  font-size: 16px;
}

.library-favorites-entry .secondary {
  justify-self: start;
  min-height: 38px;
}

.library-tournament-panel {
  grid-column: 1 / -1;
  opacity: 0.68;
  box-shadow: none;
  filter: grayscale(0.35);
}

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

.privacy-note {
  border: 1px solid rgba(8, 127, 116, 0.16);
  border-radius: 12px;
  background: rgba(231, 255, 247, 0.74);
  color: var(--muted);
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
}

.report-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.report-item-actions button {
  min-height: 36px;
}

.practice-draft-panel textarea {
  min-height: 116px;
}

.featured-placeholder {
  border-style: dashed;
  box-shadow: none;
  background: var(--wash);
}

.mini-item.compact {
  padding: 10px;
}

.mini-item.compact h3 {
  font-size: 14px;
}

.share-card {
  min-height: 170px;
  border: 1px solid #c6eee2;
  border-radius: 16px;
  background: linear-gradient(135deg, #e6fff6 0%, #fff 58%, #fff2ed 100%);
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.share-card strong {
  color: var(--teal);
  font-size: 22px;
}

.share-card span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.report-stats div {
  border: 1px solid rgba(8, 127, 116, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px;
  display: grid;
  gap: 2px;
}

.report-stats strong {
  font-size: 20px;
}

.report-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 850;
}

.badge.unlocked {
  border-color: #9ce3d0;
  background: #f4fffb;
}

.badge span:first-child {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 950;
}

.badge small {
  color: var(--muted);
  font-size: 11px;
}

.privacy-toggle {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.privacy-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.inline-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inline-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.compact-library #libraryMotionList {
  gap: 7px;
}

.compact-library #libraryMotionList .mini-item {
  padding: 9px 10px;
  gap: 5px;
}

.compact-library #libraryMotionList .mini-item h3 {
  font-size: 13px;
}

.compact-library #libraryMotionList .mini-item p:nth-of-type(n+3) {
  display: none;
}

.compact-library #libraryMotionList .mini-item .actions {
  display: flex;
  gap: 6px;
}

.compact-library #libraryMotionList .mini-item button {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 12px;
}

.mobile-entry-panel { display: none; }
.mobile-entry-grid { display: grid; gap: 9px; }
.mobile-entry-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.mobile-entry-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  list-style: none;
}

.mobile-entry-card summary::-webkit-details-marker { display: none; }
.mobile-entry-card summary strong { font-size: 15px; }
.mobile-entry-card summary span { color: var(--muted); font-size: 12px; }
.mobile-nav { display: none; }

.app-footer {
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 14px 2px 4px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.app-footer strong {
  color: var(--teal);
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; width: 100vw; max-width: 100vw; }
  .sidebar { display: none; }
  .main {
    width: 100vw;
    max-width: 100vw;
    min-height: 100dvh;
    padding: 16px 14px calc(92px + env(safe-area-inset-bottom));
  }
  .top-actions { display: none; }
  .topbar { margin-bottom: 14px; }
  .grid.two, .grid.three, .control-grid, .workspace-grid { grid-template-columns: 1fr; }
  .page { width: 100%; max-width: 720px; }
  .mobile-entry-panel { display: grid; margin-bottom: 14px; }
  .section-panel { display: none; }
  .section-panel.section-open { display: grid; }
  .desktop-only { display: none; }
  .focused { min-height: auto; align-content: start; }
  .app-footer {
    display: grid;
    margin-bottom: 6px;
  }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 5px 5px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
  }
  .mobile-nav .nav-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    gap: 0;
    padding: 4px 2px;
    font-size: 13px;
    font-weight: 950;
    text-align: center;
    border-radius: 12px;
  }
  .mobile-nav .nav-button span:first-child { display: none; }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main {
    min-height: 100dvh;
    padding: 20px 20px calc(90px + env(safe-area-inset-bottom));
  }
  .page,
  .topbar,
  .app-footer {
    max-width: 940px;
  }
  .workspace-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  }
  .hero,
  #motionPicker,
  #argumentPicker,
  #godReplyPanel {
    grid-column: 1;
  }
  #framingPanel,
  #practicePanel,
  #speechStrategyPanel {
    grid-column: 2;
  }
  #researchNotesPanel {
    grid-column: 1 / -1;
  }
  .mobile-nav {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(720px, calc(100vw - 28px));
    transform: translateX(-50%);
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
  }
  .mobile-nav .nav-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    gap: 0;
    padding: 4px 2px;
    font-size: 13px;
    font-weight: 950;
    text-align: center;
  }
  .mobile-nav .nav-button span:first-child { display: none; }
}

@media (min-width: 981px) {
  .page[data-page="train"] .hero {
    grid-column: 1 / -1;
  }
  #motionPicker,
  #argumentPicker,
  #godReplyPanel {
    grid-column: 1;
  }
  #framingPanel,
  #practicePanel,
  #speechStrategyPanel {
    grid-column: 2;
  }
  #researchNotesPanel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  h1 { font-size: 29px; }
  .page,
  .topbar,
  .app-footer {
    width: calc(100vw - 44px);
    max-width: calc(100vw - 44px);
  }
  .main,
  .card,
  .poster,
  .mini-item,
  .argument-block,
  .note,
  .notice {
    max-width: 100%;
    overflow-x: hidden;
  }
  .card, .poster { border-radius: 14px; padding: 12px; }
  .mini-item, .argument-block { padding: 10px; }
  .row,
  .mobile-entry-panel > .row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }
  .tag {
    max-width: 100%;
    white-space: normal;
  }
  .actions, .duration-row { display: grid; grid-template-columns: 1fr; }
  .actions button, .duration-row button { width: 100%; }
  .train-flow {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .flow-step {
    min-height: 36px;
    justify-content: start;
    place-items: center start;
    text-align: left;
  }
  .field-grid,
  .asset-grid {
    grid-template-columns: 1fr;
  }
  .library-layout {
    display: block;
  }
  .library-segmented {
    position: sticky;
    top: 8px;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 12px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
  }
  [data-theme="dark"] .library-segmented {
    background: rgba(23, 33, 30, 0.94);
  }
  .library-segmented button {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 950;
    text-align: center;
  }
  .library-segmented button.active {
    border-color: #9ce3d0;
    background: var(--mint);
    color: var(--teal);
  }
  [data-library-section] {
    display: none;
  }
  [data-library-section].library-panel-active {
    display: grid;
  }
  details[data-library-section].library-panel-active {
    display: block;
  }
  .library-primary,
  .library-secondary,
  .library-favorites-entry,
  .library-tournament-panel {
    grid-column: auto;
  }
  .library-search {
    min-height: 46px;
  }
  .library-filter-chips {
    gap: 6px;
  }
  .library-filter-chips .chip {
    min-height: 32px;
    padding: 6px 9px;
  }
  .library-list-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .library-list-controls .secondary {
    width: 100%;
  }
  .motion-card .primary {
    width: 100%;
  }
  .timer-options {
    display: grid;
    grid-template-columns: 1fr;
  }
  .timer-options.compact,
  .practice-timer-strip .timer-options.compact {
    grid-template-columns: 1fr;
  }
  .practice-timer-strip {
    grid-template-columns: 1fr;
  }
  .timer {
    width: 96px;
  }
  .listen-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .listen-controls .tag,
  .listen-controls .inline-toggle {
    grid-column: 1 / -1;
  }
  .listen-controls .ghost {
    width: 100%;
  }
  .timer-options [data-duration="420"] {
    grid-column: auto;
  }
  .rating-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .report-stats {
    grid-template-columns: 1fr;
  }
  .saved-case-columns {
    grid-template-columns: 1fr;
  }
  .motion-text,
  .subtitle,
  .app-footer span,
  .note,
  .notice,
  .textarea,
  .mini-item p {
    overflow-wrap: anywhere;
  }
  .textarea { min-height: 90px; }
  .badge-grid { grid-template-columns: 1fr; }
  .mobile-nav {
    left: 50%;
    right: auto;
    width: min(100vw, 430px);
    transform: translateX(-50%);
  }
}
