* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  :root {
    --bg: #0a0a0a;
    --bg-elev: #141414;
    --bg-elev-2: #1c1c1c;
    --bg-elev-3: #242424;
    --border: #262626;
    --border-strong: #383838;
    --text: #f5f5f5;
    --text-dim: #9a9a9a;
    --text-muted: #5a5a5a;
    --accent: #d4ff3a;
    --accent-dark: #a8cc2e;
    --accent-glow: rgba(212, 255, 58, 0.15);
    --danger: #ff4d4d;
    --success: #3aff8a;
    --warning: #ffb83a;
    --muscle-fresh: #3aff8a;
    --muscle-moderate: #ffb83a;
    --muscle-fatigued: #ff6b3a;
    --muscle-exhausted: #ff3a3a;
    --font-display: 'Archivo Black', sans-serif;
    --font-body: 'Inter Tight', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
  }

  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    overscroll-behavior: none;
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    background:
      radial-gradient(ellipse at top, rgba(212, 255, 58, 0.04), transparent 50%),
      var(--bg);
  }

  #app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  @media (max-width: 520px) {
    #app { border-left: none; border-right: none; }
  }

  /* ============== TYPOGRAPHY ============== */
  .display { font-family: var(--font-display); letter-spacing: -0.02em; text-transform: uppercase; }
  .mono { font-family: var(--font-mono); }
  .eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
  }

  /* ============== LAYOUT ============== */
  .screen {
    flex: 1;
    padding: 20px 20px 100px;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
  }

  .logo {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .logo-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    position: relative;
    transform: rotate(45deg);
  }
  .logo-mark::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: var(--bg);
  }

  /* ============== BOTTOM NAV ============== */
  .nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
  }

  .nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .nav-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
  }

  .nav-btn.active {
    color: var(--accent);
  }

  .nav-btn:active {
    transform: scale(0.92);
  }

  /* ============== CARDS ============== */
  .card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
  }

  .card-hero {
    background: linear-gradient(135deg, var(--bg-elev-2), var(--bg-elev));
    border: 1px solid var(--border-strong);
    position: relative;
    overflow: hidden;
  }

  .card-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
  }

  /* ============== BUTTONS ============== */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .btn-primary {
    background: var(--accent);
    color: #0a0a0a;
  }

  .btn-primary:active { transform: scale(0.97); background: var(--accent-dark); }

  .btn-secondary {
    background: var(--bg-elev-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
  }

  .btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
  }

  .btn-block { width: 100%; }
  .btn-lg { padding: 18px 24px; font-size: 16px; }
  .btn-sm { padding: 10px 14px; font-size: 13px; }
  .btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 0;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    color: var(--text);
  }

  /* ============== FORMS ============== */
  input, select, textarea {
    width: 100%;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
  }

  input:focus, select:focus, textarea:focus { border-color: var(--accent); }

  input[type="number"] {
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: center;
    font-size: 24px;
  }

  label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
  }

  /* ============== MUSCLE HEATMAP ============== */
  .muscle-map {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    gap: 20px;
  }

  .muscle-body {
    width: 130px;
    height: 260px;
    position: relative;
  }

  .muscle-body svg {
    width: 100%;
    height: 100%;
  }

  .muscle-part {
    fill: var(--bg-elev-3);
    stroke: var(--border-strong);
    stroke-width: 1;
    transition: fill 0.3s;
    cursor: pointer;
  }

  .muscle-part.fresh { fill: var(--muscle-fresh); opacity: 0.85; }
  .muscle-part.moderate { fill: var(--muscle-moderate); opacity: 0.75; }
  .muscle-part.fatigued { fill: var(--muscle-fatigued); opacity: 0.8; }
  .muscle-part.exhausted { fill: var(--muscle-exhausted); opacity: 0.9; }

  .muscle-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim);
  }

  .legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
  }

  /* ============== EXERCISE LIST ============== */
  .exercise-item {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .exercise-item:active { transform: scale(0.99); border-color: var(--border-strong); }

  .exercise-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-elev-2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 14px;
  }

  .exercise-info { flex: 1; min-width: 0; }

  .exercise-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .exercise-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    gap: 10px;
  }

  .exercise-meta .done { color: var(--accent); }

  /* ============== SET ROW ============== */
  .set-row {
    display: grid;
    grid-template-columns: 30px 1fr 1fr 44px;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }

  .set-row:last-child { border-bottom: none; }

  .set-num {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-dim);
    font-size: 14px;
  }

  .set-input {
    padding: 10px;
    font-size: 15px;
    text-align: center;
  }

  .set-check {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
  }

  .set-check.checked {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
  }

  .set-check:active { transform: scale(0.9); }

  /* ============== STATS ============== */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
  }

  .stat {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }

  .stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--accent);
    line-height: 1;
  }

  .stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 6px;
  }

  /* ============== CHART ============== */
  .chart {
    width: 100%;
    height: 180px;
    margin-top: 12px;
  }

  .chart-bar {
    fill: var(--bg-elev-3);
    transition: fill 0.2s;
  }

  .chart-bar.active { fill: var(--accent); }

  /* ============== TIMER MODAL ============== */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
  }

  .modal-backdrop.open { display: flex; }

  .modal {
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-title {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 16px;
  }

  .timer-display {
    font-family: var(--font-display);
    font-size: 72px;
    text-align: center;
    color: var(--accent);
    padding: 24px 0;
    letter-spacing: -0.02em;
  }

  .timer-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-elev-3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
  }

  .timer-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.2s linear;
  }

  /* ============== PILLS / TAGS ============== */
  .pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-dim);
    gap: 6px;
  }

  .pill.active {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
  }

  .pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  /* ============== TODAY BANNER ============== */
  .today-banner {
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-elev-2), var(--bg-elev));
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
  }

  .today-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    pointer-events: none;
  }

  .today-title {
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1;
    margin: 8px 0 4px;
  }

  .today-sub {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* ============== SECTION ============== */
  .section-title {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 0.02em;
    margin: 24px 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .section-title .count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
  }

  /* ============== EMPTY STATE ============== */
  .empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
  }

  .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
  }

  .hidden { display: none !important; }

  /* ============== TOAST ============== */
  .toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: var(--accent);
    color: #0a0a0a;
    padding: 12px 20px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
    z-index: 2000;
    transition: transform 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  }

  .toast.show { transform: translateX(-50%) translateY(0); }

  /* ============== ONBOARDING ============== */
  .onboard {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    justify-content: center;
  }

  .onboard-step { animation: fadeIn 0.3s; }

  .onboard-title {
    font-family: var(--font-display);
    font-size: 36px;
    line-height: 1;
    margin-bottom: 12px;
  }

  .onboard-sub {
    color: var(--text-dim);
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.4;
  }

  .option-btn {
    width: 100%;
    padding: 20px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .option-btn:active { transform: scale(0.98); }
  .option-btn.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
  }

  .option-icon {
    font-size: 24px;
  }

  .option-desc {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 2px;
  }

  /* ============== WORKOUT PROGRESS ============== */
  .progress-bar {
    height: 4px;
    background: var(--bg-elev-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
  }

  .progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
  }

  /* ============== SCROLL X ============== */
  .scroll-x {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin: 0 -20px 16px;
    padding-left: 20px;
    padding-right: 20px;
    scrollbar-width: none;
  }
  .scroll-x::-webkit-scrollbar { display: none; }

  /* tap-feedback */
  button { font-family: var(--font-body); }