/* State and density layer; project surface/text tokens stay authoritative. */
.ticket-progress { min-width:0; border:0; border-radius:6px; padding:12px; background:var(--ui-surface-muted); color:var(--ui-text); }
.ticket-progress-heading { display:flex; align-items:center; gap:12px; }
.ticket-status-icon { display:grid; place-items:center; width:44px; height:44px; flex-shrink:0; font-size:30px; color:var(--ui-text-muted); }
.ticket-progress-copy { flex:1; min-width:0; }
.ticket-progress-copy strong { display:block; font-size:14px; font-weight:600; line-height:1.4; }
.ticket-progress-copy > span { display:block; margin-top:3px; color:var(--ui-text-muted); font-size:12px; line-height:1.5; }
.ticket-count { flex-shrink:0; font-size:28px; font-weight:600; font-variant-numeric:tabular-nums; line-height:1.2; }
.ticket-count-total { font-size:16px; color:var(--ui-text-muted); }
.ticket-state-complete.ticket-progress,.ticket-state-complete.rating-match-card { border-color:transparent; background:color-mix(in srgb,var(--ui-surface) 94%,#10b981); }
.ticket-state-complete .ticket-status-icon,.ticket-state-complete .ticket-count,.ticket-state-complete .rating-match-status > i { color:#047857; }
.dark .ticket-state-complete .ticket-status-icon,.dark .ticket-state-complete .ticket-count,.dark .ticket-state-complete .rating-match-status > i { color:#34d399; }
.ticket-state-partial.ticket-progress,.ticket-state-partial.rating-match-card { border-color:transparent; background:color-mix(in srgb,var(--ui-surface) 94%,#f59e0b); }
.ticket-state-partial .ticket-status-icon,.ticket-state-partial .ticket-count,.ticket-state-partial .rating-match-status > i { color:#b45309; }
.dark .ticket-state-partial .ticket-status-icon,.dark .ticket-state-partial .ticket-count,.dark .ticket-state-partial .rating-match-status > i { color:#fbbf24; }
.ticket-segments { display:flex; gap:5px; margin-top:12px; }
.ticket-segment { display:flex; flex:1; min-width:0; height:13px; align-items:center; justify-content:center; border-radius:3px; background:var(--ui-border-strong); color:transparent; font-size:10px; }
.ticket-segment.is-saved { background:#d97706; color:white; }
.ticket-state-complete .ticket-segment.is-saved { background:#059669; }
.ticket-segment.is-saved:only-child { flex:1; }
.ticket-action { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:38px; padding:8px 14px; border:1px solid transparent; border-radius:6px; background:var(--ui-text); color:var(--ui-surface); font-size:12px; font-weight:600; text-decoration:none; line-height:1.4; }
.ticket-action:hover { opacity:.85; }
.ticket-action:focus-visible,.rating-match-card a:focus-visible { outline:2px solid #3b82f6; outline-offset:3px; }
.ticket-action-secondary { background:var(--ui-surface-muted); color:var(--ui-text); border-color:var(--ui-border-color); }
/* One consistent row per match. Tooltip targets never occupy row space. */
.compact-page-heading { display:flex; align-items:center; gap:8px; margin:0 0 10px; }
.compact-page-heading h1 { font-size:18px; font-weight:600; }
.rating-rows { border:0; border-radius:6px; background:var(--ui-surface); }
.rating-row { display:flex; align-items:center; gap:5px; min-height:64px; padding:7px 8px; border-bottom:1px solid var(--ui-divider-color); }
.rating-row:last-of-type { border-bottom:0; }
.rating-row:hover { background:var(--ui-surface-hover); }
.rating-row-match { display:flex; align-items:center; gap:8px; flex:1; min-width:0; text-decoration:none; color:var(--ui-text); }
.rating-row-logos { display:flex; gap:2px; flex-shrink:0; }
.rating-row-logos:empty { display:none; }
.rating-row-logos img { width:22px; height:22px; object-fit:contain; }
.rating-row-title { display:block; min-width:0; }
.rating-row-title strong { display:block; font-size:13px; font-weight:600; line-height:1.4; }
.rating-row-title time { display:block; margin-top:2px; font-size:11px; line-height:1.4; color:var(--ui-text-muted); }
.rating-row-count { font-size:12px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; color:var(--ui-text-muted); }
.compact-icon { display:inline-flex; align-items:center; justify-content:center; width:36px; min-width:36px; height:36px; padding:0; flex-shrink:0; border:0; border-radius:4px; background:transparent; color:var(--ui-text-muted); font-size:18px; cursor:pointer; }
.compact-icon:hover { background:var(--ui-surface-hover); }
.compact-icon:focus-visible,.rating-row a:focus-visible,.compact-save:focus-visible { outline:2px solid #3b82f6; outline-offset:2px; }
.rating-row-state.is-complete { color:#047857; }
.rating-row-state.is-partial { color:#b45309; }
.dark .rating-row-state.is-complete { color:#34d399; }
.dark .rating-row-state.is-partial { color:#fbbf24; }
.rating-row-action { display:flex; justify-content:center; align-items:center; gap:8px; min-width:30px; height:36px; border-radius:4px; color:var(--ui-text); font-size:12px; font-weight:600; text-decoration:none; }
.rating-row-action span { display:none; }
.rating-row.is-actionable .rating-row-action { color:var(--ui-accent-text,var(--ui-text)); }
.compact-tooltip { max-width:min(280px,calc(100vw - 24px)); font-size:12px; line-height:1.5; text-align:left; }
.compact-empty { padding:16px; font-size:13px; color:var(--ui-text-muted); }
@media (min-width:640px) {
 .rating-row { min-height:58px; padding:6px 12px; gap:12px; }
 .rating-row-logos img { width:26px; height:26px; }
 .rating-row-action { min-width:88px; }
 .rating-row-action span { display:inline; }
}
.homepage-ticket-link { background:var(--ui-surface); }
.homepage-ticket-grid { display:grid; gap:14px; align-items:center; }
.homepage-ticket-personal { min-width:0; }
.homepage-ticket-community { background:var(--ui-surface-muted); }
.homepage-ticket-link .ticket-action { margin-top:10px; }
.homepage-community-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border-bottom:1px solid var(--ui-divider-color); }
.homepage-community-stat { padding:16px; min-width:0; }
.homepage-community-stat strong { display:block; font-size:28px; line-height:1.2; font-weight:600; font-variant-numeric:tabular-nums; color:var(--ui-text); }
.homepage-community-stat > span { display:block; margin-top:5px; font-size:12px; line-height:1.5; color:var(--ui-text-muted); }
.homepage-club-stats { display:grid; }
/* Player statistic: portrait / discipline and name / number. */
.homepage-player-cards { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin-top:10px; }
.homepage-club-stats .homepage-player-stat { position:relative; isolation:isolate; overflow:hidden; min-height:128px; padding:0; border-radius:6px; background:var(--ui-surface-muted); }
.homepage-club-stats .homepage-player-stat-copy { position:relative; z-index:2; min-height:128px; width:100%; padding:16px 12px 16px 114px; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:1fr 1fr; gap:3px 10px; align-items:center; }
.homepage-club-stats .homepage-player-stat-label { grid-column:1; grid-row:1; align-self:end; color:var(--ui-text-muted); font-size:11px; font-weight:600; line-height:1.3; text-transform:none; letter-spacing:0; white-space:normal; overflow:visible; }
.homepage-club-stats .homepage-player-stat-metric { display:contents; }
.homepage-club-stats .homepage-player-stat-name { grid-column:1; grid-row:2; align-self:start; min-width:0; width:auto; margin:0; font-size:13px; line-height:1.4; font-weight:600; color:var(--ui-text); white-space:normal; overflow-wrap:anywhere; overflow:visible; text-overflow:clip; }
.homepage-club-stats a.homepage-player-stat-name:hover { text-decoration:underline; text-underline-offset:3px; }
.homepage-club-stats a.homepage-player-stat-name:focus-visible { outline:2px solid var(--ui-text); outline-offset:3px; }
.homepage-club-stats .homepage-player-stat-result { grid-column:2; grid-row:1 / 3; display:block; min-width:0; }
.homepage-club-stats .homepage-player-stat-value { display:block; font-size:52px; font-weight:600; line-height:1; letter-spacing:-.04em; font-variant-numeric:tabular-nums; color:var(--ui-text); }
.homepage-club-stats .homepage-player-stat-photo { position:absolute; z-index:0; inset:0 auto 0 0; width:104px; height:100%; display:grid; place-items:center; overflow:hidden; border-radius:0; background:transparent; color:var(--ui-text-muted); font-size:40px; }
.homepage-club-stats .homepage-player-stat-photo img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; object-position:center 20%; transform:scale(1); transition:transform 220ms ease-out; }
.homepage-club-stats .homepage-player-stat-photo::after { content:""; position:absolute; inset:0; background:linear-gradient(to left,var(--ui-surface-muted),transparent 25%); pointer-events:none; }
@media (hover:hover) and (pointer:fine) { .homepage-club-stats .homepage-player-stat:hover .homepage-player-stat-photo img { transform:scale(1.06); } }
.homepage-club-stats .homepage-player-stat:focus-within .homepage-player-stat-photo img { transform:scale(1.06); }
@media (min-width:1100px) {
 .homepage-player-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .homepage-club-stats .homepage-player-stat-copy { padding-left:106px; gap:3px 7px; }
 .homepage-club-stats .homepage-player-stat-photo { width:96px; }
 .homepage-club-stats .homepage-player-stat-value { font-size:48px; }
}
@media (prefers-reduced-motion:reduce) {
 .homepage-club-stats .homepage-player-stat-photo img { transition:none; }
 .homepage-club-stats .homepage-player-stat:hover .homepage-player-stat-photo img,
 .homepage-club-stats .homepage-player-stat:focus-within .homepage-player-stat-photo img { transform:none; }
}
.clasiga-overview-layout { grid-template-columns:minmax(0,1fr); }
.clasiga-overview-layout > aside { display:grid; gap:12px; align-items:start; }
.prediction-form-layout { display:grid; gap:16px; }
.prediction-markets { display:grid; gap:12px; align-content:start; min-width:0; }
.prediction-markets-heading { grid-column:1 / -1; }
.prediction-market { min-width:0; padding:14px; border:0; border-radius:6px; background:var(--ui-surface); }
.prediction-market.is-saved { border-color:transparent; background:color-mix(in srgb,var(--ui-surface) 95%,#10b981); }
.prediction-market.is-dirty { border-color:transparent; background:color-mix(in srgb,var(--ui-surface) 95%,#f59e0b); }
.prediction-market-input { margin-top:12px; }
.prediction-market form [type=submit] { margin-left:0; min-height:38px; }
.prediction-market form > div:first-of-type { gap:8px; }
.prediction-market .ts-wrapper { flex:1; min-width:140px; max-width:100%; }
.prediction-market form [data-v2-save-status] { line-height:1.5; }
.prediction-match-list-row { min-width:0; }
.prediction-match-list-progress { min-width:0; }
.prediction-match-list-progress .ticket-progress { padding:10px; }
.prediction-match-list-progress .ticket-progress-copy > span { display:none; }
.prediction-match-list-progress .ticket-status-icon { width:30px; height:30px; font-size:24px; }
.prediction-match-list-progress .ticket-count { font-size:24px; }
.ticket-list-action { display:flex; gap:8px; align-items:center; margin-top:8px; font-size:12px; font-weight:600; color:var(--ui-text); }
@media (min-width:640px) {
  .homepage-community-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .homepage-community-stat + .homepage-community-stat { border-left:1px solid var(--ui-divider-color); }
  .prediction-markets { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:768px) {
  .rating-match-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .homepage-club-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .clasiga-overview-layout > aside { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .prediction-match-list-row { grid-template-columns:6rem minmax(0,1fr); align-items:center; }
  .prediction-match-list-progress { grid-column:1 / -1; }
}
@media (min-width:1024px) {
  .homepage-ticket-grid { grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); }
  .homepage-ticket-community { grid-column:1 / -1; }
  .homepage-ticket-community > div:first-child { font-size:10px; }
  .prediction-form-layout:has(> aside) { grid-template-columns:minmax(0,1fr) 16rem; }
}
@media (min-width:1280px) {
  .prediction-match-list-row { grid-template-columns:6rem minmax(0,1fr) 20rem; }
  .prediction-match-list-progress { grid-column:auto; }
}
@media (max-width:380px) {
  .ticket-progress-heading { gap:7px; flex-wrap:wrap; }
  .ticket-progress-copy { flex-basis:calc(100% - 51px); }
  .ticket-count { padding-left:51px; }
}

.prediction-market-check { display:none; margin-left:auto; font-size:28px; color:#047857; line-height:1; }
.prediction-market.is-saved:not(.is-dirty) .prediction-market-check { display:block; }
.dark .prediction-market-check { color:#34d399; }
.prediction-market.is-dirty [data-v2-market-saved] { background:#fef3c7; color:#92400e; }

/* Compact prediction rows: label / answer and save / state, including on phones. */
.compact-contest-header header > div:first-child { display:none; }
.compact-match-header > div:first-child { padding:10px 12px; }
.compact-match-header > div:first-child > div:first-child { font-size:11px; }
.compact-match-header .mx-auto.mt-4 { margin-top:10px; }
.compact-match-header img { max-height:32px; max-width:32px; }
.compact-match-header .text-3xl { font-size:22px; }
.compact-match-header > div:last-child { padding:10px 12px; }
.compact-match-header .ticket-progress { padding:8px 10px; }
.compact-match-header .ticket-progress-copy > span { display:none; }
.compact-match-header .ticket-status-icon { height:28px; width:28px; font-size:24px; }
.compact-match-header .ticket-count { font-size:22px; }
.compact-match-header .ticket-segments { margin-top:7px; }
.compact-match-header .ticket-segment { height:7px; }
.compact-match-header .ticket-segment i { display:none; }
.compact-match-tools { display:flex; justify-content:flex-end; align-items:center; gap:8px; min-height:28px; }
.compact-match-tools:has(.hidden) { margin-top:0; }
.compact-inline-link { display:inline-flex; gap:6px; align-items:center; font-size:12px; color:var(--ui-text-muted); }
.compact-closed-notice { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ui-text-muted); }
.compact-match-page .prediction-form-layout { display:block; }
.compact-match-page .prediction-form-layout > aside { margin-top:12px; }
.compact-markets { display:block; border:0; border-radius:6px; background:var(--ui-surface); }
.compact-section-title { padding:10px; border-bottom:1px solid var(--ui-divider-color); font-size:13px; font-weight:600; }
.compact-markets .compact-market { position:relative; display:grid; grid-template-columns:24px minmax(68px,.65fr) minmax(0,1.6fr); align-items:center; gap:6px; min-height:60px; padding:8px; border:0;  border-bottom:1px solid var(--ui-divider-color); border-radius:0; background:transparent; }
.compact-market:last-of-type { border-bottom:0; }
.compact-markets .compact-market.is-saved { background:color-mix(in srgb,var(--ui-surface) 96%,#10b981); }
.compact-markets .compact-market.is-dirty { background:color-mix(in srgb,var(--ui-surface) 96%,#f59e0b); }
.compact-market-label { min-width:0; font-size:12px; line-height:1.4; font-weight:600; overflow-wrap:anywhere; }
.compact-market .prediction-market-input { margin:0; min-width:0; }
.compact-market-form { display:grid; gap:0; min-width:0; }
.compact-market-form > div:first-of-type { display:flex; flex-wrap:nowrap; gap:5px; min-width:0; align-items:center; }
.compact-market-form input[type=number] { width:36px; min-width:0; height:36px; padding:3px; font-size:14px; }
.compact-market-form select { min-width:0; width:100%; height:36px; padding:4px 22px 4px 7px; font-size:12px; }
.compact-market .ts-wrapper { width:0; min-width:0; flex:1; }
.compact-market .ts-control { min-height:36px; font-size:12px; padding:7px; }
.compact-market .compact-market-form .compact-save { display:inline-flex; align-items:center; justify-content:center; min-width:56px; height:36px; min-height:36px; margin:0 0 0 auto; padding:0 10px; border:0; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; }
.compact-save:disabled { opacity:.55; cursor:wait; }
.compact-save-feedback:empty { display:none; }
.compact-save-feedback { margin-top:4px; font-size:12px; line-height:1.4; }
.compact-save-feedback.text-emerald-600 { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); }
.compact-lineup-action { display:flex; align-items:center; justify-content:space-between; gap:5px; min-height:36px; font-size:12px; font-weight:600; color:var(--ui-text); }
.compact-closed-answer { font-size:13px; line-height:1.4; }
.compact-closed-answer strong { font-weight:600; }
.market-state-icon { width:32px; min-width:32px; }
.market-state-icon .state-saved,.market-state-icon .state-dirty { display:none; }
.is-saved:not(.is-dirty) > .market-state-icon .state-saved { display:inline; }
.is-saved:not(.is-dirty) > .market-state-icon .state-empty { display:none; }
.is-saved:not(.is-dirty) > .market-state-icon { color:#047857; }
.dark .is-saved:not(.is-dirty) > .market-state-icon { color:#34d399; }
.is-dirty > .market-state-icon .state-dirty { display:inline; }
.is-dirty > .market-state-icon .state-empty { display:none; }
.is-dirty > .market-state-icon { color:#b45309; }
.dark .is-dirty > .market-state-icon { color:#fbbf24; }
.compact-market-extra { grid-column:1 / -1; font-size:12px; color:var(--ui-text-muted); }
.compact-market-extra summary { padding:3px 0; cursor:pointer; }
.compact-market-extra > div { padding:8px 0; }
@media (min-width:640px) {
 .compact-markets .compact-market { grid-template-columns:32px minmax(120px,.65fr) minmax(0,1.4fr); min-height:54px; padding:6px 12px; gap:12px; }
 .compact-market-label { font-size:13px; }
 .compact-market-form input[type=number] { width:48px; }
 .compact-market-form > div:first-of-type { gap:8px; }
}

.compact-market .prediction-market-input { display:flex; align-items:center; gap:5px; }
.compact-market-form,.compact-closed-answer,.compact-lineup-action { flex:1; min-width:0; }
.compact-market-disclosures { display:inline-flex; align-items:center; flex-shrink:0; gap:2px; }
.compact-market-disclosures:empty { display:none; }
.compact-market-disclosures .compact-icon { width:28px; min-width:28px; height:36px; font-size:14px; }
.compact-market-detail { grid-column:1 / -1; padding:10px 0 4px; font-size:12px; border-top:1px solid var(--ui-divider-color); }

.compact-inline-link.hidden { display:none; }

.compact-lock-row { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; padding:7px 10px; border:0; border-radius:6px; font-size:12px; color:var(--ui-text-muted); }
.compact-lock-row > span { display:inline-flex; gap:6px; align-items:center; }
.compact-lock-button { min-height:36px; padding:6px 10px; border:0; border-radius:6px; font-size:12px; font-weight:600; cursor:pointer; }

.compact-final-notice { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--ui-text-muted); }
.compact-lock-row.hidden,.compact-final-notice.hidden { display:none; }

.compact-markets-header { display:flex; align-items:center; justify-content:space-between; padding:0 8px; border-bottom:1px solid var(--ui-divider-color); }
.compact-markets-header .compact-section-title { padding:9px 0; border:0; }
.compact-markets-header .compact-match-tools { margin:0; }
.compact-icon.hidden { display:none; }

/* Keep existing ui-primary/ui-secondary palettes authoritative. */
.match-ticket-layout { display:grid; gap:12px; align-items:start; }
.match-ticket-context { display:grid; gap:12px; min-width:0; }
.match-ticket-context .compact-match-header > div:last-child { display:grid; grid-template-columns:minmax(0,1fr); }
.match-ticket-context .compact-match-header > div:last-child > a { justify-self:start; border:0; }
.compact-match-page .prediction-form-layout { min-width:0; }
.compact-market .market-state-icon { width:24px; min-width:24px; }
.compact-market-disclosures { order:-1; }
.compact-lineup-action { justify-content:flex-end; flex:0 1 auto; margin-left:auto; padding:0 10px; border-radius:6px; }
.compact-market-form input,.compact-market-form select,.compact-market .ts-control { border-color:var(--ui-control-border,var(--ui-border-color)); }
.compact-market-label { font-size:13px; }
.match-community { font-size:12px; }
@media (min-width:1100px) {
 .match-ticket-layout { grid-template-columns:minmax(300px,.8fr) minmax(0,1.4fr); gap:16px; }
}
@media (max-width:359px) {
 .compact-markets .compact-market { grid-template-columns:24px minmax(0,1fr); gap:4px 6px; }
 .compact-market .prediction-market-input { grid-column:2; }
}

/* Loading feedback is announced without adding a row to the form. */
[data-v2-market-form][data-saving="1"] [data-v2-save-status] { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); }
.compact-market .compact-market-form .compact-save { flex-shrink:0; }
