:root {
  color-scheme: light;
  --crimson: #ad1236;
  --deep: #7d0d2a;
  --ink: #21181c;
  --muted: #62585d;
  --line: #e9e1e4;
  --field-border: #93868b;
  --surface: #fff;
  --canvas: #f8f6f7;
  --tint: #fbecf0;
  --shadow: 0 8px 24px #33132008, 0 1px 2px #33132009;
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 100%;
  font-weight: 500;
  line-height: 1.45;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .57; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
svg { display: block; flex: none; }
a { color: var(--crimson); }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; }
.visually-hidden, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 20;
  left: 12px;
  top: 12px;
  transform: translateY(-200%);
  padding: 8px 11px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--deep);
}
.skip-link:not(:focus) { clip-path: inset(50%); }
.skip-link:focus { transform: none; }
.icon-glyph, [data-icon] { display: inline-flex; flex: none; align-items: center; justify-content: center; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner, .shell, .site-footer { width: min(100% - 64px, 1280px); margin-inline: auto; }
.header-inner {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.brand {
  justify-self: start;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-size: 1.48rem;
  font-weight: 850;
  letter-spacing: -.055em;
}
.brand-mark { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.nav, .main-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; min-width: 0; }
.nav-link, .profile-button {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: .88rem;
  font-weight: 730;
}
.nav-link:hover, .profile-button:hover { color: var(--crimson); background: var(--tint); }
.nav-link[aria-current="page"] { color: var(--crimson); background: var(--tint); }
.profile-button { justify-self: end; }
.profile-button img, .profile-button .avatar { width: 32px; height: 32px; border-radius: 50%; }
.avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  flex: none;
  place-items: center;
  overflow: hidden;
  border: 1px solid #efdae0;
  border-radius: 50%;
  background: var(--tint);
  color: var(--deep);
  font-size: .87rem;
  font-weight: 850;
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.primary, .secondary, .text-button, .icon-button, .button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  font-size: .87rem;
  font-weight: 760;
  line-height: 1.15;
}
.primary, .button.primary { border-color: var(--crimson); background: var(--crimson); color: var(--surface); }
.primary:hover { border-color: var(--deep); background: var(--deep); }
.secondary, .button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.secondary:hover { border-color: #d7bbc4; color: var(--crimson); }
.text-button, .icon-button { border-color: transparent; background: transparent; color: var(--crimson); }
.text-button:hover, .icon-button:hover { background: var(--tint); }
.icon-button { width: 36px; min-height: 36px; padding: 7px; }
:where(.primary, .secondary, .text-button, .icon-button, .button) svg { width: 17px; height: 17px; }

.hero {
  min-height: 240px;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 29px clamp(24px, 4vw, 56px);
  margin: 24px 0 23px;
  overflow: hidden;
  border: 1px solid #a61539;
  border-radius: 19px;
  background: linear-gradient(102deg, #8c1230 0%, var(--crimson) 73%);
  color: var(--surface);
}
.hero-content { position: relative; z-index: 1; min-width: 0; max-width: 660px; }
.hero h1 {
  font-size: clamp(2.62rem, 5vw, 4.55rem);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.071em;
  text-wrap: balance;
}
.hero em { font-style: normal; color: #ffe0e7; }
.hero p {
  max-width: 48ch;
  margin-top: 12px;
  color: #fff3f6;
  font-size: clamp(.93rem, 1.3vw, 1.04rem);
  line-height: 1.45;
}
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.hero .primary { min-height: 42px; border-color: var(--surface); background: var(--surface); color: var(--deep); }
.hero .primary:hover { border-color: #ffdbe4; background: #ffdbe4; }
.hero .secondary { border-color: #ffffff6e; background: transparent; color: var(--surface); }
.hero .secondary:hover { border-color: var(--surface); background: #ffffff18; }
.hero :focus-visible { outline-color: var(--surface); }
.hero-lanes {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: min(58%, 700px);
  overflow: hidden;
  pointer-events: none;
}
.hero-lanes span {
  position: absolute;
  width: 137%;
  height: 70%;
  top: 20%;
  left: 13%;
  border: 1px solid #ffffff58;
  border-left-width: 2px;
  border-radius: 999px;
  transform: rotate(-24deg);
}
.hero-lanes span:nth-child(2) { top: 13%; left: 9%; height: 84%; }
.hero-lanes span:nth-child(3) { top: 6%; left: 5%; height: 98%; }
.hero-lanes span:nth-child(4) { top: -1%; left: 1%; height: 112%; }
.hero-lanes span:nth-child(5) { top: -8%; left: -3%; height: 126%; }
.hero-lanes span:nth-child(6) { top: -15%; left: -7%; height: 140%; }
.hero-lanes span:nth-child(7) { top: -22%; left: -11%; height: 154%; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.tag, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--tint);
  color: var(--deep);
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.2;
}
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 15px; padding: 21px 0; color: var(--muted); font-size: .78rem; }

@media (max-width: 960px) {
  .header-inner, .shell, .site-footer { width: calc(100% - 44px); }
}
@media (max-width: 700px) {
  .header-inner, .shell, .site-footer { width: calc(100% - 30px); }
  .header-inner { min-height: 60px; display: flex; flex-wrap: wrap; gap: 5px 8px; padding: 8px 0; }
  .header-inner .brand { margin-inline-end: auto; }
  .header-inner :is(.nav, .main-nav) { order: 1; flex-basis: 100%; justify-content: flex-start; }
  .header-inner .profile-button { margin-inline-start: auto; }
  .hero { min-height: 210px; border-radius: 13px; margin: 14px 0 15px; padding: 22px 19px; }
  .hero-lanes { width: 58%; opacity: .48; }
  .hero-actions { margin-top: 16px; }
}

@media (forced-colors: active) {
  :is(.nav-link, .profile-button)[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: .2em;
  }
}
@media (max-width: 380px) {
  .brand-mark { width: 32px; height: 32px; }
  .hero h1 { font-size: 2.43rem; }
  .profile-button { padding-inline: 6px; }
}

.quiet, .icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--crimson);
  font-size: .85rem;
  font-weight: 750;
}
.quiet:hover, .icon:hover { background: var(--tint); }
.icon { min-width: 34px; min-height: 34px; padding: 6px; }
:where(.primary, .secondary, .quiet, .icon, .nav-link, .profile-button) svg { width: 18px; height: 18px; }

.hero .hero-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 8px;
  color: #ffdde6;
  font-size: .79rem;
  font-weight: 780;
}
.hero-location svg { width: 15px; height: 15px; }
.hero-lane-marker {
  position: absolute;
  width: 70px;
  height: 15px;
  left: 47%;
  top: 41%;
  border-radius: 3px;
  transform: rotate(-24deg);
  background: #ffffff1f;
  box-shadow: inset 0 0 0 1px #ffffff28;
}

.board-heading, .board-view { display: flex; align-items: center; gap: 7px; }
.board-heading { justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.board-heading h2 { margin: 0 0 2px; font-weight: 850; font-size: clamp(1.24rem, 2.1vw, 1.52rem); letter-spacing: -.044em; }
.board-heading p { color: var(--muted); font-size: .88rem; }
.board-view { justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.board-view button[aria-pressed="true"] { background: var(--tint); border-color: #edccd7; color: var(--deep); }
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  align-items: start;
  gap: 17px;
}
.board-list, .workout-details { min-width: 0; }
.board-list, .workout-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.board-list { padding: clamp(13px, 1.45vw, 19px); }
.empty-workouts { padding: 17px 5px; color: var(--muted); font-size: .9rem; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.filters button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 740;
}
.filters button:hover { border-color: #e7c6d0; color: var(--crimson); }
.filters button[aria-pressed="true"] { border-color: var(--deep); background: var(--deep); color: var(--surface); }
.filters button svg { width: 15px; height: 15px; }
.day-group + .day-group { margin-top: 16px; }
.day-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 690;
}
.day-heading h3, .day-heading strong { color: var(--ink); font-size: .86rem; font-weight: 850; }
.day-heading::after { flex: 1; min-width: 0; height: 1px; content: ""; background: var(--line); }
.workout-list { display: grid; gap: 5px; }
.workout-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 57px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}
.workout-row:hover { border-color: #d9a8b6; background: #fffbfc; }
.workout-row[aria-pressed="true"] { border-color: #c85a75; background: #fcf1f4; box-shadow: inset 3px 0 var(--crimson); }
.workout-time {
  display: grid;
  align-content: center;
  gap: 1px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.07;
}
.workout-time strong { font-size: .93rem; font-weight: 850; }
.workout-time small { color: var(--muted); font-size: .71rem; font-weight: 700; }
.sport-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 35px;
  height: 35px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--deep);
}
.sport-badge svg { width: 19px; height: 19px; }
.sport-badge:is([data-sport="ride"], .ride) { background: #f9f1e3; color: #73551f; }
.sport-badge:is([data-sport="swim"], .swim) { background: #e8f0f7; color: #315b79; }
.sport-badge:is([data-sport="climb"], .climb) { background: #eeece7; color: #64563e; }
.sport-badge:is([data-sport="other"], .other) { background: #f1eafb; color: #6a4d7e; }
.workout-summary { display: grid; gap: 2px; min-width: 0; }
.workout-summary strong { font-size: .93rem; font-weight: 850; line-height: 1.18; letter-spacing: -.017em; overflow-wrap: anywhere; }
.workout-summary small { color: var(--muted); font-size: .8rem; line-height: 1.3; overflow-wrap: anywhere; }
.workout-spots {
  max-width: 102px;
  min-width: 0;
  justify-self: end;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}
.workout-spots[data-status="joined"], .workout-spots[data-status="own"] { color: var(--deep); }

.workout-details { position: sticky; top: 15px; overflow: hidden; }
.details-top {
  display: grid;
  gap: 6px;
  padding: 17px clamp(14px, 2.1vw, 25px) 15px;
  border-bottom: 1px solid #efdae1;
  background: #fcf0f3;
}
.details-top h3 { font-size: clamp(1.52rem, 2.25vw, 2.18rem); font-weight: 850; line-height: 1.04; letter-spacing: -.054em; overflow-wrap: anywhere; }
.details-top p { color: var(--muted); font-size: .84rem; }
.details-top .tag, .details-top .badge { justify-self: start; }
.detail-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--deep);
  font-size: .75rem;
  font-weight: 790;
}
.details-top svg { width: 15px; height: 15px; }
.details-body {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 16px clamp(14px, 2.1vw, 25px) 17px;
}
.details-body > p { color: var(--muted); font-size: .89rem; line-height: 1.42; overflow-wrap: anywhere; }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 13px; }
.detail-fact { min-width: 0; display: flex; align-items: flex-start; gap: 7px; }
.detail-fact > .icon-glyph {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
  background: var(--tint);
  color: var(--deep);
}
.detail-fact svg { width: 16px; height: 16px; }
.detail-fact :is(small, dt, h3) { display: block; margin-bottom: 2px; color: var(--muted); font-size: .73rem; font-weight: 720; line-height: 1.18; }
.detail-fact :is(strong, dd) { display: block; min-width: 0; color: var(--ink); font-size: .85rem; font-weight: 820; line-height: 1.24; overflow-wrap: anywhere; }
.detail-host {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  color: var(--muted);
  font-size: .83rem;
}
.host-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--tint);
  font-size: 1.1rem;
}
.detail-host :is(small, strong) { display: block; line-height: 1.18; }
.detail-host small { margin-bottom: 2px; color: var(--muted); }
.detail-host strong { color: var(--ink); }
.detail-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 6px; }
.detail-actions > :is(.primary, .secondary) { flex: 1 1 auto; min-height: 42px; }
.detail-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding: 8px 9px;
  border: 1px solid #efdae1;
  border-radius: 7px;
  background: #fff9fb;
  color: var(--muted);
  font-size: .81rem;
}
.detail-note > span { min-width: 0; }
.detail-note > svg { width: 16px; height: 16px; color: var(--crimson); }
.detail-note > .quiet { margin-left: auto; padding: 3px 5px; }

