/* ============================================
   PUPGRADE - Dog Training App
   Design System v0.2, Sage + Terracotta
   Selected 2026-05-27. Light-mode tokens in memory
   for the marketing site.
   ============================================ */

:root {
  /* Deep forest surfaces, app is dark by default. */
  --bg:           #14201B;
  --surface:      #1C2D26;
  --surface2:     #243B32;
  --surface3:     #2D4A3E;

  /* Sage primary, slightly lifted for legibility on the dark bg. */
  --accent:       #6FA48C;
  --accent-dim:   #4F806A;
  --accent-glow:  rgba(111,164,140,0.18);
  --accent-muted: rgba(111,164,140,0.08);
  --accent-tint:  rgba(111,164,140,0.12);

  /* Terracotta, the warm CTA / focus color. Used sparingly. */
  --cta:          #E07856;
  --cta-dim:      #B85F40;
  --cta-glow:     rgba(224,120,86,0.20);

  /* Honey-sand secondary, tags, chips, soft highlights. */
  --secondary:    #D9B382;
  --secondary-bg: rgba(217,179,130,0.10);

  --success:      #5A9171;
  --success-bg:   rgba(90,145,113,0.12);
  --warning:      #D9933D;
  --warning-bg:   rgba(217,147,61,0.12);
  --danger:       #C25A4F;
  --danger-bg:    rgba(194,90,79,0.12);
  --gold:         #D4A24B;
  --gold-bg:      rgba(212,162,75,0.12);

  --text:         #EEEAE0;
  --muted:        #8FA095;
  --border:       #2D4035;
  --border-light: rgba(238,234,224,0.06);

  --nav-h:        68px;
  --header-h:     58px;
  --oye-bar-h:    36px;
  --r:            16px;
  --r-sm:         10px;
  --r-lg:         24px;
  --r-full:       9999px;

  --shadow:       0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:    0 8px 48px rgba(0,0,0,0.55);
  --shadow-accent:0 4px 24px rgba(111,164,140,0.30);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- Typography --- */
h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; }
h4 { font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.mono { font-family: 'DM Mono', 'Courier New', monospace; }
.label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.text-muted  { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.text-danger { color: var(--danger); }
.text-gold   { color: var(--gold); }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }

/* --- Layout --- */
.page-wrap {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}
.screen {
  padding: calc(var(--header-h) + var(--oye-bar-h)) 0 calc(var(--nav-h) + 16px);
  min-height: 100dvh;
}

/* --- OYE Brand Bar (umbrella, present on every sub-brand page) --- */
.oye-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 102;
  height: var(--oye-bar-h);
  background: #090806;
  border-bottom: 1px solid rgba(201,168,76,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.oye-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: rgba(255,255,255,0.82);
  font-family: 'Fraunces', 'Playfair Display', serif;
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 150ms;
}
.oye-brand em { font-style: normal; color: #C9A84C; transition: color 150ms; }
.oye-brand svg ellipse, .oye-brand svg circle, .oye-brand svg line { stroke: rgba(255,255,255,0.65); transition: stroke 150ms; }
.oye-brand:hover { color: #C9A84C; }
.oye-brand:hover em { color: rgba(255,255,255,0.82); }
.oye-brand:hover svg ellipse, .oye-brand:hover svg circle, .oye-brand:hover svg line { stroke: #C9A84C; }
.oye-net-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.oye-net-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.oye-net-link svg { opacity: 0.65; transition: opacity 0.15s; flex-shrink: 0; }
.oye-net-link:hover { color: #C9A84C; }
.oye-net-link:hover svg { opacity: 1; }
@media (max-width: 700px) { .oye-net-links { display: none; } }
.screen-content {
  padding: 16px 16px 0;
}
.section { margin-bottom: 28px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header h3 { font-size: 0.9375rem; }

/* --- App Header --- */
.app-header {
  position: fixed;
  top: var(--oye-bar-h); left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(20,32,27,0.92);
}
.app-header .page-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.header-action {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.header-action:active { background: var(--surface3); }
.pg-header-avatar {
  background: transparent;
  text-decoration: none;
  padding: 0;
}
.pg-header-avatar:active { background: transparent; opacity: 0.7; }

/* --- Lesson panel (session modal) --- */
.lesson-panel {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lesson-cue {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
}
.lesson-cue-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.lesson-cue-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.lesson-dose {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: var(--r-sm);
}
.lesson-dose strong { color: var(--text); font-weight: 700; }
.lesson-section-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.lesson-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-chip {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text);
}
.lesson-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.5;
}
.lesson-list li { margin-bottom: 4px; }
.lesson-levels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: lvl;
}
.lesson-level {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  line-height: 1.4;
}
.lesson-level-current {
  background: var(--accent-tint);
  border-color: var(--accent);
}
.lesson-level-past { opacity: 0.55; }
.lesson-level-n {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface3);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}
.lesson-level-current .lesson-level-n {
  background: var(--accent);
  color: var(--bg);
}
.lesson-level-past .lesson-level-n { background: var(--accent-dim); color: var(--bg); }
.lesson-level-body { display: flex; flex-direction: column; gap: 2px; }
.lesson-level-label { font-weight: 700; color: var(--text); }
.lesson-level-crit { color: var(--muted); }
.lesson-failure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
}
.lesson-failure[open] { border-color: var(--secondary); background: var(--secondary-bg); }
.lesson-failure summary {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 600;
  list-style: none;
}
.lesson-failure summary::-webkit-details-marker { display: none; }
.lesson-failure summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  color: var(--muted);
  transition: transform 0.15s;
}
.lesson-failure[open] summary::before { transform: rotate(90deg); }
.lesson-failure-advice {
  padding: 0 12px 10px 24px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.lesson-steps {
  list-style: decimal;
  padding-left: 22px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
}
.lesson-step::marker { color: var(--accent); font-weight: 700; }
.lesson-tip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--secondary-bg);
  border-left: 3px solid var(--secondary);
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  line-height: 1.5;
}
.lesson-tip-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 700;
}
.lesson-tip-body { color: var(--text); }

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--nav-h);
  background: rgba(28,45,38,0.95);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  flex: 1;
  transition: all 0.15s;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
}
.nav-item svg { width: 22px; height: 22px; transition: all 0.15s; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { filter: drop-shadow(0 0 6px var(--accent)); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}
.nav-dot {
  position: absolute;
  top: 6px; right: calc(50% - 16px);
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  transition: border-color 0.15s;
}
.card:active { border-color: var(--accent); }
.card-sm { padding: 12px; border-radius: var(--r-sm); }
.card-accent {
  background: var(--accent-muted);
  border-color: rgba(111,164,140,0.25);
}
.card-success { background: var(--success-bg); border-color: rgba(90,145,113,0.2); }
.card-warning { background: var(--warning-bg); border-color: rgba(217,147,61,0.2); }
.card-danger  { background: var(--danger-bg);  border-color: rgba(194,90,79,0.2); }
.card-gold    { background: var(--gold-bg);    border-color: rgba(212,162,75,0.2); }
.card-row {
  display: flex; gap: 8px;
}
.card-row .card { flex: 1; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.15s;
  min-height: 48px;
  cursor: pointer;
  width: 100%;
}
.btn-primary {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 4px 24px var(--cta-glow);
}
.btn-primary:active { background: var(--cta-dim); transform: scale(0.98); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--surface3); transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(111,164,140,0.35);
}
.btn-ghost:active { background: var(--accent-muted); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(245,101,101,0.2);
}

