@font-face { font-family: 'Grotesk'; src: url(fonts/grotesk.woff2) format('woff2'); font-weight: 300 700; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: 'Grotesk'; src: url(fonts/grotesk-ext.woff2) format('woff2'); font-weight: 300 700; unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: 'Mono'; src: url(fonts/mono.woff2) format('woff2'); font-weight: 400 800; }
@font-face { font-family: 'Naskh'; src: url(fonts/naskh.ttf) format('truetype'); font-weight: 400 700; }

:root {
  --bg: #0c0f14; --bg2: #11151b; --card: #151a21; --card2: #1c222b; --line: #222932; --line2: #2c343f;
  --text: #eef2f6; --dim: #a3adba; --mute: #6c7684;
  --mint: #5eead4; --mint2: #2dd4bf; --peach: #fbbf77; --lilac: #b4a0fb; --blue: #6fb1fc; --red: #f87171; --green: #86efac;
  --r: 20px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Grotesk', system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body { -webkit-user-select: none; user-select: none; }
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; }
a { color: var(--mint); }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.screen { padding: 18px 18px calc(100px + var(--safe-b)); animation: in .25s ease; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.glow { display: none; }

/* type */
.title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.big2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.h2 { font-size: 12px; font-weight: 600; color: var(--mute); text-transform: uppercase; letter-spacing: .1em; }
.hint { font-size: 13px; color: var(--mute); }
.dim { color: var(--dim); } .mute { color: var(--mute); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: 'Mono', monospace; font-variant-numeric: tabular-nums; }
.mint { color: var(--mint); } .peach { color: var(--peach); } .lilac { color: var(--lilac); } .blue { color: var(--blue); } .red { color: var(--red); } .green { color: var(--green); }
.up { color: var(--green); } .down { color: var(--red); }

/* layout */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.sect { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 2px 10px; }
.sect button { background: none; border: 0; color: var(--mint); font-size: 13px; padding: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* header */
.top { display: flex; align-items: center; gap: 12px; margin: 2px 0 18px; }
.logo { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, var(--mint2), var(--lilac)); color: #0c0f14; font-family: 'Naskh'; font-size: 20px; font-weight: 700; padding-bottom: 6px; flex: none; }
.iconbtn { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--card); border: 0; font-size: 18px; color: var(--dim); }
.iconbtn:active { transform: scale(.94); }
.back { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

/* cards */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.accent { background: linear-gradient(160deg, rgba(94, 234, 212, .10), var(--card) 55%); }
.card.warm { background: linear-gradient(160deg, rgba(251, 191, 119, .10), var(--card) 55%); }
.card.violet { background: linear-gradient(160deg, rgba(180, 160, 251, .10), var(--card) 55%); }
.card.ss, .ex.ss { box-shadow: inset 3px 0 0 var(--peach); }
.row-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 0; border-radius: var(--r); padding: 14px 16px; margin: 12px 0; }
.row-card.accent { background: linear-gradient(160deg, rgba(94, 234, 212, .12), var(--card) 60%); }
.row-card.violet { background: linear-gradient(160deg, rgba(180, 160, 251, .12), var(--card) 60%); }
.row-card:active, .day:active, .ex:active, .logrow:active { transform: scale(.99); }
.linkrow { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); margin-top: 14px; padding: 12px 0 0; color: var(--dim); }
.next { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border-radius: 16px; background: var(--card2); }
.mname { font-weight: 600; font-size: 15.5px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; background: var(--card); border: 0; border-radius: var(--r); padding: 14px 6px; margin-bottom: 12px; text-align: center; }
.stats .sv { font-weight: 700; font-size: 17px; }
.score { font-size: 34px; font-weight: 700; text-align: center; min-width: 76px; }

/* lists */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; }
.day, .ex, .logrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
.list > :last-child { border-bottom: 0; }
.day .dname { width: 40px; font-weight: 700; color: var(--mute); text-transform: uppercase; font-size: 13px; letter-spacing: .05em; }
.day .dfocus { font-weight: 600; font-size: 16px; }
.day.today { background: rgba(94, 234, 212, .07); }
.day.today .dname { color: var(--mint); }
.exname { font-weight: 600; }
.meal { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.meal.ate { opacity: .55; }
.mealmain { background: none; border: 0; text-align: left; padding: 0; }
.slot { font-size: 11.5px; font-weight: 600; color: var(--mint); text-transform: uppercase; letter-spacing: .08em; }
.x { background: none; border: 0; color: var(--mute); width: 34px; height: 34px; border-radius: 10px; }
.plate-item { background: var(--card2); border-radius: 16px; padding: 12px; margin-bottom: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
.item .em { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--card2); overflow: hidden; }
.item .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 12.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; background: none; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.check .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line2); display: grid; place-items: center; flex: none; font-size: 13px; }
.check.on .box { background: var(--mint); border-color: var(--mint); color: #06221d; }
.check.on .lbl { color: var(--mute); text-decoration: line-through; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--card2); padding: 12px 16px; border-radius: 14px; font-weight: 600; transition: transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--mint); color: #06221d; }
.btn.danger { color: var(--red); background: rgba(248, 113, 113, .1); }
.btn.ghost { background: transparent; color: var(--dim); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn[disabled] { opacity: .4; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* inputs */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--dim); margin: 0 0 6px 2px; }
.input { width: 100%; background: var(--bg2); border: 1px solid var(--line2); border-radius: 13px; padding: 12px 14px; outline: none; font-size: 16px; }
.input:focus { border-color: var(--mint); }
textarea.input { resize: vertical; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; white-space: nowrap; }
.chip.on { background: rgba(94, 234, 212, .14); border-color: var(--mint); color: var(--mint); }
.seg { display: flex; padding: 4px; border-radius: 14px; background: var(--card); gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 8px; border-radius: 11px; font-size: 13px; color: var(--mute); font-weight: 600; white-space: nowrap; }
.seg button.on { background: var(--card2); color: var(--text); }
.switch { width: 48px; height: 28px; border-radius: 99px; background: var(--line2); border: 0; position: relative; flex: none; padding: 0; transition: background .2s; }
.switch::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .2s; }
.switch.on { background: var(--mint2); } .switch.on::after { transform: translateX(20px); }

