:root {
  color-scheme: light dark;
  --bg: #f4f7f1;
  --surface: #ffffff;
  --surface-soft: #eaf0e6;
  --ink: #102519;
  --muted: #637267;
  --line: rgba(16, 37, 25, 0.12);
  --accent: #16a34a;
  --accent-strong: #0f873b;
  --accent-soft: #d8f5df;
  --danger: #c73d3d;
  --shadow: 0 20px 60px rgba(35, 61, 41, 0.1);
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 4%, rgba(22, 163, 74, 0.1), transparent 26rem),
    var(--bg);
  color: var(--ink);
}
button, input, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.35);
  outline-offset: 3px;
}
svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: min(100%, 640px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) calc(38px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(70px + env(safe-area-inset-top));
  margin: 0 -6px;
  padding: env(safe-area-inset-top) 6px 0;
  background: linear-gradient(var(--bg) 75%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  content: "";
  width: 4px;
  border-radius: 99px;
  background: var(--accent);
  transform: rotate(20deg);
}
.brand-mark::before { height: 12px; left: 6px; top: 9px; }
.brand-mark span { height: 20px; left: 12px; top: 4px; }
.brand-mark::after { height: 10px; right: 5px; top: 6px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.network-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.network-pill > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}
.network-pill.is-offline > span:first-child { background: #db8b22; box-shadow: none; }
.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.icon-button svg { width: 20px; }

.screen { display: none; padding: 34px 0 0; animation: reveal 260ms ease both; }
.screen.is-active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.eyebrow,
.section-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.pulse-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}
.home-screen > h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(48px, 13vw, 78px);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.94;
}
.home-screen > h1 span { color: var(--accent); }
.hero-copy {
  max-width: 480px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.device-callout {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
}
.callout-icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  color: var(--accent-strong);
}
.callout-icon svg { width: 23px; }
.device-callout strong { display: block; margin: 1px 0 5px; font-size: 15px; }
.device-callout p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 38px 0 15px;
}
.section-heading.compact { margin-top: 46px; }
.section-heading h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -0.025em; }
.demo-badge,
.history-count {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.history-count { min-width: 30px; text-align: center; }
.type-grid { display: grid; gap: 10px; }
.type-card {
  display: grid;
  grid-template-columns: 50px 1fr 22px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.type-card:active { transform: scale(0.985); }
.type-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1); }
.type-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink);
}
.is-selected .type-icon { background: var(--accent-soft); color: var(--accent-strong); }
.type-icon svg { width: 25px; }
.type-card strong { display: block; margin-bottom: 4px; font-size: 16px; }
.type-card small { color: var(--muted); font-size: 12px; }
.radio-dot {
  width: 19px;
  height: 19px;
  border: 2px solid color-mix(in srgb, var(--muted) 50%, transparent);
  border-radius: 50%;
}
.is-selected .radio-dot { border: 5px solid var(--accent); }
.primary-action,
.secondary-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 750;
  box-shadow: var(--shadow);
}
.primary-action svg { width: 22px; }
.primary-action:active { transform: translateY(1px); }
.primary-action:disabled { opacity: 0.55; }
.secondary-action {
  justify-content: center;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}
.permission-note { margin: 11px 8px 0; color: var(--muted); font-size: 12px; text-align: center; }
.history-list { display: grid; gap: 9px; }
.empty-state {
  display: grid;
  min-height: 130px;
  place-items: center;
  padding: 25px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}
