/* Signed-in My RUNWIV product chrome — desktop sidebar + mobile bottom nav */

:root {
  --os-bg: #0c0d0e;
  --os-panel: rgba(24, 25, 27, 0.88);
  --os-line: rgba(59, 73, 75, 0.55);
  --os-text: #e5e2e3;
  --os-muted: #8b9798;
  --os-cyan: #81ecff;
  --os-cyan-hot: #00f0ff;
  --os-sidebar: 240px;
  --os-top: 56px;
  --os-bottom: 64px;
}

body.rw-app-shell {
  background: var(--os-bg);
  color: var(--os-text);
}

body.rw-app-shell .rw-navbar,
body.rw-app-shell .rw-account-shell,
body.rw-app-shell #rw-corner-brand,
body.rw-app-shell > footer {
  display: none !important;
}

/* Legacy pages pad for the marketing navbar (Tailwind pt-28 / pt-[72px]); the shell
   hides that navbar, so the padding became a dead band. Route Studio's sticky
   sub-bar reads --rw-nav-h for its offset: the mobile top bar on small screens,
   nothing on desktop where the sidebar takes over. */
body.rw-app-shell {
  --rw-nav-h: var(--os-top);
  --os-content-max: 1120px;
}

body.rw-app-shell main#main-content,
body.rw-app-shell main.club-page-main,
body.rw-app-shell.rw-has-account-shell #main-content.club-page-main {
  padding-top: 1.25rem;
}

/* The legacy nav spacer reserves room for the hidden marketing navbar. */
body.rw-app-shell .rw-nav-spacer {
  display: none;
}

body.rw-app-shell main#main-content.max-w-3xl {
  --os-content-max: 48rem;
}

body.rw-app-shell .rsx-topbar {
  top: var(--rw-nav-h);
}

.os-skip {
  position: absolute;
  left: -999px;
}

.os-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  box-sizing: border-box;
  width: var(--os-sidebar);
  z-index: 60;
  display: none;
  flex-direction: column;
  padding: 1.25rem 0.9rem 1.1rem;
  background: linear-gradient(180deg, rgba(16, 17, 19, 0.97), rgba(12, 13, 14, 0.96));
  border-right: 1px solid var(--os-line);
  backdrop-filter: blur(22px);
}

.os-brand {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem 1.15rem;
  text-decoration: none;
  color: var(--os-text);
}

.os-brand__my {
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--os-cyan);
}

.os-brand__name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.04em;
  font-size: 1.35rem;
}

.os-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.os-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  color: var(--os-muted);
  text-decoration: none;
  font-family: Inter, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.os-nav__link:hover,
.os-nav__link:focus-visible {
  color: var(--os-text);
  background: rgba(129, 236, 255, 0.08);
  outline: none;
}

.os-nav__link[aria-current="page"] {
  color: #0c0d0e;
  background: linear-gradient(135deg, #81ecff, #67e8f9);
}

.os-nav__icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.os-nav__badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #fe5f00;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.os-sidebar__foot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.4rem 0;
  border-top: 1px solid var(--os-line);
}

.os-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
  min-width: 0;
}

.os-user__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #1c1b1c;
  border: 1px solid var(--os-line);
}

.os-user__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.os-user__name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-user__email {
  font-size: 0.72rem;
  color: var(--os-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--os-top);
  padding: 0.5rem 1rem;
  background: rgba(12, 13, 14, 0.88);
  border-bottom: 1px solid var(--os-line);
  backdrop-filter: blur(18px);
}

.os-topbar__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.os-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--os-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--os-text);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.os-btn:hover,
.os-btn:focus-visible {
  border-color: rgba(129, 236, 255, 0.55);
  outline: none;
}

.os-btn--primary {
  background: linear-gradient(135deg, #81ecff, #67e8f9);
  color: #0c0d0e;
  border-color: transparent;
}

.os-btn--ghost {
  background: transparent;
}

.os-btn--danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.os-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  min-height: var(--os-bottom);
  padding: 0.2rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
  background: rgba(13, 14, 16, 0.94);
  border-top: 1px solid var(--os-line);
  backdrop-filter: blur(20px);
}

.os-bottom__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  color: var(--os-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.os-bottom__link[aria-current="page"],
.os-bottom__link:hover {
  color: var(--os-cyan);
}

/* width:auto + border-box on every page main: `width:100%` (or Tailwind w-full)
   plus side padding is wider than the phone — mobile Safari/Chrome then zoom
   the layout viewport out (innerWidth 425 on a 390px phone). */
.os-main,
body.rw-app-shell main#main-content,
body.rw-app-shell main.club-page-main {
  box-sizing: border-box;
  width: auto;
}

.os-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.1rem calc(var(--os-bottom) + 1.5rem);
}

body.rw-app-shell--compact .os-bottom {
  display: none;
}

body.rw-app-shell--compact .os-main,
body.rw-app-shell--compact main.club-page-main {
  padding-bottom: 2rem;
}

.os-gate {
  max-width: 420px;
  margin: 4rem auto;
  padding: 1.75rem;
  border-radius: 22px;
  border: 1px solid var(--os-line);
  background: var(--os-panel);
  text-align: center;
}

.os-gate h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.os-gate p {
  color: var(--os-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.os-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.os-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--os-cyan);
  margin: 0 0 0.35rem;
}

