/* Forge Gym. Every rule is scoped under .fg so nothing leaks into the rest of Forge. */
.fg {
  --fg-bg1: #111; --fg-bg2: #161616; --fg-bg3: #1c1c1c; --fg-border: #222;
  --fg-muted: #666; --fg-xp: #7c6cff; --fg-pr: #ff8c42; --fg-good: #3ddc84;
  --fg-hud: 'Orbitron', monospace; --fg-mono: 'Share Tech Mono', monospace; --fg-ui: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  font-family: var(--fg-mono); font-size: 14px; color: #fff;
}
.fg *, .fg *::before, .fg *::after { box-sizing: border-box; }
.fg button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fg input { font: inherit; color: inherit; }
.fg .hidden, .fg.hidden { display: none !important; }
.fg.fg-root { max-width: 560px; margin: 0 auto; padding: 16px 16px 110px; }

.fg .fg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.fg .brand { font-family: var(--fg-hud); font-weight: 900; font-size: 18px; letter-spacing: 0.18em; }
.fg .sub { font-size: 11px; color: var(--fg-muted); margin-top: 3px; letter-spacing: 0.08em; }
.fg .head-right { display: flex; align-items: center; gap: 10px; }
.fg .icon-btn { width: 36px; height: 36px; border: 1px solid var(--fg-border); border-radius: 10px; font-size: 16px; color: #aaa; }

.fg .fg-tabs { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--fg-bg1); border: 1px solid var(--fg-border); border-radius: 12px; padding: 3px; margin-bottom: 16px; position: sticky; top: 0; z-index: 5; }
.fg .fg-tabs button { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; color: #777; padding: 10px 0; border-radius: 9px; }
.fg .fg-tabs button.active { background: #fff; color: #000; }

.fg .belt { display: inline-flex; align-items: center; gap: 6px; font-family: var(--fg-hud); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--fg-border); background: var(--fg-bg1); white-space: nowrap; }
.fg .belt i { width: 14px; height: 6px; border-radius: 2px; display: inline-block; }
.fg .belt i.black { background: #000; box-shadow: 0 0 0 1px #888 inset; }

.fg h2 { font-family: var(--fg-hud); font-size: 11px; letter-spacing: 0.22em; color: var(--fg-muted); font-weight: 700; margin: 22px 0 10px; }
.fg .fg-view > h2:first-child { margin-top: 4px; }
.fg .card { background: var(--fg-bg1); border: 1px solid var(--fg-border); border-radius: 14px; padding: 14px; }
.fg .card + .card { margin-top: 10px; }
.fg .muted { color: var(--fg-muted); }
.fg .small { font-size: 12px; }
.fg .link { color: var(--fg-xp); }
.fg .c-pr { color: var(--fg-pr); }
.fg .c-xp { color: var(--fg-xp); }

.fg .btn { display: block; width: 100%; padding: 14px; border-radius: 12px; font-family: var(--fg-ui); font-weight: 700; font-size: 15px; text-align: center; }
.fg .btn-primary { background: #fff; color: #000; }
.fg .btn-ghost { border: 1px solid var(--fg-border); color: #bbb; }
.fg .btn-danger { border: 1px solid #3a1414; color: #ff6b6b; }
.fg .btn + .btn { margin-top: 10px; }

.fg .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fg .tpl { text-align: left; background: var(--fg-bg1); border: 1px solid var(--fg-border); border-radius: 14px; padding: 14px; }
.fg .tpl b { display: block; font-family: var(--fg-hud); font-size: 13px; letter-spacing: 0.08em; margin-bottom: 6px; }
.fg .tpl span { font-size: 11px; color: var(--fg-muted); line-height: 1.4; display: block; }
.fg .tpl:active { border-color: #555; }

.fg .coach { border-left: 3px solid var(--fg-xp); }
.fg .coach .who { font-family: var(--fg-hud); font-size: 9px; letter-spacing: 0.2em; color: var(--fg-xp); margin-bottom: 8px; }
.fg .coach p { font-family: var(--fg-ui); font-size: 14px; line-height: 1.55; color: #ddd; margin: 0; }
.fg .coach p + p { margin-top: 6px; }

.fg .wk-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.fg .wk-name { font-family: var(--fg-hud); font-size: 16px; font-weight: 700; letter-spacing: 0.06em; }
.fg .wk-time { font-size: 20px; color: #ddd; }
.fg .wk-stats { display: flex; gap: 16px; font-size: 12px; color: var(--fg-muted); margin-bottom: 14px; flex-wrap: wrap; }
.fg .wk-stats b { color: #fff; font-weight: normal; }

.fg .ex { background: var(--fg-bg1); border: 1px solid var(--fg-border); border-radius: 14px; padding: 14px 12px 10px; margin-bottom: 12px; }
.fg .ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fg .ex-name { font-family: var(--fg-ui); font-weight: 700; font-size: 16px; }
.fg .ex-musc { font-size: 11px; color: var(--fg-muted); margin-top: 2px; }
.fg .ex-x { color: #555; font-size: 18px; padding: 0 4px; }
.fg .ex-hint { font-family: var(--fg-ui); font-size: 12px; color: var(--fg-xp); margin: 8px 0 4px; }
.fg .sets { width: 100%; border-collapse: collapse; margin-top: 8px; }
.fg .sets th { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.16em; color: #555; font-weight: 400; text-align: center; padding: 4px 2px; }
.fg .sets td { text-align: center; padding: 3px 2px; }
.fg .sets td.n { color: var(--fg-muted); width: 26px; white-space: nowrap; }
.fg .sets td.prev { color: #555; font-size: 12px; width: 70px; }
.fg .sets input { width: 64px; background: var(--fg-bg3); border: 1px solid transparent; border-radius: 8px; text-align: center; padding: 9px 4px; font-size: 16px; outline: none; }
.fg .sets input:focus { border-color: #555; }
.fg .sets tr.done input { background: #10251a; color: var(--fg-good); }
.fg .chk { width: 38px; height: 36px; border-radius: 8px; background: var(--fg-bg3); color: #555; font-size: 16px; }
.fg .sets tr.done .chk { background: var(--fg-good); color: #000; }
.fg .pr-tag { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.1em; color: #000; background: var(--fg-pr); border-radius: 4px; padding: 2px 4px; margin-left: 4px; vertical-align: middle; }
.fg .add-set { width: 100%; margin-top: 6px; padding: 9px; border-radius: 8px; background: var(--fg-bg2); color: #aaa; font-size: 12px; letter-spacing: 0.08em; }

.fg .fg-rest { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: calc(100% - 24px); max-width: 536px; background: #151225; border: 1px solid #2d2650; border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 10px; z-index: 900; }
.fg .rest-label { font-family: var(--fg-hud); font-size: 9px; letter-spacing: 0.2em; color: var(--fg-xp); }
.fg .rest-time { font-size: 20px; }
.fg .rest-bar { grid-column: 1 / -1; height: 3px; background: #2d2650; border-radius: 2px; order: 9; }
.fg .fg-rest-fill { height: 100%; background: var(--fg-xp); border-radius: 2px; width: 100%; transition: width 0.25s linear; }
.fg .fg-rest button { font-size: 12px; padding: 7px 10px; border-radius: 8px; background: #221c3d; }

.fg .seg { display: inline-flex; background: var(--fg-bg1); border: 1px solid var(--fg-border); border-radius: 10px; padding: 3px; }
.fg .seg button { font-size: 12px; padding: 7px 14px; border-radius: 7px; color: #888; }
.fg .seg button.active { background: #fff; color: #000; }
.fg .maps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; }
.fg .maps figure { text-align: center; margin: 0; }
.fg .maps figcaption { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.24em; color: #444; margin-top: 4px; }
.fg .bodymap { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; }
.fg .bodymap .shell { fill: #161616; }
.fg .bodymap .muscle { fill: #262626; stroke: #0a0a0a; stroke-width: 1.2; stroke-linejoin: round; cursor: pointer; transition: fill 0.2s; }
.fg .bodymap .muscle.selected { stroke: #fff; stroke-width: 1.6; }
.fg .bodymap .detail line { stroke: #0a0a0a; stroke-width: 1.2; pointer-events: none; }
.fg .legend { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; font-size: 11px; color: #888; }
.fg .legend span { display: inline-flex; align-items: center; gap: 5px; }
.fg .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fg .muscle-info { margin-top: 14px; }
.fg .mi-name { font-family: var(--fg-ui); font-size: 17px; }

.fg .overall { display: flex; align-items: center; gap: 14px; }
.fg .overall .big-belt { width: 56px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.fg .overall .t { font-family: var(--fg-hud); font-size: 16px; font-weight: 700; letter-spacing: 0.08em; }
.fg .rank-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--fg-border); }
.fg .rank-row:last-child { border-bottom: none; }
.fg .rank-row .m { font-family: var(--fg-ui); font-weight: 600; font-size: 15px; }
.fg .rank-row .d { grid-column: 1 / -1; font-size: 12px; color: var(--fg-muted); }
.fg .bar { grid-column: 1 / -1; height: 5px; background: var(--fg-bg3); border-radius: 3px; overflow: hidden; }
.fg .bar div { height: 100%; border-radius: 3px; }

.fg .hist { cursor: pointer; }
.fg .hist-top { display: flex; justify-content: space-between; align-items: baseline; }
.fg .hist-name { font-family: var(--fg-ui); font-weight: 700; font-size: 15px; }
.fg .hist-date { font-size: 11px; color: var(--fg-muted); }
.fg .hist-meta { font-size: 12px; color: #888; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.fg .hist-body { margin-top: 10px; border-top: 1px solid var(--fg-border); padding-top: 8px; font-size: 12px; color: #aaa; line-height: 1.7; }

/* bottom sheet: picker / settings / workout summary */
.fg-sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9500; display: flex; align-items: flex-end; justify-content: center; }
.fg .sheet-inner { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--fg-bg1); border: 1px solid var(--fg-border); border-bottom: none; border-radius: 18px 18px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
.fg .sheet-title { font-family: var(--fg-hud); font-size: 13px; letter-spacing: 0.16em; margin-bottom: 14px; display: flex; justify-content: space-between; }
.fg .search { width: 100%; background: var(--fg-bg3); border: 1px solid var(--fg-border); border-radius: 10px; padding: 12px; font-size: 16px; margin-bottom: 10px; outline: none; }
.fg .search:focus { border-color: #555; }
.fg .chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; scrollbar-width: none; }
.fg .chips button { flex-shrink: 0; font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--fg-border); color: #999; }
.fg .chips button.active { background: #fff; color: #000; border-color: #fff; }
.fg .pick { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--fg-border); text-align: left; }
.fg .pick b { font-family: var(--fg-ui); font-weight: 600; font-size: 15px; display: block; }
.fg .pick span { font-size: 11px; color: var(--fg-muted); }
.fg .field { margin-bottom: 14px; }
.fg .field label { display: block; font-family: var(--fg-hud); font-size: 9px; letter-spacing: 0.18em; color: var(--fg-muted); margin-bottom: 6px; }
.fg .field input { width: 100%; background: var(--fg-bg3); border: 1px solid var(--fg-border); border-radius: 10px; padding: 12px; font-size: 16px; outline: none; }

.fg .sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.fg .sum-grid div { background: var(--fg-bg2); border-radius: 10px; padding: 10px; text-align: center; }
.fg .sum-grid b { display: block; font-size: 20px; }
.fg .sum-grid span { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.14em; color: var(--fg-muted); }
.fg .xp-big { font-family: var(--fg-hud); font-size: 26px; font-weight: 900; color: var(--fg-xp); text-align: center; margin: 6px 0 2px; }
.fg .beltup { background: #1a1408; border: 1px solid #3d2e10; border-radius: 12px; padding: 12px; margin-top: 10px; font-family: var(--fg-ui); font-size: 14px; }
.fg .empty { text-align: center; color: var(--fg-muted); padding: 30px 10px; font-size: 13px; line-height: 1.6; }

/* recovery */
.fg .pills { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.fg .pills button { padding: 10px 0; border-radius: 9px; background: var(--fg-bg3); color: #aaa; font-size: 13px; }
.fg .pills button.active { background: #fff; color: #000; }
.fg .sleep-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 84px; margin: 16px 0 10px; }
.fg .sleep-bars div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.fg .sleep-bars i { width: 100%; max-width: 22px; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.fg .sleep-bars span { font-size: 10px; color: #555; }
.fg .water { display: grid; grid-template-columns: 48px 1fr 48px; gap: 14px; align-items: center; }
.fg .water > button { height: 48px; border-radius: 12px; background: var(--fg-bg3); font-size: 22px; color: #ddd; }
.fg .water-n { font-family: var(--fg-hud); font-size: 22px; font-weight: 700; text-align: center; }
.fg .water-n span { font-family: var(--fg-mono); font-size: 12px; color: var(--fg-muted); font-weight: 400; }
.fg .bw-now { font-family: var(--fg-hud); font-size: 24px; font-weight: 700; }
.fg .bw-chart { width: 100%; height: 90px; display: block; margin: 12px 0; }
.fg .bw-log { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.fg .bw-log input { background: var(--fg-bg3); border: 1px solid var(--fg-border); border-radius: 10px; padding: 12px; font-size: 16px; outline: none; min-width: 0; }
.fg .bw-log .btn { width: auto; padding: 12px 20px; }

/* 2.0 week 2: your templates, lift progress, editing, plates, custom exercises */
.fg .tpl-wrap { position: relative; }
.fg .tpl-wrap .tpl { width: 100%; height: 100%; padding-right: 30px; }
.fg .tpl-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; color: #555; font-size: 16px; }
.fg .ex-title { text-align: left; padding: 0; min-width: 0; }
.fg .ex-more { color: #555; font-weight: 400; }
.fg .ex-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fg .ex-plates { font-size: 11px; letter-spacing: 0.06em; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--fg-border); color: #999; }
.fg .rank-row[data-lift] { cursor: pointer; }
.fg .hist-lift { color: #ddd; text-decoration: none; border-bottom: 1px dotted #555; }
.fg .hist-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fg .hist-actions button { font-size: 12px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--fg-border); color: #bbb; }
.fg .hist-actions button.del { border-color: #3a1414; color: #ff6b6b; margin-left: auto; }
.fg .lift-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--fg-border); text-align: left; }
.fg .lift-item:last-child { border-bottom: none; }
.fg .lift-item b { font-family: var(--fg-ui); font-weight: 600; font-size: 15px; display: block; }
.fg .lift-item span { font-size: 11px; color: var(--fg-muted); }
.fg .spark { width: 70px; height: 26px; flex-shrink: 0; }
.fg .lift-card { padding-bottom: 10px; }
.fg .lift-chart { width: 100%; height: 120px; display: block; margin: 10px 0 4px; }
.fg .lift-axis { display: flex; justify-content: space-between; font-size: 10px; color: #555; }
.fg .lift-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--fg-border); font-size: 13px; }
.fg .lift-row:last-child { border-bottom: none; }
.fg .lift-row button { font-size: 12px; }
.fg .chips.wrap { flex-wrap: wrap; overflow: visible; }
.fg .plate-bar { display: flex; align-items: center; gap: 3px; min-height: 110px; margin: 10px 0; }
.fg .plate-bar i { width: 14px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,0.5) inset; }
.fg .plate-bar b { flex: 1; height: 8px; background: #888; border-radius: 0 4px 4px 0; max-width: 140px; }
.fg .plate-list { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.fg .plate-list span { background: var(--fg-bg3); border-radius: 8px; padding: 6px 10px; }

/* friends: ranks list + you vs them */
.fg .c-good { color: var(--fg-good); }
.fg .fr-row { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 10px; align-items: center; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--fg-border); text-align: left; }
.fg .fr-row:last-child { border-bottom: none; }
.fg .fr-row.me { grid-template-columns: 22px 1fr auto; }
.fg .fr-row.me .fr-name { color: var(--fg-xp); }
.fg .fr-n { font-size: 12px; color: var(--fg-muted); }
.fg .fr-name { font-family: var(--fg-ui); font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg .fr-name span { display: block; font-family: var(--fg-mono); font-weight: 400; font-size: 11px; color: var(--fg-muted); margin-top: 2px; }
.fg .cmp-maps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.fg .cmp-maps figure { margin: 0; text-align: center; min-width: 0; }
.fg .cmp-maps .bodymap { max-width: 150px; }
.fg .cmp-maps figcaption { font-family: var(--fg-hud); font-size: 7px; letter-spacing: 0.18em; color: #555; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg .cmp-row { display: grid; grid-template-columns: 1fr 96px 16px 96px; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--fg-border); font-size: 13px; }
.fg .cmp-row:last-child { border-bottom: none; }
.fg .cmp-row .belt { justify-content: center; padding: 4px 6px; font-size: 8px; }
.fg .cmp-row > span:not(.belt) { text-align: center; }
.fg .cmp-head { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.14em; color: var(--fg-muted); padding: 10px 0 6px; }
.fg .cmp-head span { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg .cmp-m { font-family: var(--fg-ui); font-weight: 600; }

/* exercise sheet: muscles worked */
.fg .ex-map { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; align-items: center; background: var(--fg-bg1); border: 1px solid var(--fg-border); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.fg .ex-map-svgs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.fg .ex-map-svgs > div { text-align: center; }
.fg .ex-map-svgs span { font-family: var(--fg-hud); font-size: 7px; letter-spacing: 0.18em; color: #555; }
.fg .ex-map .bodymap { max-width: 100%; max-height: 190px; pointer-events: none; }
.fg .ex-map .bodymap .muscle { cursor: default; }
.fg .ex-map-key { display: flex; flex-direction: column; gap: 12px; }
.fg .ex-map-key > div { display: flex; gap: 8px; align-items: flex-start; }
.fg .ex-map-key i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; margin-top: 3px; }
.fg .ex-map-key span { display: flex; flex-direction: column; font-size: 12px; color: #bbb; line-height: 1.35; }
.fg .ex-map-key b { font-family: var(--fg-hud); font-size: 8px; letter-spacing: 0.16em; color: #777; font-weight: 700; margin-bottom: 2px; text-transform: uppercase; }
.fg .ex-ask { width: 100%; margin-bottom: 14px; color: #b8b0ff; border-color: #3a3470; }
