:root {
  --page: #eef0ec;
  --surface: #ffffff;
  --surface-soft: #f7f8f5;
  --ink: #17201d;
  --muted: #68736e;
  --line: #d8ddd8;
  --dark: #121817;
  --teal: #176a55;
  --teal-soft: #e5f2ed;
  --lime: #b9e541;
  --blue: #2c6098;
  --blue-soft: #e8f0f8;
  --orange: #d95532;
  --orange-soft: #fbe9e3;
  --gold: #a86610;
  --gold-soft: #fff1d5;
  --shadow: 0 12px 32px rgba(21, 30, 26, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(44, 96, 152, 0.28);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 24, 23, 0.97);
  border-bottom: 3px solid var(--lime);
}

.header-inner {
  width: min(1200px, calc(100% - 32px));
  min-height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  width: 44px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: #142016;
  border-radius: 6px;
  font-weight: 950;
  font-size: 17px;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 16px;
  line-height: 1.1;
}

.brand-copy span {
  margin-top: 3px;
  color: #aebdb7;
  font-size: 11px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.main-nav a {
  color: #d9e3df;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.main-nav a.active {
  background: #26312e;
  color: #fff;
}

.account-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.button {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #e8ece9;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.button.dark-ghost {
  background: transparent;
  border-color: #4a5753;
  color: #edf3f0;
}

.button.join {
  background: var(--lime);
  color: #172015;
}

.button.search-submit {
  min-height: 58px;
  min-width: 126px;
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-size: 16px;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.search-stage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-head {
  padding: 26px 28px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 28px;
  align-items: end;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.search-copy h1 {
  font-size: 32px;
  line-height: 1.18;
  font-weight: 950;
}

.search-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-title-row.is-admin {
  gap: 9px;
  flex-wrap: nowrap;
}

.search-title-row.is-admin h1 {
  font-size: 29px;
}

.admin-work-link {
  display: inline-flex;
  min-height: 42px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  background: #17324d;
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.search-title-row.is-admin .admin-work-link {
  min-height: 40px;
  padding: 0 12px;
  flex: 0 0 auto;
  font-size: 13px;
}

.admin-work-link:hover,
.admin-work-link:focus-visible {
  background: #0f263b;
  color: #fff;
}

.admin-search-stats {
  min-width: 0;
  padding-left: 8px;
  flex: 0 0 114px;
  display: grid;
  gap: 2px;
  border-left: 1px solid #ccd5d1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.admin-search-stats span {
  white-space: nowrap;
}

.admin-search-stats .is-cumulative {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid #dbe2df;
}

.admin-search-stats strong {
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.search-copy p:last-child {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.quota-box {
  min-height: 92px;
  padding: 15px 17px;
  display: grid;
  align-content: center;
  background: var(--dark);
  color: #fff;
  border-left: 6px solid var(--lime);
  border-radius: 6px;
}

.quota-box span,
.quota-box small {
  color: #b8c5c0;
  font-size: 12px;
}

.quota-box strong {
  margin: 2px 0;
  color: var(--lime);
  font-size: 25px;
  line-height: 1.1;
}

.search-area {
  padding: 0 28px 24px;
}

.search-form {
  max-width: 820px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-form input {
  width: 100%;
  min-height: 58px;
  padding: 0 17px;
  border: 2px solid #bfc9c4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.search-form input::placeholder {
  color: #8b9590;
  font-weight: 650;
}

.search-form input:focus {
  border-color: var(--teal);
}

.search-notice {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.archive-stats {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface-soft);
}

.archive-stat {
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.archive-stat:last-child {
  border-right: 0;
}

.archive-stat strong,
.archive-stat span {
  display: block;
}

.archive-stat strong {
  font-size: 21px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-stat span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.archive-stat small {
  display: block;
  margin-top: 5px;
  color: #66716c;
  font-size: 9px;
  line-height: 1.35;
  font-weight: 750;
  word-break: keep-all;
}

.grade-browser {
  padding: 13px 18px;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  border-top: 1px solid var(--line);
  background: #fff;
}

.grade-browser-title {
  padding: 0 10px 0 2px;
  display: grid;
  align-content: center;
  gap: 2px;
  white-space: nowrap;
}

.grade-browser-title strong {
  font-size: 12px;
}

.grade-browser-title span {
  color: var(--muted);
  font-size: 9px;
}

.grade-browser-button {
  min-width: 0;
  min-height: 52px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.grade-browser-button > span,
.grade-browser-button strong,
.grade-browser-button small {
  display: block;
  min-width: 0;
}

.grade-browser-button strong {
  font-size: 13px;
}

.grade-browser-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.grade-browser-button small b {
  font-weight: 900;
}

.grade-browser-button em {
  font-style: normal;
  font-size: 10px;
  white-space: nowrap;
}

.grade-browser-button em b {
  font-size: 19px;
}

.grade-master-button {
  border-color: #9a8554;
  background: #151817;
  color: #f6f1e4;
}

.grade-master-button small { color: #c4b995; }
.grade-master-button em b { color: #dbc47f; }

.grade-seven-button {
  border-color: #a9aaa7;
  background: #e2e1dc;
  color: #272a28;
}

.grade-seven-button small { color: #626561; }
.grade-seven-button em b { color: #353936; }

.grade-tristar-button {
  border-color: #9d6949;
  background: #c98e67;
  color: #3f2114;
}

.grade-tristar-button small { color: #67402d; }
.grade-tristar-button em b { color: #542918; }
.grade-master-button[aria-pressed="true"] { border: 2px solid #d7be77; box-shadow: inset 0 0 0 1px #4f462e; }
.grade-seven-button[aria-pressed="true"] { border: 2px solid #5f625f; box-shadow: inset 0 0 0 1px #fff; }
.grade-tristar-button[aria-pressed="true"] { border: 2px solid #6c3822; box-shadow: inset 0 0 0 1px #e8b18b; }

.grade-browser-button:focus-visible {
  outline: 3px solid rgba(27, 119, 91, 0.2);
  outline-offset: 2px;
}

.workspace {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 58px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 950;
}

.count-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #edf0ed;
  color: #39443f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tag.teal {
  background: var(--teal-soft);
  color: #0d5c46;
}

.tag.blue {
  background: var(--blue-soft);
  color: #245887;
}

.tag.gold {
  background: var(--gold-soft);
  color: #81500d;
}

.tag.grade-finisher {
  background: #edf0ed;
  color: #39443f;
}

.tag.grade-tristar {
  border: 1px solid #8b5437;
  background: #a96543;
  color: #fff7f1;
}

.tag.grade-seven {
  border: 1px solid #888b88;
  background: #dad9d4;
  color: #252825;
}

.tag.grade-master {
  border: 1px solid #ad985e;
  background: #111412;
  color: #dfca85;
}

.record-type-full {
  background: #e3f2ec;
  color: #0d5c46;
}

.record-type-half {
  background: #e8f1fb;
  color: #245887;
}

.record-type-overtime {
  background: #fff0df;
  color: #864700;
}

.record-type-half-overtime {
  background: #edf0ed;
  color: #39443f;
}

.record-type-ebike {
  background: #e8eef7;
  color: #294f78;
}

.record-type-stage12 {
  background: #f4eadf;
  color: #71411f;
}

.tag.temporary-bib {
  border: 1px solid #b56b27;
  background: #fff3e5;
  color: #7b3f12;
}

.result-body {
  padding: 12px;
}

.result-list {
  display: grid;
  gap: 8px;
  max-height: 720px;
  overflow-y: auto;
}

.result-item {
  width: 100%;
  min-height: 86px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.result-item.is-search-highlight {
  border-color: var(--teal);
  background: #f7fcf9;
  animation: result-attention 780ms ease-in-out calc(var(--result-index, 0) * 90ms) 3;
}

@keyframes result-attention {
  0%, 100% {
    border-color: var(--teal);
    background: #f7fcf9;
    box-shadow: 0 0 0 0 rgba(27, 119, 91, 0);
  }
  50% {
    border-color: var(--teal);
    background: #edfaf4;
    box-shadow: 0 0 0 4px rgba(27, 119, 91, 0.16);
  }
}

.result-item:hover,
.result-item[aria-current="true"] {
  border-color: var(--teal);
  background: #f7fcf9;
}

.result-name {
  display: block;
  font-size: 16px;
  font-weight: 950;
}

.result-nickname {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.result-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.result-records {
  margin-top: 7px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.result-record {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.result-side {
  min-width: 54px;
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.result-count {
  min-width: 54px;
}

.result-count strong,
.result-count span {
  display: block;
}

.result-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 25px;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.result-action > span {
  font-size: 13px;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .result-item.is-search-highlight {
    animation: none;
    border-color: var(--teal);
    background: #f7fcf9;
  }
}

.result-count strong {
  color: var(--teal);
  font-size: 18px;
}

.result-count span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.result-empty {
  min-height: 240px;
  padding: 28px 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.result-empty strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.result-empty p {
  margin-top: 6px;
  font-size: 13px;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.records-section {
  min-width: 0;
}

.records-section-head {
  min-height: 48px;
  padding: 4px 2px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.records-section-head h2 {
  font-size: 18px;
  font-weight: 950;
}

.event-stream {
  display: grid;
  gap: 16px;
}

.event-record-panel {
  scroll-margin-top: 16px;
}

.detail-empty {
  min-height: 500px;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-number {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 2px solid var(--teal);
  border-radius: 50%;
  color: var(--teal);
  font-size: 23px;
  font-weight: 950;
}

.detail-empty h2 {
  font-size: 22px;
}

.detail-empty p {
  max-width: 460px;
  margin-top: 8px;
  color: var(--muted);
}

.profile-top {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.profile-photo-column {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.profile-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #cbd3ce;
  border-radius: 6px;
  background: #dfe4df;
  color: #6c7771;
  font-size: 48px;
  font-weight: 950;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-control {
  margin-top: 10px;
}

.photo-coming-soon {
  min-height: 44px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #cbd3ce;
  border-radius: 6px;
  background: #fff;
}

.photo-coming-soon strong {
  font-size: 12px;
}

.photo-coming-soon span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #81500d;
  font-size: 10px;
  font-weight: 900;
}

.photo-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.profile-main {
  min-width: 0;
  padding: 20px 22px;
}

.honor-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 14px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 950;
}

.honor-rank {
  margin-bottom: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid currentColor;
  font-size: 11px;
  font-weight: 950;
  opacity: 0.78;
}

#profilePanel.honor-tristar,
#profilePanel.honor-seven,
#profilePanel.honor-master {
  position: relative;
  overflow: hidden;
}

#profilePanel.honor-tristar .profile-top,
#profilePanel.honor-seven .profile-top,
#profilePanel.honor-master .profile-top {
  position: relative;
  isolation: isolate;
}

#profilePanel.honor-tristar .profile-top::before,
#profilePanel.honor-seven .profile-top::before,
#profilePanel.honor-master .profile-top::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

#profilePanel.honor-tristar .profile-photo-column,
#profilePanel.honor-tristar .profile-main,
#profilePanel.honor-seven .profile-photo-column,
#profilePanel.honor-seven .profile-main,
#profilePanel.honor-master .profile-photo-column,
#profilePanel.honor-master .profile-main {
  background: transparent;
}

#profilePanel.honor-tristar {
  border: 2px solid #8b5639;
  background: #b97852;
  box-shadow: 0 18px 38px rgba(90, 49, 30, 0.22);
}

#profilePanel.honor-tristar .profile-top::before {
  background-color: #c88962;
  background-image: repeating-linear-gradient(122deg, rgba(89, 45, 27, 0.08) 0, rgba(89, 45, 27, 0.08) 1px, transparent 1px, transparent 11px);
}

#profilePanel.honor-tristar .profile-photo-column {
  border-color: #875137;
}

#profilePanel.honor-tristar .profile-photo {
  border-color: #70402c;
  background: #d99c73;
  color: #5e2d1d;
}

#profilePanel.honor-tristar .photo-coming-soon,
#profilePanel.honor-tristar .profile-metrics,
#profilePanel.honor-tristar .profile-metric,
#profilePanel.honor-tristar .finish-total {
  border-color: rgba(91, 46, 28, 0.38);
}

#profilePanel.honor-tristar .photo-coming-soon,
#profilePanel.honor-tristar .profile-metric,
#profilePanel.honor-tristar .record-breakdown-item {
  background: rgba(255, 244, 235, 0.54);
}

#profilePanel.honor-tristar .finish-total strong {
  color: #572817;
}

#profilePanel.honor-tristar .honor-label {
  border-color: #63311f;
  background: #713d29;
  color: #ffe8d7;
}

#profilePanel.honor-tristar .goal-track {
  background: rgba(79, 42, 27, 0.25);
}

#profilePanel.honor-seven {
  border: 2px solid #858885;
  background: #d7d6d1;
  box-shadow: 0 20px 40px rgba(49, 53, 50, 0.2);
}

#profilePanel.honor-seven .profile-top::before {
  background-color: #deddd8;
  background-image: repeating-linear-gradient(104deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.2) 1px, rgba(64, 68, 65, 0.05) 2px, transparent 7px);
}

#profilePanel.honor-seven .profile-photo-column {
  border-color: #9a9c99;
}

#profilePanel.honor-seven .profile-photo {
  border-color: #858885;
  background: #bfc0bd;
  color: #f5f5f2;
}

#profilePanel.honor-seven .photo-coming-soon,
#profilePanel.honor-seven .profile-metrics,
#profilePanel.honor-seven .profile-metric,
#profilePanel.honor-seven .finish-total {
  border-color: rgba(65, 69, 66, 0.35);
}

#profilePanel.honor-seven .photo-coming-soon,
#profilePanel.honor-seven .profile-metric,
#profilePanel.honor-seven .record-breakdown-item {
  background: rgba(255, 255, 253, 0.52);
}

#profilePanel.honor-seven .finish-total strong {
  color: #242724;
}

#profilePanel.honor-seven .honor-label {
  border-color: #5e615e;
  background: #ecebe7;
  color: #292c29;
  box-shadow: 0 3px 0 #92948f;
}

#profilePanel.honor-seven .goal-track {
  background: rgba(55, 59, 56, 0.2);
}

#profilePanel.honor-master {
  border: 2px solid #b9a261;
  border-top-width: 6px;
  background: #111412;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

#profilePanel.honor-master .profile-top::before {
  background-color: #121614;
  background-image: repeating-radial-gradient(ellipse at 20% 15%, rgba(201, 177, 108, 0.1) 0, rgba(201, 177, 108, 0.1) 1px, transparent 2px, transparent 14px);
}

#profilePanel.honor-master .profile-photo-column {
  border-color: #514a35;
}

#profilePanel.honor-master .profile-photo {
  border-color: #a9955e;
  background: #202521;
  color: #dfca85;
}

#profilePanel.honor-master .photo-coming-soon {
  border-color: #504b3a;
  background: #191d1a;
  color: #f4f1e7;
}

#profilePanel.honor-master .profile-main {
  color: #f7f8f7;
}