.os-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}

.os-lede {
  color: var(--os-muted);
  margin: 0.4rem 0 0;
  max-width: 42rem;
  line-height: 1.55;
}

.os-grid {
  display: grid;
  /* minmax(0, 1fr): a plain 1fr track can't shrink below its content, so one long
     word in a card pushed the whole grid past the phone's right edge. */
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}

.os-card {
  min-width: 0;
  grid-column: span 12;
  border-radius: 18px;
  border: 1px solid var(--os-line);
  background: var(--os-panel);
  backdrop-filter: blur(18px);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.os-card--4 { grid-column: span 12; }
.os-card--6 { grid-column: span 12; }
.os-card--8 { grid-column: span 12; }

.os-card__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--os-muted);
  margin: 0 0 0.45rem;
}

.os-card__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.os-card__meta {
  color: var(--os-muted);
  font-size: 0.88rem;
  margin: 0;
}

.os-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.os-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 52px;
  padding: 0.55rem 0.15rem;
  border-bottom: 1px solid rgba(59, 73, 75, 0.28);
}

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

.os-row > div {
  min-width: 0;
}

.os-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-empty {
  text-align: center;
  padding: 1.6rem 1rem;
}

.os-empty strong {
  display: block;
  margin-bottom: 0.35rem;
}

.os-empty p {
  color: var(--os-muted);
  margin: 0 0 0.9rem;
}

.os-skel__hero,
.os-skel__grid > div,
.os-skel-line {
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: os-pulse 1.4s ease-in-out infinite;
}

.os-skel__hero {
  height: 120px;
  margin-bottom: 1rem;
}

.os-skel__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.os-skel__grid > div {
  height: 96px;
}

@keyframes os-pulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.os-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding-bottom: 0.15rem;
}

.os-tabs a,
.os-tabs button {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--os-muted);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
}

.os-tabs a[aria-current="page"],
.os-tabs button[aria-selected="true"] {
  color: #0c0d0e;
  background: var(--os-cyan);
}

.os-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.os-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--os-muted);
}

.os-field input,
.os-field textarea,
.os-field select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--os-line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--os-text);
  padding: 0.55rem 0.8rem;
  font: inherit;
}

.os-field textarea {
  min-height: 88px;
  resize: vertical;
}

.os-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
}

.os-chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  min-height: 60vh;
}

.os-chat__thread {
  display: flex;
  flex-direction: column;
  min-height: 50vh;
}

.os-bubbles {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.4rem 0 0.8rem;
}

.os-bubble {
  max-width: 78%;
  padding: 0.55rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.45;
}

.os-bubble--me {
  align-self: flex-end;
  background: rgba(129, 236, 255, 0.16);
}

.os-compose {
  display: flex;
  gap: 0.5rem;
}

.os-compose input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--os-line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--os-text);
  padding: 0.5rem 0.8rem;
}

.os-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.os-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--os-muted);
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--os-line);
}

.os-table td {
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid rgba(59, 73, 75, 0.28);
  vertical-align: middle;
}

.os-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(129, 236, 255, 0.12);
  color: var(--os-cyan);
}

body.rw-app-shell .profile-page-shortcuts,
body.rw-app-shell .ap-hero-band__links {
  display: none;
}

body.rw-app-shell.rw-app-shell--compact main.club-page-main {
  padding-top: calc(var(--os-top) + 8px);
}

@media (min-width: 900px) {
  body.rw-app-shell { --rw-nav-h: 0px; }
  .os-sidebar { display: flex; }
  .os-bottom { display: none; }
  .os-topbar { display: none; }
  /* width:auto (not 100%) — `width: 100%` plus the sidebar margin overflowed the
     viewport by the sidebar's width on every page. The margin centres the content
     column in the space left of the sidebar; legacy mains (Tailwind mx-auto /
     w-full, Route Studio's own shell) are covered by the same rule. */
  .os-main,
  body.rw-app-shell main#main-content,
  body.rw-app-shell main.club-page-main {
    width: auto;
    max-width: var(--os-content-max);
    margin-left: max(
      var(--os-sidebar),
      calc(var(--os-sidebar) + (100% - var(--os-sidebar) - var(--os-content-max)) / 2)
    );
    margin-right: 0;
    padding: 1.75rem 1.75rem 2.5rem;
  }
  body.rw-app-shell main.rsx-shell {
    --os-content-max: 1800px;
    padding: 1rem 1.25rem 2rem;
  }
  body.rw-app-shell .rsx-topbar { margin-left: var(--os-sidebar); }
  body.rw-app-shell--compact .os-sidebar { display: none; }
  body.rw-app-shell--compact .os-topbar { display: flex; }
  body.rw-app-shell--compact .os-main,
  body.rw-app-shell--compact main#main-content,
  body.rw-app-shell--compact main.club-page-main {
    margin-left: auto;
    margin-right: auto;
  }
  body.rw-app-shell--compact .rsx-topbar { margin-left: 0; }
  .os-card--4 { grid-column: span 4; }
  .os-card--6 { grid-column: span 6; }
  .os-card--8 { grid-column: span 8; }
  .os-skel__grid { grid-template-columns: repeat(3, 1fr); }
  .os-chat { grid-template-columns: 280px minmax(0, 1fr); }
}
