
.home-panel { grid-column:1; width:100%; padding-top:8px; }
.home-panel .create-panel,.home-panel .join-panel { padding:24px 0 0; }

.create-panel {
  padding: 24px;
  min-block-size: 160px;
  display: flex;
  flex-direction: column;
}

.create-explanation {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  margin: 0;
}

.create-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-top: 0;
  padding-top: 28px;
}

.create-footer>span { display: none; }

.home-mode-tabs {
  display: flex;
  gap: 4px;
  padding:0;
  max-width:400px;
  border-bottom:1px solid var(--line);
}

.home-mode-tabs button {
  flex:1;
  min-height:44px;
  border:0;
  border-radius:0;
  background:transparent;
  color: var(--muted);
  font-size: 14px;
}

.home-mode-tabs [aria-pressed="true"] {
  background:transparent;
  color:var(--text);
  box-shadow:inset 0 -2px 0 var(--rose);
}

.join-panel {
  padding: 24px;
  min-block-size: 160px;
  display: flex;
  flex-direction: column;
}

.join-panel>label {
  margin-top: 0;
}

.join-panel>.field-help {
  margin-top: 16px;
}

.home-panel .create-panel {
  border: 0;
  border-radius: 0;
}

.create-panel>.source-tabs {
  margin-top: 0;
}

.recent-section {
  margin-top: 28px;
}

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

.recent-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: background 160ms;
}

.recent-link:hover {
  background: var(--overlay);
  border-color: var(--material-line);
}

.recent-link .recent-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.recent-link strong {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--subtle);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--muted);
}

#session-code {
  font: 11px ui-monospace,monospace;
}

.toolbar-actions {
  display: flex;
  gap: 4px;
}

.toolbar-actions button {
  font-size: 12px;
  padding: 8px 12px;
}

.phase-label {
  color: var(--muted);
}

.match-strip {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 32px;
}

.player-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  width:100%;
  margin-inline:0;
}
.duel-axis { display:grid; place-items:center; color:var(--muted); font-size:12px; font-weight:500; }
.player-card { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; }
/* Active play has one compact scoreboard, with the session score at its centre. */
body:not([data-phase="lobby"]) .match-strip { width:100%; margin:0 0 24px; padding:0 0 16px; border:0; border-bottom:1px solid var(--line); }
.player-cards.scoreboard { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 20px; width:100%; }
.scoreboard .match-player { display: block; text-align: left; }
.scoreboard .match-player:last-child { text-align: right; }
.scoreboard .player-top strong { max-width: none; font-size: 14px; }
.match-tally { display: flex; align-items: center; justify-content: center; gap: 12px; font-variant-numeric: tabular-nums; }
.match-tally .win-count { font-size: 22px; font-weight: 600; }
.tally-colon { color: var(--subtle); font-size: 18px; }
@media (max-width: 720px) {
  body:not([data-phase="lobby"]) .match-strip { padding: 12px; margin-bottom: 20px; }
  .player-cards.scoreboard { gap: 12px; }
  .match-tally { gap: 6px; }
  .match-tally .win-count { font-size: 18px; }
  .scoreboard .player-top strong { font-size: 13px; }
}

