.trophy-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .75rem; }
.trophy-controls button, .trophy-name { min-height: 44px; }
.trophy-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: .75rem 1.25rem; margin-block: 0 1rem;
}
.trophy-metadata { min-width: 0; }
.trophy-metadata .trophy-heading { margin: 0 0 .35rem; }
.trophy-metadata p { margin: .15rem 0; }
.trophy-edition-name { font-weight: 600; }
.trophy-updated { color: #47636e; font-size: .85rem; }
.trophy-toolbar .trophy-categories {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 0 auto;
}
.trophy-categories button {
  border: 1px solid var(--trophy-category-color); background: var(--trophy-category-soft);
  color: var(--trophy-category-color); box-shadow: none; white-space: nowrap;
}
.trophy-category-f { --trophy-category-color: var(--women, #b01762); --trophy-category-soft: var(--women-soft, #fff2f7); }
.trophy-category-m { --trophy-category-color: var(--men, #1769aa); --trophy-category-soft: var(--men-soft, #eff7ff); }
.trophy-categories button[aria-pressed="true"],
.trophy-categories button:hover { background: var(--trophy-category-color); color: #fff; }
.trophy-categories button:focus-visible { outline: 2px solid var(--trophy-category-color); outline-offset: 2px; }
.trophy-scroll { overflow-x: auto; max-width: 100%; }
.trophy-table { width: 100%; min-width: 800px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.trophy-table :is(th, td) { box-sizing: border-box; padding: .45rem .55rem; border-bottom: 1px solid #cfe1e5; white-space: nowrap; text-align: center; vertical-align: middle; }
.trophy-table th { background: #e4f3f5; color: #153c4a; }
.trophy-table :is(th, td):first-child { position: sticky; left: 0; min-width: 3.5rem; width: 3.5rem; }
.trophy-table :is(th, td):nth-child(2) { position: sticky; left: 3.5rem; text-align: left; }
.trophy-table th:nth-child(2) { width: 29%; }
.trophy-table th:nth-child(3) { width: 4.5rem; }
.trophy-table th:last-child { width: 6rem; }
.trophy-table td:nth-child(-n+2) { background: #f3f9fa; color: #153c4a; }
.trophy-table td:last-child { font-weight: 700; }
.trophy-table small { display: block; }
.trophy-table .trophy-name,
.trophy-table .trophy-name:hover {
  border: 0; background: transparent; color: inherit; padding: 0; box-shadow: none;
  font-weight: 400; text-decoration: underline; text-underline-offset: .16em;
  max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left;
}
.trophy-table .trophy-name:focus-visible { outline: 2px solid #086f7e; outline-offset: 3px; }
.trophy-profile-dialog {
  box-sizing: border-box; width: min(28rem, calc(100% - 2rem)); max-width: none;
  padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid #cfe1e5; border-radius: .875rem;
  background: #fff; color: #153c4a; box-shadow: 0 18px 55px rgb(12 42 54 / .24);
}
.trophy-profile-dialog::backdrop { background: rgb(10 31 40 / .55); }
.trophy-profile-dialog h3 { margin: 0; font-size: 1.25rem; color: inherit; }
.trophy-profile-dialog .trophy-profile-person { margin: .5rem 0 1.25rem; color: #47636e; overflow-wrap: anywhere; }
.trophy-profile-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.trophy-profile-actions :is(a, button) {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 44px; padding: .5rem .75rem; border-radius: .45rem; font: inherit;
  font-weight: 600; text-align: center; text-decoration: none;
}
.trophy-profile-actions button { border: 1px solid #b8d4d9; background: #f3f9fa; color: #153c4a; }
.trophy-profile-actions a { border: 1px solid #086f7e; background: #086f7e; color: #fff; }
.trophy-profile-actions a:hover { background: #075a66; }
.trophy-profile-actions :is(a, button):focus-visible { outline: 2px solid #086f7e; outline-offset: 2px; }
.trophy-edition-fields { display: flex; flex-wrap: wrap; gap: .75rem; }
.trophy-edition-fields label { display: grid; gap: .2rem; }
.trophy-course-label { display: none; }
.trophy-table .trophy-cutoff td {
  position: static; width: auto; padding: .35rem .55rem;
  background: #d4e7eb; border-top: 2px solid #527984; color: #153c4a;
  font-size: .8rem; text-align: left; white-space: normal;
}
@media (max-width: 700px) and (orientation: portrait) {
  #trophyRanking .trophy-toolbar .trophy-categories { width: min(100%, 24rem); }
  #trophyRanking .trophy-categories button { padding-inline: .25rem; font-size: .875rem; }
  #trophyRanking .trophy-scroll { overflow-x: visible; }
  #trophyRanking .trophy-table { display: block; min-width: 0; }
  #trophyRanking .trophy-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #trophyRanking .trophy-table tbody { display: grid; gap: .6rem; }
  #trophyRanking .trophy-swimmer {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #fff;
    border: 1px solid #cfe1e5;
    border-radius: .5rem;
    padding: .35rem .4rem .5rem;
    color: #153c4a;
  }
  #trophyRanking .trophy-swimmer td {
    min-width: 0; width: auto; position: static; padding: .15rem .2rem;
    border: 0; background: transparent; white-space: normal; overflow-wrap: anywhere;
  }
  #trophyRanking .trophy-swimmer td:nth-child(-n+2) { align-self: center; }
  #trophyRanking .trophy-swimmer td:nth-child(2) { grid-column: 2 / 6; }
  #trophyRanking .trophy-swimmer td:nth-child(3) { grid-column: 1 / 4; grid-row: 2; }
  #trophyRanking .trophy-swimmer td:last-child { grid-column: 4 / 6; grid-row: 2; }
  #trophyRanking .trophy-swimmer .trophy-course {
    grid-row: 3; margin-top: .35rem; padding-top: .35rem; border-top: 1px solid #cfe1e5;
    text-align: center; font-size: .78rem;
  }
  #trophyRanking .trophy-course-label { display: block; color: #47636e; font-size: .68rem; }
  #trophyRanking .trophy-name { text-align: left; }
  #trophyRanking .trophy-cutoff { display: block; }
  #trophyRanking .trophy-cutoff td { display: block; }
}
