/* Shared visual system for every public and account page. */
:root, .journal-page, .entry-page {
  --ink: #292929;
  --muted: #686868;
  --bg: #fafafa;
  --panel: #fff;
  --line: #e3e3e3;
  --accent: #353535;
  --accent-light: #f1f1f1;
  --radius: 6px;
  --sport-black: #292929;
  --sport-red: #353535;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
:focus-visible { outline: 2px solid #777; outline-offset: 4px; }
a:hover { color: #111; }
h1, h2, h3 { font-family: inherit; }
.brand-name { position: relative; display: inline-block; font-size: 24px; font-weight: 400; letter-spacing: -1.1px; line-height: 1.3; white-space: nowrap; }
.brand-name strong { font-weight: 700; }
.brand-name::after { content: ''; position: absolute; right: 1px; bottom: -4px; height: 2px; width: 22px; background: var(--brand-red); border-radius: 2px; }
.journal-page .brand, .entry-brand, .entry-brand:hover { color: var(--ink); gap: 9px; }
.journal-logo, .entry-logo { width: 26px; height: 32px; border-radius: 0; background: transparent; }
.journal-logo .brand-logo, .entry-logo img { width: 26px; height: 26px; }
.journal-page .brand small, .entry-brand small { display: none; }
.journal-page .sidebar { width: 242px; padding: 38px 16px 24px; color: var(--ink); background: #fff; border-right: 1px solid var(--line); }
.journal-page .sidebar nav { margin-top: 48px; }
.journal-page .sidebar nav a { min-height: 48px; padding: 12px; margin-bottom: 5px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); box-shadow: none; font-weight: 500; font-size: 15px; gap: 12px; }
.journal-page .sidebar nav a:hover, .journal-page .sidebar nav a.active { background: #efefef; color: var(--ink); box-shadow: none; }
.journal-page .sidebar nav a.active { font-weight: 650; }
.journal-page .sidebar nav .feed-nav-link { margin-top: 12px; }
.journal-page .sidebar nav .profile-nav-link { margin-top: 0; }
.journal-page .sidebar-footer { border-color: var(--line); }
.sidebar-caption { color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.journal-page .main-shell { margin-left: 242px; }
.journal-page .topbar { height: 76px; padding-inline: 36px; background: #fff; }
.user-avatar.logged-in-avatar { width: 40px; height: 40px; border: 1px solid var(--line); }
.journal-page main { padding: 44px 36px; max-width: 1400px; }
.journal-page .page-heading { margin-bottom: 36px; }
.journal-page .page-heading h1 { font-family: inherit; font-size: 36px; font-weight: 650; text-transform: none; letter-spacing: -1.3px; line-height: 1.2; }
.journal-page .page-heading p { font-size: 16px; color: var(--muted); }
.journal-page h2 { font-size: 19px; font-weight: 600; letter-spacing: -.4px; }
.journal-page .card { border: 1px solid var(--line); border-radius: 6px; padding: 24px; box-shadow: none; }
.journal-page .shared-workout, .journal-page .post-composer { border-radius: 10px; }
.journal-page .button, .entry-button { background: #353535; color: #fff; border: 1px solid #353535; border-radius: 4px; min-height: 48px; padding: 11px 18px; font-size: 15px; font-weight: 600; box-shadow: none; }
.journal-page .button:hover, .entry-button:hover { background: #202020; border-color: #202020; color: #fff; }
.journal-page .button.secondary { background: #fff; border-color: #d9d9d9; color: var(--ink); }
.journal-page .button.secondary:hover { background: #f1f1f1; border-color: #ccc; }
.journal-page .button.danger { color: #a32424; border-color: #e4caca; background: #fff; }
.journal-page .button.danger:hover { color: #fff; background: #a32424; border-color: #a32424; }
input, select, textarea, .journal-page input, .journal-page select, .journal-page textarea, .training-form-panel input { border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; color: var(--ink); }
.journal-page .field label, .training-form-panel .field label { font-size: 15px; font-weight: 500; }
.journal-page .stats { border-radius: 6px; }
.journal-page .stat { border-radius: 0; }
.journal-page .current .bar { background: #555; }
.journal-page .bar { background: #dedede; }
.journal-page .activity-icon, .journal-page .badge { background: #f2f2f2; color: #666; }
.journal-page .calendar-day.today > span { color: #fff; background: #353535; }
.journal-page .calendar-day small { color: #555; }
.has-workout { background: #f0f0f0; }
.journal-page .notice { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.composer-toggle > span:last-child { color: #666; }
.story-ring, .story-add { border-color: #bbb; }
.story-add { background: #f3f3f3; color: #444; }
.entry-shell { max-width: 1600px; border: 0; }
.entry-header { min-height: 100px; border-color: var(--line); padding: 26px 4%; background: #fff; }
.entry-nav-link { color: var(--ink); border: 0; font-weight: 500; }
.entry-nav-link:hover { color: #111; text-decoration: underline; }
.entry-eyebrow { color: var(--muted); font-size: 10px; letter-spacing: 1.8px; font-weight: 600; }
.entry-eyebrow > span { background: #999; width: 4px; height: 4px; border-radius: 50%; }
.landing-hero { grid-template-columns: 1.1fr 1fr; min-height: 620px; }
.landing-copy { padding: 76px 7% 60px; align-self: center; }
.landing-copy .entry-eyebrow { color: var(--muted); }
.landing-copy h1, .training-visual h2, .training-form-panel h1 { font-family: inherit; font-weight: 650; font-stretch: normal; text-transform: none; letter-spacing: -2px; }
.landing-copy h1 { font-size: clamp(38px, 4.5vw, 66px); line-height: 1.15; }
.landing-copy h1 em { color: inherit; }
.landing-copy > p { color: var(--muted); font-size: 17px; max-width: 440px; }
.entry-secondary-link, .hero-caption { color: var(--muted); }
.entry-secondary-link:hover { color: #111; }
.landing-features { margin: 40px 8%; padding: 24px 0; background: transparent; color: var(--ink); border: 0; border-radius: 0; }
.feature-panel-heading .entry-eyebrow { color: var(--muted); }
.feature-panel-heading h2 { font-size: 25px; font-weight: 600; }
.feature-panel-row, .feature-panel-footer { border-color: var(--line); }
.feature-panel-icon { background: transparent; color: #777; }
.feature-panel-row p, .feature-panel-footer { color: var(--muted); }
.sport-strip { display: none; }
.entry-features { border-top: 1px solid var(--line); padding: 44px 4%; }
.entry-features article { border-color: var(--line); }
.entry-features h2 { font-size: 18px; font-weight: 600; }
.entry-features p { color: var(--muted); font-size: 15px; }
.feature-number { color: #777; }
.entry-footer { color: var(--muted); border-color: var(--line); margin-inline: 4%; }
.training-auth { margin: 0; min-height: calc(100dvh - 176px); grid-template-columns: 1fr 1fr; border-radius: 0; }
.training-visual { padding: clamp(32px, 5vw, 80px); background: #f2f2f2; color: var(--ink); justify-content: center; }
.training-visual::before { display: none; }
.training-visual h2 { margin: 28px 0; padding: 0; font-size: clamp(32px, 4vw, 56px); line-height: 1.2; }
.training-visual h2 span { color: inherit; }
.training-caption { margin-top: 16px; }
.training-caption p { color: var(--muted); font-size: 16px; }
.training-caption strong { font-weight: 400; }
.training-form-panel { background: #fff; padding: 48px clamp(28px, 6vw, 96px); }
.training-form-panel .entry-eyebrow { color: var(--muted); }
.training-form-panel h1 { font-size: 32px; letter-spacing: -1px; line-height: 1.2; }
.training-form-intro, .training-signup-link, .training-privacy { color: var(--muted); font-size: 15px; }
.training-form-panel .entry-button { justify-content: center; }
.training-auth-signup .training-visual { min-height: 0; }
.training-privacy { border: 0; padding: 0; font-size: 13px; }
.entry-back { margin-bottom: 32px; }
.information-page { margin-block: 40px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.information-page h1, .information-page h2 { color: var(--ink); }
.information-page p, .signup-policy-note { color: var(--muted); }
.information-page a, .signup-policy-note a { color: var(--ink); }
.entry-page .social-profile .social-section:not(.card) > h2 { color: var(--ink); }
@media (max-width: 1100px) {
  .entry-features-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .training-form-panel { padding-inline: 32px; }
}
@media (max-width: 850px) {
  .journal-page .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .journal-page .main-shell { margin-left: 0; }
  .journal-page .topbar { padding-inline: 24px; height: 70px; }
  .journal-page main { padding: 30px 24px; }
  .journal-page .page-heading h1 { font-size: 30px; }
  .journal-page .mobile-navigation { box-shadow: none; }
  .journal-page .mobile-navigation a[aria-current="page"] { background: #eee; color: #222; }
  .journal-page .mobile-navigation .mobile-feed { color: #555; }
  .landing-hero { grid-template-columns: 1fr 1fr; }
  .landing-copy { padding: 48px 7%; }
  .landing-copy h1 { font-size: 40px; }
}
@media (max-width: 600px) {
  .entry-header { min-height: 82px; padding: 20px; }
  .brand-name { font-size: 22px; }
  .entry-header-actions { gap: 12px; }
  .entry-nav-link { font-size: 14px; }
  .landing-hero { display: block; min-height: 0; }
  .landing-copy { padding: 48px 22px 24px; }
  .landing-copy h1 { font-size: 42px; }
  .landing-features { margin: 16px 22px 32px; padding: 0; }
  .entry-features-four { grid-template-columns: 1fr; }
  .entry-features article, .entry-features article:first-child, .entry-features-four article:nth-child(3) { border-bottom: 1px solid var(--line); padding: 24px 0; }
  .entry-features article:last-child { border-bottom: 0; }
  .training-auth { display: flex; flex-direction: column; margin: 0; }
  .training-visual, .training-auth-signup .training-visual { padding: 30px 24px; min-height: 0; }
  .training-visual h2 { font-size: 32px; max-width: none; margin: 18px 0; letter-spacing: -1px; }
  .training-caption { margin: 0; }
  .training-caption p { font-size: 15px; }
  .training-form-panel { padding: 32px 24px 40px; }
  .training-form-panel h1 { font-size: 30px; }
  .training-form-panel .entry-eyebrow { font-size: 10px; }
  .journal-page main { padding: 28px 18px; }
  .journal-page .topbar { padding-inline: 18px; }
  .journal-page .card { padding: 18px; }
  .journal-page .stat { border-radius: 0; }
  .information-page { margin: 20px 16px; width: auto; padding: 24px; }
}

.entry-page :focus-visible { outline: 2px solid #777; outline-offset: 4px; }
.journal-page .stat { border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.journal-page .stat:last-child { border-right: 0; }
.journal-page .photo-card { padding: 0; }
@media (max-width: 1100px) {
  .journal-page .stat:nth-child(2) { border-right: 0; }
  .journal-page .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* Editing pages use the open, two-column layout of the reference. */
.journal-page .form-card { max-width: 960px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.journal-page .form-card .form-grid { gap: 24px; }
.journal-page .form-card .field label { color: var(--muted); }
.journal-page .form-card .form-actions { padding-top: 24px; margin-top: 8px; }
.journal-page .delete-panel { max-width: 960px; }
@media (max-width: 600px) {
  .journal-page .form-card .form-grid { gap: 20px; }
}

/* Keep the entry flow to one message and one primary action. */
.entry-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.entry-main { width: 100%; flex: 1; display: flex; flex-direction: column; }
.entry-page .training-auth { display: block; width: min(440px, 100%); min-height: 0; margin: 56px auto; padding: 0 24px; }
.entry-page .training-form-panel { padding: 0; background: transparent; }
.entry-page .training-form-panel h1 { font-size: 30px; margin: 0; }
.entry-page .training-form-panel .form-grid { margin-top: 24px; }
.entry-page .training-form-panel .entry-button { margin-top: 0; }
.entry-footer { justify-content: flex-end; margin-top: auto; }
.journal-page .page-footer { justify-content: flex-end; }
.journal-page .card:not(.stat):not(.shared-workout):not(.post-composer):not(.photo-card):not(.person-card):not(.profile-heading):not(.photo-comparison figure) { border: 0; border-radius: 0; background: transparent; padding: 0; }
.journal-page .recent { margin-top: 36px; padding-top: 24px !important; border-top: 1px solid var(--line) !important; }
.journal-page .section-heading { margin-bottom: 20px; }
.journal-page .page-heading { margin-bottom: 28px; }
.journal-page .stat > strong { font-size: 30px; }
.journal-page .activity-icon { width: 30px; height: 30px; background: transparent; font-size: 19px; }
.journal-page .badge { background: transparent; padding: 0; }
.journal-page .shared-workout { padding: 18px 20px; }
.journal-page .connection-list { padding-block: 16px !important; border-top: 1px solid var(--line) !important; }
@media (max-width: 600px) {
  .entry-page .training-auth { margin-block: 36px; }
  .journal-page .shared-workout { padding: 16px; }
}
.entry-main > * { min-width: 0; }
.entry-page .social-profile { width: 100%; }

/* Open sections share the available width instead of nesting panels. */
.journal-page main { max-width: none; }
.journal-page .form-card, .journal-page .delete-panel, .journal-page .feed-list, .journal-page .story-form { width: 100%; max-width: none; }
.journal-page .measurement-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
.journal-page .profile-heading { padding: 0; border: 0; border-radius: 0; background: transparent; }
.journal-page .stats { border: 0; border-radius: 0; background: transparent; }
.journal-page .stat { background: transparent; }
.journal-page .stat:first-child { padding-left: 0; }
@media (max-width: 850px) {
  .journal-page .sidebar { display: none; }
  .journal-page .topbar { height: 56px; padding-inline: 16px; }
  .journal-page .logged-in-profile { gap: 8px; }
  .journal-page .user-avatar.logged-in-avatar { width: 32px; height: 32px; font-size: 15px; }
  .logged-in-profile strong, .logged-in-profile small { max-width: calc(100vw - 144px); }
  .logged-in-profile strong { font-size: 13px; }
  .logged-in-profile small { font-size: 11px; margin: 0; }
  .profile-action-label { display: none; }
  .journal-page .topbar .text-button { min-height: 44px; padding-inline: 8px; }
  .journal-page main { padding: 20px 16px; }
  .journal-page .page-heading { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
  .journal-page .page-heading h1 { font-size: 28px; margin-bottom: 0; letter-spacing: -1px; }
  .journal-page .page-heading p { font-size: 14px; line-height: 1.4; margin-top: 6px; }
  .journal-page .heading-actions { width: auto; margin-left: auto; }
  .journal-page .page-heading > .button { align-self: auto; margin-left: auto; }
  .journal-page .page-heading .button { min-height: 44px; padding: 9px 12px; font-size: 14px; }
  .journal-page .back-link { margin-bottom: 14px; }
  .journal-page .form-grid { margin-top: 16px; }
  .journal-page .mobile-navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .journal-page .mobile-navigation > a, .mobile-more > summary { min-height: 48px; }
  .mobile-more > summary.current-section { background: #eee; color: #222; }
  .journal-page .mobile-more-panel { max-height: calc(100dvh - 100px); overflow-y: auto; border-radius: 6px; box-shadow: 0 4px 16px #0001; }
  .journal-page .main-shell { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .journal-page .back-to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .journal-page .stat { padding: 16px; }
  .journal-page .stat:nth-child(odd) { padding-left: 0; }
}

.frequency-section { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.frequency-chart { height: 200px; gap: 12px; }
.frequency-chart .chart-column { min-width: 0; }
.frequency-chart .bar[style="height:0%"] { min-height: 0; }
@media (max-width: 600px) {
  .frequency-chart { height: 170px; gap: 6px; padding-inline: 0; }
  .frequency-chart .chart-column, .frequency-chart .chart-value { font-size: 11px; }
  .frequency-section .section-heading { gap: 8px; }
  .frequency-section .section-heading h2 { font-size: 18px; }
  .frequency-section .badge { font-size: 11px; }
}

/* Profile identity shares the top row instead of stacking empty columns. */
.social-profile .profile-heading { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 0; border: 0; background: transparent; }
.social-profile .user-avatar.profile-avatar { width: 64px; height: 64px; font-size: 26px; }
.profile-identity { min-width: 0; }
.social-profile .profile-heading h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; letter-spacing: -.7px; }
.social-profile .profile-heading p { margin: 0; }
.profile-wide { grid-column: 1 / -1; }
.social-profile .profile-bio { max-width: none; line-height: 1.5; }
.social-profile .profile-social-links { margin-top: 0; gap: 8px 16px; }
.social-profile .profile-counters { margin: 16px 0 0; padding: 10px 0; color: var(--ink); }
.social-profile .profile-counters a, .journal-page .social-profile .profile-counters a { gap: 2px; padding: 4px; min-height: 44px; }
.social-profile .profile-counters strong { font-size: 22px; }
.social-profile .story-section { margin: 12px 0 0; }
.social-profile .story-strip { padding-bottom: 0; }
.social-profile .social-section { margin-top: 20px; }
.social-profile .follow-actions { margin: 0; }

/* The square thumbnail fills the card; the enlarged viewer keeps the full photo. */
.journal-page .shared-workout, .entry-page .social-profile .shared-workout { --publication-padding: 20px; padding: 16px var(--publication-padding); overflow: hidden; }
.shared-workout .shared-body { margin-left: 0; }
.shared-workout .publication-image-link { width: calc(100% + 2 * var(--publication-padding)); margin: 12px calc(-1 * var(--publication-padding)); aspect-ratio: 1; border-radius: 0; }
.publication-image-link > .publication-image { width: 100%; height: 100%; aspect-ratio: 1; max-height: none; object-fit: cover; }
.publication-photo-tools > .publication-preview { width: 100%; max-width: none; max-height: none; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
@media (max-width: 600px) {
  .social-profile .profile-heading { grid-template-columns: 56px minmax(0, 1fr); gap: 8px 12px; }
  .social-profile .user-avatar.profile-avatar { width: 56px; height: 56px; font-size: 24px; }
  .social-profile .profile-heading h1 { font-size: 22px; }
  .profile-actions { grid-column: 1 / -1; grid-row: 3; }
  .profile-actions .button { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .social-profile .profile-counters { margin-top: 12px; padding: 8px 0; }
  .social-profile .profile-counters a > span { font-size: 12px; }
  .journal-page .shared-workout, .entry-page .social-profile .shared-workout { --publication-padding: 16px; }
}
