:root {
  /* Moji Debate Academy palette (DESIGN.md), light-only */
  --color-navy-950: #0d1257;
  --color-navy-900: #16164f;
  --color-navy-800: #2d2dbf;
  --color-navy-700: #3737e6;
  --color-navy-600: #4c4eff;
  --color-navy-500: #757aff;
  --color-navy-400: #9ea4ff;
  --color-navy-300: #c2c7ff;
  --color-navy-200: #dcdfff;
  --color-navy-100: #ebedff;
  --color-navy-50: #f5f6ff;

  --bg: #fff;
  --panel: var(--color-navy-50);
  --panel-soft: var(--color-navy-50);
  --panel-accent: var(--color-navy-100);
  --surface: #fff;
  --surface-hover: var(--color-navy-50);
  --text: var(--color-navy-900);
  --muted: #4a5068;
  --line: var(--color-navy-200);
  --green: #166534;
  --blue: var(--color-navy-950);
  --amber: #92400e;
  --red: #b91c1c;
  --focus: var(--color-navy-600);
  --ok-ink: #166534; --ok-bg: #f0fdf4; --ok-line: #bbf7d0;
  --warn-ink: #92400e; --warn-bg: #fffbeb; --warn-line: #fde68a;
  --bad-ink: #b91c1c; --bad-bg: #fef2f2; --bad-line: #fecaca;
  --red-accent: #b91c1c;
  --shadow-brand: 0 2px 8px rgba(13, 18, 87, 0.06);
  --radius: 0.75rem;
  --radius-card: 1rem;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: normal;
  color-scheme: light;
}

:where(.tracker-wrapper) *,
:where(.tracker-wrapper) *::before,
:where(.tracker-wrapper) *::after {
  box-sizing: border-box;
}

.tracker-wrapper {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(.tracker-wrapper) a {
  color: inherit;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.print-header {
  display: none;
}

.pdf-report {
  display: none;
}

.print-action-bar {
  display: none;
}

.tracker-wrapper.printing-report .print-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.print-now-button {
  width: auto;
}

.print-export-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}


/* ── Screen-only report styles (parent report tab) ── */

.parent-report-panel .pdf-report {
  display: grid;
  gap: 20px;
}

.pdf-report .report-table th {
  text-align: left;
}

.pdf-report .report-label {
  display: block;
  text-align: left;
}

/* Report meta — compact single line */
.parent-report-panel .report-meta {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Section heads — accent border + uppercase eyebrow */
.parent-report-panel .report-section {
  padding-left: 14px;
}

.parent-report-panel .report-section-head {
  margin-bottom: 10px;
}

.parent-report-panel .report-section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--text);
}

.parent-report-panel .report-section-head p {
  display: none;
}

/* Stat cards — tighter, accent bar */
.parent-report-panel .report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.parent-report-panel .report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.parent-report-panel .report-card .summary-head {
  margin-bottom: 8px !important;
}

.parent-report-panel .report-card .eyebrow {
  font-size: 12px;
  margin: 0;
}

.parent-report-panel .report-card h3 {
  margin: 0;
  font-size: 15px;
}

.parent-report-panel .report-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.parent-report-panel .report-metrics div {
  border-left: 1px solid var(--line);
  padding: 4px 8px;
  background: var(--panel);
  border-radius: 4px;
}

.parent-report-panel .report-metrics span,
.parent-report-panel .report-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.parent-report-panel .report-metrics strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  margin: 2px 0 1px;
}

/* Weakness rows — tighten */
.parent-report-panel .report-weakness-list {
  display: grid;
  gap: 6px;
}

.parent-report-panel .report-weakness-row {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 0.9fr;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-color: var(--amber);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface);
}

.parent-report-panel .report-weakness-row.weak {
  border-color: var(--red);
}

.parent-report-panel .report-weakness-row span,
.parent-report-panel .report-weakness-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.parent-report-panel .report-weakness-row strong {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  line-height: 1.2;
}

/* Plans — compact steps, collapsible meta */
.parent-report-panel .report-stack {
  display: grid;
  gap: 8px;
}

.parent-report-panel .report-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.parent-report-panel .report-plan h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.parent-report-panel .report-focus {
  margin: 0 !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 800;
}

.parent-report-panel .report-plan-step {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 8px;
}

.parent-report-panel .report-plan-step strong {
  display: block;
  font-size: 12px;
}

.parent-report-panel .report-plan-step > p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.parent-report-panel .report-plan-meta {
  margin-top: 6px;
  border: 0;
  padding: 0;
}

.parent-report-panel .report-plan-meta > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  list-style: none;
  user-select: none;
}

.parent-report-panel .report-plan-meta > summary::-webkit-details-marker {
  display: none;
}

.parent-report-panel .report-plan-meta > summary::before {
  content: "▸ ";
}

.parent-report-panel .report-plan-meta[open] > summary::before {
  content: "▾ ";
}

.parent-report-panel .report-plan-meta .plan-meta-grid {
  display: grid;
  gap: 3px;
  margin-top: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.parent-report-panel .report-plan-meta .plan-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Topic tags — horizontal chip row */
.parent-report-panel .report-topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.parent-report-panel .report-topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-color: #166534;
  border-radius: 6px;
  padding: 5px 10px;
  background: var(--surface);
}

.parent-report-panel .report-topic.weak {
  border-color: var(--red);
}

.parent-report-panel .report-topic strong {
  font-size: 12px;
  white-space: nowrap;
}

.parent-report-panel .report-topic span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.parent-report-panel .report-empty {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

/* Motions — collapsible details */
.parent-report-panel .report-motions-collapsible {
  border: 0;
  padding: 0;
  margin: 0;
}

.parent-report-panel .report-motions-collapsible > summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  user-select: none;
}

.parent-report-panel .report-motions-collapsible > summary::-webkit-details-marker {
  display: none;
}

.parent-report-panel .report-motions-collapsible > summary::before {
  content: "▸ ";
}

.parent-report-panel .report-motions-collapsible[open] > summary::before {
  content: "▾ ";
}

.parent-report-panel .report-motions-collapsible > summary .motion-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.parent-report-panel .report-motion-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.parent-report-panel .report-motion {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface);
}

.parent-report-panel .report-motion strong {
  font-size: 12px;
  white-space: nowrap;
}

.parent-report-panel .report-motion span,
.parent-report-panel .report-motion small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.parent-report-panel .report-motion p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.parent-report-panel .report-motion .info-slide {
  margin-top: 4px;
}

/* Result pill for motion rows */
.report-result-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  line-height: 1;
}

.report-result-pill.win,
.report-result-pill.top-half {
  background: #f0fdf4;
  color: var(--green);
  border: 1px solid #bbf7d0;
}

.report-result-pill.loss,
.report-result-pill.bottom-half {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
}

.report-result-pill.unknown {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Coach notes — compact */
.parent-report-panel .report-notes-section .report-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
}

.parent-report-panel .report-notes-section .report-note h3 {
  margin: 0;
  font-size: 13px;
}

.parent-report-panel .report-notes-section .report-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* Confidence in report cards */
.parent-report-panel .report-card .confidence-list {
  padding: 6px 0 0;
}

.parent-report-panel .report-card .confidence-list span {
  font-size: 12px;
  padding: 5px 8px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}

.logo {
  height: 28px;
  margin-right: 8px;
  vertical-align: middle;
}

.logo + h1 {
  display:inline-block;
  margin-left:8px;
  vertical-align:middle;
}

