:root {
  color-scheme: dark;
  --bg: #111510;
  --surface: #191e18;
  --surface-raised: #20271e;
  --line: #2b3328;
  --text: #f1f4ed;
  --muted: #99a293;
  --lime: #c7ff68;
  --lime-dark: #25351a;
  --orange: #ffad70;
  --danger: #ff8178;
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.app-shell { max-width: 720px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.045); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: .08em; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--lime); color: #15190f; font-size: 17px; font-weight: 800; letter-spacing: -.06em; }
.brand-dot { color: var(--lime); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.today-label { color: var(--muted); text-transform: capitalize; font-size: 11px; letter-spacing: .04em; }
.profile-button { min-width: 0; display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px 3px 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); cursor: pointer; }
.profile-initials { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--lime-dark); color: var(--lime); font-size: 11px; font-weight: 800; }
.profile-name { max-width: 86px; overflow: hidden; color: #dfe5d8; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--lime); font-size: 20px; cursor: pointer; }
.main-content { padding: 25px 18px 34px; }
.eyebrow { color: var(--lime); text-transform: uppercase; letter-spacing: .13em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(28px, 7vw, 38px); line-height: 1.12; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: -.035em; }
h3 { margin-bottom: 5px; font-size: 15px; letter-spacing: -.025em; }
.subhead { color: var(--muted); font-size: 13px; line-height: 1.55; margin-bottom: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 7px 2px 22px; }
.page-heading .eyebrow { margin-bottom: 8px; }
.card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card + .card { margin-top: 13px; }
.hero-card { position: relative; overflow: hidden; padding: 23px 21px; border: 1px solid #3c4d2d; border-radius: 25px; background: radial-gradient(circle at 100% 0%, rgba(199,255,104,.14), transparent 42%), linear-gradient(135deg,#20291c,#171d16 67%); }
.hero-card h2 { max-width: 280px; font-size: 24px; line-height: 1.18; margin: 11px 0 8px; }
.hero-card p { max-width: 300px; }
.hero-mark { position: absolute; top: 18px; right: 16px; color: rgba(199,255,104,.17); font-size: 90px; line-height: .9; font-weight: 800; letter-spacing: -.12em; transform: rotate(-10deg); pointer-events: none; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 0 17px; border: 0; border-radius: 15px; background: var(--lime); color: #18200f; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .15s, filter .15s; }
.button:active { transform: scale(.98); }
.button:hover { filter: brightness(1.04); }
.button.secondary { background: var(--surface-raised); border: 1px solid var(--line); color: var(--text); }
.button.ghost { min-height: 38px; padding: 0 12px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.button.danger { background: rgba(255,129,120,.1); border: 1px solid rgba(255,129,120,.25); color: var(--danger); }
.button.full { width: 100%; }
.button.small { min-height: 38px; border-radius: 12px; font-size: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 25px 2px 12px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.stat-card { padding: 14px 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.stat-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; line-height: 1.1; letter-spacing: -.08em; }
.stat-label { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.weekly-muscles { display: flex; flex-wrap: wrap; gap: 8px; }
.muscle-chip, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: #dce2d5; font-size: 11px; }
.muscle-chip strong { color: var(--lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; }
.empty-note { padding: 17px; border: 1px dashed #394234; border-radius: 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.inline-link { border: 0; padding: 0; background: none; color: var(--lime); font-size: 12px; font-weight: 700; cursor: pointer; }
.workout-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px; border: 1px solid #3a4a2e; border-radius: 21px; background: linear-gradient(135deg,#202a1b,#191e18); }
.workout-top .eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px rgba(199,255,104,.6); }
.workout-clock { color: var(--lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; white-space: nowrap; }
.workout-summary { display: flex; gap: 15px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.exercise-card { margin-top: 12px; padding: 15px 13px 12px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.exercise-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exercise-title-wrap { min-width: 0; }
.exercise-head h3 { margin: 0 0 7px; overflow-wrap: anywhere; }
.exercise-muscles { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 4px 7px; background: var(--surface-raised); color: var(--muted); font-size: 9px; }
.exercise-menu { border: 0; padding: 0 5px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.last-performance { margin: 12px 0 6px; color: var(--muted); font-size: 10px; }
.last-performance strong { color: #d8e2cd; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 400; }
.set-header, .set-row { display: grid; grid-template-columns: 32px minmax(0,1fr) minmax(0,1fr) 38px; gap: 7px; align-items: center; }
.set-header { padding: 5px 3px 7px; color: #747f70; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; text-align: center; }
.set-row { padding: 5px 2px; }
.set-number { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; text-align: center; }
.set-input { width: 100%; height: 39px; min-width: 0; border: 1px solid #323b2f; border-radius: 11px; background: #131712; color: var(--text); text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; appearance: textfield; }
.set-input::-webkit-inner-spin-button, .set-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.set-input::placeholder { color: #5e6859; }
.set-done { width: 34px; height: 34px; justify-self: center; display: grid; place-items: center; border: 1px solid #3a4436; border-radius: 11px; background: #151a14; color: transparent; cursor: pointer; }
.set-done.done { border-color: var(--lime); background: var(--lime); color: #17200d; font-weight: 900; }
.set-row.completed .set-input { color: #aeb8a5; border-color: #39432f; }
.exercise-actions { display: flex; justify-content: space-between; align-items: center; padding: 7px 3px 0; }
.add-set { border: 0; padding: 5px 0; background: none; color: var(--lime); font-size: 11px; font-weight: 700; cursor: pointer; }
.exercise-note { color: var(--muted); font-size: 10px; }
.session-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 14px; }
.rest-banner { position: sticky; z-index: 5; bottom: calc(78px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 0; padding: 12px 15px; border: 1px solid #53683c; border-radius: 16px; background: #24321b; box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.rest-banner span:first-child { color: #d8e9c4; font-size: 11px; }
.rest-time { color: var(--lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; }
.rest-skip { border: 0; padding: 5px 0 5px 8px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.chart-card { overflow: hidden; }
.chart-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.chart-select { max-width: 55%; height: 37px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); color: var(--text); font-size: 11px; }
.chart-wrap { margin-top: 15px; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.chart-empty { display: grid; place-items: center; min-height: 150px; margin-top: 13px; border: 1px dashed #394234; border-radius: 14px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; padding: 20px; }
.muscle-row { display: grid; grid-template-columns: 76px 1fr 29px; gap: 10px; align-items: center; margin: 14px 0; font-size: 11px; }
.muscle-row:last-child { margin-bottom: 3px; }
.muscle-name { color: #dfe5d8; }
.bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: #30382c; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#91ce44,var(--lime)); }
.muscle-count { color: var(--lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.bodymap-card { padding: 17px 15px 14px; }
.bodymap-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bodymap-header .eyebrow { margin-bottom: 5px; }
.bodymap-header h3 { margin: 0; }
.bodymap-toggle { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #121711; }
.body-view-button { min-height: 31px; padding: 0 9px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.body-view-button.selected { background: var(--lime); color: #17200d; font-weight: 800; }
.bodymap-figure { display: grid; place-items: center; margin: 10px auto 3px; min-height: 240px; }
.body-svg { display: block; width: min(100%, 190px); height: auto; filter: drop-shadow(0 12px 18px rgba(0,0,0,.24)); }
.body-zone { stroke: #f0f4e7; stroke-opacity: .24; stroke-width: 1.3; transition: fill .2s ease; }
.bodymap-scale { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 14px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.bodymap-scale span { display: inline-flex; align-items: center; gap: 4px; }
.bodymap-scale i, .bodymap-key-name i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.bodymap-scale small { color: #788272; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 9px; }
.bodymap-key { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 5px; padding: 12px 0 3px; border-top: 1px solid var(--line); }
.bodymap-key-item { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 7px; border: 1px solid rgba(255,255,255,.045); border-radius: 10px; background: rgba(255,255,255,.018); }
.bodymap-key-name { min-width: 0; display: inline-flex; align-items: center; gap: 5px; overflow: hidden; color: #c8d0c1; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.bodymap-key-name i { flex: 0 0 8px; width: 8px; height: 8px; }
.bodymap-key-item strong { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 500; }
.bodymap-note { margin: 11px 2px 0; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }
.bodymap-stage { position: relative; width: 100%; height: 330px; margin: 12px auto 0; overflow: hidden; border: 1px solid rgba(255,255,255,.055); border-radius: 16px; background: radial-gradient(ellipse at 50% 36%, #26332a 0%, #1a211b 58%, #151a16 100%); }
.bodymap-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.bodymap-loading { position: absolute; z-index: 1; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 11px; pointer-events: none; }
.bodymap-spinner { width: 24px; height: 24px; border: 2px solid rgba(199,255,104,.15); border-top-color: var(--lime); border-radius: 50%; animation: body-spin .85s linear infinite; }
@keyframes body-spin { to { transform: rotate(360deg); } }
.bodymap-error { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 22px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.bodymap-hint { margin: 8px 0 14px; color: #818b7e; font-size: 9px; text-align: center; }
.bodymap-attribution { margin: 6px 2px 0; color: #788272; font-size: 8px; line-height: 1.5; text-align: center; }
.bodymap-attribution a { color: #aebc9e; text-decoration-color: rgba(174,188,158,.35); text-underline-offset: 2px; }
.history-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.history-item:first-child { padding-top: 0; }
.history-item:last-child { padding-bottom: 0; border-bottom: 0; }
.history-toolbar { display: flex; align-items: center; gap: 8px; }
.backup-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.backup-card p { max-width: 360px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.backup-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.history-entry + .history-entry { border-top: 1px solid var(--line); }
.history-entry .history-item { padding: 14px 0 7px; border-bottom: 0; }
.history-entry:first-child .history-item { padding-top: 0; }
.history-entry:last-child .history-item { padding-bottom: 7px; }
.detail-button { display: block; margin: 0 0 13px auto; }
.history-entry:last-child .detail-button { margin-bottom: 0; }
.history-title { margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.history-meta { color: var(--muted); font-size: 10px; line-height: 1.5; }
.history-volume { color: var(--lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: nowrap; }
.detail-meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.detail-sets { margin-top: 13px; }
.detail-set { display: flex; justify-content: space-between; gap: 12px; padding: 9px 1px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.detail-set strong { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 500; }
.history-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.history-actions .button { flex: 1; }
.share-workout-button { margin-top: 16px; }
.social-copy { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.social-recovery { margin-top: 13px; }
.social-recovery summary { color: #dce2d5; font-size: 12px; font-weight: 700; cursor: pointer; }
.social-recovery[open] summary { margin-bottom: 8px; }
.social-group-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.social-group-card > div:first-child { flex: 1 1 230px; }
.social-group-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.social-rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.leaderboard-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 42px; border-bottom: 1px solid var(--line); font-size: 11px; }
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-row > strong { color: var(--lime); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 500; white-space: nowrap; }
.leaderboard-rank { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.leaderboard-name { min-width: 0; overflow-wrap: anywhere; }
.leaderboard-name small, .record-exercise small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.record-exercise { min-width: 0; overflow-wrap: anywhere; }
.shared-workout-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.shared-workout-entry:first-child { padding-top: 0; }
.shared-workout-entry:last-child { padding-bottom: 0; border-bottom: 0; }
.shared-workout-main { display: grid; gap: 4px; min-width: 0; }
.shared-workout-main strong { font-size: 12px; overflow-wrap: anywhere; }
.shared-workout-main span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.shared-workout-entry .inline-link { flex: 0 0 auto; }
.editor-section-heading { margin-top: 24px; }
.edit-exercise { padding: 14px 12px 11px; }
.editor-exercise-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-exercise-head .eyebrow { margin-bottom: 0; }
.edit-kind-label { display: flex; align-items: center; min-height: 46px; color: var(--text); font-size: 12px; }
.edit-sets-list { display: grid; gap: 5px; margin-top: 12px; }
.edit-set-row { display: grid; grid-template-columns: 27px minmax(0,1fr) minmax(0,1fr) 48px 28px; gap: 5px; align-items: center; }
.edit-no-weight { display: grid; place-items: center; height: 37px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 10px; }
.edit-done-label { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 8px; }
.edit-done-label input { width: 16px; height: 16px; accent-color: var(--lime); }
.remove-set-button { width: 26px; height: 28px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.edit-exercise .add-set { margin-top: 8px; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(4,6,4,.7); backdrop-filter: blur(5px); }
.modal { width: 100%; max-width: 720px; max-height: min(88vh, 820px); overflow: hidden; border: 1px solid var(--line); border-bottom: 0; border-radius: 25px 25px 0 0; background: #171c16; box-shadow: 0 -10px 50px rgba(0,0,0,.4); padding-bottom: env(safe-area-inset-bottom); animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(20px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 19px 13px; }
.modal-head h2 { font-size: 20px; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-body { max-height: calc(min(88vh, 820px) - 76px); overflow-y: auto; padding: 0 18px 20px; overscroll-behavior: contain; }
.search-input, .text-input, .select-input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 13px; background: #111510; color: var(--text); font-size: 13px; }
.file-input { height: auto; min-height: 46px; padding: 9px 11px; }
.search-input { margin-bottom: 12px; }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.filter-chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.filter-chip.selected { background: var(--lime); border-color: var(--lime); color: #17200d; font-weight: 800; }
.exercise-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 3px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.exercise-option:last-child { border-bottom: 0; }
.exercise-option-name { font-size: 12px; font-weight: 700; }
.exercise-option-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.option-arrow { color: var(--lime); font-size: 17px; }
.field-label { display: block; margin: 13px 0 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.profile-privacy { margin: 14px 0 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-foot { margin-top: 17px; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(91px + env(safe-area-inset-bottom)); max-width: calc(100vw - 36px); padding: 11px 16px; border: 1px solid #48583a; border-radius: 14px; background: #27351e; color: #e6f3d8; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 0; width: 100%; max-width: 720px; height: calc(70px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.07); background: rgba(17,21,16,.95); backdrop-filter: blur(16px); transform: translateX(-50%); }
.nav-item { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; border: 0; background: transparent; color: #798372; font-size: 9px; cursor: pointer; }
.nav-item.active { color: var(--lime); font-weight: 800; }
.nav-icon { font-size: 20px; line-height: 1.1; }
.danger-text { color: var(--danger); }
.footer-note { margin: 16px 3px 0; color: #76806f; font-size: 10px; line-height: 1.5; }
.install-hint { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.install-hint strong { color: var(--text); }
.divider { height: 1px; margin: 15px 0; background: var(--line); }
.empty-history { padding: 28px 15px; text-align: center; }
.empty-history .empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; border-radius: 16px; background: var(--lime-dark); color: var(--lime); font-size: 22px; }
.empty-history p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (min-width: 560px) {
  .main-content { padding: 32px 28px 45px; }
  .topbar { padding: 0 30px; }
  .modal { align-self: center; border-bottom: 1px solid var(--line); border-radius: 25px; }
  .modal-backdrop { align-items: center; padding: 20px; }
}

@media (max-width: 380px) {
  .main-content { padding-right: 14px; padding-left: 14px; }
  .today-label { display: none; }
  .topbar-right { gap: 8px; }
  .profile-name { max-width: 68px; }
  .card { padding: 14px; }
  .set-header, .set-row { grid-template-columns: 27px minmax(0,1fr) minmax(0,1fr) 34px; gap: 5px; }
  .set-input { height: 37px; }
  .social-rank-grid { grid-template-columns: 1fr; }
  .social-group-actions { width: 100%; }
  .social-group-actions .button { flex: 1 1 150px; }
  .page-heading { margin-right: 0; margin-left: 0; }
  .page-heading:has(.history-toolbar) { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .backup-card { align-items: flex-start; flex-direction: column; }
  .backup-actions { width: 100%; }
  .backup-actions .button { flex: 1; }
  .bodymap-stage { height: 300px; }
  .bodymap-toggle { gap: 1px; }
  .body-view-button { padding: 0 7px; font-size: 9px; }
}