#profilePanel.honor-master .profile-heading p,
#profilePanel.honor-master .finish-total span,
#profilePanel.honor-master .profile-metric span,
#profilePanel.honor-master .photo-note {
  color: #b9c0bc;
}

#profilePanel.honor-master .finish-total,
#profilePanel.honor-master .profile-metrics,
#profilePanel.honor-master .profile-metric,
#profilePanel.honor-master .goal-section {
  border-color: #3b423e;
}

#profilePanel.honor-master .profile-metric,
#profilePanel.honor-master .record-breakdown-item {
  background: rgba(255, 255, 255, 0.035);
}

#profilePanel.honor-master .finish-total strong {
  color: #dfca85;
}

#profilePanel.honor-master .honor-label {
  border-color: #a8965f;
  background: #080a09;
  color: #dfca85;
  box-shadow: 0 3px 0 #5b5030;
}

#profilePanel.honor-master .goal-track {
  background: #3a413d;
}

.profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-heading h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 950;
}

.profile-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.finish-total {
  min-width: 96px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.finish-total strong,
.finish-total span {
  display: block;
}

.finish-total strong {
  color: var(--teal);
  font-size: 30px;
  line-height: 1.05;
}

.finish-total span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.record-breakdown {
  margin-top: 14px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.record-breakdown-item {
  min-height: 34px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 11px;
}

.record-breakdown-item strong,
.record-breakdown-item span {
  white-space: nowrap;
}

.record-breakdown-item span {
  font-weight: 950;
}

.profile-metrics {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-metric {
  min-width: 0;
  padding: 13px 12px;
  border-right: 1px solid var(--line);
}

.profile-metric:first-child {
  padding-left: 0;
}

.profile-metric:last-child {
  border-right: 0;
}

.profile-metric strong,
.profile-metric span {
  display: block;
}

.profile-metric strong {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-metric span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.goal-section {
  margin-top: 18px;
}

.section-label {
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 950;
}

.goal-list {
  display: grid;
  gap: 9px;
}

.goal-row {
  display: grid;
  grid-template-columns: 82px minmax(90px, 1fr) 112px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.goal-row > span {
  font-weight: 850;
}

.goal-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e7e3;
}

.goal-fill {
  height: 100%;
  border-radius: inherit;
  background: #7a8580;
}

.goal-tristar .goal-fill {
  background: #9a5b3c;
}

.goal-seven .goal-fill {
  background: #777b78;
}

.goal-master .goal-fill {
  background: #c4ad69;
}

#profilePanel.honor-master .goal-fill {
  background: #dfca85;
}

#profilePanel.honor-seven .goal-fill {
  background: #555a56;
}

#profilePanel.honor-tristar .goal-fill {
  background: #713d29;
}

.goal-row strong {
  text-align: right;
  font-size: 11px;
}

.year-section {
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.year-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.year-section-head h3 {
  font-size: 14px;
  font-weight: 950;
}

.year-section-head span {
  color: var(--muted);
  font-size: 11px;
}

.year-tabs {
  margin-top: 10px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.year-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd3ce;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.year-tab span,
.year-tab small {
  display: block;
}

.year-tab small {
  margin-top: 1px;
  color: inherit;
  font-size: 9px;
  font-weight: 800;
  opacity: .72;
}

.year-tab:hover,
.year-tab[aria-selected="true"] {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.history-list {
  display: grid;
}

.history-row {
  width: 100%;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row:hover,
.history-row[aria-current="true"] {
  background: #f6fbf8;
}

.history-year {
  color: var(--teal);
  font-size: 18px;
  font-weight: 950;
}

.history-title {
  min-width: 0;
}

.history-title strong,
.history-title span {
  display: block;
}

.history-title strong {
  font-size: 14px;
}

.history-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-result {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.event-overview {
  padding: 18px;
}

.event-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.event-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.event-title-row h3 {
  font-size: 22px;
  line-height: 1.25;
}

.event-title-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.record-highlight {
  margin: 18px -18px 0;
  padding: 0 18px;
  display: grid;
  grid-template-columns: minmax(150px, .85fr) minmax(240px, 1.4fr) minmax(150px, .85fr);
  align-items: stretch;
  background: #f2f8f5;
  border-top: 1px solid #cddbd4;
  border-bottom: 1px solid #cddbd4;
  box-shadow: inset 0 3px 0 var(--lime);
  text-align: center;
}

.record-highlight-item {
  min-width: 0;
  min-height: 98px;
  padding: 18px 14px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #d5e0da;
}

.record-highlight-item:last-child {
  border-right: 0;
}

.record-highlight-item span,
.record-highlight-item strong {
  display: block;
}

.record-highlight-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.record-highlight-item strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.record-highlight-time strong {
  color: var(--teal);
  font-size: 31px;
}

.record-highlight-percent strong {
  color: var(--blue);
  font-size: 23px;
}

.my-record {
  min-width: 120px;
  text-align: right;
}

.my-record strong,
.my-record span {
  display: block;
}

.my-record strong {
  color: var(--blue);
  font-size: 20px;
}

.my-record span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.event-metrics {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.event-record-notice {
  margin-top: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  border-left: 4px solid #256d57;
  background: #eef6f2;
  color: #25352f;
  font-size: 13px;
  line-height: 1.55;
}

.event-record-notice.temporary {
  border-left-color: #b56b27;
  background: #fff7ed;
}

.event-record-notice strong,
.event-record-notice span {
  display: block;
}

.event-metric {
  min-width: 0;
  padding: 13px 12px;
  border-right: 1px solid var(--line);
}

.event-metric:first-child {
  padding-left: 0;
}

.event-metric:last-child {
  border-right: 0;
}

.event-metric strong,
.event-metric span {
  display: block;
}

.event-metric strong {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-metric span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.weather-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 20px;
  border-top: 1px solid var(--line);
  background: #f3f6f5;
}

.weather-band::before,
.weather-band::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.weather-band::before {
  z-index: -2;
  background-image: url("./weather-skins-atlas-v1.webp");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  opacity: 0.5;
  filter: saturate(1.04) contrast(1.02);
}

.weather-band::after {
  z-index: -1;
  background: linear-gradient(90deg, rgba(246, 248, 247, 0.94) 0%, rgba(246, 248, 247, 0.78) 50%, rgba(246, 248, 247, 0.42) 100%);
}

.weather-band > * {
  position: relative;
  z-index: 1;
}

.weather-band.tone-rain,
.weather-band.tone-storm {
  background: #eaf1f7;
  border-left: 6px solid var(--blue);
}

.weather-band.tone-rain::before {
  background-position: 100% 0;
}

.weather-band.tone-storm::before {
  background-position: 0 100%;
  opacity: 0.68;
}

.weather-band.tone-rain::before {
  opacity: 0.62;
}

.weather-band.tone-rain::after,
.weather-band.tone-storm::after {
  background: linear-gradient(90deg, rgba(236, 243, 248, 0.95) 0%, rgba(236, 243, 248, 0.8) 50%, rgba(236, 243, 248, 0.38) 100%);
}

.weather-band.tone-heat,
.weather-band.tone-heat-rain {
  background: var(--orange-soft);
  border-left: 6px solid var(--orange);
}

.weather-band.tone-heat::before {
  background-position: 0 0;
  opacity: 0.64;
}

.weather-band.tone-heat-rain::before {
  background-position: 100% 0;
  opacity: 0.62;
}

.weather-band.tone-heat::after,
.weather-band.tone-heat-rain::after {
  background: linear-gradient(90deg, rgba(255, 239, 231, 0.96) 0%, rgba(255, 239, 231, 0.8) 50%, rgba(255, 239, 231, 0.38) 100%);
}

.weather-band.tone-humid {
  background: var(--teal-soft);
  border-left: 6px solid var(--teal);
}

.weather-band.tone-humid::before {
  background-position: 100% 100%;
  opacity: 0.58;
}

.weather-band.tone-humid::after {
  background: linear-gradient(90deg, rgba(231, 245, 240, 0.95) 0%, rgba(231, 245, 240, 0.8) 50%, rgba(231, 245, 240, 0.4) 100%);
}

.weather-band.tone-mild {
  background: #f3f5ea;
  border-left: 6px solid #7e9731;
}

.weather-band.tone-mild::before {
  background-position: 100% 100%;
  opacity: 0.3;
}

.weather-band.tone-none::before {
  display: none;
}

.weather-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.weather-story {
  margin-top: 5px;
  max-width: 760px;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 950;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.weather-metrics {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.weather-metric {
  min-width: 0;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(117, 129, 123, 0.25);
  border-radius: 6px;
}

.weather-metric strong,
.weather-metric span {
  display: block;
}

.weather-metric strong {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-metric span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.weather-footnote {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.record-card-tool {
  padding: 22px 24px 24px;
  border-top: 1px solid var(--line);
  background: #f7f8f6;
}

.record-card-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.record-card-tool-copy {
  min-width: 0;
}

.record-card-tool-copy h3 {
  margin-top: 3px;
  font-size: 19px;
  line-height: 1.25;
}

.record-card-tool-copy > p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  word-break: keep-all;
}

.record-card-action-block {
  flex: 0 0 auto;
  text-align: right;
}

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

.record-card-actions .button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}

.record-card-preview-button {
  border: 1px solid #c7cfcb;
  background: #fff;
  color: var(--dark);
}

.record-card-download-button {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.record-card-actions .button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.record-card-storage-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.record-card-preview {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.record-card-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.record-card-preview-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.record-card-preview-head strong {
  font-size: 13px;
}

.record-card-preview-head span {
  color: var(--muted);
  font-size: 10px;
}

.record-card-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.record-card-canvas-scroll {
  max-height: 680px;
  overflow: auto;
  border: 1px solid #c8cfcb;
  background: #dfe3df;
}

#recordCardCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.honor-master .record-card-tool {
  border-top-color: rgba(216, 191, 107, 0.38);
  background: #151915;
  color: #f6f1dc;
}

.honor-master .record-card-tool-copy > p:last-child,
.honor-master .record-card-storage-note,
.honor-master .record-card-preview-head span {
  color: #b9b8aa;
}

.honor-master .record-card-preview,
.honor-master .record-card-canvas-scroll {
  border-color: rgba(216, 191, 107, 0.36);
}

.honor-seven .record-card-tool {
  background: #eef0ed;
}

.honor-tristar .record-card-tool {
  background: #f4e0d1;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(360px, calc(100% - 40px));
  padding: 13px 15px;
  border-radius: 6px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .main-nav {
    display: none;
  }

  .workspace {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .profile-top {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .weather-metrics,
  .event-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-metric:nth-child(2) {
    border-right: 0;
  }

  .event-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .header-inner,
  .app-shell {
    width: min(100% - 20px, 1200px);
  }

  .site-header {
    position: static;
  }

  .header-inner {
    min-height: 60px;
    gap: 10px;
  }

  .brand-copy span {
    display: none;
  }

  .account-actions {
    margin-left: auto;
  }

  .account-actions .button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .app-shell {
    padding-top: 12px;
  }

  .search-head {
    grid-template-columns: 1fr;
    padding: 20px 16px 14px;
    gap: 15px;
  }

  .search-copy h1 {
    font-size: 26px;
  }

  .search-title-row {
    align-items: flex-start;
  }

  .search-title-row.is-admin {
    flex-wrap: wrap;
  }

  .search-title-row.is-admin h1 {
    flex-basis: 100%;
    font-size: 26px;
  }

  .admin-search-stats {
    flex: 0 0 auto;
    min-width: 0;
    padding: 3px 0 3px 9px;
    border-left: 1px solid #d8dfdc;
  }

  .quota-box {
    min-height: 72px;
  }

  .search-area {
    padding: 0 16px 18px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .button.search-submit {
    width: 100%;
  }

  .archive-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-stat:nth-child(2) {
    border-right: 0;
  }

  .archive-stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .grade-browser {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .grade-browser-title {
    min-height: 30px;
    padding: 0;
  }

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

  .result-list {
    max-height: 350px;
  }

  .detail-empty {
    min-height: 320px;
  }

  .profile-top {
    grid-template-columns: 1fr;
  }

  .profile-photo-column {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-photo {
    width: 118px;
  }

  .photo-control {
    margin-top: 0;
  }

  .profile-main {
    padding: 18px 16px;
  }

  .record-card-tool {
    padding: 18px 16px 20px;
  }

  .record-card-tool-head {
    display: block;
  }

  .record-card-action-block {
    margin-top: 14px;
    text-align: left;
  }

  .record-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-card-actions .button {
    width: 100%;
    padding: 0 10px;
  }

  .record-card-preview-head {
    align-items: flex-start;
  }

  .record-card-preview-head > div {
    display: block;
  }

  .record-card-preview-head span {
    display: block;
    margin-top: 3px;
  }

  .record-card-canvas-scroll {
    max-height: 520px;
  }

  .profile-heading h2 {
    font-size: 24px;
  }

  .history-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .history-result {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 70px;
  }

  .event-title-row {
    display: block;
  }

  .my-record {
    margin-top: 12px;
    text-align: left;
  }

  .record-highlight {
    margin: 16px -16px 0;
    padding: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-highlight-item {
    min-height: 86px;
    padding: 14px 10px 12px;
  }

  .record-highlight-time {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid #d5e0da;
  }

  .record-highlight-rank {
    border-right: 1px solid #d5e0da;
  }

  .record-highlight-time strong {
    font-size: 29px;
  }

  .record-highlight-rank strong {
    font-size: 15px;
  }

  .record-highlight-percent strong {
    font-size: 20px;
  }

  .weather-story {
    font-size: 18px;
  }
}

@media (max-width: 460px) {
  .brand-copy strong {
    font-size: 14px;
  }

  .account-actions .dark-ghost {
    display: none;
  }

  .profile-heading {
    display: block;
  }

  .finish-total {
    margin-top: 12px;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
  }

  .goal-row {
    grid-template-columns: 72px minmax(70px, 1fr) 96px;
  }

  .profile-photo-column {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .profile-photo {
    width: 104px;
  }
}