/* Hover affordances. Gated on (hover: hover) so touch devices don't keep
 * the hover state stuck after a tap. */
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); }
  .btn-primary:hover {
    background: var(--cta-dim, var(--cta));
    box-shadow: 0 6px 28px var(--cta-glow);
    filter: brightness(1.05);
  }
  .btn-secondary:hover { background: var(--surface3); border-color: var(--accent); }
  .btn-ghost:hover { background: var(--accent-muted); border-color: var(--accent); }
  .btn-danger:hover { background: rgba(245,101,101,0.16); border-color: var(--danger); }
  .chip:hover { border-color: var(--accent); color: var(--text); background: var(--surface3); }
  .header-action:hover { background: var(--surface3); transform: scale(1.06); }
  .nav-item:hover { color: var(--text); }
  .nav-item:hover svg { transform: translateY(-2px); }
}
.btn-sm {
  padding: 8px 14px;
  font-size: 0.8125rem;
  min-height: 36px;
  border-radius: var(--r-sm);
}
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--r-full);
  min-height: unset;
  width: unset;
}
.btn-inline {
  width: auto;
  display: inline-flex;
}

/* --- Badge / Chips --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-accent  { background: var(--accent-muted);  color: var(--accent); }
.badge-success { background: var(--success-bg);    color: var(--success); }
.badge-warning { background: var(--warning-bg);    color: var(--warning); }
.badge-danger  { background: var(--danger-bg);     color: var(--danger); }
.badge-gold    { background: var(--gold-bg);       color: var(--gold); }
.badge-muted   { background: var(--surface2);      color: var(--muted); }

/* --- Mastery Dots (5-level system) --- */
.mastery {
  display: flex; gap: 4px; align-items: center;
}
.mastery-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface3);
  transition: background 0.2s;
}
.mastery-dot.filled { background: var(--accent); }
.mastery-dot.filled-gold { background: var(--gold); }
.mastery-lg .mastery-dot { width: 11px; height: 11px; }

