/* Shared surfaces, text and controls */
[hidden] { display: none !important; }
html { font-size: 100%; }
body { font-synthesis: none; }
p, h1, h2, h3, dl, dd, figure { margin: 0; }
h1, .card-heading { font: var(--md-sys-typescale-headline-sm); }
h2 { font: var(--md-sys-typescale-headline-sm); }
h3 { font: var(--md-sys-typescale-title-md); }
a { color: var(--md-sys-color-primary); }
button, input { font: inherit; color: inherit; }
button, summary, a, input { touch-action: manipulation; }
button {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: var(--ca-touch-min);
}
button:disabled { cursor: wait; opacity: .62; }
button:active:not(:disabled) { opacity: .8; }
:where(button, a, input, summary):focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 2; padding: 12px; background: var(--md-sys-color-surface-container-high); }
.shell { max-width: var(--ca-max-width); padding-inline: var(--ca-page-gutter); margin-inline: auto; }
header, footer, header nav, .brand, .row, .actions, .view-tabs, .quiz-controls, .quiz-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}
header, footer {
  justify-content: space-between;
  background: var(--md-sys-color-surface-container-low);
  margin-inline: calc(-1 * var(--ca-page-gutter));
  padding-inline: var(--ca-page-gutter);
}
header { height: 56px; }
.brand { font: var(--md-sys-typescale-title-md); white-space: nowrap; }
.mark { display: flex; align-items: center; gap: 2px; width: 21px; transform: skew(-14deg); }
.mark i { display: block; width: 4px; height: 13px; background: var(--md-sys-color-primary); }
.mark i:nth-child(2) { height: 20px; }
.mark i:last-child { height: 9px; }
nav { display: flex; align-items: center; gap: 2px; }
.nav-button, .back, .text-link, .inline-link {
  font: var(--md-sys-typescale-label-lg);
  color: var(--md-sys-color-primary);
}
.nav-button { padding-inline: 6px; font: var(--md-sys-typescale-label-md); }
.theme-button {
  width: var(--ca-touch-min);
  border-radius: var(--md-sys-shape-corner-full);
  display: inline-grid;
  place-items: center;
  color: var(--md-sys-color-on-surface-variant);
}
.theme-button svg, .alternatives svg, .empty-cover svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
main { min-height: calc(100svh - 108px); padding-block: var(--ca-section-gap) 28px; }
main:focus { outline: none; }
footer { min-height: 52px; color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-body-sm); }
.button, .view-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ca-touch-min);
  padding: 10px 20px;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-lg);
  text-align: center;
}
.button.primary, .button.accent { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.button.soft, .view-tabs button {
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
}
.button.tonal, .button.result-link, .view-tabs .active {
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
  border-color: transparent;
}
.button.clear { color: var(--md-sys-color-primary); }
.button.danger { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.actions { flex-wrap: wrap; margin-top: var(--ca-section-gap); }
.back { margin-bottom: 8px; }
.panel, .welcome {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-xl);
  padding: clamp(18px, 4vw, 28px);
}
.inner .panel + .panel, .fold, .axis-evidence { margin-top: var(--ca-section-gap); }
.page-head, .view-tabs { margin-bottom: var(--ca-section-gap); }
.page-head p, .muted, .hint, .small-note, .body-copy p, .privacy dd, .fold summary, .demo-note,
.report-meta, .scale-note, .radar-figure figcaption, .welcome-note, .exposure-note, .account-copy > span,
.field small, .optional, .metric dt, .quiz-foot, .eyebrow { color: var(--md-sys-color-on-surface-variant); }
.small-note, .demo-note, .report-meta, .scale-note, .radar-figure figcaption, .welcome-note,
.exposure-note, .field small, .optional, .metric dt, .quiz-foot { font: var(--md-sys-typescale-body-sm); }
.eyebrow { font: var(--md-sys-typescale-label-md); }
.welcome-heading h1 { font-size: clamp(24px, 6vw, 32px); }
.welcome-heading em { color: var(--md-sys-color-primary); font-style: normal; }
.welcome-heading p, .page-head p, .panel > p, .fold p { margin-top: 8px; }
.welcome-actions, .stack, .account-forms, .unlock-actions { display: grid; gap: 12px; }
.welcome-actions, .unlock-actions { margin-top: 20px; }
.account-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-top: 20px;
  text-align: start;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-md);
}
.account-symbol, .account-next, .mode-dot { color: var(--md-sys-color-primary); }
.account-copy { flex: 1; }
.account-copy strong, .account-copy > span { display: block; }
.account-copy small, .mode-dot { margin-inline: 6px; }
.account-copy small, .account-copy > span { font: var(--md-sys-typescale-body-sm); }
.welcome-note { margin-top: 20px; }
.code-entry, input[type=number] { font-variant-numeric: tabular-nums; }
.form-grid, .unlock-actions > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; }
.field input {
  width: 100%;
  min-height: var(--ca-touch-min);
  font-size: 16px;
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-sm);
}
.consent-box, .notice, .code, #message, .retry-box {
  padding: var(--ca-card-pad);
  border-radius: var(--md-sys-shape-corner-md);
  background: var(--md-sys-color-surface-container-high);
}
#message, .retry-box { color: var(--md-sys-color-on-error-container); background: var(--md-sys-color-error-container); margin-top: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input, meter { accent-color: var(--md-sys-color-primary); }
.inline-link { text-decoration: underline; }
details summary { cursor: pointer; padding-block: 12px; min-height: var(--ca-touch-min); }
.privacy dt { font-weight: 600; margin-top: 8px; }
.privacy dd, .code, .report-meta, .dim-row, .rank-table { overflow-wrap: anywhere; }
.code { font-family: var(--md-sys-typescale-font-mono); user-select: all; }
.unlock-actions > .button { min-height: 54px; }
.unlock-actions > div .button { padding-inline: 10px; }

