/* Turnierplaner – page styles (organiser page and live view). */
:root,
[data-theme="dark"] {
  --win: var(--m-primary-soft-fg);
  --now-bg: color-mix(in srgb, var(--m-primary) 9%, var(--m-card));
  --line: var(--m-border);
  --gold: #c99a2e;
  --silver: #9aa3ad;
  --bronze: #b5703f;
}

.spacer {
  flex: 1 1 auto;
}

.toolbar,
.actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.input-sm {
  width: auto;
  min-height: 32px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 13px;
}

.tour-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tour-pick select {
  width: auto;
  min-width: 140px;
  max-width: 260px;
  min-height: 32px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-weight: 500;
}

.tabs span {
  padding: 5px 11px;
}

.summary {
  flex: 1 1 220px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-width: 0;
  color: var(--m-muted-fg);
  font-size: 13px;
}

.summary strong {
  color: var(--m-fg);
  font-weight: 600;
}

.summary .ok {
  color: var(--ok);
  font-weight: 500;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -4px -8px -2px 0;
}

.name-row {
  display: flex;
  gap: 6px;
}

.name-row .input {
  flex: 1 1 auto;
}

#teams {
  min-height: 190px;
}

.btn-col {
  display: grid;
  gap: 6px;
}

.btn-col .btn {
  justify-content: flex-start;
}

.more,
.backup {
  margin-top: 12px;
  font-size: 13px;
}

.more summary,
.backup summary {
  font-weight: 500;
  cursor: pointer;
}

.more-body {
  padding-top: 10px;
}

.backup p {
  margin: 8px 0;
}

/* Tie-break list */
.tb-list {
  display: grid;
  gap: 4px;
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  counter-reset: tb;
}

.tb-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 8px;
  background: var(--m-muted);
  font-size: 13px;
  counter-increment: tb;
}

.tb-list li::before {
  content: counter(tb) ".";
  min-width: 18px;
  color: var(--m-muted-fg);
}

.tb-list .tb-name {
  flex: 1 1 auto;
}

.mini {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--m-muted-fg);
  font: inherit;
  cursor: pointer;
}

.mini:hover:not(:disabled) {
  background: var(--m-card);
  color: var(--m-fg);
}

.mini:disabled {
  opacity: 0.3;
  cursor: default;
}

.mini svg {
  width: 14px;
  height: 14px;
}

/* ---------- Panels ---------- */
.side {
  display: contents;
}

.layout .card + .card {
  margin-top: 0;
}

.layout {
  row-gap: 16px;
}

.tour-card { order: 1; }
.teams-card { order: 2; }
.format-card { order: 3; }
.time-card { order: 4; }
.live-card { order: 5; }
.cert-card { order: 6; }
.out-card { order: 7; }

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

@media (min-width: 901px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 350px;
    grid-template-rows: repeat(6, auto) 1fr;
  }

  .stage-card {
    grid-column: 1;
    grid-row: 1 / 8;
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow: auto;
  }

  .tour-card, .teams-card, .format-card, .time-card, .live-card, .cert-card, .out-card {
    grid-column: 2;
    align-self: start;
  }

  .tour-card { grid-row: 1; }
  .teams-card { grid-row: 2; }
  .format-card { grid-row: 3; }
  .time-card { grid-row: 4; }
  .live-card { grid-row: 5; }
  .cert-card { grid-row: 6; }
  .out-card { grid-row: 7; }

  body.melon-fs-tool .layout {
    grid-template-columns: clamp(250px, 22vw, 320px) minmax(0, 1fr) clamp(240px, 20vw, 300px);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
  }

  body.melon-fs-tool .side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: auto;
  }

  body.melon-fs-tool .side-left { grid-column: 1; grid-row: 1 / 3; }
  body.melon-fs-tool .side-right { grid-column: 3; grid-row: 1 / 3; }

  body.melon-fs-tool .stage-card {
    grid-column: 2;
    grid-row: 1;
    position: static;
    max-height: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.melon-fs-tool .stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  body.melon-fs-tool .side .card {
    flex: none;
    align-self: stretch;
    padding: 4px 16px 12px;
  }

  body.melon-fs-tool .layout > .time-card {
    grid-column: 2;
    grid-row: 2;
    align-self: stretch;
    padding: 10px 16px;
  }

  body.melon-fs-tool .time-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px 12px;
  }

  body.melon-fs-tool .time-body .field {
    margin: 0;
  }

  body.melon-fs-tool .time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  body.melon-fs-tool .time-grid .field {
    width: 92px;
  }

  body.melon-fs-tool .time-grid .label {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.melon-fs-tool .field-names {
    flex: 1 1 160px;
  }

  body.melon-fs-tool .time-body .label {
    font-size: 12px;
  }

  body.melon-fs-tool .rest-check {
    margin: 0 0 8px;
  }

  body.melon-fs-tool .rest-check .hint {
    display: none;
  }
}

