@layer base {
  .muted-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
  }

  .display-title {
    margin: 0;
    font-size: clamp(2.1rem, 4.2vw, 3.6rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
    font-weight: 800;
  }

  h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  .lead-copy {
    margin: 0;
    color: var(--muted);
    font-size: clamp(0.95rem, 1.3vw, 1.12rem);
    line-height: 1.55;
    max-width: 48ch;
  }

  .screen {
    position: absolute;
    inset: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.985);
    transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
    overflow: hidden;
  }

  .screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .screen-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    flex-shrink: 0;
  }

  .step-pills {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
  }

  .step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-2); }
  .step-dot.active { width: 20px; border-radius: 999px; background: var(--accent); }
  .step-dot.done { background: var(--ok); }
  .step-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }

  .btn {
    border: none;
    border-radius: var(--radius-lg);
    min-height: 48px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 130ms var(--ease-out), background-color 180ms var(--ease-out), opacity 180ms var(--ease-out);
  }

  .btn:active,
  .pill-chip:active,
  .chip-btn:active,
  .frame-option:active,
  .picker-item:active,
  .stepper-btn:active,
  .key-btn:active {
    transform: scale(0.97);
  }

  .btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 28px rgba(230, 169, 77, 0.24);
  }

  .btn-hero { min-height: 56px; font-size: 16.5px; padding: 14px 28px; }
  .btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--glass-border); }

  .btn-link {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .chip-btn {
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    color: var(--ink);
    border-radius: 999px;
    min-height: 36px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 130ms var(--ease-out);
  }

  .chip-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

  .pill-chip {
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 130ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
  }

  .pill-chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--accent);
  }

  .status-badge.ok { color: var(--ok); }

  .framing-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
  }

  .glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
  }

  .fitts-bottom-zone { width: 100%; display: flex; justify-content: center; align-items: center; gap: 14px; }
  .dual-actions { max-width: 780px; width: 100%; display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
  .dual-actions .btn { width: 100%; }

  @media (hover: hover) and (pointer: fine) {
    .btn:hover,
    .pill-chip:hover,
    .chip-btn:hover { filter: brightness(1.06); }
  }
}