.empty-state p { margin: 0; font-size: 13px; }
.empty-line { width: 42px; height: 4px; border-radius: 99px; background: var(--line); }
.history-card {
  display: grid;
  grid-template-columns: 58px 1fr auto 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
}
.history-type { display: grid; height: 42px; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.history-main strong, .history-main small { display: block; }
.history-main strong { font-size: 16px; }
.history-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-card svg { width: 17px; color: var(--muted); }
.home-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 34px; padding: 18px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.home-footer a { color: var(--ink); font-weight: 750; }
.privacy-page { max-width: 700px; padding-top: max(48px, env(safe-area-inset-top)); }
.privacy-title { margin-bottom: 18px; font-size: 48px; letter-spacing: -.05em; }
.privacy-copy { color: var(--muted); font-size: 17px; line-height: 1.65; }
.privacy-back { margin-top: 30px; text-decoration: none; }

.active-screen { padding-top: 18px; }
.activity-head { display: flex; align-items: start; justify-content: space-between; margin-bottom: 22px; }
.activity-head h1 { margin: 5px 0 0; font-size: 38px; letter-spacing: -0.045em; }
.activity-status { display: flex; align-items: center; gap: 7px; color: var(--accent-strong); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.activity-status > span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.activity-status > span.is-live { animation: pulse 1.5s ease infinite; }
.activity-status.is-paused { color: #9a6416; }
.activity-status.is-paused > span { background: #db8b22; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
.text-button { padding: 9px 0 9px 14px; border: 0; background: transparent; font-size: 13px; font-weight: 700; }
.text-button.danger { color: var(--danger); }
.recovery-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #fff0d8;
  color: #684614;
}
.recovery-banner strong { display: block; font-size: 13px; }
.recovery-banner p { margin: 3px 0 0; font-size: 11px; line-height: 1.35; }
.recovery-banner button { flex: 0 0 auto; padding: 9px 12px; border: 0; border-radius: 10px; background: #684614; color: white; font-size: 12px; font-weight: 750; }
.gps-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
}
.gps-state { display: flex; align-items: center; gap: 8px; }
.gps-state strong { color: var(--ink); }
#gpsDot { width: 8px; height: 8px; border-radius: 50%; background: #db8b22; }
#gpsDot[data-state="good"] { background: var(--accent); box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12); }
#gpsDot[data-state="filtered"] { background: #db8b22; }
#gpsDot[data-state="error"] { background: var(--danger); }
.route-panel { position: relative; overflow: hidden; height: min(52vw, 320px); min-height: 220px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-soft); }
.route-panel canvas { width: 100%; height: 100%; }
.route-badge { position: absolute; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.86); color: #36533e; font-size: 10px; font-weight: 800; backdrop-filter: blur(8px); }
.route-badge svg { width: 14px; }
.primary-metric { padding: 31px 0 28px; text-align: center; }
.primary-metric > span, .primary-metric small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.primary-metric strong { display: block; margin: 6px 0 2px; font-size: clamp(72px, 21vw, 108px); font-weight: 730; letter-spacing: -0.075em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.metric-grid > div { min-height: 100px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.metric-grid span { display: block; margin-bottom: 12px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
.metric-grid strong { font-size: 24px; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.metric-grid small { margin-left: 5px; color: var(--muted); font-size: 10px; }
.tracking-note { display: flex; align-items: center; gap: 10px; margin: 13px 3px; color: var(--muted); font-size: 11px; }
.tracking-note svg { flex: 0 0 auto; width: 17px; color: #9a6416; }
.activity-controls { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10; display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 18px; padding: 10px; border: 1px solid var(--line); border-radius: 24px; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.control-button { display: flex; min-height: 58px; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 17px; font-weight: 800; }
.control-button svg { width: 21px; }
.control-button.pause { background: var(--surface-soft); color: var(--ink); }
.control-button.finish { background: var(--ink); color: var(--bg); }
.control-button .play-icon { display: none; }
.control-button.is-resume .pause-icon { display: none; }
.control-button.is-resume .play-icon { display: block; }
.stop-square { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); }

.strength-screen { padding-top: 18px; padding-bottom: 12px; }
.strength-overview { display: grid; grid-template-columns: 1.15fr 1.35fr 1fr; gap: 8px; margin-bottom: 20px; }
.strength-overview > div { min-width: 0; padding: 14px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.strength-overview span, .strength-overview strong { display: block; }
.strength-overview span { margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.strength-overview strong { overflow: hidden; font-size: 15px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.strength-list { display: grid; gap: 13px; }
.strength-empty { display: grid; min-height: 290px; place-items: center; align-content: center; padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius-lg); text-align: center; }
.strength-empty .type-icon { width: 60px; height: 60px; margin-bottom: 18px; }
.strength-empty h2 { margin: 0 0 8px; font-size: 22px; }
.strength-empty p { max-width: 320px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.add-exercise-action { margin-top: 14px; }
.add-exercise-action svg { width: 20px; }
.strength-controls { grid-template-columns: 1fr 1.35fr; }
.strength-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.strength-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.strength-card-head h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.strength-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.remove-exercise { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 11px; background: var(--surface-soft); color: var(--muted); }
.remove-exercise svg { width: 16px; }
.set-table-head, .strength-set-row { display: grid; grid-template-columns: 28px minmax(62px, 1fr) minmax(58px, 1fr) minmax(54px, .8fr) 36px 28px; align-items: center; gap: 7px; }
.set-table-head { padding: 11px 14px 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-align: center; text-transform: uppercase; }
.strength-set-row { padding: 7px 14px; }
.set-number { color: var(--muted); font-size: 12px; font-weight: 750; text-align: center; }
.set-input { width: 100%; height: 40px; padding: 0 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; text-align: center; }
.set-input::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.set-complete { position: relative; display: grid; width: 34px; height: 34px; place-items: center; }
.set-complete input { position: absolute; opacity: 0; }
.set-complete span { display: grid; width: 28px; height: 28px; place-items: center; border: 2px solid var(--line); border-radius: 9px; color: transparent; }
.set-complete span::after { content: "✓"; font-size: 15px; font-weight: 900; }
.set-complete input:checked + span { border-color: var(--accent); background: var(--accent); color: white; }
.strength-set-row:has(.set-complete input:checked) .set-input { opacity: .66; }
.remove-set { padding: 5px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.add-set-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: calc(100% - 28px); min-height: 40px; margin: 10px 14px 14px; border: 1px dashed var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.strength-paused .set-input, .strength-paused .set-complete, .strength-paused .add-set-button, .strength-paused .add-exercise-action { pointer-events: none; opacity: .45; }

.exercise-dialog { width: min(calc(100% - 24px), 560px); max-height: min(780px, calc(100dvh - 30px)); padding: 0; overflow: hidden; border: 0; border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px rgba(0,0,0,.28); }
.exercise-dialog::backdrop { background: rgba(14, 26, 18, .48); backdrop-filter: blur(6px); }
.exercise-dialog-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 14px; }
.exercise-dialog-head h2 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.04em; }
.exercise-dialog-head .dialog-close { top: 20px; right: 20px; }
.exercise-search { display: flex; align-items: center; gap: 10px; margin: 0 20px 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.exercise-search svg { flex: 0 0 auto; width: 18px; color: var(--muted); }
.exercise-search input { width: 100%; height: 48px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.muscle-filters { display: flex; gap: 7px; overflow-x: auto; padding: 0 20px 12px; scrollbar-width: none; }
.muscle-filters::-webkit-scrollbar { display: none; }
.muscle-filter { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; }
.muscle-filter.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.exercise-results { display: grid; max-height: 390px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.exercise-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 10px 22px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; }
.exercise-option:last-child { border-bottom: 0; }
.exercise-option strong, .exercise-option small { display: block; }
.exercise-option strong { font-size: 14px; }
.exercise-option small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.exercise-option .plus { display: grid; flex: 0 0 auto; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 18px; }
.exercise-no-results { padding: 36px 20px; color: var(--muted); font-size: 13px; text-align: center; }
.custom-exercise { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); }
.custom-exercise input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); }
.custom-exercise button { padding: 0 16px; border: 0; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 750; }
.continue-strength-action { justify-content: center; }

.summary-screen { padding-top: 36px; text-align: center; }
.summary-check { display: grid; width: 70px; height: 70px; margin: 0 auto 26px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); }
.summary-check svg { width: 35px; stroke-width: 2.3; }
.summary-screen > h1 { margin: 7px 0; font-size: 42px; letter-spacing: -0.05em; }
.summary-screen > p { margin: 0; color: var(--muted); font-size: 13px; }
.summary-hero { margin: 30px 0 12px; padding: 30px 20px; border-radius: var(--radius-lg); background: var(--ink); color: var(--bg); }
.summary-hero span { display: block; margin-bottom: 8px; color: #a8c7af; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.summary-hero strong { display: block; font-size: 58px; letter-spacing: -0.06em; }
.summary-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; text-align: left; }
.summary-metrics > div { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.summary-metrics span, .summary-metrics strong { display: block; }
.summary-metrics span { margin-bottom: 9px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.summary-metrics strong { font-size: 15px; }
.share-settings { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); text-align: left; }
.share-settings strong { display: block; font-size: 14px; }
.share-settings p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.switch { position: relative; flex: 0 0 auto; width: 51px; height: 31px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #c9d2ca; transition: background 160ms ease; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; content: ""; border-radius: 50%; background: white; box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform 160ms ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.share-action { background: var(--accent); color: white; }

.post-composer { margin-top: 24px; padding: 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); text-align: left; }
.composer-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.composer-heading h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.035em; }
.local-chip { padding: 6px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.field-label { display: block; margin: 14px 0 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.composer-input { width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
.composer-textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.composer-textarea.short { min-height: 72px; }
.composer-divider { height: 1px; margin: 22px 0 4px; background: var(--line); }
.choice-row, .theme-row, .metric-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.choice-button { min-height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 750; }
.choice-button.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.theme-choice { display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 6px; min-width: 0; min-height: 48px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); text-align: left; }
.theme-choice > span { width: 27px; height: 31px; border-radius: 9px; background: linear-gradient(135deg, var(--theme-start), var(--theme-end)); box-shadow: inset 0 0 0 2px var(--theme-accent); }
.theme-choice strong { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; }
.theme-choice-mint { --theme-start: #f7faf4; --theme-end: #dfead9; --theme-accent: #16a34a; }
.theme-choice-ink { --theme-start: #111814; --theme-end: #24372b; --theme-accent: #72e491; }
.theme-choice-sunrise { --theme-start: #fff4e6; --theme-end: #f5c8a8; --theme-accent: #e65f3c; }
.theme-choice.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent); }
.theme-choice.is-selected strong { color: var(--ink); }
.metric-choices { margin-top: 14px; }
.metric-choices label { position: relative; }
.metric-choices input { position: absolute; opacity: 0; }
.metric-choices span { display: grid; min-height: 37px; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 10px; font-weight: 750; }
.metric-choices input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.metric-choices input:disabled + span { opacity: .4; }
.save-aura-action { justify-content: center; margin-top: 14px; }

.social-screen { padding-top: 26px; }
.social-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.social-head > div { min-width: 0; }
.social-head h1 { margin: 5px 0 8px; font-size: 52px; letter-spacing: -.06em; }
.social-head p { max-width: 430px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.local-social-note { display: flex; align-items: start; gap: 10px; margin: 24px 0 18px; padding: 14px; border: 1px solid rgba(22,163,74,.2); border-radius: 15px; background: var(--accent-soft); color: var(--muted); font-size: 11px; line-height: 1.45; }
.local-social-note .pulse-dot { flex: 0 0 auto; margin-top: 3px; }
.local-social-note > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.export-backup-action { justify-content: center; margin: 0 0 18px; }
.aura-feed { display: grid; gap: 16px; }
.aura-post { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 12px 35px rgba(35,61,41,.06); }
.aura-open { display: block; width: 100%; padding: 20px; border: 0; background: var(--aura-background); color: var(--aura-ink); text-align: left; }
.aura-theme-mint { --aura-background: linear-gradient(135deg,#f7faf4,#dfead9); --aura-ink: #102519; --aura-muted: #56705d; --aura-accent: #16a34a; }
.aura-theme-ink { --aura-background: linear-gradient(135deg,#111814,#24372b); --aura-ink: #f2f8f1; --aura-muted: #a9bdac; --aura-accent: #72e491; }
.aura-theme-sunrise { --aura-background: linear-gradient(135deg,#fff4e6,#f5c8a8); --aura-ink: #3b2117; --aura-muted: #805545; --aura-accent: #e65f3c; }
.aura-post-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; color: var(--aura-muted); font-size: 9px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.aura-post-title { display: block; font-size: 27px; letter-spacing: -.04em; }
.aura-caption { display: block; margin-top: 8px; color: var(--aura-muted); font-size: 13px; line-height: 1.5; }
.aura-post-metrics { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 5px 12px; margin-top: 24px; }
.aura-post-metrics strong { grid-row: span 2; color: var(--aura-accent); font-size: 34px; letter-spacing: -.05em; }
.aura-post-metrics span { color: var(--aura-muted); font-size: 10px; text-align: right; }
.aura-actions { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.aura-actions button { padding: 7px 8px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.aura-actions .aura-reaction.is-active { color: var(--accent-strong); }
.aura-comments { padding: 13px 14px 15px; }
.aura-comments p { margin: 0 0 9px; padding: 10px 11px; border-radius: 12px; background: var(--surface-soft); color: var(--ink); font-size: 12px; line-height: 1.4; }
.aura-comments p span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.aura-comments form { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.aura-comments input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--ink); font-size: 12px; }
.aura-comments form button { padding: 0 13px; border: 0; border-radius: 11px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 750; }

.install-dialog { width: min(calc(100% - 32px), 500px); padding: 30px; border: 0; border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px rgba(0,0,0,.22); }
.install-dialog::backdrop { background: rgba(14, 26, 18, .45); backdrop-filter: blur(6px); }
.install-dialog h2 { margin: 8px 0 22px; font-size: 32px; letter-spacing: -.04em; }
.install-dialog ol { margin: 0; padding-left: 24px; color: var(--muted); }
.install-dialog li { margin: 0 0 13px; padding-left: 5px; line-height: 1.45; }
.dialog-close { position: absolute; top: 15px; right: 15px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: var(--surface-soft); font-size: 24px; }
.dialog-note { margin: 24px 0 0; padding: 14px; border-radius: 14px; background: var(--accent-soft); color: var(--muted); font-size: 12px; line-height: 1.45; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); width: min(calc(100% - 40px), 460px); padding: 14px 17px; border-radius: 15px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 13px; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 390px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .home-screen > h1 { font-size: 48px; }
  .topbar { margin: 0; }
  .network-pill { display: none; }
  .primary-metric strong { font-size: 76px; }
  .metric-grid strong { font-size: 21px; }
  .summary-hero strong { font-size: 48px; }
  .set-table-head, .strength-set-row { grid-template-columns: 24px minmax(55px, 1fr) minmax(50px, .9fr) minmax(48px, .8fr) 32px 22px; gap: 5px; }
  .strength-set-row { padding-left: 10px; padding-right: 10px; }
  .set-table-head { padding-left: 10px; padding-right: 10px; }
  .social-head { gap: 10px; }
  .social-head h1 { font-size: 46px; }
  .social-head .text-button { padding-left: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101612;
    --surface: #18201a;
    --surface-soft: #202b23;
    --ink: #eef6ed;
    --muted: #9aaa9d;
    --line: rgba(238, 246, 237, 0.12);
    --accent: #5bd67d;
    --accent-strong: #72e491;
    --accent-soft: #173824;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }
  .route-badge { background: rgba(18, 27, 20, .84); color: #c9ddcd; }
  .recovery-banner { background: #3e2e17; color: #ffd99f; }
  .recovery-banner button { background: #ffd99f; color: #3e2e17; }
  .share-action { color: #0b1a0f; }
}