.player-initials { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; color: var(--text); background: var(--surface); }
body[data-phase="lobby"] .match-strip { padding:8px 0 24px; margin:0 0 24px; border-bottom:1px solid var(--line); }
body[data-phase="lobby"] .player-cards { align-items: start; }
body[data-phase="lobby"] .player-card:first-child .player-initials { border-color: #9ccfd8; background: color-mix(in srgb, #9ccfd8 10%, var(--surface)); }
body[data-phase="lobby"] .player-card:last-child .player-initials { border-color: #c4a7e7; background: color-mix(in srgb, #c4a7e7 10%, var(--surface)); }
body[data-phase="lobby"] .player-initials { box-shadow: inset 0 1px 0 var(--material-rim), 0 8px 24px #0002; }
body[data-phase="lobby"] .duel-axis { margin-top: 10px; }
body[data-phase="lobby"] .player-card { display: flex; flex-direction: column; text-align: center; width: 100%; gap: 8px; }
body[data-phase="lobby"] .player-initials { width: 48px; height: 48px; font-size: 18px; }
body[data-phase="lobby"] .player-top strong { font-size: 16px; max-width: 240px; white-space: normal; overflow-wrap: anywhere; }
body[data-phase="lobby"] .player-card[data-ready="true"] .player-initials { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-phase="lobby"] .player-card[data-ready="true"] .player-status { color: var(--focus); }
body[data-phase="lobby"] .player-card.muted .player-initials { border-style: dashed; background: transparent; color: var(--muted); }
body[data-phase="lobby"] .win-count { order: 0; font-size: 16px; }

.player-card .player-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player-top strong {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 210px;
}

.player-status {
  font-size: 11px;
  color: var(--muted);
}

.win-count {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  order: 0;
}

.score-info {
  display: none;
}

.player-card.muted {
  font-size: 13px;
  color: var(--subtle);
}

.competition-grid {
  display: block;
}

.lobby {
  scroll-margin-top: 104px;
  padding-top:0;
}
.lobby-task-settings { min-width:0; }
.lobby-invite { min-width:0; }
/* Invite first; task configuration stays a secondary disclosure. */
.lobby-invite>label {
  margin-top: 0;
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invite-row>input {
  font-size: 14px;
  color: var(--text);
  background: var(--base);
}

#copy-lobby-invite {
  inline-size: var(--action-width);
}

#invite-feedback {
  min-height: 20px;
  color: var(--muted);
}

.lobby-task-settings {
  border-top:0;
  padding-top:0;
  margin-top:0;
}

.lobby-task-settings>h2 {
  margin-bottom: 16px;
}

.task-mode-tabs>button {
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

.task-mode-tabs>[aria-pressed="true"] {
  background: var(--overlay);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--material-rim);
}
#lobby[data-players="two"] .lobby-task-settings { grid-column:1/-1; }

.lobby-model-state {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 12px 0 0;
}

.submission-status {
  margin-top: 8px;
  font-size: 12px;
}

.submission-status>.text-button {
  font-size: 12px;
}

.lobby-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 24px;
}

.lobby-bottom p {
  font-size: 13px;
  margin: 0;
}

.lobby-bottom>.primary {
  flex-shrink: 0;
}

.lobby-bottom>div {
  min-width: 0;
}

#next-problem {
  margin-top: 16px;
}

#next-problem .inline-field {
  margin-top: 12px;
}

#next-problem-json {
  font: 12px/1.7 ui-monospace,monospace;
}

#topic-availability {
  font-size: 12px;
  color: var(--muted);
}

.solve {
  width:100%;
  margin:0;
}

.solve .problem-card {
  padding-top: 4px;
}

.problem-card h1 {
  font-size: 25px;
}

.competition-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.main-actions {
  display: flex;
  gap: 8px;
}

.action-menu {
  position: relative;
}

.action-menu>summary {
  list-style: none;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: var(--control-radius);
  font-size: 16px;
  letter-spacing: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  line-height: 1.3;
}

.action-menu>summary::after {
  display: none;
}

.action-menu[open] {
  z-index: 15;
}

.action-menu[open]>summary {
  margin: 0;
}

.action-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 260px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--floating-material);
  border-color: var(--material-line);
  box-shadow: var(--material-shadow);
  -webkit-backdrop-filter:blur(32px) saturate(120%);
  backdrop-filter: blur(32px) saturate(120%);
  animation: menu-in 160ms ease-out;
}

.action-popover>button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
}

.action-popover>p {
  font-size: 12px;
  color: var(--muted);
  padding: 8px;
  margin: 0;
}