/* Arena. The two jackets share a single grid row at every phone width. */
body[data-page="survey"] header { display: none; }
body[data-page="survey"] main { padding-top: 0; min-height: calc(100svh - 52px); }
.progress-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  column-gap: 6px;
  margin-bottom: 12px;
}
.progress-line h1 { font: var(--md-sys-typescale-headline-sm); }
.confirmed-progress { color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-label-md); white-space: nowrap; }
.quiz-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-primary);
}
.quiz-progress::-webkit-progress-bar { background: var(--md-sys-color-surface-container-highest); }
.quiz-progress::-webkit-progress-value { background: var(--md-sys-color-primary); }
.quiz-progress::-moz-progress-bar { background: var(--md-sys-color-primary); }
.match, .lean-choices, .alternatives {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ca-arena-gap);
}
.chart-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--md-sys-shape-corner-lg);
  background: var(--md-sys-color-surface-container);
  text-align: start;
  transition: transform var(--md-sys-motion-duration-tap) var(--md-sys-motion-easing-standard), opacity var(--md-sys-motion-duration-tap);
}
.chart-choice:active:not(:disabled), .chart-choice.is-picked {
  transform: scale(.97);
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
  opacity: 1;
}
.chart-choice.is-other { opacity: .55; }
.chart-choice.is-picked:disabled { opacity: 1; }
.match.arriving { animation: swap-in var(--md-sys-motion-duration-swap) var(--md-sys-motion-easing-standard); }
@keyframes swap-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.cover-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--md-sys-color-surface-container-high);
}
.cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.empty-cover { color: var(--md-sys-color-outline); display: grid; place-items: center; }
.empty-cover svg { width: 30px; height: 30px; }
.chart-info { min-height: 62px; align-content: space-between; padding: 10px; display: grid; gap: 6px; }
.song {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: var(--md-sys-typescale-title-sm);
  color: var(--md-sys-color-on-surface);
}
.chart-meta { white-space: nowrap; min-width: 0; display: flex; align-items: center; gap: 6px; }
.public-level { color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-body-sm); }
.variant {
  display: inline-block;
  padding: 3px 7px;
  border-radius: var(--md-sys-shape-corner-xs);
  font: var(--md-sys-typescale-label-sm);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.variant-pst { background: var(--ca-diff-pst-bg); color: var(--ca-diff-pst-fg); }
.variant-prs { background: var(--ca-diff-prs-bg); color: var(--ca-diff-prs-fg); }
.variant-ftr { background: var(--ca-diff-ftr-bg); color: var(--ca-diff-ftr-fg); }
.variant-byd { background: var(--ca-diff-byd-bg); color: var(--ca-diff-byd-fg); }
.variant-etr { background: var(--ca-diff-etr-bg); color: var(--ca-diff-etr-fg); }
.variant-ins { background: var(--ca-diff-ins-bg); color: var(--ca-diff-ins-fg); }
.compare-instruction { margin-block: var(--ca-section-gap) 0; text-align: center; }
.lean-choices { margin-top: 12px; }
.alternatives { margin-top: var(--ca-arena-gap); }
.lean-choices .button, .alternatives .button { padding-inline: clamp(8px, 4vw, 20px); }
body[data-page="survey"] footer > span:nth-child(2) { display: none; }
.alternatives button { white-space: nowrap; }
.quiz-controls, .quiz-foot { justify-content: space-between; }
.quiz-controls { margin-top: var(--ca-section-gap); }
.quiz-controls .back { margin: 0; }
.quiz-foot { margin-top: 8px; }
.quiz-options { border-block-start: 1px solid var(--md-sys-color-outline-variant); }
.quiz-options .fold { margin: 0; }
.ability-preview { margin-top: var(--ca-section-gap); padding-block: 12px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.ability-preview h2, .inner .panel h3 { font: var(--md-sys-typescale-title-sm); }
.ability-preview p, .duel-list p { margin-top: 4px; color: var(--md-sys-color-on-surface-variant); }
.participant-total { padding-block: 4px 16px; }
.participant-total strong { font: var(--md-sys-typescale-headline-sm); color: var(--md-sys-color-primary); }
.band-counts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.band-counts div { background: var(--md-sys-color-surface-container-high); border-radius: var(--md-sys-shape-corner-md); padding: 10px; }
.band-counts dt { color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-body-sm); }
.band-counts dd { margin: 4px 0 0; }
.duel-list { list-style: none; padding: 0; margin: 8px 0; }
.duel-list li { padding-block: 10px; overflow-wrap: anywhere; }
.duel-list li + li { border-top: 1px solid var(--md-sys-color-outline-variant); }

/* Reports and community statistics */
.metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.metric { border-top: 1px solid var(--md-sys-color-outline-variant); padding-block: 8px; }
.metric dd { font: var(--md-sys-typescale-headline-sm); }
.axis-table, .rank-table { border-collapse: collapse; width: 100%; margin-block: 12px; font-size: 13px; }
:is(.axis-table, .rank-table) :is(td, th) { text-align: end; padding: 6px 2px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
:is(.axis-table, .rank-table) :is(th, td):first-child { text-align: start; }
.dim-row { display: grid; grid-template-columns: minmax(64px, .4fr) 1fr; gap: 10px; }
.glyph { color: var(--md-sys-color-primary); margin-inline-end: 6px; }
.report-meta { display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 14px; }
@media (hover: hover) {
  :where(.button, .nav-button, .theme-button):hover { filter: brightness(1.1); }
  .chart-choice:hover { outline: 1px solid var(--md-sys-color-outline); outline-offset: -1px; }
  .chart-choice:focus-visible, .chart-choice.is-picked { outline: 2px solid var(--md-sys-color-primary); }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .kbd-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-choice:active:not(:disabled), .chart-choice.is-picked { transform: none; }
}
.quiz-progress { grid-row: 1; margin-top: 6px; }
.progress-line h1 { font: var(--md-sys-typescale-title-md); }
.quiz-foot, .overlay-bar { background: var(--md-sys-color-surface-container-low); border-radius: var(--md-sys-shape-corner-md); padding: 10px 12px; }
.button:active:not(:disabled) { transform: scale(.98); }
.back, .text-link, .nav-button { border-radius: var(--md-sys-shape-corner-full); padding-inline: 10px; }
.page-head p, .report-hero > p { color: var(--md-sys-color-on-surface-variant); }
.confirm-dialog {
  width: min(calc(100% - 24px), 420px); padding: 24px; border: 0;
  border-radius: var(--md-sys-shape-corner-xl); background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.confirm-dialog::backdrop { background: var(--md-sys-color-scrim); }
.field input:focus-visible { border-color: var(--md-sys-color-primary); }
.field > span { font: var(--md-sys-typescale-label-lg); }
.view-tabs { padding: 4px; gap: 4px; background: var(--md-sys-color-surface-container-low); border-radius: var(--md-sys-shape-corner-full); }
.view-tabs button { flex: 1; border: 0; }
.report-hero, .stats-heading { margin-bottom: 12px; }
.stats-heading { padding-block: 6px; }
@media (max-width: 380px) { .nav-button { padding-inline: 4px; } }

