:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17201d;
  background: #f7f7f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --paper: #f7f7f2;
  --card: #fff;
  --ink: #17201d;
  --muted: #626c66;
  --line: #e3e7df;
  --forest: #254e46;
  --forest-deep: #1e403a;
  --citron: #dce983;
  --danger: #9a352f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--paper); }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .62; cursor: wait; }
a { color: var(--forest); }
:focus-visible { outline: 3px solid #718a34; outline-offset: 3px; }
.page-shell {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
.site-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size:1.0625rem; font-weight: 760; letter-spacing: -.035em; }
.brand img { display: block; width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.language-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #eeefe9; }
.language-switch button { min-width: 44px; min-height: 44px; padding: 5px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size:0.75rem; font-weight: 750; }
.language-switch button.is-active { background: var(--card); color: var(--forest); box-shadow: 0 1px 3px #17201d12; }
.icon-button { display: grid; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; place-items: center; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--forest); }
.icon-button:hover { background: #e9eee9; }
.icon-button svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.quiet-button, .back-button, .outline-button, .primary-button, .danger-button {
  min-height: 46px; padding: 11px 17px; border-radius: 11px; font-size:0.875rem; font-weight: 680; line-height: 1.25;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.quiet-button { border: 1px solid transparent; background: transparent; color: var(--forest); }
.quiet-button:hover, .back-button:hover { background: #e9eee9; }
.primary-button { border: 1px solid var(--forest); background: var(--forest); color: #fff; box-shadow: 0 3px 8px #254e4618; }
.primary-button:hover { background: var(--forest-deep); border-color: var(--forest-deep); }
.outline-button { border: 1px solid #c7d2c9; background: #fff; color: var(--forest); }
.outline-button:hover { border-color: var(--forest); background: #f3f7f3; }
.text-button { min-height: 44px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--forest); font-size:0.875rem; font-weight: 670; text-align: left; }
.text-button:hover { background: #eff3ed; }
.status { margin: 14px 0 0; color: var(--muted); font-size:0.8125rem; line-height: 1.5; }
.status:empty { display: none; }
.error { margin: 14px 0 0; padding: 12px 14px; border: 1px solid #edc9c4; border-radius: 10px; background: #fff5f2; color: #7f2a25; font-size:0.875rem; line-height: 1.5; }
main { flex: 1; }
.entry-view { min-height: min(690px, calc(100vh - 150px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); align-items: center; gap: clamp(42px, 8vw, 92px); padding: 54px 0 66px; }
.entry-copy { max-width: 490px; padding-bottom: 18px; }
.eyebrow { margin: 0 0 15px; color: #637b44; font-size:0.6875rem; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 15ch; margin-bottom: 17px; color: var(--ink); font-size: clamp(34px, 5vw, 48px); font-weight: 730; letter-spacing: -.055em; line-height: 1.06; }
.intro-text { max-width: 49ch; margin-bottom: 22px; color: var(--muted); font-size:1rem; line-height: 1.65; }
.auth-panel { padding: 29px; border: 1px solid #e5e7df; border-radius: 20px; background: var(--card); box-shadow: 0 16px 42px #1d302608, 0 2px 7px #1d302606; }
.auth-panel h2 { margin-bottom: 8px; font-size:1.3125rem; letter-spacing: -.03em; }
.panel-copy { margin-bottom: 21px; color: var(--muted); font-size:0.875rem; line-height: 1.55; }
.form-stack { display: flex; flex-direction: column; gap: 9px; margin: 0; }
.form-stack label { margin-top: 5px; color: #36423b; font-size:0.8125rem; font-weight: 650; }
.form-stack input { width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid #d4dbd3; border-radius: 10px; background: #fff; color: var(--ink); font-size:1rem; }
.form-stack input:focus { border-color: #769188; outline: 3px solid #254e461c; }
.form-stack .primary-button { width: 100%; margin-top: 6px; }
.field-help { margin: 1px 0 4px; color: var(--muted); font-size:0.75rem; line-height: 1.5; }
.code-email-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.code-email-row span { min-width: 0; color: #3f4c44; font-size:0.8125rem; overflow-wrap: anywhere; }
.code-email-row .text-button { flex: 0 0 auto; }
.alternate-login { margin-top: 21px; padding-top: 17px; border-top: 1px solid #ebeee9; }
.alternate-login > p { margin: 0 0 1px; color: var(--muted); font-size:0.8125rem; }
.alternate-login > .text-button { padding-left: 0; }
.password-form { margin-top: 11px; }
.password-form .field-help { margin-top: 6px; }
.code-form { padding-top: 8px; }
.account-view { max-width: 760px; margin: 0 auto; padding: 44px 0 70px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 7px; }
.section-heading .eyebrow { margin-bottom: 11px; }
.section-heading h1, .settings-view h1 { margin: 0; font-size: clamp(31px, 5vw, 42px); }
.verified-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; margin-bottom: 4px; padding: 7px 10px; border: 1px solid #dce8d8; border-radius: 999px; background: #eff5eb; color: #3b674b; font-size:0.75rem; font-weight: 680; }
.identity-line { margin: 11px 0 0; color: #65716a; font-size:0.8125rem; overflow-wrap: anywhere; }
.account-view > #chooserView > .intro-text { margin: 12px 0 20px; font-size:0.9375rem; }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 28px 0 11px; }
.list-heading h2 { margin: 0; font-size:1.0625rem; letter-spacing: -.02em; }
.list-heading-actions { display: inline-flex; align-items: center; gap: 7px; }
.count-label { color: #768078; font-size:0.75rem; }
.empty-state { margin: 33px 0 0; padding: clamp(22px, 4.5vw, 36px); border: 1px solid #e2e7df; border-radius: 18px; background: var(--card); box-shadow: 0 10px 26px #1d302607; }
.empty-mark { display: grid; width: 42px; height: 42px; margin-bottom: 17px; place-items: center; border-radius: 13px; background: #edf2df; color: var(--forest); font-size:1.6875rem; font-weight: 450; }
.empty-state h2 { margin-bottom: 8px; font-size:1.25rem; letter-spacing: -.03em; }
.empty-state > p { max-width: 57ch; margin-bottom: 16px; color: var(--muted); font-size:0.875rem; line-height: 1.6; }
.email-share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 15px; padding: 5px 6px 5px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.email-value { min-width: 0; color: #36423b; font-size:0.875rem; overflow-wrap: anywhere; }
.email-share-row .text-button { flex: 0 0 auto; }
.empty-state > .primary-button { min-width: min(100%, 230px); }
.gym-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.gym-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 116px; padding: 17px 19px; border: 1px solid #e1e6df; border-radius: 16px; background: #fff; box-shadow: 0 5px 17px #1d302606; }
.gym-card.is-invited { border-color: #d3dfcf; box-shadow: 0 5px 17px #1d302606, inset 3px 0 #dce983; }
.gym-identity { display: flex; min-width: 0; align-items: center; gap: 15px; }
.gym-mark { position: relative; display: grid; flex: 0 0 64px; width: 64px; height: 64px; place-items: center; overflow: hidden; border: 1px solid #e4e8e2; border-radius: 14px; background: #f8f9f5; }
.gym-mark-fallback { color: var(--forest); font-size:1.125rem; font-weight: 760; letter-spacing: -.05em; }
.gym-logo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 6px; object-fit: contain; background: #fff; }
.gym-name-group { min-width: 0; }
.gym-name-group h2 { margin: 0 0 6px; font-size:1.125rem; font-weight: 720; letter-spacing: -.035em; overflow-wrap: anywhere; }
.gym-status { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #68746c; font-size:0.75rem; }
.gym-status::before { width: 6px; height: 6px; border-radius: 50%; background: #91a593; content: ""; }
.is-invited .gym-status { color: #6e762e; }
.is-invited .gym-status::before { background: #b4bd45; }
.gym-actions { display: flex; min-width: 172px; flex-direction: column; align-items: stretch; gap: 2px; }
.gym-actions .primary-button, .gym-actions .outline-button { width: 100%; }
.gym-options { position: relative; align-self: flex-end; }
.gym-options > summary { min-height: 44px; display: flex; align-items: center; padding: 5px 9px; border-radius: 8px; color: #647169; font-size:0.75rem; font-weight: 650; list-style: none; cursor: pointer; }
.gym-options > summary::-webkit-details-marker { display: none; }
.gym-options > summary::after { margin-left: 6px; color: #718078; content: "⌄"; font-size:0.875rem; }
.gym-options > summary:hover { background: #f1f4ef; color: var(--forest); }
.gym-options-popover { position: absolute; z-index: 2; top: 41px; right: 0; width: min(250px, calc(100vw - 45px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 9px 28px #17201d1c; }
.gym-options-popover p { margin: 0 0 6px; color: var(--muted); font-size:0.6875rem; line-height: 1.45; }
.gym-options-popover .text-button { width: 100%; padding-inline: 8px; }
.hidden-toggle { margin: 12px 0 0 -8px; }
.hidden-gyms-panel { margin: 23px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.hidden-gyms-panel h2 { margin-bottom: 12px; color: #68746c; font-size:0.9375rem; }
.hidden-gyms-panel .gym-card { background: #f3f4ef; }
.hidden-gyms-panel .gym-logo { opacity: .82; }
.chooser-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 21px; padding-top: 15px; border-top: 1px solid var(--line); }
.chooser-footer p { max-width: 45ch; margin: 0; color: var(--muted); font-size:0.75rem; line-height: 1.55; }
.settings-view { padding-top: 2px; }
.back-button { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 30px -11px; border: 0; background: transparent; color: var(--forest); }
.settings-view > .eyebrow { margin-bottom: 9px; }
.settings-view .identity-line { margin: 10px 0 25px; }
.settings-section { margin: 17px 0; padding: 22px 24px; border: 1px solid #e2e7df; border-radius: 15px; background: #fff; }
.settings-section h2 { margin: 0 0 8px; font-size:1.0625rem; }
.settings-section p { margin-bottom: 13px; color: var(--muted); font-size:0.8125rem; line-height: 1.6; }
.settings-section .panel-copy { margin-bottom: 14px; }
.settings-section .form-stack { max-width: 420px; }
.settings-section .form-stack .primary-button { align-self: flex-start; width: auto; min-width: 175px; }
.settings-section > .outline-button { min-width: 210px; }
.delete-section { margin: 20px 0; padding: 17px 20px; border: 1px solid #e7d9d6; border-radius: 14px; background: #fff; }
.delete-section summary { min-height: 42px; display: flex; align-items: center; color: #823932; font-size:0.875rem; font-weight: 680; cursor: pointer; }
.delete-section p { max-width: 70ch; margin: 8px 0 14px; color: var(--muted); font-size:0.8125rem; line-height: 1.6; }
.signout-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.signout-row span { color: var(--muted); font-size:0.8125rem; line-height: 1.5; }
.confirmation { display: flex; align-items: flex-start; gap: 10px; color: #4c5750; font-size:0.8125rem; line-height: 1.5; }
.confirmation input { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--forest); }
.danger-button { margin-top: 8px; border: 1px solid #a94e46; background: #fff7f5; color: #8e302a; }
.danger-button:hover { background: #fce9e5; }
.retry-button { margin: 14px 0; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: auto; padding-top: 17px; border-top: 1px solid var(--line); }
.site-footer a { min-height: 44px; display: inline-flex; align-items: center; color: #66746b; font-size:0.75rem; text-decoration: none; }
.site-footer a:hover { color: var(--forest); text-decoration: underline; }

@media (max-width: 760px) {
  .page-shell { padding-inline: max(19px, env(safe-area-inset-left)) max(19px, env(safe-area-inset-right)); }
  .entry-view { min-height: auto; grid-template-columns: 1fr; gap: 25px; padding: 47px 0 54px; }
  .entry-copy { max-width: 600px; padding-bottom: 0; }
  .entry-copy h1 { max-width: 13ch; }
  .auth-panel { width: min(100%, 520px); padding: 24px; }
  .account-view { padding-top: 35px; }
}
@media (max-width: 520px) {
  .page-shell { padding-top: max(11px, env(safe-area-inset-top)); padding-right: max(14px, env(safe-area-inset-right)); padding-bottom: max(14px, env(safe-area-inset-bottom)); padding-left: max(14px, env(safe-area-inset-left)); }
  .site-header { min-height: 54px; gap: 8px; }
  .brand { gap: 8px; font-size:0.9375rem; }
  .brand img { width: 31px; height: 31px; }
  .header-actions { gap: 4px; }
  .language-switch { padding: 2px; }
  .language-switch button { min-width: 44px; min-height: 44px; padding-inline: 6px; }
  .entry-view { gap: 18px; padding: 38px 0 42px; }
  .eyebrow { margin-bottom: 10px; font-size:0.625rem; }
  h1 { font-size: clamp(31px, 9vw, 39px); }
  .entry-copy h1 { margin-bottom: 11px; }
  .intro-text { margin-bottom: 13px; font-size:0.875rem; line-height: 1.58; }
  .auth-panel { padding: 20px 18px; border-radius: 16px; }
  .auth-panel h2 { font-size:1.1875rem; }
  .panel-copy { font-size:0.8125rem; }
  .account-view { padding: 29px 0 50px; }
  .section-heading { align-items: flex-start; gap: 8px; }
  .section-heading h1, .settings-view h1 { font-size: clamp(29px, 8vw, 36px); }
  .verified-chip { margin-top: 23px; padding: 6px 8px; font-size:0.625rem; }
  .identity-line { margin-top: 8px; font-size:0.75rem; }
  .account-view > #chooserView > .intro-text { margin-top: 10px; font-size:0.875rem; }
  .list-heading { margin-top: 21px; }
  .list-heading-actions { gap: 2px; }
  .count-label { font-size:0.6875rem; }
  .gym-card { grid-template-columns: minmax(0, 1fr); gap: 12px; min-height: auto; padding: 14px; border-radius: 14px; }
  .gym-identity { gap: 12px; }
  .gym-mark { flex-basis: 56px; width: 56px; height: 56px; border-radius: 12px; }
  .gym-name-group h2 { font-size:1rem; }
  .gym-actions { min-width: 0; align-items: stretch; gap: 0; padding-left: 68px; }
  .gym-actions .primary-button, .gym-actions .outline-button { width: 100%; }
  .gym-options { margin-right: -7px; }
  .empty-state { margin-top: 23px; padding: 20px 17px; border-radius: 15px; }
  .empty-state > .primary-button { width: 100%; }
  .email-share-row { align-items: flex-start; padding: 6px 5px 6px 10px; }
  .email-value { padding-top: 10px; font-size:0.8125rem; }
  .email-share-row .text-button { font-size:0.75rem; }
  .chooser-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .settings-section { padding: 18px 16px; }
  .settings-section .form-stack .primary-button, .settings-section > .outline-button { width: 100%; }
  .delete-section { padding-inline: 15px; }
  .signout-row { align-items: flex-start; flex-direction: column; gap: 8px; padding: 13px; }
}
@media (max-width: 420px) {
  .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .verified-chip { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Guest disclosure reuses the account's device language controls. */
.member-guest-language { position: relative; }
.guest-language-toggle { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-width: 64px; min-height: 48px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.guest-language-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: 240px; max-width: calc(100vw - 32px); padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px #18352b20; }
.guest-language-panel .device-language-label { margin-top: 0; }
.member-home-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 16px; color: var(--ink); font-size: 15px; }
.guest-language-toggle:focus-visible, .member-home-link:focus-visible { outline: 3px solid #6b892a; outline-offset: 3px; }
.site-header .brand { min-width: 0; }
.site-header .header-actions { flex: none; }