.topbar h1 {
  font-size: clamp(2rem, 1.7rem + 1vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
  color: var(--color-navy-950);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.source-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.source-meta a {
  color: var(--blue);
  font-weight: 700;
}

.import-panel,
.stat-summary,
.overview-card,
.motion-item,
.diagnostic-card,
.plan-card,
.training-card,
.tag-row,
.empty,
.warnings {
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-brand);
}

.import-panel {
  border: 1px solid var(--line);
  box-shadow: var(--shadow-brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-brand);
  padding: 16px;
  margin-bottom: 16px;
}

.import-form {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 16px;
}

@media (min-width: 821px) {
  .import-form {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(180px, 220px);
    grid-template-areas:
      "urls debaters format"
      "urls debaters actions";
    grid-template-rows: auto 1fr;
    column-gap: 20px;
  }
  .import-form > label:nth-of-type(1) { grid-area: urls; }
  .import-form > label:nth-of-type(2) { grid-area: debaters; }
  .import-form > label:nth-of-type(3) { grid-area: format; }
  .import-form > .action-stack { grid-area: actions; align-self: end; }
  .import-form > label:nth-of-type(-n+2) textarea { flex: 1; min-height: 132px; }
  .import-form > label:nth-of-type(-n+2) { display: flex; flex-direction: column; gap: 8px; height: 100%; }
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.action-stack {
  display: grid;
  gap: 8px;
}

:where(.tracker-wrapper) label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

:where(.tracker-wrapper) label span {
  font-size: 14px;
}

:where(.tracker-wrapper) input,
:where(.tracker-wrapper) textarea,
:where(.tracker-wrapper) select,
:where(.tracker-wrapper) button {
  width: 100%;
  border-radius: var(--radius);
  font: inherit;
  letter-spacing: 0;
}

:where(.tracker-wrapper) input,
:where(.tracker-wrapper) textarea,
:where(.tracker-wrapper) select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 160ms ease-out;
}

:where(.tracker-wrapper) input,
:where(.tracker-wrapper) textarea,
:where(.tracker-wrapper) select {
  font-weight: 400;
}

:where(.tracker-wrapper) input::placeholder,
:where(.tracker-wrapper) textarea::placeholder {
  color: var(--muted);
}

:where(.tracker-wrapper) input:focus-visible,
:where(.tracker-wrapper) textarea:focus-visible,
:where(.tracker-wrapper) select:focus-visible {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

:where(.tracker-wrapper) textarea {
  resize: vertical;
  min-height: 44px;
}

:where(.tracker-wrapper) button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

:where(.tracker-wrapper) button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  background: var(--color-navy-950);
  color: #fff;
  padding: 0 24px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

:where(.tracker-wrapper) button:where(:not([class]), .loading):hover:not(:disabled) {
  background: var(--color-navy-900);
}

:where(.tracker-wrapper) button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.secondary-button {
  border: 1px solid var(--color-navy-950);
  background: var(--surface);
  color: var(--color-navy-950);
  box-shadow: none;
}

.secondary-button:hover:not(:disabled) {
  background: var(--surface-hover);
  box-shadow: none;
}

.tool-button {
  width: auto;
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: none;
}

.tool-button:hover:not(:disabled) {
  background: var(--surface-hover);
  transform: none;
  box-shadow: none;
}

.import-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.button-icon {
  font-weight: 900;
  margin-right: 4px;
}

.roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-btn {
  padding: 2px 8px;
  min-height: 24px;
  font-size: 12px;
  width: auto;
  margin: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
}
.text-btn:hover {
  background: var(--surface);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.check-row input {
  width: auto;
}

.button-icon {
  display: none;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

.secondary-button .button-icon {
  border-color: currentColor;
}

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.import-result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.import-result-main {
  display: grid;
  gap: 4px;
}

.import-result-main strong {
  color: var(--text);
  font-size: 14px;
}

.import-result-main span {
  color: var(--muted);
}

.import-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.import-result-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface);
}

.status.error {
  color: var(--red);
  font-weight: 700;
}

.export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel-soft);
}

.export-panel[hidden] {
  display: none;
}

.export-panel-copy {
  display: grid;
  gap: 3px;
}

.export-panel-copy strong {
  color: var(--text);
  font-size: 14px;
}

.export-panel-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.export-panel-copy code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
}

.export-path-block {
  display: grid;
  gap: 2px;
}

.export-path-block label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.export-panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.export-link-button,
.export-link-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 800;
}

.export-link-button {
  background: var(--color-navy-950);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-brand);
  transition: all 0.2s ease;
}

.export-link-button:hover {
  box-shadow: var(--shadow-brand);
}

.export-link-secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s ease;
}

.export-link-secondary:hover {
  background: var(--surface-hover);
}

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

.import-steps span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.import-steps span.done {
  border-color: rgba(22, 101, 52, 0.25);
  background: rgba(22, 101, 52, 0.1);
  color: var(--green);
}

.import-steps span.active {
  border-color: rgba(13, 18, 87, 0.28);
  background: rgba(13, 18, 87, 0.1);
  color: var(--blue);
}

.import-steps span.failed {
  border-color: rgba(185, 28, 28, 0.28);
  background: rgba(185, 28, 28, 0.1);
  color: var(--red);
}

.import-error {
  margin-top: 6px;
}

.warnings {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-color: rgba(146, 64, 14, 0.35);
  background: rgba(146, 64, 14, 0.1);
  color: var(--amber);
  font-size: 14px;
}

.warnings[hidden] {
  display: none;
}

.review-panel,
.quality-panel,
.history-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-brand);
}