/* ---------- Stage ---------- */
.stale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.stale span {
  flex: 1 1 220px;
}

.clock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 12px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: var(--m-muted);
}

.clock-label {
  color: var(--m-muted-fg);
  font-size: 12.5px;
  font-weight: 500;
}

.clock-time {
  min-width: 64px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.clock-time.is-over {
  color: var(--m-danger);
}

.clock-sound {
  margin: 0 6px 0 auto;
}

.stage {
  min-height: 300px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 48px 16px;
  border-radius: var(--m-radius-card);
  background: var(--m-muted);
  text-align: center;
}

.empty-state h2 {
  margin: 6px 0 0;
  font-size: 18px;
}

.empty-state p {
  max-width: 440px;
  margin: 0 0 10px;
  color: var(--m-muted-fg);
}

.es-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--m-primary-soft);
  color: var(--m-primary-soft-fg);
}

.es-icon svg {
  width: 30px;
  height: 30px;
}

.empty {
  padding: 28px 8px;
  color: var(--m-muted-fg);
  text-align: center;
}

/* Schedule */
.slot {
  margin-bottom: 14px;
}

.slot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  padding: 0 4px;
  color: var(--m-muted-fg);
  font-size: 12.5px;
  font-weight: 600;
}

.slot-time {
  color: var(--m-fg);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.slot-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--m-muted);
  font-size: 11px;
  font-weight: 600;
}

.slot-tag.is-now {
  background: var(--m-primary);
  color: var(--m-primary-fg);
}

.mrow {
  display: grid;
  grid-template-columns: 30px 108px minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13.5px;
}

.mrow + .mrow {
  margin-top: 2px;
}

.mrow:nth-child(even) {
  background: color-mix(in srgb, var(--m-muted) 55%, transparent);
}

.slot.is-now .mrow {
  background: var(--now-bg);
}

.mrow.is-wait {
  color: var(--m-muted-fg);
}

.mrow.is-flash {
  animation: flash 1.2s ease-out;
}

@keyframes flash {
  from { box-shadow: 0 0 0 2px var(--m-primary); }
  to { box-shadow: 0 0 0 2px transparent; }
}

