.brand,
.real-nav a {
  color: inherit;
  text-decoration: none;
}
.real-nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
  color: #176c5e;
  font-size: 14px;
}
.open-event {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 22px;
}
.open-event label,
.upload-panel label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.open-event input,
.upload-panel input {
  padding: 9px 12px;
  border: 1px solid #c3d3c9;
  border-radius: 7px;
}
.event-notice,
.revision {
  padding: 12px 0;
  color: #597367;
  font-size: 13px;
}
.published-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.9fr) 1.2fr 1.4fr auto;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  text-align: left;
  border-top: 1px solid var(--line);
}
.published-row:hover {
  background: #f5faf6;
}
.published-row small {
  display: block;
  margin-top: 3px;
}
.upload-panel {
  padding: 22px;
}
.upload-panel label,
.upload-panel button {
  margin-bottom: 12px;
}
.upload-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.code-card {
  background: white;
  border: 1px solid var(--line);
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  break-inside: avoid;
}
.code-card img {
  margin: auto;
}
.code-card a {
  color: #09695c;
}
.revision button {
  margin-left: 10px;
}
@media (max-width: 660px) {
  .published-row {
    grid-template-columns: 1fr auto;
    gap: 7px;
  }
  .real-nav {
    gap: 10px;
    font-size: 12px;
  }
  .open-event {
    align-items: stretch;
    flex-direction: column;
  }
  .code-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media print {
  body {
    background: white;
  }
  .no-print,
  .mast {
    display: none !important;
  }
  .shell {
    width: 100%;
  }
  .code-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .code-card a {
    display: none;
  }
}
.directory-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}
.directory-row:hover {
  background: #eef6ef;
}
.published-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media screen and (max-width: 760px) {
  #published .real-nav {
    display: none;
  }
  #published main,
  #publisher main {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  .published-tabs a {
    flex: 1;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-height: 44px;
    color: #697a72;
    font-size: 11px;
    text-decoration: none;
  }
  .published-tabs svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .published-tabs a[aria-current='page'] {
    color: #0b745e;
    font-weight: 700;
  }
}

.draw-panel .inner-heading {
  flex-wrap: wrap;
  gap: 12px;
}
.draw-panel label {
  color: var(--muted);
  font-size: 13px;
}
.draw-panel select {
  max-width: 100%;
  padding: 6px;
}
.draw-board {
  position: relative;
  width: max-content;
  min-width: 100%;
  display: flex;
  align-items: stretch;
  gap: 48px;
  padding: 16px 20px;
}
.draw-board svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.draw-board path {
  fill: none;
  stroke: #91b3a7;
  stroke-width: 1.7;
}
.draw-column {
  position: relative;
  flex: 0 0 210px;
  width: 210px;
  display: flex;
  flex-direction: column;
}
.draw-column h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.draw-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 15px;
}
.draw-card {
  width: 100%;
  border: 1px solid #cad8d0;
  background: white;
  border-radius: 9px;
  text-align: left;
  padding: 9px 12px;
  overflow-wrap: anywhere;
}
.draw-card.located,
.draw-card:focus-visible {
  outline: 2px solid #14724e;
  background: #edf8ef;
}
.draw-meta,
.draw-side {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.draw-meta {
  padding-bottom: 4px;
  border-bottom: 1px solid #edf2ee;
}
.draw-side {
  padding-top: 4px;
}
.draw-side small {
  margin-left: 6px;
}
.draw-side.won,
.draw-score {
  color: #116447;
}
.draw-card small {
  font-size: 11px;
}
.draw-scroll {
  overscroll-behavior-x: contain;
}
.draw-source,
.draw-next {
  display: inline-block;
  margin: 8px 8px 4px 0;
}
.draw-next {
  color: inherit;
}
@media (max-width: 740px) {
  .draw-board {
    gap: 32px;
    padding: 12px;
  }
  .real-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 12px;
  }
}

.match-links {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--line);
}
.match-links .published-row {
  flex: 1;
  min-width: 0;
  border-top: 0;
}
.match-links > a {
  display: flex;
  align-items: center;
  padding: 0 12px 0 4px;
  color: #176c5e;
  font-size: 12px;
  white-space: nowrap;
}