/* --- Progress Bar --- */
.progress-bar {
  height: 6px;
  background: var(--surface3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--accent);
  transition: width 0.4s ease;
}
.progress-fill.success { background: var(--success); }
.progress-fill.gold    { background: var(--gold); }

/* --- Form Elements --- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  min-height: 48px;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--muted); }
.form-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* --- Chip Select (multi-select) --- */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: var(--r-full);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:active, .chip.selected {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--text);
}

/* --- Sound Buttons --- */
.sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sound-grid .sound-btn:first-child {
  grid-column: 1 / -1;
}
.sound-btn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sound-btn:active, .sound-btn.playing {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: scale(0.97);
}
.sound-btn .sound-icon { font-size: 2rem; line-height: 1; }
.sound-btn .sound-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}
.sound-btn .sound-key {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 4px;
}
.sound-btn .sound-desc {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
.sound-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(111,164,140,0.3);
  transform: scale(0);
  animation: ripple 0.5s ease-out;
  pointer-events: none;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* --- Skill Row --- */
.skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.skill-row:last-child { border-bottom: none; }
.skill-info { flex: 1; }
.skill-name { font-size: 0.9375rem; font-weight: 600; margin-bottom: 2px; }
.skill-meta { font-size: 0.72rem; color: var(--muted); }
.skill-actions { display: flex; align-items: center; gap: 8px; }

/* --- Stat Cards --- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
  font-family: 'DM Mono', monospace;
}
.stat-label {
  font-size: 0.7rem;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* --- Dog Profile Card --- */
.dog-card {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.dog-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  overflow: hidden;
}
.dog-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dog-info { flex: 1; }
.dog-name { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.dog-meta { font-size: 0.8125rem; color: var(--muted); }
.dog-streak {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8125rem; font-weight: 700; color: var(--gold);
  margin-top: 6px;
}

/* --- Command Card --- */
.command-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.command-card:active { border-color: var(--accent); }
.command-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--accent-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.command-info { flex: 1; }
.command-name { font-size: 0.9375rem; font-weight: 700; margin-bottom: 2px; }
.command-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }

/* --- Routine Block --- */
.routine-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
}
.routine-block-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.routine-block-icon {
  font-size: 1.25rem;
}
.routine-block-title { font-weight: 700; font-size: 0.9375rem; }
.routine-block-count { font-size: 0.75rem; color: var(--muted); margin-left: auto; }
.routine-activity {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.routine-activity:last-child { border-bottom: none; }
.routine-activity-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.routine-activity-info { flex: 1; }
.routine-activity-name { font-size: 0.875rem; font-weight: 600; }
.routine-activity-meta { font-size: 0.72rem; color: var(--muted); }
.routine-add-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
}
.routine-add-btn:hover { background: var(--accent-muted); }

/* --- Shop Product Card --- */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 12px;
}
.product-image {
  height: 160px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
}
.product-body { padding: 14px; }
.product-name { font-size: 0.9375rem; font-weight: 700; margin-bottom: 6px; }
.product-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.product-why {
  background: var(--success-bg);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--success);
  line-height: 1.5;
  margin-bottom: 12px;
}
.product-why-avoid {
  background: var(--danger-bg);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--danger);
  line-height: 1.5;
  margin-bottom: 12px;
}
.product-price {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--success);
  font-family: 'DM Mono', monospace;
}