.m-no {
  color: var(--m-muted-fg);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.m-meta {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.m-field {
  font-size: 12.5px;
  font-weight: 500;
}

.m-label {
  overflow: hidden;
  color: var(--m-muted-fg);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tm-a {
  text-align: right;
}

.tm.is-open {
  color: var(--m-muted-fg);
  font-style: italic;
  font-size: 12.5px;
}

.tm.is-win {
  font-weight: 650;
}

.tm.is-me,
.bx-line.is-me .bx-name {
  color: var(--m-primary);
  font-weight: 650;
}

.m-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 78px;
}

.sc {
  width: 38px;
  height: 32px;
  padding: 0 2px;
  border: 1px solid var(--m-border);
  border-radius: 8px;
  background: var(--m-card);
  color: var(--m-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sc:focus {
  outline: 2px solid var(--m-primary);
  outline-offset: -1px;
}

.sc:disabled {
  background: transparent;
  opacity: 0.5;
}

.sc-sep {
  color: var(--m-muted-fg);
  font-weight: 600;
}

.sc-text,
.sc-sum {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mrow.is-wait .sc-text,
.mrow.is-open .sc-text {
  color: var(--m-muted-fg);
  font-weight: 500;
}

.m-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  grid-column: 3 / 6;
}

.sets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
}

.set {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.set-n {
  margin-right: 4px;
  color: var(--m-muted-fg);
  font-size: 11.5px;
}

.sc-s {
  width: 34px;
  height: 28px;
  font-size: 13.5px;
}

.sets-text {
  color: var(--m-muted-fg);
  font-size: 12px;
}

.chess-pick,
.decider {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.decider {
  font-size: 12px;
}

.decider > span {
  margin-right: 4px;
  color: var(--m-muted-fg);
}

.cp {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--m-card);
  box-shadow: inset 0 0 0 1px var(--m-border);
  color: var(--m-fg);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.cp.is-on {
  background: var(--m-primary);
  box-shadow: none;
  color: var(--m-primary-fg);
}

.cp:disabled {
  opacity: 0.4;
  cursor: default;
}

.swiss-wait {
  margin: 4px 4px 8px;
  color: var(--m-muted-fg);
  font-size: 13px;
}

/* Tables */
.tbl-wrap {
  margin-bottom: 18px;
  overflow-x: auto;
}

.tbl-head,
.br-head {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.tbl-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: 0 18px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tbl th,
.tbl td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.tbl th {
  color: var(--m-muted-fg);
  font-size: 11.5px;
  font-weight: 600;
}

.tbl .c-team {
  width: 100%;
  overflow: hidden;
  max-width: 1px;
  text-align: left;
  text-overflow: ellipsis;
}

.tbl .c-rank {
  width: 28px;
  color: var(--m-muted-fg);
}

.tbl .c-pts {
  font-weight: 700;
}

.tbl tr.is-adv td:first-child {
  box-shadow: inset 3px 0 0 var(--m-primary);
}

.tbl tr.is-me td {
  background: var(--m-primary-soft);
}

@media (max-width: 560px) {
  .tbl .c-opt {
    display: none;
  }
}

/* Bracket */
.br {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 6px;
  overflow-x: auto;
}

.br-col {
  display: flex;
  flex: 0 0 196px;
  flex-direction: column;
}

.br-title {
  margin-bottom: 6px;
  color: var(--m-muted-fg);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.br-matches {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
}

.br-subs {
  display: grid;
  gap: 4px;
}

.bx {
  overflow: hidden;
  border-radius: 10px;
  background: var(--m-card);
  box-shadow: 0 0 0 1px var(--m-ring-line), 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 13px;
}

.bx[data-jump] {
  cursor: pointer;
}

.bx[data-jump]:hover {
  box-shadow: 0 0 0 1px var(--m-muted-fg);
}

.bx.is-void {
  opacity: 0.6;
  box-shadow: 0 0 0 1px var(--m-ring-line);
}

.bx-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 9px;
  background: var(--m-muted);
  color: var(--m-muted-fg);
  font-size: 10.5px;
}

.bx-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
}

.bx-line + .bx-line {
  border-top: 1px solid var(--line);
}

.bx-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bx-line.is-open .bx-name,
.bx-line.is-bye .bx-name {
  color: var(--m-muted-fg);
  font-style: italic;
  font-size: 12px;
}

.bx-line.is-win {
  font-weight: 650;
}

.bx-line.is-win .bx-score {
  color: var(--win);
}

.bx-score {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Ranking */
.rank {
  display: grid;
  gap: 4px;
  max-width: 560px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--m-muted);
  font-size: 14px;
}

.rk-n {
  min-width: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rk-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.rk-note {
  color: var(--m-muted-fg);
  font-size: 12px;
}

.rk.m1 { background: color-mix(in srgb, var(--gold) 22%, var(--m-card)); }
.rk.m2 { background: color-mix(in srgb, var(--silver) 22%, var(--m-card)); }
.rk.m3 { background: color-mix(in srgb, var(--bronze) 20%, var(--m-card)); }

.rk.m1 .rk-n::before,
.rk.m2 .rk-n::before,
.rk.m3 .rk-n::before {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  content: "";
}

.rk.m1 .rk-n::before { background: var(--gold); }
.rk.m2 .rk-n::before { background: var(--silver); }
.rk.m3 .rk-n::before { background: var(--bronze); }

.rk.is-me {
  box-shadow: inset 3px 0 0 var(--m-primary);
}

.rk.is-open {
  opacity: 0.7;
}

/* Certificates */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.cert-grid figure {
  margin: 0;
}

.cert-grid canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--m-ring-line), 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

.cert-grid figcaption {
  margin-top: 4px;
  overflow: hidden;
  color: var(--m-muted-fg);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-more {
  display: grid;
  place-items: center;
  aspect-ratio: 210 / 297;
  border-radius: 4px;
  background: var(--m-muted);
  color: var(--m-muted-fg);
  font-size: 13px;
  text-align: center;
}

/* Live */
.live-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.live-qr {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  padding: 6px;
  border-radius: 8px;
  background: #ffffff;
}

.live-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.live-links {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
}

.live-links .input {
  width: 100%;
  font-size: 12px;
}

/* ---------- Beamer ---------- */
.beamer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1.6vh;
  padding: 2.2vh 2.4vw;
  background: var(--m-page);
  color: var(--m-fg);
  font-size: clamp(14px, 1.7vw, 30px);
}

.bm-head {
  display: flex;
  align-items: center;
  gap: 2vw;
}

.bm-title {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.bm-title strong {
  overflow: hidden;
  font-size: 1.5em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-title span {
  color: var(--m-muted-fg);
  font-size: 0.75em;
}

.bm-clock {
  display: grid;
  justify-items: end;
  line-height: 1;
}

.bm-clock span:first-child {
  color: var(--m-muted-fg);
  font-size: 0.6em;
}

.bm-clock-time {
  font-size: 2.8em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bm-clock-time.is-over {
  color: var(--m-danger);
}

.bm-wall {
  color: var(--m-muted-fg);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}

.bm-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.4vw;
  min-height: 0;
}

.bm-matches,
.bm-side {
  min-height: 0;
  overflow: hidden;
}

.bm-h {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin: 0 0 0.4em;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bm-h .is-now {
  color: var(--m-primary);
}

.bm-h small {
  color: var(--m-muted-fg);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.bm-m {
  display: grid;
  grid-template-columns: 5.6em minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.35em;
  padding: 0.45em 0.7em;
  border-radius: 0.5em;
  background: var(--m-card);
  box-shadow: 0 0 0 1px var(--m-ring-line);
}

.bm-m .f {
  color: var(--m-muted-fg);
  font-size: 0.7em;
  line-height: 1.2;
}

.bm-m .a {
  text-align: right;
}

.bm-m .a,
.bm-m .b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-m .s {
  min-width: 3.2em;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.bm-m .o {
  color: var(--m-muted-fg);
  font-style: italic;
  font-weight: 500;
}

#bmNext {
  margin-top: 1.4em;
  opacity: 0.85;
}

.bm-side .tbl {
  font-size: 0.78em;
}

.bm-side .tbl th {
  font-size: 0.75em;
}

.bm-side .tbl th,
.bm-side .tbl td {
  padding: 0.3em 0.4em;
}

.bm-side .tbl-head {
  font-size: 0.85em;
}

.bm-side .bx {
  font-size: 0.6em;
}

.bm-side .br-col {
  flex-basis: 11em;
}

.bm-side .rk {
  padding: 0.35em 0.7em;
  font-size: 0.85em;
}

.bm-foot {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bm-qr {
  width: 11vh;
  height: 11vh;
  padding: 0.6vh;
  border-radius: 6px;
  background: #ffffff;
}

.bm-qr:empty {
  display: none;
}

.bm-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bm-qr-text {
  max-width: 40vw;
  color: var(--m-muted-fg);
  font-size: 0.65em;
}

body.bm-page {
  padding: 0;
  overflow: hidden;
}

.bm-hint {
  flex: 1 1 260px;
  max-width: 560px;
  margin: 0;
  color: var(--m-muted-fg);
  font-size: 13px;
}

/* ---------- Print ---------- */
#printArea {
  display: none;
}

@media (max-width: 900px) {
  .stage-card {
    order: 0;
  }
}

@media (max-width: 640px) {
  .mrow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 2px 8px;
    padding: 8px 8px;
  }

  .m-no {
    display: none;
  }

  .m-meta {
    display: flex;
    grid-column: 1 / 4;
    gap: 8px;
  }

  .m-extra {
    grid-column: 1 / 4;
  }

  .m-score {
    min-width: 70px;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tabs span {
    padding: 5px 9px;
    font-size: 12.5px;
  }

  .clock-sound {
    margin-left: 0;
  }

  .tour-pick select {
    max-width: 200px;
  }
}

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

  body {
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  body > *:not(#printArea) {
    display: none !important;
  }

  #printArea {
    display: block;
    color: #000000;
    font-size: 11pt;
  }

  #printArea h1 {
    margin: 0 0 2mm;
    font-size: 18pt;
  }

  #printArea .p-sub {
    margin: 0 0 6mm;
    color: #444444;
  }

  #printArea h2 {
    margin: 6mm 0 2mm;
    font-size: 13pt;
    break-after: avoid;
  }

  #printArea .slot {
    break-inside: avoid;
  }

  #printArea .mrow {
    grid-template-columns: 8mm 26mm minmax(0, 1fr) 22mm minmax(0, 1fr);
    padding: 1.4mm 2mm;
    border-bottom: 0.2mm solid #cccccc;
    border-radius: 0;
    background: none !important;
    font-size: 10.5pt;
  }

  #printArea .slot-head {
    color: #000000;
  }

  #printArea .sc-text {
    color: #000000;
  }

  #printArea .mrow.is-open .sc-text,
  #printArea .mrow.is-wait .sc-text {
    color: #bbbbbb;
  }

  #printArea .tbl-wrap,
  #printArea .br,
  #printArea .rank {
    break-inside: avoid;
  }

  #printArea .br {
    flex-wrap: wrap;
    overflow: visible;
  }

  #printArea .bx {
    box-shadow: 0 0 0 0.2mm #999999;
  }

  #printArea .sheets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
  }

  #printArea .sheet {
    min-height: 120mm;
    padding: 5mm;
    border: 0.3mm solid #000000;
    break-inside: avoid;
    font-size: 10pt;
  }

  #printArea .sheet h3 {
    margin: 0 0 1mm;
    font-size: 11pt;
  }

  #printArea .sheet .meta {
    margin-bottom: 4mm;
    color: #333333;
  }

  #printArea .sheet table {
    width: 100%;
    border-collapse: collapse;
  }

  #printArea .sheet td {
    height: 11mm;
    padding: 1mm 2mm;
    border: 0.2mm solid #555555;
  }

  #printArea .sheet .team {
    width: 55%;
    font-weight: 700;
  }

  #printArea .sheet .sign {
    display: flex;
    gap: 6mm;
    margin-top: 10mm;
  }

  #printArea .sheet .sign span {
    flex: 1;
    padding-top: 1mm;
    border-top: 0.2mm solid #000000;
    font-size: 8.5pt;
  }
}