/* progress */
.bar { height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 9px; background: var(--mint); transition: width .5s; }
.bar.warm > i { background: var(--peach); } .bar.hot > i { background: var(--red); } .bar.ok > i { background: var(--green); } .bar.lilac > i { background: var(--lilac); } .bar.blue > i { background: var(--blue); }

/* exercises */
.exphoto { position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden; background: #fff; }
.exphoto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .5s ease; }
.exthumb { width: 56px; height: 40px; border-radius: 9px; overflow: hidden; background: #fff; flex: none; position: relative; }
.exthumb img { width: 100%; height: 100%; object-fit: cover; }
.figbox { border-radius: 16px; background: var(--bg2); display: grid; place-items: center; }
.fig .fb { stroke: #e8edf3; stroke-width: 5; stroke-linecap: round; fill: none; } .fig .far .fb { stroke: #5b6574; }
.fig .ffloor { stroke: var(--line2); stroke-width: 2; } .fig .fp { fill: #3a4351; } .fig .fl { stroke: #3a4351; stroke-width: 3; } .fig .fpl { stroke: #6b7686; stroke-width: 5; stroke-linecap: round; }
.fig .fdb rect, .fig .fdb { fill: var(--peach); } .fig .fcable { stroke: var(--blue); stroke-width: 1.5; } .fig .fdbc { fill: var(--blue); } .fig .fpad { fill: #8b6a4a; } .fig .fplate { fill: none; stroke: #6b7686; stroke-width: 3; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--card2); color: var(--dim); }
.tag.mint { color: var(--mint); background: rgba(94, 234, 212, .12); } .tag.peach { color: var(--peach); background: rgba(251, 191, 119, .12); } .tag.lilac { color: var(--lilac); background: rgba(180, 160, 251, .12); } .tag.red { color: var(--red); background: rgba(248, 113, 113, .12); }

/* session */
.setrow { display: grid; grid-template-columns: 26px 1fr 1fr 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.setrow .n { color: var(--mute); font-weight: 600; text-align: center; }
.setrow input { text-align: center; padding: 10px 6px; }
.setrow .done { width: 44px; height: 44px; border-radius: 13px; border: 2px solid var(--line2); background: none; font-size: 17px; color: var(--mute); }
.setrow .done.on { background: var(--mint); border-color: var(--mint); color: #06221d; }
.rest { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); z-index: 30; width: min(520px, calc(100% - 24px)); background: var(--card2); border-radius: 20px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
.rest .t { font-family: 'Mono'; font-size: 28px; font-weight: 700; color: var(--mint); min-width: 50px; }

/* nav */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); z-index: 20; width: min(420px, calc(100% - 28px)); height: 64px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; border-radius: 22px; background: rgba(22, 27, 34, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.nav button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--mute); font-size: 11px; font-weight: 600; padding: 6px 0; }
.nav button.on { color: var(--mint); }

/* sheet */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--bg2); border-radius: 24px 24px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(30%); opacity: 0; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line2); margin: 2px auto 14px; }
.sheet h3 { margin: 0 0 14px; font-size: 19px; }
.toast { position: fixed; z-index: 90; left: 50%; top: 14px; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); padding: 13px 16px; border-radius: 16px; background: var(--card2); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); font-weight: 600; display: flex; gap: 10px; align-items: center; animation: drop .3s; }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
.empty { text-align: center; padding: 24px 10px; color: var(--mute); }
.empty .e { font-size: 32px; display: block; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--dim); } .kv > :nth-child(even) { font-weight: 600; text-align: right; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat3 > div { background: var(--card); border-radius: 16px; padding: 12px; }
.stat3 .l { font-size: 11.5px; color: var(--mute); } .stat3 .v { font-weight: 700; font-size: 17px; margin-top: 2px; } .stat3 .d { font-size: 11px; color: var(--mute); }
.chart { width: 100%; display: block; touch-action: pan-y; }
.chart-tip { font-size: 12px; color: var(--dim); min-height: 18px; }
ol.steps { padding-left: 20px; margin: 6px 0; } ol.steps li { margin-bottom: 6px; }
ul.plain { padding-left: 18px; margin: 6px 0; } ul.plain li { margin-bottom: 4px; }
details summary { cursor: pointer; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line2); border-top-color: var(--mint); border-radius: 50%; animation: spin .8s linear infinite; margin: 12px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