/* --- Modal / Bottom Sheet --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.bottom-sheet {
  width: 100%; max-width: 430px;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 85dvh;
  overflow-y: auto;
}
.modal-overlay.open .bottom-sheet { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  margin: 0 auto 20px;
}

/* --- Onboarding --- */
.onboarding-screen {
  min-height: 100dvh;
  padding: 60px 24px 40px;
  display: flex; flex-direction: column;
}
.onboarding-step { display: none; flex-direction: column; flex: 1; }
.onboarding-step.active { display: flex; }
.step-progress {
  display: flex; gap: 6px; margin-bottom: 40px;
}
.step-pip {
  flex: 1; height: 3px; border-radius: var(--r-full);
  background: var(--surface3);
  transition: background 0.3s;
}
.step-pip.done { background: var(--accent); }
.step-pip.active { background: var(--accent); opacity: 0.5; }
.step-content { flex: 1; }
.step-emoji { font-size: 3rem; margin-bottom: 16px; }
.step-title { margin-bottom: 8px; }
.step-subtitle { color: var(--muted); margin-bottom: 32px; font-size: 0.9375rem; }
.step-nav {
  display: flex; gap: 10px; margin-top: 32px;
}

/* --- Streak / Achievement --- */
.streak-card {
  background: linear-gradient(135deg, rgba(240,192,64,0.1), rgba(245,166,35,0.05));
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: var(--r);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
}
.streak-flame { font-size: 2.5rem; line-height: 1; }
.streak-count {
  font-size: 2.25rem;
  font-weight: 900;
  font-family: 'DM Mono', monospace;
  color: var(--gold);
  line-height: 1;
}
.streak-label { font-size: 0.8125rem; color: var(--muted); }

/* --- Category Filter Pills --- */
.filter-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--r-full);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Quick Action Grid --- */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
}
.quick-card:active {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: scale(0.97);
}
.quick-card-icon { font-size: 1.75rem; }
.quick-card-title { font-size: 0.875rem; font-weight: 700; }
.quick-card-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.empty-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 24px; }

/* --- Gate (subscription locks) --- */
.gate-nudge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--gold, #D4A24B);
  background: var(--gold-bg, rgba(212,162,75,0.10));
  border-radius: var(--r);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.gate-nudge:hover { background: rgba(212,162,75,0.18); border-style: solid; }
