:root {
  color-scheme: dark;
  --bg: #06100e;
  --panel: #101b19;
  --panel-2: #172825;
  --panel-3: #0a1513;
  --text: #f8fafc;
  --muted: #9ba8bb;
  --line: #29413b;
  --accent: #19a978;
  --accent-2: #54d6aa;
  --accent-soft: #143b31;
  --success: #54d6aa;
  --danger: #ff6b6b;
  --shadow: 0 20px 48px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(circle at 82% -10%, rgba(25, 169, 120, .18), transparent 34%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { max-width: 100%; font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img { max-width: 100%; }

.auth-screen { position: relative; isolation: isolate; width: 100%; min-height: 100dvh; display: grid; overflow-x: hidden; padding: max(20px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right)); }
.auth-grid { position: absolute; z-index: -3; inset: 0; opacity: .12; background-image: linear-gradient(rgba(84,214,170,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(84,214,170,.25) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, transparent, black 20%, transparent 92%); }
.auth-orb { position: absolute; z-index: -2; border-radius: 50%; filter: blur(4px); pointer-events: none; }
.auth-orb-one { width: 420px; height: 420px; top: -190px; right: -120px; background: radial-gradient(circle, rgba(25,169,120,.35), transparent 68%); animation: float-orb 9s ease-in-out infinite; }
.auth-orb-two { width: 300px; height: 300px; bottom: -160px; left: 25%; background: radial-gradient(circle, rgba(84,214,170,.18), transparent 68%); animation: float-orb 12s ease-in-out infinite reverse; }
@keyframes float-orb { 50% { transform: translate3d(18px, 22px, 0) scale(1.08); } }
.auth-visual { position: relative; z-index: 1; align-self: end; max-width: 720px; padding: 18px 6px 28px; }
.auth-brand, .auth-card-brand { display: flex; align-items: center; gap: 12px; }
.auth-logo { width: 76px; height: 76px; border-radius: 22px; object-fit: cover; box-shadow: 0 18px 45px rgba(25, 169, 120, .24); }
.auth-brand div, .auth-card-brand div { display: flex; align-items: baseline; font-size: 1.22rem; font-weight: 900; }
.auth-brand span, .auth-card-brand span, .brand-button b span { color: var(--accent-2); }
.eyebrow, .form-kicker { margin: 0 0 8px; color: var(--accent-2); font-size: .75rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.auth-visual h1 { margin: 0; font-size: clamp(2.25rem, 11vw, 4.8rem); line-height: .98; letter-spacing: -.055em; }
.auth-visual h1 span { color: var(--accent-2); text-shadow: 0 0 38px rgba(84, 214, 170, .2); }
.auth-visual > p:not(.eyebrow) { max-width: 560px; margin: 18px 0 0; color: var(--muted); font-size: 1.03rem; line-height: 1.55; }
.auth-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 24px; }
.auth-highlights article { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 11px; border: 1px solid rgba(84,214,170,.24); border-radius: 15px; background: rgba(14, 32, 28,.74); backdrop-filter: blur(12px); }
.auth-highlights article > div { min-width: 0; }
.highlight-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-2); font-weight: 900; }
.auth-highlights strong, .auth-highlights small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-highlights strong { font-size: .83rem; }
.auth-highlights small { margin-top: 3px; color: var(--muted); font-size: .63rem; }
.auth-pulse-card { display: flex; align-items: end; justify-content: space-between; gap: 18px; max-width: 470px; margin-top: 12px; padding: 14px; border: 1px solid rgba(84,214,170,.2); border-radius: 18px; background: linear-gradient(135deg, rgba(20,59,49,.86), rgba(10,21,19,.92)); }
.auth-pulse-card span, .auth-pulse-card strong, .auth-pulse-card small { display: block; }
.auth-pulse-card span { color: var(--accent-2); font-size: .62rem; font-weight: 900; letter-spacing: .12em; }
.auth-pulse-card strong { margin-top: 4px; font-size: 1.4rem; }
.auth-pulse-card small { color: var(--muted); font-size: .65rem; }
.pulse-bars { display: flex; align-items: end; gap: 4px; height: 44px; }
.pulse-bars i { width: 6px; border-radius: 6px; background: linear-gradient(to top, var(--accent), var(--accent-2)); animation: pulse 1.8s ease-in-out infinite; }
.pulse-bars i:nth-child(1), .pulse-bars i:nth-child(7) { height: 16px; }.pulse-bars i:nth-child(2), .pulse-bars i:nth-child(6) { height: 26px; }.pulse-bars i:nth-child(3), .pulse-bars i:nth-child(5) { height: 36px; }.pulse-bars i:nth-child(4) { height: 44px; }
.pulse-bars i:nth-child(2n) { animation-delay: -.6s; }
@keyframes pulse { 50% { opacity: .45; transform: scaleY(.72); transform-origin: bottom; } }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 480px; align-self: start; justify-self: center; padding: 16px; border: 1px solid rgba(84,214,170,.26); border-radius: 26px; background: rgba(12, 27, 24, .94); box-shadow: 0 24px 70px rgba(0,0,0,.42), 0 0 0 1px rgba(84,214,170,.03) inset; backdrop-filter: blur(22px); }
.auth-card-brand { justify-content: center; margin-bottom: 14px; }
.auth-card-brand img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: var(--panel-3); }
.auth-tab { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; }
.auth-tab.active { background: var(--panel-2); color: white; }
.auth-form { display: grid; gap: 14px; padding: 24px 4px 8px; }
.auth-form h2 { margin: 0; font-size: 1.38rem; }
.form-lead { margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.auth-form label, .field-label { display: grid; gap: 7px; color: #c8d1df; font-size: .82rem; font-weight: 750; }
.field-hint { margin: -7px 2px 0; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.auth-link { justify-self: end; margin: -6px 2px 0; padding: 2px; border: 0; background: transparent; color: var(--accent-2); font-size: .76rem; font-weight: 800; }
.auth-link:hover { text-decoration: underline; }
.auth-link-center { justify-self: center; margin-top: 0; }
input, select, textarea {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: #0a111f; color: var(--text); outline: none;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(25, 169, 120, .14); }
.primary-button, .secondary-button, .danger-button, .ghost-button, .icon-button {
  min-height: 44px; border: 1px solid transparent; border-radius: 12px; padding: 9px 14px; color: white; font-weight: 800;
}
.primary-button { background: linear-gradient(135deg, var(--accent), #138964); box-shadow: 0 8px 20px rgba(25, 169, 120, .24); }
.secondary-button { border-color: var(--line); background: var(--panel-2); }
.ghost-button { border-color: var(--line); background: transparent; color: #d3dbe7; }
.danger-button { border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .12); color: #ffb4b4; }
.icon-button { min-width: 44px; padding: 8px; border-color: var(--line); background: var(--panel-2); }
.wide { width: 100%; }
.form-message { min-height: 18px; margin: 0; color: #ffb4b4; font-size: .82rem; text-align: center; }
.form-message.success { color: var(--success); }
.auth-note { margin: 12px 8px 0; color: #6f7b8e; font-size: .72rem; line-height: 1.45; text-align: center; }

.app-shell { width: min(100%, 1120px); min-height: 100dvh; margin: 0 auto; overflow-x: clip; padding: calc(72px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-left)) calc(94px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right)); }
.topbar { position: fixed; z-index: 30; top: 0; left: 50%; width: min(100%, 1120px); min-height: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: end; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 14px 10px; background: rgba(6, 16, 14, .9); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(41, 65, 59, .7); }
.brand-button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: white; font-size: 1.05rem; }
.brand-button img { width: 36px; height: 36px; border-radius: 11px; object-fit: cover; box-shadow: 0 8px 20px rgba(25,169,120,.18); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user-name { max-width: clamp(88px, 24vw, 190px); overflow: hidden; color: var(--text); font-size: .82rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.avatar-button { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; padding: 0; border: 1px solid #2a705b; border-radius: 50%; background: var(--accent-soft); color: #d7fff1; font-weight: 900; }
.topbar-avatar-image { width: 100%; height: 100%; object-fit: cover; }
.view-root { width: 100%; min-width: 0; min-height: 70vh; }
.bottom-nav { position: fixed; z-index: 35; left: 50%; bottom: 0; width: min(100%, 680px); min-height: calc(68px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: start; padding: 8px 7px max(8px, env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; background: rgba(14, 21, 35, .96); backdrop-filter: blur(18px); box-shadow: 0 -10px 28px rgba(0, 0, 0, .2); }
.nav-item { display: grid; justify-items: center; gap: 3px; min-height: 50px; border: 0; background: transparent; color: #78869b; }
.nav-item span { font-size: 1.25rem; line-height: 1; }
.nav-item b { font-size: .62rem; }
.nav-item.active { color: var(--accent-2); }
.nav-create { width: 54px; height: 54px; margin: -19px auto 0; border: 5px solid var(--bg); border-radius: 18px; background: var(--accent); color: white; font-size: 1.7rem; box-shadow: 0 10px 24px rgba(25, 169, 120, .35); }
.nav-create.locked { background: #40524d; box-shadow: none; }

.page-head { display: flex; min-width: 0; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 2px 18px; }
.page-head > div { min-width: 0; }
.page-head h1 { margin: 0; font-size: clamp(1.55rem, 6vw, 2.4rem); letter-spacing: -.035em; }
.page-head p { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--muted); line-height: 1.45; }
.section-title { margin: 24px 2px 11px; font-size: 1rem; }
.loading, .empty-state { display: grid; place-items: center; min-height: 280px; padding: 28px; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); text-align: center; }
.empty-state div { max-width: 390px; }
.empty-state strong { display: block; margin-bottom: 7px; color: white; font-size: 1.1rem; }

.feed-grid, .program-grid { display: grid; gap: 12px; }
.feed-card, .program-card, .profile-card, .builder-card, .library-card { border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
.feed-card { overflow: hidden; }
.feed-author { display: flex; align-items: center; gap: 10px; padding: 14px 15px 8px; }
.mini-avatar { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, #1e5f4d, #263f47); color: #d5fff1; font-weight: 900; }
.feed-author div { min-width: 0; }
.feed-author b, .feed-author span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-author span { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.feed-body { padding: 9px 15px 14px; }
.feed-body h2 { margin: 0; font-size: 1.18rem; }
.feed-description { margin: 8px 0 12px; color: var(--muted); line-height: 1.45; }
.day-summary { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.day-chip { flex: 0 0 auto; padding: 8px 10px; border-radius: 11px; background: var(--panel-3); color: #cdd6e3; font-size: .72rem; }
.day-chip b { color: white; }
.feed-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 15px 15px; }
.like-button.liked { border-color: #2a705b; background: var(--accent-soft); color: #8cf2ce; }

.program-card { padding: 15px; }
.program-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.program-card h2 { margin: 0; font-size: 1.08rem; }
.program-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 12px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 999px; background: var(--panel-3); color: #b7c2d2; font-size: .7rem; font-weight: 800; }
.pill.public { background: rgba(57, 217, 138, .12); color: #8ff0bd; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.builder-card { min-width: 0; padding: 15px; }
.builder-fields { display: grid; gap: 12px; }
.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(3px, .55vw, 7px); width: 100%; padding: 3px 0; }
.day-tab { min-width: 0; min-height: 46px; padding: 6px 2px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-3); color: var(--muted); font-size: clamp(.58rem, 1vw, .78rem); font-weight: 800; line-height: 1.12; white-space: nowrap; }
.day-tab small { display: block; margin-top: 3px; font-size: clamp(.54rem, .85vw, .69rem); font-weight: 700; }
.day-tab small b { color: var(--text); }
.day-short { display: none; }
.day-tab.active { border-color: var(--accent); background: var(--accent-soft); color: #baf5df; }
.builder-exercises { display: grid; gap: 8px; margin-top: 12px; }
.builder-exercise { display: grid; grid-template-columns: 64px minmax(0, 1fr) 38px; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-3); }
.builder-exercise img { width: 64px; height: 56px; border-radius: 9px; object-fit: contain; background: white; }
.builder-exercise h3 { margin: 0; font-size: .88rem; line-height: 1.25; }
.builder-exercise p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.exercise-controls { display: grid; grid-template-columns: 72px minmax(78px, 1fr); gap: 7px; margin-top: 7px; }
.exercise-controls label { display: grid; gap: 3px; color: var(--muted); font-size: .62rem; font-weight: 800; }
.exercise-controls input { min-height: 36px; padding: 6px 8px; font-size: .75rem; }
.builder-layout { padding-bottom: 94px; }
.builder-actions { position: fixed; z-index: 34; left: 50%; bottom: calc(74px + env(safe-area-inset-bottom)); width: min(calc(100% - 28px), 1092px); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: rgba(12, 27, 24, .97); backdrop-filter: blur(18px); box-shadow: 0 -12px 34px rgba(0,0,0,.28); }

.date-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: #0a1513; color: var(--text); text-align: left; }
.date-trigger span { display: grid; gap: 4px; }
.date-trigger small { color: var(--muted); font-size: .66rem; }
.date-trigger b { font-size: .84rem; }
.date-trigger i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-2); font-style: normal; font-size: 1.15rem; }

.search-panel { display: grid; gap: 9px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.search-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.library-card { overflow: hidden; }
.library-image { position: relative; aspect-ratio: 1.3 / 1; background: white; }
.library-image img { width: 100%; height: 100%; object-fit: contain; }
.library-card-body { padding: 10px; }
.library-card h3 { min-height: 35px; margin: 0; font-size: .82rem; line-height: 1.25; }
.library-card p { margin: 5px 0 9px; color: var(--muted); font-size: .67rem; line-height: 1.3; }
.library-card .secondary-button { width: 100%; min-height: 38px; padding: 6px; font-size: .72rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 16px 0; }
.pagination span { color: var(--muted); font-size: .8rem; }

.profile-card { padding: 18px; }
.profile-editor { display: flex; align-items: center; gap: 16px; }
.profile-photo-wrap { position: relative; flex: 0 0 auto; }
.profile-avatar { display: grid; place-items: center; width: 86px; height: 86px; overflow: hidden; border: 2px solid rgba(84,214,170,.4); border-radius: 28px; object-fit: cover; background: linear-gradient(135deg, var(--accent), #28584c); color: white; font-size: 1.5rem; font-weight: 900; }
.photo-edit-button { position: absolute; right: -5px; bottom: -5px; width: 34px; height: 34px; border: 3px solid var(--panel); border-radius: 50%; background: var(--accent); color: white; font-weight: 900; }
.profile-copy { min-width: 0; }
.profile-copy h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.profile-copy p { margin: 5px 0 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.profile-form { display: grid; gap: 11px; margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-3); }
.profile-photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.profile-stats div { padding: 12px; border-radius: 13px; background: var(--panel-3); }
.profile-stats strong, .profile-stats span { display: block; }
.profile-stats span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.account-security-grid { display: grid; gap: 12px; margin-top: 12px; }
.security-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: 0 10px 28px rgba(0, 0, 0, .14); }
.security-card.pending { border-color: rgba(255, 190, 92, .42); background: linear-gradient(145deg, rgba(64, 44, 20, .44), var(--panel) 62%); }
.security-card.verified { border-color: rgba(84, 214, 170, .32); }
.security-card-head { display: flex; align-items: center; gap: 12px; }
.security-card-head h2 { margin: 0; font-size: 1.08rem; }
.security-card-head .form-kicker { margin-bottom: 4px; }
.security-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-2); font-size: 1.2rem; font-weight: 900; }
.security-card.pending .security-icon { background: rgba(255, 190, 92, .13); color: #ffd28d; }
.security-card > p { margin: 13px 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.verification-address { display: block; overflow-wrap: anywhere; color: var(--accent-2); font-size: .8rem; font-weight: 800; }
.password-change-form { display: grid; gap: 11px; margin-top: 15px; }
.app-footer { display: grid; justify-items: center; gap: 5px; margin: 18px 2px 4px; padding: 18px 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(16,27,25,.72); color: var(--muted); text-align: center; }
.app-footer p { margin: 0; font-size: .72rem; }
.app-footer strong { color: var(--text); font-size: .82rem; }
.app-footer a { color: var(--accent-2); font-size: .78rem; font-weight: 800; overflow-wrap: anywhere; }

.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; align-items: end; background: rgba(0, 0, 0, .7); backdrop-filter: blur(7px); }
.modal { width: min(100%, 760px); max-height: 94dvh; margin: 0 auto; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; background: var(--bg); box-shadow: var(--shadow); padding: 14px 14px max(22px, env(safe-area-inset-bottom)); }
.modal.full { width: min(100%, 1120px); height: 94dvh; }
.picker-modal #picker-content { min-height: 0; }
.picker-modal .search-panel { position: sticky; z-index: 3; top: 59px; background: rgba(16,27,25,.97); backdrop-filter: blur(16px); }
.picker-modal .library-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.added-button { border-color: rgba(84,214,170,.38); background: var(--accent-soft); color: var(--accent-2); opacity: 1; }
.modal-head { position: sticky; z-index: 4; top: -14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -14px -14px 12px; padding: 14px; border-bottom: 1px solid var(--line); background: rgba(7, 11, 20, .96); backdrop-filter: blur(15px); }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.exercise-detail-images { display: grid; grid-template-columns: 1fr; }
.exercise-detail-images img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 13px; background: white; }
.detail-section { margin-top: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.detail-section h3 { margin: 0 0 9px; font-size: .95rem; }
.instruction-list { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.5; font-size: .84rem; }
.detail-section > p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .86rem; }
.program-detail-days { display: grid; gap: 10px; }
.program-day { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); overflow: hidden; }
.program-day > h3 { margin: 0; padding: 12px 14px; background: var(--panel-2); font-size: .9rem; }
.detail-exercise { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 11px; border-top: 1px solid var(--line); }
.detail-exercise-preview { width: 52px; height: 46px; overflow: hidden; padding: 0; border: 1px solid transparent; border-radius: 8px; background: white; cursor: zoom-in; }
.detail-exercise-preview:hover, .detail-exercise-preview:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.detail-exercise-preview img { width: 100%; height: 100%; object-fit: contain; background: white; }
.detail-exercise b { font-size: .78rem; }
.detail-exercise span { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.track-button { min-height: 36px; padding: 6px 9px; font-size: .7rem; }
.weeks { display: grid; gap: 9px; }
.week-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.week-card h3 { margin: 0 0 9px; font-size: .88rem; }
.week-fields { display: grid; grid-template-columns: repeat(var(--fields, 1), minmax(0, 1fr)); gap: 7px; }
.week-fields label { display: grid; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 800; }
.week-fields input { min-height: 43px; padding: 8px; }

.date-modal { width: min(calc(100% - 24px), 440px); margin: auto; padding-bottom: 16px; border: 1px solid var(--line); border-radius: 24px; }
.date-modal .modal-head { top: -14px; }
.calendar-heading { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; margin-bottom: 12px; }
.calendar-heading strong { text-align: center; text-transform: capitalize; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-weekdays { margin-bottom: 6px; color: var(--muted); font-size: .68rem; font-weight: 800; text-align: center; }
.calendar-day { aspect-ratio: 1; min-width: 0; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #dce7e3; font-size: .78rem; font-weight: 800; }
.calendar-day:hover { background: var(--panel-2); }
.calendar-day.outside { color: #52635e; }
.calendar-day.today { border-color: rgba(84,214,170,.45); color: var(--accent-2); }
.calendar-day.selected { border-color: var(--accent); background: var(--accent); color: white; box-shadow: 0 7px 18px rgba(25,169,120,.28); }
.calendar-quick { display: grid; grid-template-columns: 1fr 1.45fr; gap: 8px; margin-top: 14px; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: max(88px, calc(78px + env(safe-area-inset-bottom))); max-width: calc(100% - 28px); transform: translate(-50%, 20px); padding: 10px 15px; border: 1px solid #315b4a; border-radius: 999px; background: #10291f; color: #c8f8df; opacity: 0; pointer-events: none; transition: .2s; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.muted { color: var(--muted); }

@media (min-width: 720px) {
  .auth-screen { grid-template-columns: minmax(0, 1.3fr) minmax(390px, .7fr); align-items: center; gap: 54px; padding: 42px clamp(42px, 6vw, 110px); }
  .auth-visual, .auth-card { align-self: center; }
  .auth-card { padding: 22px; }
  .auth-card-brand { display: none; }
  .feed-grid, .program-grid { grid-template-columns: 1fr 1fr; }
  .search-row { grid-template-columns: 1.6fr 1fr 1fr; }
  .library-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .builder-layout { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
  .builder-actions { grid-column: 1 / -1; }
  .weeks { grid-template-columns: 1fr 1fr; }
  .account-security-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { max-height: min(900px, calc(100dvh - 48px)); border-bottom: 1px solid var(--line); border-radius: 24px; }
  .modal.full { height: min(860px, calc(100dvh - 48px)); }
  .modal-head { border-radius: 24px 24px 0 0; }
}

@media (max-width: 719px) {
  .auth-brand { display: none; }
  .auth-visual, .auth-card { width: 100%; min-width: 0; max-width: 100%; }
  .auth-visual { align-self: start; padding: 16px 2px 20px; }
  .auth-visual h1 { font-size: clamp(2.1rem, 11vw, 3.2rem); overflow-wrap: anywhere; }
  .auth-visual > p:not(.eyebrow) { margin-top: 14px; font-size: .92rem; }
  .auth-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
  .auth-highlights article:last-child { grid-column: 1 / -1; }
  .auth-highlights strong, .auth-highlights small { white-space: normal; }
  .auth-pulse-card { display: none; }
  .auth-card { margin-top: 8px; }
  input, select, textarea { font-size: 16px; }
  .page-head { align-items: start; }
  .page-head h1 { font-size: clamp(1.55rem, 7vw, 2rem); }
  .builder-layout, .builder-card, .profile-card { width: 100%; min-width: 0; max-width: 100%; }
  .builder-card { padding: 13px; }
  .builder-actions { right: max(12px, env(safe-area-inset-right)); bottom: calc(72px + env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); width: auto; transform: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .builder-actions button { min-width: 0; padding-inline: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .date-trigger span { min-width: 0; }
  .date-trigger b { overflow-wrap: anywhere; }
  .day-full { display: none; }
  .day-short { display: inline; }
  .day-count-label { display: none; }
  .profile-card { padding: 14px; }
  .profile-editor { gap: 12px; }
  .profile-avatar { width: 76px; height: 76px; border-radius: 23px; }
  .profile-copy h2 { font-size: 1.18rem; }
  .profile-copy p { white-space: nowrap; }
  .profile-form { padding: 12px; }
  .picker-modal .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { width: max-content; white-space: normal; text-align: center; }
}

@media (max-width: 479px) {
  .library-grid { grid-template-columns: 1fr; }
  .picker-modal .library-grid { grid-template-columns: 1fr; }
  .library-card { display: grid; grid-template-columns: 118px 1fr; }
  .library-image { height: 100%; aspect-ratio: auto; }
  .week-fields[style*="--fields: 3"] { grid-template-columns: 1fr 1fr; }
  .week-fields[style*="--fields: 3"] label:last-child { grid-column: 1 / -1; }
  .builder-exercise { grid-template-columns: 54px minmax(0, 1fr) 36px; }
  .builder-exercise img { width: 54px; height: 54px; }
  .profile-photo-actions { grid-template-columns: 1fr; }
}

@media (max-width: 359px) {
  .auth-highlights { grid-template-columns: 1fr; }
  .auth-highlights article:last-child { grid-column: auto; }
  .topbar-user-name { max-width: 92px; }
  .builder-actions { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
