:root {
  --bg: #0b0e13;
  --bg2: #090c10;
  --surf: #151a22;
  --surf2: #11151c;
  --line: rgba(255, 255, 255, 0.07);
  --line2: rgba(255, 255, 255, 0.12);
  --tx: #eef1f5;
  --muted: #9aa3af;
  --dim: #79828f;
  --accent: #c7f24a;
  --accent-ink: #1b2900;
  --accent-dim: #7d9a2e;
  --warn: #f5a623;
  --danger: #ff6b5e;
  --r: 16px;
  --r-lg: 20px;
  --maxw: 480px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--tx); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
#app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; position: relative; }
.view { padding: calc(env(safe-area-inset-top) + 14px) 16px 96px; }
button { font-family: inherit; cursor: pointer; }
.kick { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* cards */
.card { background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card.tight { padding: 13px 16px; }

/* buttons */
.btn { border: 1px solid var(--line2); background: var(--surf); color: var(--tx); border-radius: 14px; height: 48px; padding: 0 16px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.98); }
.btn.go { background: var(--accent); color: var(--accent-ink); border: none; font-weight: 600; width: 100%; height: 54px; font-size: 17px; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 40px; font-size: 14px; border-radius: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--surf); border: 1px solid var(--line); color: var(--tx); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.icon-btn:active { transform: scale(0.94); }

/* pills + dots */
.pill { font-size: 11px; color: #cbd2db; background: #222a35; border-radius: 8px; padding: 4px 9px; }
.pill.accent { color: #dff7a6; background: rgba(199, 242, 74, 0.12); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #2a323d; }
.dot.on { background: var(--accent); }

/* banner */
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.banner.accent { background: rgba(199, 242, 74, 0.1); border: 1px solid rgba(199, 242, 74, 0.25); color: #d6e6b4; }
.banner.warn { background: rgba(245, 166, 35, 0.1); border: 1px solid rgba(245, 166, 35, 0.28); color: #f3d39a; }
.banner i { font-size: 18px; margin-top: 1px; }

/* headings */
h1.title { font-size: 24px; font-weight: 600; margin: 0; }
h2.title { font-size: 19px; font-weight: 600; margin: 0; }
.big-num { font-size: 30px; font-weight: 600; letter-spacing: 0.01em; }

/* up-next preview list */
.ex-line { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ex-line:first-child { border-top: none; }
.ex-line .w { color: var(--muted); font-size: 13px; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; max-width: var(--maxw); margin: 0 auto; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(11, 14, 19, 0.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-around; z-index: 40; }
.tabbar button { background: none; border: none; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; }
.tabbar button i { font-size: 23px; }
.tabbar button.on { color: var(--accent); }

/* workout */
.wk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wk-dots { display: flex; gap: 5px; margin: 6px 0 16px; }
.wk-dots span { flex: 1; height: 4px; border-radius: 2px; background: #2a323d; }
.wk-dots span.done { background: var(--accent); }
.wk-dots span.cur { background: var(--accent-dim); }

.ex-card .mv { font-size: 23px; font-weight: 600; }
select.variant { appearance: none; background: var(--surf2); color: var(--tx); border: 1px solid var(--line2); border-radius: 12px; padding: 9px 30px 9px 12px; font-size: 14px; max-width: 62%; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa3af' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; }

.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .val { text-align: center; min-width: 92px; }
.stepper .val .n { font-size: 30px; font-weight: 600; }
.stepper .val .u { font-size: 13px; color: var(--dim); }
.stepper button { width: 46px; height: 46px; border-radius: 13px; background: var(--surf2); border: 1px solid var(--line2); color: var(--tx); font-size: 22px; }
.stepper button:active { transform: scale(0.93); }

.setrow { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surf2); border: 1px solid var(--line); margin-top: 9px; }
.setrow.done { background: rgba(199, 242, 74, 0.1); border-color: rgba(199, 242, 74, 0.32); }
.setrow .sn { width: 26px; height: 26px; border-radius: 8px; background: #222a35; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.setrow.done .sn { background: var(--accent); color: var(--accent-ink); }
.setrow .mini { width: 56px; text-align: center; background: transparent; border: none; color: var(--tx); font-size: 16px; font-weight: 500; -moz-appearance: textfield; }
.setrow .mini::-webkit-outer-spin-button, .setrow .mini::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.setrow .x { color: var(--dim); font-size: 13px; }
.logcircle { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line2); background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.setrow.done .logcircle { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

/* rest bar + timer */
.restbar { position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); max-width: calc(var(--maxw) - 24px); margin: 0 auto; background: var(--surf); border: 1px solid rgba(199, 242, 74, 0.3); border-radius: 18px; padding: 11px 14px; display: flex; align-items: center; gap: 12px; z-index: 45; }
.ring-wrap { position: relative; flex: none; }
.ring-bg { stroke: #2a323d; }
.ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.95s linear, stroke 0.3s; }

.overlay { position: fixed; inset: 0; background: rgba(6, 8, 11, 0.78); backdrop-filter: blur(6px); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet { width: 100%; max-width: 420px; background: var(--surf); border: 1px solid var(--line); border-radius: 24px; padding: 22px; }
.preset { flex: 1; height: 44px; border-radius: 13px; background: var(--surf2); border: 1px solid var(--line2); color: #cbd2db; font-size: 15px; }
.preset.sel { background: rgba(199, 242, 74, 0.14); border-color: var(--accent); color: #dff7a6; }
.round-btn { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: none; font-size: 26px; display: flex; align-items: center; justify-content: center; }

/* progress */
.seg { display: flex; gap: 4px; background: var(--surf2); border-radius: 13px; padding: 4px; margin-bottom: 16px; overflow-x: auto; }
.seg button { flex: 1; min-width: 64px; height: 36px; border-radius: 10px; background: transparent; border: none; color: var(--dim); font-size: 13px; white-space: nowrap; }
.seg button.sel { background: #222a35; color: var(--tx); }
.metric { background: var(--surf2); border-radius: 13px; padding: 10px 11px; flex: 1; }
.metric .l { font-size: 11px; color: var(--dim); }
.metric .v { font-size: 17px; font-weight: 600; }
.cstrip { display: flex; gap: 5px; align-items: flex-end; height: 44px; }
.cstrip span { flex: 1; border-radius: 3px; background: #222a35; min-height: 4px; }
.cstrip span.on { background: var(--accent); }

/* login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; }
.mark { width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; }
input.field { width: 100%; height: 50px; background: var(--surf2); border: 1px solid var(--line2); border-radius: 13px; color: var(--tx); font-size: 16px; padding: 0 14px; }
input.field:focus { outline: none; border-color: var(--accent); }

/* history */
.hist { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); }
.hist:first-child { border-top: none; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 7px; background: #222a35; color: #cbd2db; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--surf); border: 1px solid var(--line2); color: var(--tx); padding: 11px 16px; border-radius: 13px; font-size: 14px; z-index: 80; max-width: 90%; text-align: center; }

.fade-in { animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pop { animation: pop 0.22s ease; }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