.dialog {
  width: min(520px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100% - 28px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 75px #29121e48;
}
.dialog::backdrop { background: #2a112066; }
.dialog-inner { padding: 20px; overflow-wrap: anywhere; }
.dialog-head { display: flex; flex-flow: row-reverse wrap; align-items: start; gap: 8px; }
.dialog h2 {
  flex: 1 1 min(100%, 6em);
  align-self: center;
  font-size: 1.56rem;
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1.16;
  hyphens: auto;
}
.dialog-head .icon { flex: none; order: -1; min-width: 44px; min-height: 44px; }
.dialog p { margin-top: 6px; color: var(--muted); font-size: .89rem; }
.dialog .dialog-close { position: absolute; top: 10px; right: 10px; min-width: 33px; min-height: 33px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 3px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.form-grid :is(.full, .wide) { flex-basis: 100%; }
.form-grid label {
  display: grid;
  flex: 1 1 max(7rem, calc((100% - 10px) / 2));
  align-content: start;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
  font-size: .83rem;
  font-weight: 720;
}
.form-grid :is(input, select, textarea) {
  display: block;
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  min-height: 38px;
  border: 1px solid var(--field-border);
  border-radius: 7px;
  background: var(--surface);
}
.form-grid textarea { min-height: 67px; resize: vertical; }
.form-grid :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
.dialog :is(.primary, .secondary, .quiet) { max-inline-size: 100%; }
.toast {
  position: fixed;
  z-index: 9;
  bottom: 17px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 8px 13px;
  border-radius: 8px;
  background: #271a20;
  color: var(--surface);
  font-size: .88rem;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .board-layout { grid-template-columns: minmax(0, 1.25fr) minmax(292px, 1fr); gap: 12px; }
  .workout-row { grid-template-columns: 47px 29px minmax(0, 1fr) auto; gap: 7px; }
  .workout-row .sport-badge { width: 29px; height: 29px; }
}
@media (max-width: 760px) {
  .form-grid :is(input, select, textarea) { font-size: max(16px, .83rem); }
  .board-heading { gap: 10px; margin-bottom: 9px; }
  .board-layout { grid-template-columns: minmax(0, 1fr); }
  .workout-details { position: static; scroll-margin-top: 10px; }
  .workout-row { grid-template-columns: 48px 30px minmax(0, 1fr) minmax(43px, auto); padding-inline: 8px; }
}
@media (max-width: 380px) {
  .filters { gap: 5px; }
  .filters button { padding-left: 7px; padding-right: 7px; }
  .board-heading p, .board-view .secondary { font-size: .77rem; }
  .board-view .secondary { padding-inline: 7px; }
  .workout-row { grid-template-columns: 41px 27px minmax(0, 1fr) minmax(38px, 52px); gap: 5px; }
  .workout-row .sport-badge { width: 27px; height: 27px; }
  .workout-row .sport-badge svg { width: 16px; height: 16px; }
  .detail-facts { gap: 9px 8px; }
}