.gate-nudge-lock { font-size: 1.1rem; flex-shrink: 0; }
.gate-nudge-text { flex: 1; min-width: 0; }
.gate-nudge-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold, #D4A24B);
  font-weight: 700;
  margin-bottom: 2px;
}
.gate-nudge-body { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.gate-nudge-cta {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold, #D4A24B);
  font-weight: 700;
  flex-shrink: 0;
}

/* Locked chip / pill variant (over-quota focus areas, gated filter pills). */
.chip.gate-locked,
.filter-pill.gate-locked {
  border-style: dashed;
  border-color: var(--gold, #D4A24B);
  color: var(--gold, #D4A24B);
  background: var(--gold-bg, rgba(212,162,75,0.10));
}
.chip.gate-locked::before {
  content: "🔒";
  margin-right: 4px;
  font-size: 0.85em;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all 0.25s;
  max-width: 90%;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: #0a2a24; }
.toast.error { background: var(--danger); color: #fff; }

/* --- Session Timer --- */
.session-timer {
  text-align: center;
  padding: 20px;
}
.timer-display {
  font-size: 3.5rem;
  font-weight: 900;
  font-family: 'DM Mono', monospace;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.rep-counter {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin: 20px 0;
}
.rep-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.1s;
}
.rep-count {
  font-size: 3rem;
  font-weight: 900;
  font-family: 'DM Mono', monospace;
  min-width: 80px;
  text-align: center;
  color: var(--success);
}

/* --- Dividers & Spacing --- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.spacer-sm { height: 8px; }
.spacer    { height: 16px; }
.spacer-lg { height: 24px; }

/* --- Flex utilities --- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease both; }

@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.pulse {
  position: relative;
}
.pulse::after {
  content: '';
  position: absolute; inset: -4px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulse-ring 1.2s ease-out infinite;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 0; height: 0; }

/* --- Fonts (load from system/CDN in prototype) --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

/* ============================================
   PUPGRADE, Media embeds (shared across pages)
   ============================================ */
.media-section {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.media-toggle {
  background: none; border: none; color: var(--muted);
  font-size: 0.78rem; cursor: pointer; padding: 4px 0;
  font-family: 'DM Mono', monospace; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 6px;
  width: 100%; text-align: left;
}
.media-toggle:hover { color: var(--text); }
.media-toggle-chev { display: inline-block; transition: transform 0.15s; }
.media-section.expanded .media-toggle-chev { transform: rotate(90deg); }
.media-body { display: none; margin-top: 10px; }
.media-section.expanded .media-body { display: block; }

.media-add-btn {
  background: rgba(111,164,140,0.08); border: 1px dashed var(--accent);
  color: var(--accent); border-radius: 8px; padding: 8px 12px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  width: 100%; margin-bottom: 10px;
}
.media-add-btn:hover { background: rgba(111,164,140,0.16); }

.media-card {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px; margin-bottom: 10px;
}
.media-card-header {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 0.74rem;
}
.media-platform {
  font-family: 'DM Mono', monospace; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--accent); color: white;
  padding: 2px 6px; border-radius: 4px; font-weight: 700;
}
.media-tag {
  font-family: 'DM Mono', monospace; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(255,255,255,0.06); color: var(--muted);
  padding: 2px 6px; border-radius: 4px; font-weight: 600;
}
.media-title { color: var(--text); font-weight: 600; font-size: 0.82rem; }
.media-embed { margin: 6px 0; border-radius: 8px; overflow: hidden; background: #000; }
.media-embed iframe { width: 100%; border: 0; display: block; }
.media-youtube iframe, .media-vimeo iframe { aspect-ratio: 16 / 9; }
.media-tiktok iframe { min-height: 740px; }
.media-instagram iframe { min-height: 520px; }
.media-bluesky iframe { min-height: 340px; }
.media-image img { width: 100%; height: auto; display: block; }
.media-notes {
  font-size: 0.78rem; color: var(--muted);
  padding: 6px 4px; font-style: italic;
}
.media-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 0.72rem; color: var(--muted);
}
.media-actions { display: flex; gap: 8px; }
.media-actions button, .media-actions a {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.82rem; padding: 2px 6px; text-decoration: none;
}
.media-actions button:hover, .media-actions a:hover { color: var(--accent); }
.media-empty {
  text-align: center; color: var(--muted); font-size: 0.78rem;
  padding: 12px; font-style: italic;
}

/* Submit modal */
.modal-overlay-2 {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 1000; display: none;
  align-items: flex-end; justify-content: center; padding: 16px;
}
.modal-overlay-2.open { display: flex; }
.modal-sheet {
  background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 20px; width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
}
.modal-sheet h3 { margin-bottom: 4px; }
.modal-sheet .modal-sub { color: var(--muted); font-size: 0.82rem; margin-bottom: 16px; }
.form-input, .form-textarea, .form-select {
  width: 100%; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--text); font-size: 0.9rem; font-family: inherit;
}
.form-textarea { min-height: 60px; resize: vertical; }
.form-label-2 {
  font-family: 'DM Mono', monospace; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 12px 0 4px; display: block;
}
.form-help { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.modal-buttons { display: flex; gap: 10px; margin-top: 16px; }
.modal-buttons .btn { flex: 1; }

/* Muted (reported) media state */
.media-card-muted { border-color: rgba(255,180,0,0.4); }
.media-muted {
  background: rgba(255,180,0,0.06);
  border: 1px dashed rgba(255,180,0,0.4);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
}
.media-muted-icon { font-size: 1.8rem; margin-bottom: 6px; }
.media-muted-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffb000;
  margin-bottom: 4px;
}
.media-muted-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.media-muted-show {
  background: transparent;
  border: 1px solid rgba(255,180,0,0.5);
  color: #ffb000;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}
