  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  :root {
    --ink:        #1C1A17;
    --ink-soft:   #3A3730;
    --ink-muted:  #6B6760;
    --cream:      #F7F4EE;
    --cream-light:#F4F1EB;
    --paper:      #FAF8F4;
    --platform-bubble: #E8E4DC;
    --cream-deep: #EDE9E0;
    --warm-mid:   #C8C3B8;
    --signal-warm:#8B7355;
    --aqua:       #3AAFA9;
    --input-bar:  #A08060;
  }
  html, body {
    height: 100%; height: 100dvh;
    background: var(--cream);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--ink);
    overflow: hidden;
  }
  .screen { display: none; flex-direction: column; height: 100dvh; max-width: 430px; margin: 0 auto; }
  .screen.active { display: flex; }

  /* ── AUTH ── */
  #screen-auth {
    align-items: center; justify-content: center;
    padding: 40px 32px; gap: 0; background: var(--cream);
  }
  .auth-logo { font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif; font-size: 28px; font-weight: 400; letter-spacing: -0.02em; margin-bottom: 12px; }
  .auth-logo span.you { color: var(--aqua); }
  .auth-logo span.made { color: var(--ink); }
  .auth-tagline { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 13px; font-style: italic; color: var(--ink-muted); text-align: center; margin-bottom: 52px; line-height: 1.6; }
  .auth-divider { width: 1px; height: 40px; background: var(--warm-mid); margin: 0 auto 40px; }
  .btn-google {
    width: 100%; padding: 13px 20px;
    background: var(--cream-deep); border: 1px solid var(--warm-mid);
    border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px; font-weight: 500; color: var(--ink-soft);
    margin-bottom: 12px; transition: background 0.15s;
  }
  .btn-google:hover { background: var(--warm-mid); }
  .btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
  .auth-or { text-align: center; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin: 16px 0; }
  .auth-email-wrap { width: 100%; margin-bottom: 10px; }
  .auth-email-wrap input {
    width: 100%; padding: 13px 14px;
    background: var(--cream-deep); border: 1px solid var(--warm-mid);
    border-radius: 10px; outline: none;
    font-family: 'Cormorant Garamond', Georgia, serif; font-size: 14px; font-style: italic; color: var(--ink);
  }
  .auth-email-wrap input::placeholder { color: var(--ink-muted); }
  .btn-magic {
    width: 100%; padding: 13px 20px;
    background: var(--signal-warm); border: none; border-radius: 10px; cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px; font-weight: 500; color: var(--cream); transition: opacity 0.15s;
  }
  .btn-magic:hover { opacity: 0.88; }
  .auth-msg { margin-top: 16px; padding: 10px 14px; border-radius: 8px; font-size: 12px; text-align: center; display: none; }
  .auth-msg.ok { background: #E8F5E9; color: #2E7D32; display: block; }
  .auth-msg.err { background: #FFEBEE; color: #C62828; display: block; }
  .auth-note { margin-top: 32px; text-align: center; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 11px; font-style: italic; color: var(--ink-muted); line-height: 1.6; }

  /* ── ONBOARDING ── */
  #screen-onboarding { background: var(--cream); overflow-y: auto; }
  #screen-onboarding::-webkit-scrollbar { display: none; }
  .onb-inner {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 32px 40px;
  }
  .onb-logo { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 28px; font-weight: 400; letter-spacing: -0.02em; margin-bottom: 8px; }
  .onb-logo .you { color: var(--aqua); }
  .onb-tagline { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 13px; font-style: italic; color: var(--ink-muted); text-align: center; margin-bottom: 48px; }
  .onb-step { display: none; flex-direction: column; align-items: center; width: 100%; }
  .onb-step.active { display: flex; }
  .onb-question { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 16px; font-style: italic; font-weight: 400; color: var(--ink); text-align: center; line-height: 1.65; margin-bottom: 28px; }
  .onb-sub { font-size: 11px; color: var(--ink-muted); margin: -20px 0 24px; text-align: center; }
  .onb-opts { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .onb-opt {
    padding: 14px 20px;
    background: var(--cream-deep); border: 1px solid var(--warm-mid);
    border-radius: 10px; cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px; font-weight: 400; color: var(--ink-soft); text-align: center;
    transition: background 0.15s, border-color 0.15s;
  }
  .onb-opt:hover, .onb-opt.selected { border-color: var(--signal-warm); color: var(--ink); }
  .onb-opt.selected { font-weight: 500; }
  .onb-next {
    width: 100%; padding: 14px 20px; margin-top: 18px;
    background: var(--signal-warm); border: none; border-radius: 10px; cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px; font-weight: 500; color: var(--cream);
    transition: opacity 0.15s; display: none;
  }
  .onb-next.visible { display: block; }
  .onb-next:hover { opacity: 0.88; }
  .onb-closing {
    display: none; flex-direction: column; align-items: center; width: 100%;
  }
  .onb-closing.active { display: flex; }
  .onb-closing-line { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; font-weight: 400; font-style: italic; color: var(--ink); text-align: center; line-height: 1.5; }

  /* ── COVER ── */
  #screen-cover { background: var(--cream); }
  .masthead {
    border-bottom: 0.5px solid var(--warm-mid);
    padding: 8px 15px;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--cream); flex-shrink: 0; position: relative; z-index: 10;
  }
  .logo { font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif; font-size: 15px; font-weight: 400; letter-spacing: -0.01em; }
  .logo .l-made { color: var(--ink); }
  .logo .l-you  { color: var(--aqua); }
  .masthead-date { font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted); display: flex; align-items: center; gap: 7px; }
  .masthead-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); display: none; }
  .masthead-dot.on { display: block; }

  .cover-stage {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    padding: 12px 15px 0;
    overflow: hidden;
  }

  /* Full-screen card */
  .cover-card {
    flex: 1; min-height: 0;
    position: relative;
    background: linear-gradient(168deg, var(--card-tint, var(--paper)) 0%, var(--paper) 58%);
    border: 1px solid var(--warm-mid);
    border-radius: 14px;
    padding: 24px 22px 14px;
    display: flex; flex-direction: column;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none; -webkit-user-select: none;
  }
  /* Paper grain — the card is an object, not a screen */
  .cover-card::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    opacity: 0.05; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  /* Aesthetic atmosphere — tint families inside the cream world */
  .cover-card[data-tint='stone']    { --card-tint: #ECEAE2; --card-accent: #7A766B; }
  .cover-card[data-tint='terra']    { --card-tint: #F1E3D7; --card-accent: #A0654B; }
  .cover-card[data-tint='sage']     { --card-tint: #E7EBDF; --card-accent: #6E7B62; }
  .cover-card[data-tint='noir']     { --card-tint: #E7E4DD; --card-accent: #4A453C; }
  .cover-card[data-tint='blush']    { --card-tint: #F3E6E1; --card-accent: #A07365; }
  .cover-card[data-tint='graphite'] { --card-tint: #E8E7E5; --card-accent: #5C5A56; }
  .cover-card[data-tint='camel']    { --card-tint: #F1E8D9; --card-accent: #8B7355; }
  .cover-card[data-tint='paper']    { --card-tint: var(--paper); --card-accent: var(--signal-warm); }
  /* Brand monogram — the brand is the image. Letterpress, cropped, silent. */
  .card-watermark {
    position: absolute; left: -6px; bottom: 130px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 110px; font-weight: 500; line-height: 0.9;
    letter-spacing: -0.03em; white-space: nowrap;
    color: var(--card-accent, var(--signal-warm));
    opacity: 0.07; pointer-events: none; z-index: 0;
  }
  .cover-card > *:not(.card-watermark) { position: relative; z-index: 1; }
  /* Motion — quiet life, never spectacle */
  @keyframes card-rise  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes card-right { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
  @keyframes card-left  { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
  .cover-card.enter-rise  { animation: card-rise  0.4s cubic-bezier(0.22, 0.9, 0.3, 1); }
  .cover-card.enter-right { animation: card-right 0.26s ease-out; }
  .cover-card.enter-left  { animation: card-left  0.26s ease-out; }
  @keyframes dot-breathe { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
  .signal-new .signal-dot { animation: dot-breathe 2.8s ease-in-out infinite; }
  @media (prefers-reduced-motion: reduce) {
    .cover-card.enter-rise, .cover-card.enter-right, .cover-card.enter-left { animation: none; }
    .signal-new .signal-dot { animation: none; }
  }
  .cover-card .card-signal-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
  .signal-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
  .signal-text { font-size: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; }
  .signal-new .signal-dot { background: var(--aqua); }
  .signal-new .signal-text { color: var(--aqua); }
  .signal-old .signal-dot { background: var(--warm-mid); }
  .signal-old .signal-text { color: var(--ink-muted); }
  .cover-card .card-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--card-accent, var(--signal-warm)); margin-bottom: 14px; }
  .cover-card .card-headline {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 22px; font-weight: 400; color: var(--ink); line-height: 1.4;
  }
  .card-spacer { flex: 1; min-height: 0; }
  .cover-card .card-reason {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 13px; font-style: italic; color: var(--ink-soft); line-height: 1.6;
    margin: 14px 0 0;
  }
  .card-brand-row {
    padding-top: 14px;
    border-top: 0.5px solid var(--warm-mid);
  }
  .card-actions {
    display: flex; align-items: center; justify-content: flex-start;
    padding-top: 12px;
  }
  .card-brand { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--card-accent, var(--signal-warm)); }
  .card-counter-bottom { text-align: center; font-size: 9px; letter-spacing: 0.14em; color: var(--ink-muted); padding-top: 12px; flex-shrink: 0; }
  .cta-btns { display: flex; gap: 8px; }
  .icon-btn {
    width: 32px; height: 32px; border: 1.5px solid var(--card-accent, var(--signal-warm)); background: transparent;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--card-accent, var(--signal-warm)); line-height: 1;
  }
  .icon-btn.star { border-radius: 50%; font-size: 16px; }
  .icon-btn.ext    { border-radius: 6px; font-size: 14px; }
  .icon-btn.reject { border-radius: 50%; font-size: 13px; margin-left: 4px; opacity: 0.65; }
  .reject-toast {
    margin-left: 14px; align-self: center;
    font-family: Georgia, serif; font-size: 12px; font-style: italic;
    color: var(--ink-soft); opacity: 0; transition: opacity 0.25s;
  }
  .reject-toast.on { opacity: 1; }
  @keyframes card-exit-down { to { opacity: 0; transform: translateY(26px); } }
  .cover-card.exit-down { animation: card-exit-down 0.34s ease-in forwards; }

  /* "This is me right now" — shareable taste card */
  .taste-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(28,26,23,0.32);
    display: none; flex-direction: column; align-items: center; justify-content: center;
    padding: 28px 24px;
  }
  .taste-overlay.open { display: flex; }
  #taste-canvas {
    width: min(78vw, 320px); height: auto;
    border: 1px solid var(--warm-mid); border-radius: 12px;
    background: var(--cream);
    box-shadow: 0 18px 50px rgba(28,26,23,0.22);
  }
  .taste-actions { display: flex; gap: 10px; margin-top: 20px; width: min(78vw, 320px); }
  .taste-btn {
    flex: 1; padding: 12px 0; border-radius: 10px; cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 13px; font-weight: 500; border: none;
  }
  .taste-btn.primary { background: var(--signal-warm); color: var(--cream); }
  .taste-btn.quiet   { background: transparent; color: var(--cream); border: 1px solid rgba(247,244,238,0.5); }

  /* Empty state */
  .cover-empty {
    flex: 1; display: none; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    background: var(--paper); border: 1px solid var(--warm-mid); border-radius: 14px; padding: 24px;
  }
  .cover-empty p { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 17px; font-style: italic; color: var(--ink-soft); line-height: 1.8; }

  /* Pill rows */
  .pill-row {
    display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
    padding: 12px 15px 0; flex-shrink: 0;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .pill-row::-webkit-scrollbar { display: none; }
  .pill {
    flex-shrink: 0;
    border: 1px solid var(--warm-mid); background: transparent;
    border-radius: 20px; padding: 7px 15px; cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-muted); transition: background 0.15s, color 0.15s, border-color 0.15s;
  }
  .pill.active { background: var(--signal-warm); border-color: var(--signal-warm); color: var(--cream); }
  .pill-row.explore .pill { text-transform: none; letter-spacing: 0.02em; font-size: 11px; font-weight: 400; color: var(--ink-soft); }

  /* Chat strip */
  .chat-strip {
    margin-top: 12px; flex-shrink: 0;
    background: var(--input-bar); cursor: pointer;
    padding: 14px 20px; padding-bottom: max(14px, env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between;
  }
  .chat-strip-text { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 14px; font-style: italic; color: var(--cream); }
  .chat-strip-arrow { color: var(--cream); font-size: 13px; opacity: 0.8; }

  /* ── SHEETS (chat + explore) ── */
  .sheet {
    position: fixed; left: 50%; transform: translate(-50%, 100%);
    bottom: 0; width: 100%; max-width: 430px; height: 92dvh;
    background: var(--cream);
    border-top: 1px solid var(--warm-mid);
    border-radius: 16px 16px 0 0;
    display: flex; flex-direction: column;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 50; overflow: hidden;
  }
  .sheet.open { transform: translate(-50%, 0); }
  .sheet-head {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; border-bottom: 0.5px solid var(--warm-mid);
  }
  .sheet-title { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 15px; color: var(--ink); }
  .sheet-back {
    background: transparent; border: none; cursor: pointer;
    font-size: 16px; color: var(--ink-muted); padding: 4px 8px;
  }
  .sheet-scrim {
    position: fixed; inset: 0; background: rgba(28,26,23,0.18);
    opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 40;
  }
  .sheet-scrim.on { opacity: 1; pointer-events: auto; }

  /* Explore sheet body */
  .explore-body { flex: 1; overflow-y: auto; padding: 16px 15px 32px; -webkit-overflow-scrolling: touch; }
  .explore-body::-webkit-scrollbar { display: none; }
  .explore-card {
    background: var(--paper); border: 1px solid var(--warm-mid); border-radius: 12px;
    padding: 16px 16px 12px; margin-bottom: 10px; cursor: pointer;
  }
  .explore-card .card-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--signal-warm); margin-bottom: 8px; }
  .explore-card .ex-headline { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 16px; color: var(--ink); line-height: 1.45; margin-bottom: 10px; }
  .explore-card .ex-foot { display: flex; align-items: center; justify-content: space-between; border-top: 0.5px solid var(--warm-mid); padding-top: 9px; }
  .explore-card .ex-brand { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--signal-warm); }
  .explore-card .ex-arrow { color: var(--signal-warm); font-size: 13px; }
  .explore-quiet { text-align: center; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 14px; font-style: italic; color: var(--ink-muted); padding: 48px 24px; line-height: 1.8; }

  /* Chat sheet body */
  .chat-area { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 15px 8px; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
  .chat-area::-webkit-scrollbar { display: none; }
  .gap-same { margin-top: 13px; }
  .gap-turn { margin-top: 20px; }
  .bubble-platform { background: var(--platform-bubble); border-radius: 3px 12px 12px 12px; padding: 12px 15px; font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif; font-size: 14px; font-style: italic; font-weight: 400; color: var(--ink); line-height: 1.6; max-width: 88%; align-self: flex-start; }
  .bubble-user { background: var(--cream-light); border-radius: 12px 3px 12px 12px; padding: 10px 14px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: 400; color: var(--ink-soft); line-height: 1.55; max-width: 80%; align-self: flex-end; }
  .typing-wrap { margin-top: 20px; align-self: flex-start; }
  .typing-bubble { background: var(--platform-bubble); border-radius: 3px 12px 12px 12px; padding: 10px 15px; display: inline-flex; gap: 4px; align-items: center; }
  .typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-muted); animation: pulse 1.2s ease-in-out infinite; }
  .typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .typing-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes pulse { 0%,80%,100% { opacity: 0.3; transform: scale(0.9); } 40% { opacity: 1; transform: scale(1); } }
  .input-row { border-top: 0.5px solid var(--warm-mid); padding: 12px 15px; background: var(--input-bar); flex-shrink: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .input-inner { background: var(--cream-light); border: 1px solid var(--warm-mid); border-radius: 18px; padding: 8px 14px; display: flex; align-items: center; gap: 8px; }
  .input-field { flex: 1; border: none; background: transparent; outline: none; font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif; font-size: 14px; font-style: italic; color: var(--ink-soft); resize: none; line-height: 1.5; overflow: hidden; min-height: 21px; }
  .input-field::placeholder { color: var(--ink-soft); font-style: italic; }
  .send-btn { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--signal-warm); background: transparent; display: none; align-items: center; justify-content: center; cursor: pointer; color: var(--signal-warm); font-size: 12px; flex-shrink: 0; }
  .send-btn.visible { display: flex; }

  /* ── PWA INSTALL BANNER ── */
  .pwa-banner {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 430px;
    background: var(--ink); color: var(--cream);
    padding: 14px 20px 28px;
    display: none; flex-direction: column; gap: 10px;
    z-index: 100;
  }
  .pwa-banner.visible { display: flex; }
  .pwa-banner-text { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 13px; font-style: italic; line-height: 1.6; color: var(--cream-light); }
  .pwa-banner-row { display: flex; gap: 10px; }
  .pwa-banner-btn {
    flex: 1; padding: 11px 0; border-radius: 8px; cursor: pointer;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px; font-weight: 500; border: none;
  }
  .pwa-banner-btn.primary { background: var(--aqua); color: var(--ink); }
  .pwa-banner-btn.dismiss { background: transparent; color: var(--ink-muted); border: 1px solid var(--ink-soft); }