.review-panel[hidden],
.quality-panel[hidden],
.history-panel[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.review-row.good {
  border-color: var(--green);
}

.review-row.warn {
  border-color: var(--amber);
}

.review-row.bad {
  border-color: var(--red);
}

.review-row strong,
.review-row span {
  display: block;
}

.review-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.review-row select,
.review-row input {
  margin-top: 8px;
  min-height: 36px;
  padding: 7px 8px;
}

.quality-pill {
  display: inline-flex;
  width: max-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(74, 80, 104, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quality-pill.good,
.quality-pill.high {
  background: rgba(22, 101, 52, 0.12);
  color: var(--green);
}

.quality-pill.warn,
.quality-pill.medium {
  background: rgba(146, 64, 14, 0.14);
  color: var(--amber);
}

.quality-pill.bad,
.quality-pill.low {
  background: rgba(185, 28, 28, 0.12);
  color: var(--red);
}

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

.quality-grid div {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.quality-grid strong {
  font-size: 13px;
}

.quality-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

.results {
  display: grid;
  gap: 22px;
}

.app-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px;
}

.tab-button {
  width: auto;
  min-height: 36px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 14px;
}

.tab-button.active {
  border-color: var(--color-navy-950);
  background: var(--color-navy-950);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.coach-section {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.tournament-section-head {
  align-items: end;
}

.tournament-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
  gap: 12px;
  margin-left: auto;
}

.compact-select {
  width: auto;
  min-width: 168px;
  grid-template-columns: none;
}

.compact-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.compact-select select {
  min-height: 36px;
  padding: 7px 10px;
}

.stats-list,
.overview-list,
.student-profile-list,
.motions-list {
  display: grid;
  gap: 12px;
}

.stat-summary,
.overview-card {
  overflow: hidden;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 18px 12px;
}

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

.overview-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.overview-box span,
.overview-box strong,
.overview-box p {
  display: block;
}

.overview-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.overview-box strong {
  margin-top: 5px;
}

.overview-box p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.student-profile-card {
  overflow: hidden;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 10px 18px 12px;
}

.profile-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 0 18px 12px;
}

.profile-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.profile-box span,
.profile-box strong,
.profile-box p {
  display: block;
}

.profile-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.profile-box strong {
  margin-top: 5px;
  line-height: 1.2;
}

.profile-box p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.confidence-list {
  display: grid;
  gap: 6px;
  padding: 0 18px 12px;
}

.report-card .confidence-list {
  padding: 8px 0 0;
}

.report-mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.report-mini-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-weakness-list {
  display: grid;
  gap: 8px;
}

.report-weakness-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(3, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-color: var(--amber);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.report-weakness-row.weak {
  border-color: var(--red);
}

.report-weakness-row span,
.report-weakness-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-weakness-row strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.2;
}

.confidence-list span {
  border: 1px solid rgba(146, 64, 14, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(146, 64, 14, 0.1);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.confidence-pill {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.confidence-pill.low {
  border-color: rgba(185, 28, 28, 0.28);
  color: var(--red);
}

.confidence-pill.medium {
  border-color: rgba(146, 64, 14, 0.26);
  color: var(--amber);
}

.confidence-pill.reliable {
  border-color: rgba(22, 101, 52, 0.26);
  color: var(--green);
}

.summary-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 4px;
}

.section-head-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.confidence-summary-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.confidence-summary-badge.low {
  border-color: rgba(185, 28, 28, 0.28);
  color: var(--red);
}

.confidence-summary-badge.medium {
  border-color: rgba(146, 64, 14, 0.26);
  color: var(--amber);
}

.confidence-summary-badge.reliable {
  border-color: rgba(22, 101, 52, 0.26);
  color: var(--green);
}

.summary-head h3,
.motion-head h3 {
  font-size: 24px;
  line-height: 1.15;
}

.team-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 18px 12px;
}

.diagnostics-list,
.plan-list,
.training-list,
.tag-table {
  display: grid;
  gap: 12px;
}

.stats-list,
.stat-format-group {
  display: grid;
  gap: 12px;
}

.stats-filter-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px)) auto 1fr;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.stats-filter-bar label {
  display: grid;
  gap: 5px;
}

.stats-filter-bar label span,
.stats-filter-bar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stats-filter-bar > span {
  justify-self: end;
  align-self: center;
}

.stats-filter-bar select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.format-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
}

.format-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.format-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stat-detail-panel {
  border-top: 1px solid var(--line);
}

.stat-detail-panel > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.stat-reliability {
  display: grid;
  justify-items: end;
  gap: 4px;
  max-width: 340px;
  text-align: right;
}

.stat-reliability small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.stat-detail-panel > summary::-webkit-details-marker {
  display: none;
}

.stat-detail-panel > summary::after {
  content: ">";
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stat-detail-panel[open] > summary::after {
  content: "v";
}

.stat-detail-panel > summary span {
  font-weight: 750;
}

.stat-detail-panel > summary strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stat-detail-body {
  display: grid;
  gap: 0;
}

@media (max-width: 720px) {
  .stats-filter-bar {
    grid-template-columns: 1fr;
  }

  .stats-filter-bar > span {
    justify-self: start;
  }
}

.tournaments-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tournaments-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.tournaments-table th,
.tournaments-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.tournaments-table th {
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.tournaments-table tbody tr:last-child td {
  border-bottom: 0;
}

.tournaments-table td {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
}

.tournaments-table th:nth-child(n + 2),
.tournaments-table td:nth-child(n + 2) {
  text-align: center;
}

.tournaments-table.has-students th:nth-child(2),
.tournaments-table.has-students td:nth-child(2) {
  text-align: left;
}

.tournaments-table td strong,
.tournaments-table td small {
  display: block;
}

.tournaments-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tournaments-table a {
  color: var(--blue);
  text-decoration: none;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.quality-badge.good {
  border-color: rgba(22, 101, 52, 0.35);
  background: rgba(22, 101, 52, 0.1);
  color: var(--green);
}

.quality-badge.warn {
  border-color: rgba(146, 64, 14, 0.35);
  background: rgba(146, 64, 14, 0.1);
  color: var(--amber);
}

.quality-badge.bad {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.1);
  color: var(--red);
}

.break-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.break-badge.none {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  opacity: 0.55;
}

.break-badge.champion {
  border-color: var(--amber);
  background: rgba(146, 64, 14, 0.1);
  color: var(--amber);
}

.break-badge.final {
  border-color: var(--color-navy-800);
  background: var(--color-navy-100);
  color: var(--color-navy-900);
}

.break-badge.semi {
  border-color: var(--color-navy-300);
  background: var(--color-navy-50);
  color: var(--color-navy-800);
}

.break-badge.quarter,
.break-badge.octo,
.break-badge.elim,
.break-badge.deep,
.break-badge.break {
  border-color: rgba(22, 101, 52, 0.4);
  background: rgba(22, 101, 52, 0.08);
  color: var(--green);
}

.tournament-main-row {
  cursor: pointer;
  transition: background 0.15s;
}

.tournament-main-row:hover {
  background: var(--panel-soft);
}

.sparkline-toggle-cell {
  width: 32px;
  min-width: 32px;
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 0 !important;
}

.sparkline-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s, background 0.15s;
}

.sparkline-toggle:hover {
  background: var(--line);
}

.sparkline-open .sparkline-toggle {
  transform: rotate(180deg);
  background: var(--color-navy-100);
  border-color: var(--blue);
  color: var(--blue);
}

.sparkline-detail-row > td {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 0 !important;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  white-space: normal !important;
}

.tournament-detail-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.tournament-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.tournament-detail-head h3,
.tournament-detail-head p {
  margin: 0;
}

.tournament-detail-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-section-head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.detail-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quality-notes {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.quality-notes.good {
  border-color: rgba(22, 101, 52, 0.25);
  background: rgba(22, 101, 52, 0.05);
}

.quality-notes.warn {
  border-color: rgba(146, 64, 14, 0.25);
  background: rgba(146, 64, 14, 0.05);
}

.quality-notes.bad {
  border-color: rgba(185, 28, 28, 0.25);
  background: rgba(185, 28, 28, 0.05);
}

.quality-notes.compact {
  padding: 8px 10px;
}

.quality-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quality-chip-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}







.tournaments-table th:first-child,
.tournaments-table td:first-child {
  text-align: center;
}

.round-card-list {
  display: grid;
  gap: 8px;
}

.round-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  min-width: 0;
  text-align: left;
}

.round-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.round-card-top strong {
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
}

.round-card-top > span:not(.round-pill) {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.round-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.round-pill.good {
  background: rgba(22, 101, 52, 0.12);
  color: var(--green);
}

.round-pill.bad {
  background: rgba(185, 28, 28, 0.12);
  color: var(--red);
}

.round-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.round-card-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.round-motion p {
  margin: 0;
}

.round-motion {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.round-ballot-link {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.round-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.round-detail-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.round-detail-table th,
.round-detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.round-detail-table th {
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.round-detail-table td {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.round-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.round-detail-table td span,
.round-detail-table td a {
  display: block;
}

.round-detail-table td a {
  width: max-content;
  margin-top: 5px;
  color: var(--blue);
  text-decoration: none;
}

.tournament-detail-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.diagnostic-card,
.plan-card,
.training-card {
  overflow: hidden;
}

.diagnostic-metrics,
.intelligence-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 18px 12px;
}

.issue-list {
  display: grid;
  gap: 8px;
  padding: 0 18px 18px;
}

.issue {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.issue.high {
  border-color: var(--red);
}

.issue.medium {
  border-color: var(--amber);
}

.issue.good {
  border-color: var(--green);
}

.issue strong,
.issue span {
  display: block;
}

.issue span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.tag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.35fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.tag-row.weak {
  border-color: var(--red);
}

.tag-row:not(.weak) {
  border-color: var(--green);
}

.tag-row strong,
.tag-row span {
  display: block;
}

.tag-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.tag-row div:last-child {
  text-align: right;
}

.plan-steps {
  display: grid;
  gap: 10px;
  padding: 10px 18px 18px;
}

.plan-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.plan-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.plan-step strong {
  display: block;
}

.plan-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-step dl {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
}

.plan-step dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.plan-step dt,
.plan-step dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.plan-step dt {
  color: var(--text);
  font-weight: 900;
}

.plan-step dd {
  color: var(--muted);
}

.plan-flow-list {
  display: grid;
  gap: 10px;
  padding: 10px 18px 18px;
}

.plan-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.plan-flow span,
.plan-flow strong {
  display: block;
}

.plan-flow span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.plan-flow strong {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
}

.training-progress {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.training-progress strong {
  font-size: 24px;
  line-height: 1;
}

.training-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.training-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 18px 10px;
}

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

.training-task {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.training-task::before {
  content: attr(data-due-label);
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.training-task.todo {
  border-color: var(--blue);
}

.training-task.done {
  border-color: var(--green);
}

.training-task.skipped {
  border-color: var(--amber);
  background: rgba(146, 64, 14, 0.1);
}

.training-task-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.training-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  color: var(--text);
}

.training-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.training-check strong,
.training-check small {
  display: block;
}

.training-check small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.skip-button {
  width: auto;
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
}

.skip-button.active {
  border-color: rgba(146, 64, 14, 0.35);
  background: rgba(146, 64, 14, 0.12);
  color: var(--amber);
}

.training-task dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.training-task dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.training-task dt,
.training-task dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.training-task dt {
  font-weight: 900;
}

.training-task dd {
  color: var(--muted);
}

.training-note {
  display: grid;
  gap: 6px;
}

.training-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.training-note textarea {
  min-height: 58px;
  padding: 8px 9px;
}

.student-note {
  display: grid;
  gap: 7px;
  padding: 0 18px 18px;
}

.student-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.student-note textarea {
  min-height: 70px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.metric span .info-dot {
  width: 15px;
  height: 15px;
  margin-left: 4px;
  font-size: 12px;
  font-style: normal;
  vertical-align: middle;
}

.metric strong {
  display: block;
  margin: 5px 0 2px;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.score-distribution,
.position-analysis {
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.raw-stat-panel {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 16px 18px;
  background: var(--panel);
}

.raw-stat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.raw-stat-head h4 {
  margin: 0;
  font-size: 16px;
}

.raw-stat-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.collapsible-stat-panel > summary.raw-stat-head {
  cursor: pointer;
  list-style: none;
}

.collapsible-stat-panel > summary.raw-stat-head::-webkit-details-marker {
  display: none;
}

.collapsible-stat-panel > summary.raw-stat-head::after {
  content: ">";
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.collapsible-stat-panel[open] > summary.raw-stat-head::after {
  content: "v";
}

.raw-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.raw-stat-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.raw-stat-cell span,
.raw-stat-cell small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.raw-stat-cell strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 22px;
  line-height: 1;
}

.placement-bars {
  display: grid;
  gap: 8px;
}

.placement-bar-row {
  display: grid;
  grid-template-columns: 48px 1fr 36px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.placement-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
}

.placement-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.tag-performance-table {
  display: grid;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.tag-performance-head,
.tag-performance-row {
  display: grid;
  width: 100%;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  box-sizing: border-box;
}

.tag-performance-table.wsdc .tag-performance-head,
.tag-performance-table.wsdc .tag-performance-row,
.tag-performance-table.ap .tag-performance-head,
.tag-performance-table.ap .tag-performance-row {
  grid-template-columns: minmax(120px, 1.1fr) minmax(150px, 1.2fr) minmax(92px, 0.75fr) minmax(88px, 0.75fr) minmax(112px, 0.95fr);
}

.tag-performance-table.bp .tag-performance-head,
.tag-performance-table.bp .tag-performance-row {
  grid-template-columns: minmax(120px, 1.05fr) minmax(120px, 0.95fr) minmax(84px, 0.75fr) minmax(92px, 0.8fr) minmax(88px, 0.75fr) minmax(112px, 0.95fr);
}

.tag-performance-table.unified .tag-performance-head,
.tag-performance-table.unified .tag-performance-row {
  grid-template-columns: minmax(120px, 1.05fr) minmax(92px, 0.85fr) minmax(84px, 0.72fr) minmax(84px, 0.72fr) minmax(84px, 0.72fr) minmax(88px, 0.75fr) minmax(112px, 0.95fr);
}

.motion-type-performance .tag-performance-head.unified,
.motion-type-performance .tag-performance-row {
  grid-template-columns: 10% 16% 12% 12% 14% 16% 20%;
  column-gap: 0;
}

.motion-type-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  width: 100%;
}

.motion-type-cell strong,
.motion-type-cell small {
  display: block;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
  width: 100%;
}

.motion-type-cell small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-performance-item {
  display: grid;
  min-width: 0;
}

.tag-performance-item summary {
  display: grid;
  cursor: pointer;
  list-style: none;
}

.tag-performance-item summary::-webkit-details-marker {
  display: none;
}

.tag-performance-item summary::marker {
  content: "";
  font-size: 0;
}

.tag-performance-head {
  border-top: 0;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tag-performance-head span {
  text-align: center;
}

.tag-performance-row {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.tag-performance-row .tag-cell,
.tag-performance-row .sample-cell strong {
  color: var(--text);
}

.tag-performance-row .tag-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tag-performance-row .tag-cell::before {
  content: ">";
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.tag-performance-item[open] .tag-performance-row .tag-cell::before {
  content: "v";
}

.tag-performance-item[open] .tag-performance-row {
  background: var(--surface);
}

.tag-performance-row .score-cell {
  text-align: center;
}

.tag-performance-row .tag-cell,
.tag-performance-row .result-cell {
  text-align: center;
}

.tag-performance-row .sample-cell {
  text-align: center;
}

.tag-performance-row .score-cell {
  color: var(--text);
  font-weight: 900;
}

.sample-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.sample-cell strong,
.sample-cell span {
  display: inline;
  line-height: 1.15;
}

.sample-cell > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.confidence-cell {
  display: flex;
  justify-content: center;
}

.sample-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 21px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.motion-type-table-shell {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.motion-type-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.motion-type-table th,
.motion-type-table td {
  height: 42px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  box-sizing: border-box;
}

.motion-type-table th {
  border-top: 0;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.motion-type-table td {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.motion-type-table .result-cell,
.motion-type-table .sample-cell span {
  color: var(--muted);
}

.motion-type-table .motion-type-cell,
.motion-type-table .tag-cell,
.motion-type-table .sample-cell,
.motion-type-table .confidence-cell {
  display: table-cell;
  text-align: center;
}

.motion-type-table .motion-type-cell strong,
.motion-type-table .tag-cell strong {
  display: inline;
  width: auto;
}

.motion-type-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.motion-type-toggle::before {
  content: ">";
  font-size: 12px;
  line-height: 1;
}

.motion-type-toggle.open::before {
  content: "v";
}

.motion-type-table .motion-type-drawer-row td {
  height: auto;
  padding: 0;
  background: var(--surface);
  text-align: left;
}

.sample-pill.low {
  border-color: rgba(146, 64, 14, 0.3);
  background: rgba(146, 64, 14, 0.08);
  color: var(--amber);
}

.sample-pill.usable {
  border-color: rgba(22, 101, 52, 0.3);
  background: rgba(22, 101, 52, 0.08);
  color: var(--green);
}

.topic-motion-drawer {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
  border-top: 1px solid var(--line);
  padding: 8px;
  background: var(--surface);
}

.topic-motion-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface);
  text-align: left;
}

.topic-motion-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.topic-motion-outcome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.topic-motion-outcome.win {
  border-color: rgba(22, 101, 52, 0.18);
  background: rgba(22, 101, 52, 0.08);
  color: var(--green);
}

.topic-motion-outcome.loss {
  border-color: rgba(185, 28, 28, 0.2);
  background: rgba(185, 28, 28, 0.08);
  color: var(--red);
}

.topic-motion-outcome.unknown {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.topic-motion-body {
  min-width: 0;
}

.topic-motion-title {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.topic-motion-item p {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.motion-info-slide {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: left;
}

.motion-info-slide strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.motion-info-slide p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.topic-motion-tools {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.topic-motion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.topic-motion-meta span,
.topic-motion-meta a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.topic-motion-meta .pill {
  border-color: transparent;
  color: inherit;
  font-size: 12px;
}

.topic-motion-meta .pill.win {
  color: var(--green);
}

.topic-motion-meta .pill.loss {
  color: var(--red);
}

.topic-motion-meta .pill.unknown {
  color: var(--muted);
}

.topic-motion-meta a {
  color: var(--blue);
}

.topic-motion-item .tag-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.topic-motion-item .tag-evidence span:first-child {
  color: var(--text);
  font-weight: 800;
}

.topic-motion-item .tag-evidence.fallback span:first-child {
  color: var(--amber);
}

.topic-motion-edit {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.topic-motion-edit summary {
  width: max-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.topic-motion-edit[open] summary {
  margin-bottom: 6px;
}

.score-distribution summary,
.position-analysis summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  list-style: none;
}

.score-distribution summary::-webkit-details-marker,
.position-analysis summary::-webkit-details-marker {
  display: none;
}

.score-distribution summary::after,
.position-analysis summary::after {
  content: "v";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.score-distribution:not([open]) summary::after,
.position-analysis:not([open]) summary::after {
  content: ">";
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(13, 18, 87, 0.35);
  border-radius: 50%;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.distribution-plot {
  display: grid;
  grid-template-columns: repeat(var(--bucket-count), minmax(68px, 1fr));
  align-items: end;
  gap: 6px;
  min-height: 190px;
  padding: 22px 24px 14px;
  overflow-x: auto;
}

.score-bucket {
  display: grid;
  grid-template-rows: auto minmax(130px, 1fr) auto;
  align-items: end;
  min-width: 34px;
  height: 100%;
}

.score-count {
  display: block;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 100%;
}

.score-bar {
  width: min(100%, 78px);
  border-radius: 2px 2px 0 0;
}

.score-bar.low {
  background: var(--color-navy-300);
}

.score-bar.highlight {
  background: var(--blue);
}

.score-bucket span {
  display: block;
  padding-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.position-body {
  display: grid;
  gap: 0;
}

.position-kicker {
  padding: 24px 28px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
}

.position-table {
  display: grid;
}

.position-table-head,
.position-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 28px;
}

.position-table-head {
  min-height: 48px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
}

.position-table-head span:last-child,
.position-metrics {
  text-align: right;
}

.position-name {
  font-size: 20px;
  font-weight: 800;
}

.position-metrics strong,
.position-metrics span {
  display: block;
}

.position-metrics strong {
  font-size: 26px;
  line-height: 1;
}

.position-metrics span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.substats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 16px;
}

.substats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pill.win {
  background: rgba(22, 101, 52, 0.12);
  color: var(--green);
}

.pill.loss {
  background: rgba(185, 28, 28, 0.12);
  color: var(--red);
}

.pill.unknown {
  background: rgba(74, 80, 104, 0.12);
  color: var(--muted);
}

.motion-text {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.motion-item {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.motion-item.detailed {
  gap: 10px;
  padding: 14px;
}

.motion-list-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.motion-list-outcome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.motion-list-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.motion-list-copy .eyebrow {
  margin: 0;
}

.motion-list-copy h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.motion-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.motion-head h3 {
  font-size: 16px;
}

.motion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.motion-meta span,
.motion-meta a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface);
  font-weight: 650;
  text-decoration: none;
}

.motion-meta a {
  color: var(--blue);
}

.motion-list-tag {
  background: var(--panel-soft) !important;
  color: var(--text);
}

.motion-info-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.motion-info-toggle summary {
  min-height: 32px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.motion-info-toggle .motion-info-slide {
  margin: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 0 8px 8px;
}

.motion-card-edit {
  margin-top: 0;
}

.motion-group {
  display: grid;
  gap: 8px;
}

.motion-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--panel-soft);
}

.motion-group-head h4 {
  margin: 0;
  font-size: 13px;
}

.motion-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.weak-motion-strip {
  display: grid;
  gap: 8px;
}

.motion-mvp-panel {
  display: grid;
  gap: 12px;
}

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

.motion-triage-card,
.uncategorized-queue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.motion-triage-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.motion-triage-card h4,
.motion-triage-card p {
  margin: 0;
}

.motion-triage-card h4 {
  font-size: 15px;
}

.motion-triage-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.motion-triage-list {
  display: grid;
  gap: 8px;
}

.motion-triage-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(150px, 1.6fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-soft);
}

.motion-triage-row strong,
.motion-triage-row span {
  min-width: 0;
}

.motion-triage-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.motion-triage-row span,
.motion-triage-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.uncategorized-queue {
  overflow: hidden;
}

.uncategorized-queue summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
  list-style: none;
}

.uncategorized-queue summary::-webkit-details-marker {
  display: none;
}

.uncategorized-queue summary::after {
  content: ">";
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.uncategorized-queue[open] summary::after {
  content: "v";
}

.uncategorized-queue summary strong {
  color: var(--muted);
  font-size: 12px;
}

.collapsible-stat-panel.raw-stat-panel {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  overflow: hidden;
}

.uncategorized-queue summary,
.collapsible-stat-panel > summary.raw-stat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 0 16px;
}

.uncategorized-queue summary span,
.collapsible-stat-panel > summary.raw-stat-head h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uncategorized-queue summary strong,
.collapsible-stat-panel > summary.raw-stat-head > span {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.uncategorized-queue summary::after,
.collapsible-stat-panel > summary.raw-stat-head::after {
  justify-self: end;
  width: 24px;
  text-align: right;
}

.collapsible-stat-panel > .motion-type-table-shell {
  margin: 0 18px 16px;
}

.motion-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.motion-filters select,
.motion-filters input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 9px 10px;
  font: inherit;
}

.motion-search-control {
  grid-column: 1 / -1;
}

.motion-filters > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tag-editor {
  display: grid;
  gap: 8px;
}

.tag-editor.compact {
  border-top: 0;
  padding-top: 0;
}

.tag-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-editor small {
  display: inline-flex;
  margin-left: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tag-editor input {
  min-height: 36px;
  padding: 7px 9px;
}

.tag-editor-head {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  width: auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
}

.inline-toggle {
  display: inline-flex;
  grid-template-columns: none;
  width: auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inline-toggle input {
  width: auto;
}

.report-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.report-note h3,
.report-note p {
  margin: 0;
}

.report-note p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.empty {
  padding: 22px;
}

.empty p {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 1240px);
    padding-top: 14px;
  }

  .topbar,
  .summary-head,
  .motion-head,
  .tournament-detail-head,
  .round-card-top,
  .detail-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .round-card {
    grid-template-columns: 1fr;
  }

  .export-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .export-panel-actions {
    width: 100%;
  }

  .source-meta {
    align-items: flex-start;
    text-align: left;
  }

  .tournament-controls {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .tournament-controls .compact-select {
    flex: 1 1 180px;
  }

  .stat-reliability {
    justify-items: start;
    max-width: none;
    text-align: left;
  }

  .import-form,
  .overview-metrics,
  .overview-grid,
  .metrics-grid,
  .diagnostic-metrics,
  .intelligence-summary,
  .motion-mvp-grid,
  .plan-flow,
  .training-timeline,
  .training-task-main,
  .motion-filters,
  .tag-editor-head,
  .tag-row,
  .review-row,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .position-table-head,
  .position-row,
  .tag-performance-head,
  .tag-performance-row {
    grid-template-columns: 1fr;
  }

  .position-table-head span:last-child,
  .position-metrics,
  .tag-row div:last-child,
  .training-progress {
    text-align: left;
    justify-items: start;
  }

  .tag-performance-head span:nth-child(4),
  .tag-performance-row .score-cell {
    text-align: left;
  }

  .tag-performance-head span,
  .tag-performance-row .sample-cell,
  .confidence-cell {
    justify-content: flex-start;
    text-align: left;
  }

  .sample-pill {
    width: max-content;
  }

  .motion-search-control {
    grid-column: 1 / -1;
  }

  .motion-triage-row,
  .tag-editor-head {
    grid-template-columns: 1fr;
  }

  .team-link {
    width: max-content;
  }

  .tournaments-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .tournaments-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .tournaments-table thead {
    display: none;
  }

  .tournaments-table tbody,
  .tournaments-table tr,
  .tournaments-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .tournaments-table tbody tr.tournament-main-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface);
  }

  .tournaments-table tbody tr.tournament-main-row td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-bottom: 0;
    padding: 0 !important;
    text-align: left !important;
    white-space: normal;
  }

  .tournaments-table tbody tr.tournament-main-row td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
  }

  .tournaments-table tbody tr.tournament-main-row .sparkline-toggle-cell,
  .tournaments-table tbody tr.tournament-main-row .tournament-name-cell {
    grid-column: 1 / -1;
  }

  .tournaments-table tbody tr.tournament-main-row .sparkline-toggle-cell {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
  }

  .tournaments-table tbody tr.tournament-main-row .sparkline-toggle-cell::before {
    display: none;
  }

  .sparkline-detail-row > td {
    position: static;
    display: block;
    padding: 0 !important;
    border-bottom: 0;
  }

  .tournament-detail-panel {
    padding: 10px 0 12px;
  }

  .sparkline-svg {
    height: 160px;
  }
}


/* ── Touch, density and mobile refinements ── */
.more-filters {
  grid-column: 1 / -1;
  order: 5;
}
.more-filters > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::after { content: ""; width: 7px; height: 7px; margin-left: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.more-filters[open] > summary::after { transform: rotate(225deg); }
.more-filters > summary:hover { background: var(--surface-hover); }
.more-filters > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.more-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  padding-top: 12px;
}

summary,
.tag-chip,
.sparkline-toggle,
.tab-button,
.tool-button { min-height: 44px; }
.sparkline-toggle { min-width: 44px; }
.tournament-name-cell a,
.source-meta a { display: inline-flex; align-items: center; min-height: 44px; }

.motion-type-table-shell { overflow-x: auto; }

.app-tabs { gap: 4px; }
.tab-button.active { font-weight: 700; }

@media (max-width: 560px) {
  .tournaments-table tbody tr.tournament-main-row { grid-template-columns: minmax(0, 1fr); }
  .tournaments-table tbody tr.tournament-main-row td { grid-template-columns: minmax(84px, 36%) minmax(0, 1fr); }
  .break-badge, .report-result-pill, .sample-pill { white-space: nowrap; max-width: 100%; }
  .more-filters-grid { grid-template-columns: 1fr 1fr; }
  .motion-filters { gap: 12px; }
}

@media (max-width: 820px) {
  .motion-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .motion-filters > .tool-button { width: 100%; }
  .motion-filters > span { align-self: center; }
}

@media print {
  @page {
    margin: 14mm;
  }

  .tracker-wrapper {
    background: var(--surface);
    color: #111;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .print-header {
    display: block;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #cfd4da;
  }

  .print-header p,
  .print-header h1 {
    margin: 0;
  }

  .print-header p {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .print-header h1 {
    margin-top: 4px;
    font-size: 26px;
    line-height: 1.1;
  }

  .topbar,
  .import-panel,
  .warnings,
  .review-panel,
  .app-tabs,
  .print-action-bar,
  .parent-report-panel > .section-head,
  .tag-editor,
  .team-link,
  .motion-meta a {
    display: none !important;
  }

  .results,
  .coach-section,
  .stats-list,
  .motions-list,
  .diagnostics-list,
  .plan-list,
  .tag-table {
    gap: 10px;
  }

  .tab-panel {
    display: none !important;
  }

  .tab-panel[data-tab-panel="report"] {
    display: block !important;
  }

  .pdf-report {
    display: grid !important;
    gap: 16px;
    color: #111;
  }

  .stat-summary,
  .motion-item,
  .diagnostic-card,
  .plan-card,
  .tag-row,
  .metric,
  .issue,
  .plan-step,
  .score-distribution,
  .position-analysis {
    break-inside: avoid;
    box-shadow: none;
  }

  .summary-head,
  .metrics-grid,
  .diagnostic-metrics,
  .intelligence-summary,
  .issue-list,
  .plan-steps {
    padding-left: 12px;
    padding-right: 12px;
  }

  .summary-head h3,
  .motion-head h3 {
    font-size: 18px;
  }

  .metric strong {
    font-size: 22px;
  }

  .score-distribution summary,
  .position-analysis summary {
    min-height: 42px;
    padding: 0 12px;
  }

  .score-distribution summary::after,
  .position-analysis summary::after {
    display: none;
  }

  .distribution-plot {
    min-height: 140px;
    padding: 16px 12px 10px;
  }

  .position-kicker,
  .position-table-head,
  .position-row {
    padding-left: 12px;
    padding-right: 12px;
  }

  .report-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
  }

  .report-section {
    break-inside: avoid;
  }

  .report-section + .report-section {
    padding-top: 8px;
    border-top: 1px solid #d9dee4;
  }

  .report-section-head {
    margin-bottom: 8px;
  }

  .report-section-head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
  }

  .report-section-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
  }

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

  .report-card,
  .report-plan,
  .report-training,
  .report-note,
  .report-weakness-row,
  .report-motion,
  .report-topic,
  .report-empty {
    break-inside: avoid;
    border: 1px solid #d9dee4;
    border-radius: 6px;
    background: var(--surface);
  }

  .report-card,
  .report-plan,
  .report-training,
  .report-note {
    padding: 10px;
  }

  .report-card h3,
  .report-plan h3,
  .report-training h3,
  .report-note h3 {
    margin: 0 0 8px;
    font-size: 15px;
  }

  .report-card p,
  .report-plan p,
  .report-training p,
  .report-note p {
    margin: 8px 0 0;
    color: #30343a;
    font-size: 11px;
    line-height: 1.35;
  }

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

  .report-metrics div {
    background: var(--surface);
    padding: 6px;
  }

  .report-metrics span,
  .report-metrics small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2;
  }

  .report-metrics strong {
    display: block;
    margin: 3px 0 1px;
    font-size: 15px;
    line-height: 1;
  }

  .report-stack {
    display: grid;
    gap: 8px;
  }

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

  .report-training {
    display: grid;
    gap: 7px;
  }

  .report-training div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
  }

  .report-training span,
  .report-training strong {
    display: block;
    font-size: 10px;
    line-height: 1.35;
  }

  .report-training span {
    color: var(--muted);
    font-weight: 800;
  }

  .report-focus {
    margin-top: 0 !important;
    color: var(--muted) !important;
    font-weight: 800;
  }

  .report-weakness-list {
    display: grid;
    gap: 6px;
  }

  .report-weakness-row {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.1fr 0.9fr;
    gap: 6px;
    align-items: center;
    border-color: #92400e;
    padding: 7px 8px;
  }

  .report-weakness-row.weak {
    border-color: var(--red);
  }

  .report-weakness-row span,
  .report-weakness-row small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2;
  }

  .report-weakness-row strong {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
  }

  .report-plan-step {
    border-top: 1px solid #d9dee4;
    padding-top: 8px;
    margin-top: 8px;
  }

  .report-plan-step strong,
  .report-plan-step span {
    display: block;
  }

  .report-plan-step strong {
    font-size: 12px;
  }

  .report-plan-step div {
    display: grid;
    gap: 3px;
    margin-top: 6px;
  }

  .report-plan-step span {
    color: #30343a;
    font-size: 10px;
    line-height: 1.35;
  }

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

  .report-topic,
  .report-empty {
    padding: 7px 8px;
    border-color: #166534;
  }

  .report-topic.weak {
    border-color: var(--red);
  }

  .report-topic strong,
  .report-topic span {
    display: block;
  }

  .report-topic strong {
    font-size: 11px;
  }

  .report-topic span,
  .report-empty {
    color: var(--muted);
    font-size: 10px;
  }

  .report-motion-list {
    display: grid;
    gap: 6px;
  }

  .report-motion {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr) 120px;
    gap: 8px;
    padding: 8px;
  }

  .report-motion strong,
  .report-motion span,
  .report-motion small {
    display: block;
  }

  .report-motion strong {
    font-size: 11px;
  }

  .report-motion span,
  .report-motion small {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.3;
  }

  .report-motion p {
    margin: 0;
    font-size: 10px;
    line-height: 1.35;
  }
}


/* Progress Timeline styles */
.student-progress-timeline {
  padding: 12px 18px 14px;
  border-top: 1px dashed var(--line);
  background: var(--surface);
}

.progress-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.progress-row span {
  color: var(--muted);
}

.progress-row strong {
  color: var(--text);
}

.progress-sparkline-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sparkline {
  overflow: visible;
}

.delta {
  font-size: 12px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-left: 6px;
}

.delta.positive {
  background: rgba(22, 101, 52, 0.1);
  color: var(--green);
}

.delta.negative {
  background: rgba(185, 28, 28, 0.1);
  color: var(--red);
}

.delta.neutral {
  background: var(--surface);
  color: var(--muted);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  /* Keep colour and opacity feedback; drop movement and shadow transitions. */
  *, *::before, *::after {
    animation: none !important;
    transition-property: color, background-color, border-color, opacity !important;
  }
}

/* Tabular figures for scores, ranks and counts */
.tournaments-table,
.stats-table,
.report-table,
.report-metrics,
.stat-summary,
.overview-card {
  font-variant-numeric: tabular-nums;
}

.tab-button:hover:not(.active) { background: var(--surface-hover); color: var(--text); }

/* ── Status pills: one palette shared with Recap and Analytics ── */
.break-badge,
.format-badge,
.sample-pill,
.confidence-pill,
.quality-pill,
.quality-badge,
.report-result-pill,
.round-pill,
.pill {
  border-radius: 999px;
  font-weight: 600;
}

.tracker-wrapper .report-result-pill.win,
.tracker-wrapper .report-result-pill.top-half,
.tracker-wrapper .quality-pill.good,
.tracker-wrapper .quality-pill.high,
.tracker-wrapper .confidence-pill.reliable,
.tracker-wrapper .break-badge.quarter,
.tracker-wrapper .break-badge.octo,
.tracker-wrapper .break-badge.elim,
.tracker-wrapper .break-badge.deep,
.tracker-wrapper .break-badge.break,
.tracker-wrapper .round-pill.good,
.tracker-wrapper .pill.win,
.tracker-wrapper .topic-motion-meta .pill.win,
.tracker-wrapper .quality-badge.good,
.tracker-wrapper .import-steps span.done,
.tracker-wrapper .delta.positive {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
  color: var(--ok-ink);
}
.tracker-wrapper .quality-pill.warn,
.tracker-wrapper .quality-pill.medium,
.tracker-wrapper .confidence-pill.medium,
.tracker-wrapper .confidence-pill.low,
.tracker-wrapper .sample-pill.low,
.tracker-wrapper .break-badge.champion,
.tracker-wrapper .quality-badge.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
}
.tracker-wrapper .report-result-pill.loss,
.tracker-wrapper .report-result-pill.bottom-half,
.tracker-wrapper .quality-pill.bad,
.tracker-wrapper .quality-pill.low,
.tracker-wrapper .round-pill.bad,
.tracker-wrapper .pill.loss,
.tracker-wrapper .topic-motion-meta .pill.loss,
.tracker-wrapper .quality-badge.bad,
.tracker-wrapper .import-steps span.failed,
.tracker-wrapper .delta.negative {
  background: var(--bad-bg);
  border: 1px solid var(--bad-line);
  color: var(--bad-ink);
}
.tracker-wrapper .format-badge,
.tracker-wrapper .break-badge.final,
.tracker-wrapper .break-badge.semi,
.tracker-wrapper .sample-pill.usable,
.tracker-wrapper .pill.unknown,
.tracker-wrapper .topic-motion-meta .pill.unknown,
.tracker-wrapper .report-result-pill.unknown,
.tracker-wrapper .import-steps span.active {
  background: var(--color-navy-50);
  border: 1px solid var(--color-navy-200);
  color: var(--color-navy-900);
}

/* ── Red accent, used sparingly like Recap and Analytics ── */
.title-accent { color: #e52c38; }
.tournaments-table a:hover,
.source-meta a:hover,
.tournament-name-cell a:hover { color: var(--red-accent); }


/* Large imports: paged lists */
.show-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

/* Round table: same anatomy as the topic-frequency table in Moji Motions */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.round-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.round-table th,
.round-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.round-table thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.round-table thead th:first-child,
.round-table tbody th { width: 4.5rem; }
.round-table thead th:nth-child(2) { width: 8rem; }
.round-table thead th:nth-child(3) { width: 12rem; }
.round-table thead th:nth-child(4) { width: 9rem; }
.round-table thead th:nth-child(6) { width: 5rem; }
.round-table tbody th { font-weight: 600; }
.round-table .rt-result { font-weight: 600; }
.round-table .rt-motion .round-motion { margin: 0; line-height: 1.5; }
.round-table .rt-none { color: var(--muted); }
.rt-info { margin-top: 6px; }
.rt-info > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.rt-info > p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.round-table .round-ballot-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); font-weight: 600; }
.round-table .round-ballot-link:hover { color: var(--red-accent); }

@media (max-width: 720px) {
  .round-table, .round-table tbody { display: block; }
  .round-table thead { display: none; }
  .round-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .round-table th, .round-table td { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; padding: 0; border: 0; width: auto !important; }
  .round-table th::before, .round-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .round-table td.rt-ballot:empty { display: none; }
}

/* The round table sits inside the tournaments table; undo that table's cell styling for it. */
.tournaments-table .round-table th,
.tournaments-table .round-table td {
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  position: static;
  min-width: 0;
}
.tournaments-table .round-table thead th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tournaments-table .round-table tbody th,
.tournaments-table .round-table .rt-result { font-weight: 600; }
.tournaments-table .round-table .rt-motion,
.tournaments-table .round-table .rt-motion p { color: var(--text); }

/* Score trend: drawn at panel width, flat, legible */
.score-trend {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.score-trend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
}
.score-trend-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
}
.score-trend-stats dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.score-trend-stats dd { margin: 2px 0 0; color: var(--text); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-trend-legend { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.score-trend-legend li { display: inline-flex; align-items: center; gap: 6px; }
.score-trend-plot { width: 100%; min-width: 0; }
.score-trend-svg { display: block; max-width: 100%; font-family: inherit; overflow: visible; }
.trend-dot.win { fill: var(--ok-ink); stroke: #fff; }
.trend-dot.loss { fill: var(--bad-ink); stroke: #fff; }
.trend-dot.neutral { fill: var(--color-navy-950); stroke: #fff; }
i.trend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
i.trend-dot.win { background: var(--ok-ink); }
i.trend-dot.loss { background: var(--bad-ink); }
@media (max-width: 820px) {
  .tournaments-table .round-table,
  .tournaments-table .round-table tbody { display: block; }
  .tournaments-table .round-table thead { display: none; }
  .tournaments-table .round-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tournaments-table .round-table th,
  .tournaments-table .round-table td { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; padding: 0; border: 0; width: auto !important; }
  .tournaments-table .round-table th::before,
  .tournaments-table .round-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .tournaments-table .round-table td.rt-ballot:empty { display: none; }
}

.tournaments-table .tournament-detail-panel { text-align: left; }
.trend-avg { display: inline-block; width: 18px; height: 0; border-top: 1px dashed var(--color-navy-950); opacity: 0.6; }
.tournaments-table .round-table .round-pill { justify-self: start; }


/* ═══ Moji Debater Tracker (one debater, many tournaments) ═══ */
.dt-shell {
  /* Homepage container: 75rem with 20px (mobile) to 48px (desktop) gutters. */
  width: min(75rem, calc(100% - 2 * clamp(1.25rem, 4vw, 3rem)));
  margin: 0 auto;
  padding: 32px 0 64px;
  display: grid;
  gap: 24px;
}
.dt-header h1 {
  margin: 0;
  color: var(--color-navy-950);
  font-size: clamp(2rem, 1.7rem + 1vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}
.dt-header p { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
@media (min-width: 1000px) { .dt-header p { white-space: nowrap; } }

/* setup */
.dt-import { margin: 0; padding: 20px; }
@media (max-width: 820px) {
  .debater-tracker :is(input, textarea, select) { min-height: 44px; font-size: 16px; }
}

/* empty state: how it works + sibling tools */
.dt-intro { display: grid; gap: 16px; }
.dt-intro h2 { margin: 0; color: var(--color-navy-950); font-size: 20px; line-height: 28px; font-weight: 700; }
.dt-intro-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: dt-intro; }
@media (min-width: 821px) { .dt-intro-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.dt-intro-steps li { counter-increment: dt-intro; display: grid; gap: 4px; align-content: start; padding: 16px 20px; border: 1px solid var(--color-navy-200); border-radius: 16px; background: var(--color-navy-50); }
.dt-intro-steps li::before { content: counter(dt-intro); display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 6px; border-radius: 50%; background: var(--color-navy-950); color: #fff; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-intro-steps strong { color: var(--color-navy-950); font-size: 16px; line-height: 24px; }
.dt-intro-steps span { color: var(--muted); font-size: 15px; line-height: 1.5; }
.dt-intro-links { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.dt-intro-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-navy-950); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.dt-intro-links a:hover { color: var(--color-navy-700); }
.dt-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 821px) {
  .dt-form {
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas:
      "name format"
      "urls urls"
      "action action";
    column-gap: 20px;
    align-items: start;
  }
  .dt-field-name { grid-area: name; }
  .dt-field-format { grid-area: format; }
  .dt-field-urls { grid-area: urls; }
  .dt-field-urls textarea { min-height: 96px; }
  .dt-form > button, .dt-form-actions { grid-area: action; justify-self: end; width: auto; }
  .dt-form-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
  .dt-form-actions button { width: auto; min-width: 140px; }
}
.dt-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-brand);
}
.dt-summary strong { display: block; color: var(--text); font-size: 20px; font-weight: 700; }
.dt-summary span { color: var(--muted); font-size: 14px; }
.dt-summary-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dt-summary-actions button { width: auto; }
.status:empty { display: none; }

/* sections */
.dt-results { display: grid; gap: 40px; }
.dt-section { display: grid; gap: 16px; }
.dt-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.dt-section-head h2, .dt-results .coach-section .section-head h2 { margin: 0; color: var(--text); font-size: 24px; line-height: 1.25; font-weight: 700; }
.dt-section-head > span { color: var(--muted); font-size: 14px; }
.dt-formats { display: flex; gap: 4px; padding: 4px; width: max-content; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }

/* overview */
.dt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.dt-tile { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.dt-tile dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.dt-tile dd { margin: 6px 0 2px; color: var(--color-navy-950); font-size: 32px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.dt-tile small { color: var(--muted); font-size: 13px; line-height: 1.4; }
@media (max-width: 820px) { .dt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* topics: same anatomy as the topic-frequency table in Moji Motions */
.dt-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.dt-sort span { font-weight: 600; }
.dt-sort select { width: auto; min-height: 40px; padding: 6px 10px; }
.dt-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.dt-table th, .dt-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.dt-table thead th { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dt-table thead th:nth-child(1) { width: 34%; }
.dt-table thead th:nth-child(2) { width: 120px; }
.dt-table thead th:nth-child(4) { width: 90px; }
.dt-table thead th:nth-child(5) { width: 80px; }
.dt-table tbody th { font-weight: 600; }
.dt-table tr.thin > th, .dt-table tr.thin > td { color: var(--muted); }
.dt-toggle { width: auto; min-height: 36px; padding: 0; border: 0; background: none; box-shadow: none; color: var(--text); font-weight: 600; text-align: left; justify-content: flex-start; }
.dt-toggle:hover:not(:disabled) { background: none; color: var(--red-accent); }
.dt-toggle::after { content: ""; width: 6px; height: 6px; margin-left: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: 0.6; }
.dt-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.dt-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--color-navy-200); background: var(--color-navy-50); color: var(--color-navy-900); font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.dt-pill.reliable { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.dt-pill.low { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.dt-bar { display: inline-block; width: 96px; height: 6px; margin-right: 10px; border-radius: 999px; background: var(--color-navy-100); vertical-align: middle; overflow: hidden; }
.dt-bar i { display: block; height: 100%; border-radius: 999px; background: var(--color-navy-950); }
.dt-bar i.weak { background: var(--red-accent); }
.dt-rate small { color: var(--muted); font-size: 12px; }
.dt-drawer > td { padding: 0 10px 16px; background: var(--surface); }
.dt-motions { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.dt-motions li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.dt-motions p { margin: 0; line-height: 1.5; }
.dt-motions small { color: var(--muted); font-size: 13px; }
.dt-note { margin: 0; color: var(--muted); font-size: 14px; }

@media (max-width: 820px) {
  .dt-table, .dt-table tbody { display: block; }
  .dt-table thead { display: none; }
  .dt-table tbody tr:not(.dt-drawer) { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .dt-table tbody tr:not(.dt-drawer) > * { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; padding: 0; border: 0; align-items: center; }
  .dt-table tbody tr:not(.dt-drawer) > *::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .dt-table .dt-drawer, .dt-table .dt-drawer > td { display: block; }
}

/* the tournaments table keeps its own anatomy; just align its heading with the other sections */
.dt-results .coach-section { gap: 16px; }

.dt-rate-cell { display: flex; align-items: center; gap: 10px; }
.dt-bar { margin-right: 0; flex: none; }
.dt-pill { justify-self: start; }
.dt-motions .pill { align-self: start; justify-self: start; width: max-content; height: auto; padding: 2px 10px; font-size: 12.5px; line-height: 1.6; border-radius: 999px; }

/* Login prompt: same sizing as the one on /certificates (max-w-md, rounded-2xl, p-6 sm:p-8, mt-2 / mt-6 / mt-4) */
.dt-dialog { width: calc(100% - 2rem); max-width: 28rem; padding: 1.5rem; border: 0; border-radius: 1rem; background: #fff; color: var(--text); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
@media (min-width: 640px) { .dt-dialog { padding: 2rem; } }
.dt-dialog::backdrop { background: rgba(13, 18, 87, 0.5); }
.dt-dialog h2 { margin: 0; color: var(--color-navy-950); font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.dt-dialog p { margin: 0.5rem 0 0; color: #374151; line-height: 1.5; }
.dt-dialog-actions { display: flex; flex-direction: column-reverse; gap: 0.75rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .dt-dialog-actions { flex-direction: row; justify-content: flex-end; } }
.dt-dialog-actions button { width: auto; }
@media (max-width: 639px) { .dt-dialog-actions button { width: 100%; } }
.dt-dialog .dt-dialog-note { margin: 1rem 0 0; color: #4b5563; font-size: 0.875rem; line-height: 1.25rem; }
.dt-link { display: inline; width: auto; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--color-navy-950); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.dt-link:hover:not(:disabled) { background: none; color: var(--red-accent); }

/* Selects: drawn chevron with room to breathe instead of the native glyph hugging the edge */
.debater-tracker select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%230d1257' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 12px 8px;
  cursor: pointer;
}
.debater-tracker select:hover { background-color: var(--surface-hover); }
.debater-tracker select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Tailwind's reset zeroes every margin, which also removes the margin:auto that centres a modal <dialog>. */
.debater-tracker dialog.dt-dialog { margin: auto; inset: 0; max-height: calc(100dvh - 32px); overflow: auto; }

.dt-summary .dt-save-hint { display: block; margin-top: 6px; font-size: 14px; }

/* ── Import progress ── */
.dt-steps { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 0; padding: 0; list-style: none; }
.dt-steps li { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding-right: 20px; color: var(--muted); font-size: 14px; font-weight: 600; }
.dt-steps li:not(:last-child)::after { content: ""; width: 28px; height: 1px; margin-left: 10px; background: var(--line); }
.dt-step-mark { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--color-navy-300); border-radius: 50%; background: #fff; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dt-steps li.active { color: var(--color-navy-950); }
.dt-steps li.active .dt-step-mark { border-color: var(--color-navy-950); border-top-color: transparent; animation: dt-spin 0.9s linear infinite; }
.dt-steps li.done { color: var(--text); }
.dt-steps li.done .dt-step-mark { border-color: var(--ok-ink); background: var(--ok-ink); color: #fff; }
.dt-steps li.done:not(:last-child)::after { background: var(--ok-line); }
.dt-steps li.failed { color: var(--bad-ink); }
.dt-steps li.failed .dt-step-mark { border-color: var(--bad-ink); background: var(--bad-ink); color: #fff; }
@keyframes dt-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .dt-steps { flex-direction: column; gap: 0; }
  .dt-steps li:not(:last-child)::after { display: none; }
}
.debater-tracker .import-error { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--bad-line); border-radius: var(--radius); background: var(--bad-bg); color: var(--bad-ink); font-size: 14px; font-weight: 600; }

/* ── Overall (cross-format) ── */
.dt-table.dt-compare { table-layout: auto; }
.dt-table.dt-compare thead th:nth-child(n) { width: auto; }
.dt-table.dt-compare tbody th { font-weight: 600; color: var(--text); }
.dt-compare-note { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.dt-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.dt-chip { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dt-chart-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.dt-chart-note { max-width: 65ch; text-wrap: pretty; line-height: 1.5; }
.dt-point { cursor: pointer; outline: none; }
.dt-point:hover, .dt-point:focus-visible { stroke: var(--focus); stroke-width: 3; }
.dt-table.dt-compare thead th { white-space: normal; }
.dt-table.dt-compare thead th:not(:first-child), .dt-table.dt-compare tbody td { font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .dt-table.dt-compare tbody tr > th[scope="row"] { display: block; grid-template-columns: none; color: var(--text); font-size: 15px; }
  .dt-table.dt-compare tbody tr > th[scope="row"]::before { content: none; }
  .dt-table.dt-compare tbody tr:not(.dt-drawer) > td { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (pointer: coarse) { .dt-toggle { min-height: 44px; } }

/* Format colours for the Overall chart: one definition for lines, markers, labels */
.debater-tracker { --fmt-bp: #0d1257; --fmt-ap: #b45309; --fmt-wsdc: #0f766e; }
.dt-point-value { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }

@media (pointer: coarse) {
  .tab-button { min-height: 44px; }
}