.team-table { width: 100%; border-collapse: collapse; text-align: left; }
.team-table th, .team-table td { padding: 10px 16px; border-top: 1px solid var(--line); }
.team-table th:last-child, .team-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.team-rule { margin: 8px 16px 16px; }
.court-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 16px;
}
.court-panel {
  padding: 20px;
}
.court-panel h3 {
  margin: 0 0 10px;
}
.court-session {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.court-session header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.court-label,
.court-next small,
.court-session > small {
  color: #526c60;
  font-size: 12px;
}
.court-label,
.court-next {
  margin-top: 14px;
}
.court-next {
  padding: 10px;
  background: #f0f6f1;
  border-radius: 8px;
  margin-bottom: 8px;
}
.court-session p {
  margin-bottom: 4px;
}

.event-shortcuts {display:flex; flex-wrap:wrap; gap:12px; margin:18px 0 26px}
.event-shortcuts a {padding:12px 16px; background:white; border:1px solid #d9e4e0; border-radius:8px; color:#176c5e; text-decoration:none; font-weight:650}
.result-line {display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px 18px; border-top:1px solid #e4ebe8}
.result-line small {margin-left:auto}
a.hero-button {display:inline-flex; text-decoration:none}
@media(max-width:760px){.published-tabs {overflow-x:auto}.published-tabs a {flex:1 0 47px;min-width:47px}.real-nav {gap:8px}}

.overview-counts {display:flex;flex-wrap:wrap;gap:1px;background:#dae6df;border-radius:10px;overflow:hidden;margin-top:18px}
.overview-counts:empty {display:none}
.overview-counts div {flex:1;background:#fff;padding:16px;color:#39554c;text-align:center}
.overview-counts strong {display:block;color:#123d31;font-size:1.65rem}

.draw-filters {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr))}
.draw-filters label {min-width:0}
.draw-filters select,.draw-filters input {box-sizing:border-box;width:100%;height:40px;padding:0 10px;border:1px solid #cad9d0;border-radius:8px;background:#fff;color:inherit;font:inherit;font-size:14px}
.draw-filters select:disabled {background:#f2f5f3;color:#718078;cursor:not-allowed}
@media (max-width:600px) {
  .draw-filters {grid-template-columns:repeat(2,minmax(0,1fr))}
  .draw-filters label:last-child {grid-column:1/-1}
}

@media screen and (min-width:761px) {
  .event-nav {display:flex;align-items:center;flex-wrap:wrap;gap:8px clamp(10px,1.5vw,24px);margin-left:auto}
  .event-nav svg {display:none}
  .event-nav a {color:#405e56;font-size:14px;text-decoration:none;white-space:nowrap;padding:7px 0}
  .event-nav a:hover,.event-nav a[aria-current="page"] {color:#075d55;text-decoration:underline;text-underline-offset:6px}
}

.rank-search {display:grid;gap:8px;font-weight:650}
.rank-search input {width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink)}
.rank-cards {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));
  align-items:start; gap:18px; margin-top:18px;
}
.rank-card {
  --place-color:#27645b; --place-tint:#edf6f1;
  background:#fff; border:1px solid #d8e3dc; border-radius:16px;
  box-shadow:0 5px 16px #173f3110; overflow:hidden; overflow-wrap:anywhere;
}
.rank-card[data-place="1"] {--place-color:#79540e; --place-tint:#faf0d7}
.rank-card[data-place="2"] {--place-color:#465869; --place-tint:#edf1f5}
.rank-card[data-place="3"] {--place-color:#84502f; --place-tint:#f7eae1}
.rank-card header {
  padding:16px 20px; color:#fff; background:linear-gradient(115deg,#123d3c,#215852);
  font-size:15px; font-weight:650; line-height:1.55;
}
.rank-person {display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:22px 20px}
.rank-person h2 {font-size:26px; line-height:1.25; color:#153c38}
.rank-person p {margin-top:6px; color:#536962; font-size:14px}
.rank-place {
  display:inline-flex; align-items:baseline; gap:3px; padding:7px 10px; border-radius:10px;
  font-size:12px; color:var(--place-color); background:var(--place-tint); white-space:nowrap;
}
.rank-place em {font:700 32px/1 Georgia,serif; font-variant-numeric:lining-nums}
.rank-card dl {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); gap:14px; margin:0 20px; padding:14px 0 18px; border-top:1px solid var(--line)}
.rank-card dt {color:var(--muted); font-size:12px}
.rank-card dd {margin:4px 0 0; color:var(--ink); font-weight:600; line-height:1.45}

.mobile-match-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f0f6f1;
  overflow-wrap: anywhere;
}
.panel > .mobile-match-card { margin: 10px 12px; }
.mobile-match-body {
  display: grid;
  width: 100%;
  gap: 7px;
  padding: 12px;
  text-align: left;
}
.mobile-match-heading,
.mobile-match-sides.paired {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}
.mobile-match-heading .pill { width: 56px; }
.match-heading-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.match-heading-info > * { min-width: 0; }
.match-footer { display: flex; align-items: baseline; gap: 8px; color: var(--muted); }
.match-footer > span { min-width: 0; }
.match-round { flex: 0 0 auto; max-width: 48%; margin-left: auto; text-align: right; }
.mobile-match-sides { display: grid; gap: 5px; }
.mobile-match-sides.paired { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.mobile-match-sides.paired > :last-child { text-align: right; }
.mobile-match-sides small, .mobile-match-sides strong { display: block; }
.mobile-match-vs { padding-top: 2px; }
.mobile-match-card > a {
  display: block;
  width: fit-content;
  margin: 0 12px 10px auto;
  color: #176c5e;
  font-size: 13px;
}
.mobile-match-body:focus-visible {
  outline: 2px solid #14724e;
  border-radius: 12px;
}
.court-next { padding: 7px 10px; }
.court-next > .mobile-match-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.court-next > .mobile-match-card + .mobile-match-card { border-top: 1px solid var(--line); }
.court-next .mobile-match-body { gap: 2px; padding: 5px 0; line-height: 1.3; }
.court-next .mobile-match-heading { font-size: 13px; }
.court-next .pill { padding-block: 1px; }
.court-next .mobile-match-sides { font-size: 14px; }

.personal-identity,
.personal-entry,
.personal-result {
  min-width: 0;
  overflow-wrap: anywhere;
}
.personal-profile .btn { flex: none; }
.personal-section .inner-heading { padding-bottom: 12px; }
.personal-entry > header,
.personal-result {
  border-top: 1px solid var(--line);
  padding: 12px 20px;
}
.personal-entry h3 {
  color: var(--ink);
  font-size: 15px;
}
.personal-entry header small,
.personal-result span {
  display: block;
  margin-top: 4px;
}
.personal-note,
.personal-possible > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.personal-note { padding: 0 20px 14px; }
.personal-possible > p { padding: 8px 20px 0; }
.personal-result span { color: var(--muted); }
.personal-entry .mobile-match-card { margin: 0 12px 10px; }
.personal-possible > .mobile-match-card { margin-top: 5px; }

.schedule-refresh {
  position: fixed;
  z-index: 9;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 88px;
  min-height: 44px;
  border-radius: 24px;
  box-shadow: 0 3px 12px #12383c30;
}
.schedule-refresh svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 760px) {
  .schedule-refresh { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
@media print {
  .schedule-refresh { display: none; }
}

.single-tree { overflow: auto; background: white; color: #171717; }
.single-tree > svg { display: block; max-width: none; }
.single-tree .single-line { fill: none; stroke: #000; stroke-width: 1.15; }
.single-title { fill: black; font-size: 32px; font-weight: 700; }
.single-section, .single-round { fill: #222; font-size: 18px; font-weight: 650; }
.single-entrant, .single-match { text-align: center; font-size: 16px; line-height: 20px; }
.single-entrant { display: grid; align-content: end; height: 100%; }
.single-entrant strong, .single-entrant small, .single-match b, .single-match small {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.single-entrant strong { font-weight: 400; }
.single-entrant.numbered { grid-template-columns: 40px minmax(0, 1fr); align-content: center; align-items: center; }
.single-entrant.numbered.mirrored { grid-template-columns: minmax(0, 1fr) 40px; }
.single-entrant.mirrored .single-seed { grid-column: 2; grid-row: 1; }
.single-entrant.mirrored .single-entrant-text { grid-column: 1; grid-row: 1; }
.single-seed { font-size: 21px; }
.single-entrant, .single-match, .single-entrant small { font-size: 18px; }
.single-entrant small { color: inherit; }
.single-round { font-weight: 400; }
.single-section { font-size: 20px; }
.single-match { width: 100%; border-radius: 4px; color: #171717; }
.single-match:hover, .single-match.located, .single-match:focus-visible { background: #e4f2e9; outline: 2px solid #227650; outline-offset: -2px; }

.mobile-match-actions {display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:12px;padding:8px 14px;border-top:1px solid var(--line)}
.mobile-match-actions a {font-size:13px;color:var(--green,#145c53);text-decoration:none}
.match-recording-button {border:1px solid #bcd4c9;border-radius:7px;background:#edf6f1;color:#145c53;padding:7px 12px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.match-recording-button:hover {background:#dfeee6}
.match-recording-button:focus-visible {outline:2px solid #145c53;outline-offset:3px}
.server-bracket { overflow:auto; max-height:75vh; }
.server-bracket-content { transform-origin:top left; }
.server-bracket-content > svg { display:block; max-width:none; }
.server-zoom { display:flex; gap:8px; align-items:center; }
.server-zoom button { min-width:42px; min-height:40px; border:1px solid #cbd5ce; border-radius:6px; }
.server-card { border:1px solid #bbb; border-radius:6px; padding:6px; background:white; }
.server-card small { display:block; }
.server-bracket .format-table { padding:0; overflow:visible; }
.server-bracket .format-sheet { width:100%; }
.server-bracket .format-sheet td,.server-bracket .format-sheet th { overflow:hidden; }
.server-bracket .server-other { height:84px; overflow:hidden; }

/* Bound table text so valid long names cannot expand rows beyond SVG bounds. */
.server-bracket .server-cell { display:block; max-height:46px; line-height:23px; overflow:hidden; overflow-wrap:anywhere; }
.server-bracket .table-bout { max-height:72px; overflow:hidden; }
.server-bracket .table-bout b,.server-bracket .table-bout small { display:block; line-height:20px; max-height:40px; overflow:hidden; }
.server-bracket .points-columns .table-bout { max-height:48px; }
.server-bracket .format-sheet h3 { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:64px; }
.server-bracket .format-sheet:has(.best-three) h3 { line-height:40px; }
.server-bracket .game-slots > span { overflow:hidden; }
.server-bracket .game-slots > span:not(:nth-child(2)) { display:block; max-height:74px; line-height:23px; overflow-wrap:anywhere; padding:4px; }

.server-bracket .server-card > .single-match { height:36px; overflow:hidden; }
.server-bracket .server-card > div { height:40px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; line-height:20px; }
.server-bracket .server-card > div small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
