:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #162342;
  background: #f2f5fb;
  font-synthesis: none;
  line-height: 1.55;
  --navy: #101d40;
  --blue: #204fab;
  --muted: #52617a;
  --border: #dce4f1;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.18; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); letter-spacing: -.055em; margin-bottom: .75rem; }
h2 { font-size: 1.2rem; letter-spacing: -.025em; margin-bottom: .9rem; }
h3 { font-size: 1.05rem; margin-bottom: .45rem; }
h4 { font-size: 1rem; margin-bottom: .25rem; }
a { color: var(--blue); }
button, input, textarea, select { font: inherit; }
:is(button, a, input, textarea, select, summary):focus-visible { outline: 3px solid #3071e9; outline-offset: 3px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem max(1rem, calc((100vw - 980px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--navy); text-decoration: none; line-height: 1.25; }
.brand img { display: block; border-radius: .7rem; }
.brand small { display: block; color: var(--muted); font-size: .75rem; }
.topbar-link { font-size: .88rem; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.shell { width: min(980px, 100% - 2rem); margin: 1.35rem auto 3.5rem; }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.4rem, 5vw, 3rem);
  border-radius: 1.15rem;
  margin-bottom: 1rem;
  color: #fff;
  background: linear-gradient(125deg, #101d40 20%, #1a3c85 100%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(132deg, transparent 0 42px, #a4c5ff 42px 43px);
  opacity: .12;
  mask-image: linear-gradient(to left, #000, transparent 78%);
}
.hero p { max-width: 35rem; color: #e1ebff; margin-block: 0; }
.panel { padding: clamp(1.1rem, 3vw, 1.55rem); background: #fff; border: 1px solid var(--border); border-radius: .95rem; }
.section-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; }
.section-top h2 { margin: 0; }
.state { border-radius: 999px; padding: .22rem .62rem; background: #eaf0fb; color: #244a83; font-size: .78rem; font-weight: 700; }
.state[data-active="true"] { color: #146344; background: #e6f5ee; }
.certificate-state { margin: .65rem 0 0; font-size: .88rem; font-weight: 650; color: #465a76; }
.certificate-state[data-linked="true"] { color: #146344; }
.muted { color: var(--muted); font-size: .94rem; }
.section-top + .muted { margin-top: .6rem; }
.actions, .inline-form { display: flex; flex-wrap: wrap; gap: .6rem; }
.actions:not(:empty) { margin-top: .65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; padding: .5rem .85rem; border: 1px solid transparent; border-radius: .65rem; font-weight: 650; text-decoration: none; cursor: pointer; }
.button:disabled { cursor: wait; opacity: .7; }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:not(:disabled):hover { background: #163e92; }
.button.secondary { border-color: #c9d5e8; color: #244779; background: #f8faff; }
.button.secondary:not(:disabled):hover { background: #eaf0fb; }
.button.compact { min-height: 2.15rem; padding: .3rem .7rem; font-size: .88rem; }
.feedback { margin: .75rem 0 0; padding: .65rem .75rem; border-radius: .55rem; border-left: 3px solid #4680d7; color: #254772; background: #edf3fd; }
.feedback[data-error="true"] { border-color: #b93246; color: #88293a; background: #fff0f2; }

.guide { margin-top: 1.1rem; padding-top: .85rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.guide summary { padding-block: .15rem; font-weight: 650; color: #2c476e; cursor: pointer; }
.guide p { margin: .6rem 0 0; }
.guide form { margin-top: .65rem; }
.feed, .staff-content, .workspace-grid, .metrics, .news-form { display: grid; gap: .85rem; }
.feed { margin-top: 1.4rem; }
.feed-heading { margin-bottom: .15rem; }
.activity-list { padding: 0; margin: 0; list-style: none; }
.activity-list li + li { border-top: 1px solid var(--border); }
.activity-item { padding-block: .85rem; }
.activity-item:last-child { padding-bottom: .15rem; }
.activity-item time { display: block; margin-top: .35rem; color: var(--muted); font-size: .8rem; }
.activity-item p { margin: .35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-item h3, .activity-item h4 { overflow-wrap: anywhere; text-wrap: wrap; }
.empty-item { padding: .3rem 0 0; }
.profile-header { align-items: end; }
.profile-picker { width: min(100%, 16rem); }
.profile-name { margin-top: 1rem; font-size: 1.16rem; overflow-wrap: anywhere; }
.profile-status { margin: .55rem 0 .75rem; }
.profile-facts { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin: .85rem 0 1.15rem; }
.profile-facts div { min-width: 0; border: 1px solid var(--border); border-radius: .7rem; padding: .65rem .8rem; background: #f7f9fd; }
.profile-facts dt { font-size: .82rem; color: var(--muted); }
.profile-facts dd { margin: .14rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.race-link { display: inline-block; margin-top: .35rem; font-size: .86rem; font-weight: 650; text-underline-offset: 2px; }
.field, .invite-form, .invite-result { display: grid; gap: .4rem; }
.invite-result { margin-top: .8rem; }
.news-form { margin-top: 1rem; }
.news-form .muted { margin: 0; }
.news-form button, .invite-form button { justify-self: start; }
label { width: fit-content; font-size: .9rem; font-weight: 650; }
input, textarea, select { width: 100%; padding: .62rem .72rem; border: 1px solid #c4d0e5; border-radius: .55rem; color: #192642; background: #fff; }
.inline-form input { flex: 1 1 12rem; min-width: 0; }
textarea { resize: vertical; }
.metric { display: grid; gap: .25rem; }
.metric span { color: var(--muted); font-size: .87rem; }
.metric strong { font-size: 1.15rem; }
@media (min-width: 620px) {
  .workspace-grid, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 820px) {
  .shell { margin-top: 2rem; }
  .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .feed-heading, #feed-status, .profile-panel { grid-column: 1 / -1; }
}