/* The server deadline is a compact, non-flashing five-minute countdown. */
.deadline {
  --timer-accent: var(--foam);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 12px 16px 12px 12px;
  margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--timer-accent) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--timer-accent) 5%, var(--surface));
  box-shadow: inset 0 1px 0 var(--material-rim);
  color: var(--timer-accent);
}
.deadline[data-urgency="urgent"] { --timer-accent: var(--gold); }
.deadline[data-urgency="critical"],.deadline[data-urgency="expired"] { --timer-accent: var(--love); }
.deadline-ring { width: 48px; height: 48px; flex: 0 0 48px; }
.deadline-track { stroke: currentColor; stroke-opacity: .12; stroke-width: 3; }
.deadline-progress { stroke: currentColor; stroke-width: 3; stroke-dasharray: 100; stroke-linecap: round; transition: stroke-dashoffset 250ms linear; }
.deadline-clock { stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .65; }
.deadline-context { display: flex; flex-direction: column; gap: 2px; }
.deadline-context strong { color: var(--text); font-size: 13px; font-weight: 500; }
.deadline-context span { color: var(--muted); font-size: 12px; }
#deadline-value { min-width: 4.6ch; font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.8px; font-variant-numeric: tabular-nums; text-align: right; margin-left: 12px; }
@media (max-width: 720px) {
  .deadline { gap: 10px; padding: 10px 12px; }
  .deadline-ring { width: 40px; height: 40px; flex-basis: 40px; }
  .deadline-context strong { font-size: 12px; }
  #deadline-value { font-size: 28px; margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) { .deadline-progress { transition: none; } }

.results {
  scroll-margin-top: 104px;
  width:100%;
  padding-top: 0;
}

/* A round is a shared table: equal score heights, one real prize. */
.result-overview { position: relative; text-align:center; padding:8px 0 28px; margin-bottom:24px; border-bottom:1px solid var(--line); }
.result-heading { display:flex; justify-content:center; }
.result-heading h1 { margin:0; font-size:26px; letter-spacing:-.8px; }
.result-heading h1[data-keyboard-focus="false"]:focus { outline:none; }
.result-overview>.muted { margin:8px auto 0; max-width:60ch; font-size:13px; }
.result-overview>.muted:empty { display:none; }
.result-overview>.field-help { display:none; }
.result-overview>.primary { inline-size:auto; margin-top:16px; }
.result-comparison { display:grid; grid-template-columns:minmax(0,1fr) 170px minmax(0,1fr); gap:24px; align-items:center; max-width:780px; margin:12px auto 0; text-align:center; }
.result-player { min-width:0; padding:12px 0; align-self:start; }
.result-player:nth-child(2) { grid-column:3; grid-row:1; }
.result-player strong { display:block; font-size:14px; font-weight:500; overflow-wrap:anywhere; }
.result-number { margin:4px 0; font-size:64px; line-height:1.1; font-weight:600; letter-spacing:-3px; font-variant-numeric:tabular-nums; }
.result-number>span { font-size:14px; color:var(--muted); font-weight:400; letter-spacing:0; }
.result-player p { margin:6px 0 0; font-size:12px; color:var(--muted); }
.result-player.is-winner .result-finish { color:var(--foam); }
.match-trophy { grid-column:2; grid-row:1; color:var(--text); }
.sandwich-trophy { display:block; width:128px; height:108px; margin:auto; filter:drop-shadow(0 10px 14px #00000018); }
.trophy-caption { display:block; color:var(--muted); font-size:12px; }
@media(max-width:600px) {
 .result-overview { padding:8px 0 24px; margin-bottom:20px; }
 .result-heading h1 { font-size:23px; }
 .result-overview>.muted { font-size:12px; max-width:32ch; }
 .result-comparison { grid-template-columns:minmax(0,1fr) 96px minmax(0,1fr); gap:4px; margin-top:14px; }
 .result-number { font-size:44px; letter-spacing:-2px; }
 .result-number>span { font-size:11px; }
 .result-player strong { font-size:12px; }
 .result-player p { font-size:10px; line-height:1.5; }
 .sandwich-trophy { width:90px; height:77px; }
 .trophy-caption { font-size:10px; }
}

.review-problem {
  margin-bottom: 16px;
}

.review-problem .rendered {
  padding: 12px 0 16px;
}

.review-problem h2 {
  font-size: 16px;
}

.review-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.review-tabs {
  margin-bottom: 24px;
  overflow: auto;
  white-space: nowrap;
}

.review-tabs button {
  font-size: 13px;
}

.review-section .history-section {
  margin-top: 0;
}

.review-section .section-heading {
  display: none;
}

#revealed { margin-top:32px; padding:28px 0 0; border-top:1px solid var(--line); }
.reference-heading { display:flex; align-items:center; gap:16px; margin-bottom:24px; }
.reference-mark { font-family:Georgia,serif; font-size:40px; color:var(--foam); line-height:1; }
#revealed h2 { margin:0 0 4px; font-size:20px; letter-spacing:-.5px; }
.reference-heading p { margin:0; color:var(--muted); font-size:12px; }
#reference,#criteria { max-width:75ch; }
.results .review-section { padding-top:0; border-top:0; }
.review-navigation { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.results .review-problem { margin:0; min-width:0; }
.results .review-problem[open] { flex-basis:100%; order:2; }
.review-navigation:has(.review-problem[open]) { flex-wrap:wrap; }
.results .review-problem>summary { white-space:nowrap; font-size:12px; }
.results .review-problem>summary { padding:12px 0; }
.results .review-tabs { display:flex; gap:4px; margin:0; }
.results .review-tabs button { min-height:44px; padding:10px 18px; border-radius:10px; }
.results .review-stage { border:0; }
.results .review-document-toolbar { padding:16px 0; min-height:76px; border-top:1px solid var(--line); }
.results .attempt-rail { width:auto; margin-bottom:0; padding:0 0 12px; }
.results .attempt-rail>button { border-radius:8px; box-shadow:none; min-width:92px; }
.results .attempt-rail>[aria-selected="true"] { background:var(--overlay); }
.results .attempt-appeal-region { margin:24px 0; }
@media(max-width:600px) {
 .results .review-document-toolbar { padding:12px 0; gap:10px; grid-template-columns:minmax(0,1fr) auto; }
 .results .review-appeal-trigger { grid-column:1/-1; justify-self:stretch; min-height:44px; font-size:13px; }
 .results .review-work { padding:0; }
 .results .review-grading { padding:24px; }
 .results .review-region>h3 { font-size:16px; margin-bottom:16px; }
 .review-navigation { gap:8px; margin-bottom:12px; }
 .results .review-tabs button { padding:8px 10px; font-size:12px; }
 .results .review-problem>summary { font-size:11px; }
 .results .attempt-appeal-region { padding:24px; margin:24px 0; }
 #revealed { padding:24px 0 0; }
}

.criteria-disclosure {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.round-timeline {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.round-timeline>summary {
  font-size: 13px;
}

.round-timeline .submission>summary {
  color: var(--muted);
}

/* Desktop chat reserves space; only narrow screens use a full-screen dialog. */
.session-layout { min-width: 0; }
.competition-grid { min-width: 0; }
.chat-dock { position: sticky; top: 96px; min-width: 0; border-left: 1px solid var(--line); padding-left: 20px; }
.chat-panel { display: flex; flex-direction: column; height: max(420px,calc(100dvh - var(--chat-top,280px))); max-height: 900px; min-width: 0; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 16px; }
.chat-heading h2 { margin: 0; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
#chat-room-status { color: var(--muted); font-size: 12px; }
#chat-messages { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 4px 16px 0; overflow-wrap: anywhere; scrollbar-width: thin; }
.chat-group { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0 0 18px; }
.chat-group.is-own { align-items: flex-end; }
.chat-sender { color: var(--muted); font-size: 12px; margin: 0 12px 4px; }
.chat-bubble { max-width: 86%; margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--overlay); color: var(--text); font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.is-own .chat-bubble { background: var(--accent-soft); }
.is-other .chat-bubble:last-of-type { border-bottom-left-radius: 4px; }
.is-own .chat-bubble:last-of-type { border-bottom-right-radius: 4px; }
.chat-group time { color: var(--muted); font-size: 11px; margin: 4px 12px 0; }
.chat-empty { margin: 32px 8px; color: var(--muted); font-size: 14px; text-align: center; }
.chat-event { margin: 16px 0; padding: 8px 12px; background: var(--surface); border-radius: var(--control-radius); }
.chat-event>summary { font-size: 12px; }
.chat-event .rendered { font-size: 15px; }
#chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
#chat-form:focus-within { border-color: color-mix(in srgb,var(--focus) 45%,var(--line)); }
#chat-input { flex: 1; min-width: 0; min-height: 60px; height: 60px; max-height: 160px; resize: none; padding: 8px 4px 8px 8px; border: 0; border-radius: 0; background: transparent; font-size: 16px; line-height: 1.5; }
#chat-input:focus { outline: 0; }
#send-chat { flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 10px; background: var(--rose); color: var(--button-text); }
#send-chat svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
#chat-error:empty { display: none; }
#chat-error { margin: 8px 4px 0; font-size: 12px; }
.chat-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 20px; border: 0; border-radius: 0; background: var(--base); animation: none; backdrop-filter: none; }
.chat-dialog:not([open]) { display: none; }
.chat-dialog::backdrop { background: var(--base); backdrop-filter: none; -webkit-backdrop-filter: none; }
.chat-dialog .chat-panel { height: 100%; max-height: none; }

.appeal-status { margin: 0 0 16px; font-size: 15px; font-weight: 500; }
.appeal-warning { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 12px 0 0; max-width: 75ch; }

@media(max-width:720px) {
  body[data-phase="finished"] .player-status, body[data-phase="closed"] .player-status { display: none; }
  .task-mode-tabs>button { font-size: 12px; padding: 8px 6px; }

  .invite-row { grid-template-columns: minmax(0, 1fr); }
  .invite-row>input { font-size: 16px; }
  #copy-lobby-invite { inline-size: 100%; }
  .create-explanation { font-size: 14px; }


  .create-panel,.join-panel,.lobby-surface {
    padding: 0;
  }

  .create-panel,.join-panel {
    min-block-size: 0;
  }

  .create-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .create-footer>.muted {
    order: 1;
    text-align: center;
    font-size: 11px;
  }

  .create-footer>.primary {
    width: 100%;
    inline-size: 100%;
  }

  .recent-grid {
    grid-template-columns: 1fr;
  }

  .session-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 16px;
  }

  .breadcrumbs {
    gap: 8px;
    font-size: 11px;
  }

  .toolbar-actions {
    margin-left: auto;
    gap: 0;
  }

  .toolbar-actions button {
    font-size: 11px;
    padding: 6px 8px;
    min-height: 36px;
  }

  #round-label {
    display: none;
  }

  .match-strip {
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  .player-cards { gap: 10px; grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); }

  .player-card { grid-template-columns: 28px minmax(0,1fr); gap: 4px 8px; }
  .player-card>.player-initials { width: 28px; height: 28px; grid-row: span 2; }
  .player-card>.win-count { grid-column: 2; }

  .player-top strong {
    max-width: 110px;
    font-size: 13px;
  }

  .player-status {
    font-size: 11px;
  }

  .win-count {
    font-size: 16px;
  }

  .lobby {
    padding-top: 12px;
  }

  .lobby-bottom {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .lobby-bottom>.primary {
    width: 100%;
  }

  .competition-actions .main-actions {
    flex: 1;
  }

  .main-actions>button {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    min-inline-size: 0;
    inline-size: 0;
  }

  .result-overview h1 {
    font-size: 25px;
  }





  .result-symbol {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }





  .review-tabs {
    gap: 0;
  }

  .review-tabs button {
    padding: 8px 10px;
    font-size: 12px;
  }

  .action-popover {
    max-width: calc(100vw - 40px);
  }



}

.source-tabs {
  display: flex;
  gap: 4px;
  width: 280px;
  max-width: 100%;
  margin: 20px 0 16px;
}

.source-tabs button {
  flex: 1;
  min-width: 0;
  height: var(--control-height);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  min-height: 36px;
  padding: 8px 12px;
}

.source-tabs [aria-pressed="true"] {
  background: var(--overlay);
  color: var(--text);
}

.lobby-surface>.source-tabs {
  margin-top: 0;
}

#create-custom-fields {
  margin-top: 20px;
}

#create-custom-fields textarea {
  font: 13px/1.7 ui-monospace,monospace;
}

#create-custom-fields .file-button {
  margin-top: 12px;
}

body[data-phase="finished"] .phase-label {
  display: none;
}

body[data-phase="finished"] .match-strip { margin-bottom: 12px; padding: 0 12px; background: transparent; }
body[data-phase="finished"] .match-tally { flex-wrap:wrap; gap:0 10px; }
.series-label { flex-basis:100%; text-align:center; font-size:10px; color:var(--muted); margin-bottom:2px; font-weight:400; }
body[data-phase="finished"] .match-tally .win-count { font-size:16px; }
body[data-phase="finished"] .match-strip .player-status { display:none; }
body[data-phase="finished"] .match-strip .player-top strong { font-size:12px; color:var(--muted); }

.timeline-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 4px 0 16px;
}

.timeline-tabs button {
  white-space: nowrap;
  font-size: 12px;
  min-height: 36px;
}

.timeline-tabs [aria-pressed="true"] {
  border-color: var(--pine);
  color: var(--foam);
  background: var(--accent-soft);
}

.timeline-detail {
  padding: 16px 0;
}

.timeline-detail>h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.timeline-detail>.field-help {
  margin-bottom: 16px;
}

.timeline-detail>.review-tabs {
  margin-top: 16px;
}

@media(min-width:601px) { .results .review-appeal-trigger { grid-column:3; grid-row:1; justify-self:end; width:auto; } }
