  :root{
    --bg:#FAF3EE;
    --ink:#2B1A26;
    --muted:#7C6270;
    --wine:#B4485F;
    --wine-deep:#8E3348;
    --plum:#4A2340;
    --gold:#D9923F;
    --blush:#F6E3DD;
    --card:#FFFFFF;
    --line:#EEDCD3;
    --ok:#3E7D5E;
    --field:#FFFDFA;
    --soft:#FBF1EC;
    --soft-2:#F9EEEA;
    --error-bg:#FBE9EC;
    --error-ink:#8E2438;
    --share-bg:#FDF6F3;
    --track:#F0E2DA;
    --tag-alt-bg:#F3E8D6;
    --tag-alt-ink:#96601F;
    --header-bg:rgba(250,243,238,.88);
    --shadow:0 12px 32px rgba(74,35,64,.10);
    --radius:20px;
    --tint:180,72,95;
    --tint-deep:142,51,72;
    /* the two ends of the brand ramp, for full-bleed coloured panels. The
       presets below only move --wine/--wine-deep, so panels built from these
       three follow the theme instead of staying wine whatever is selected. */
    /* the brand ramp as a *surface* under white text: start, middle, end.
       Separate from --plum/--wine, which flip in dark mode because there they
       are text ink. A panel painted with those would go white-on-white. */
    --panel-a:#4A2340;
    --panel-b:#8E3348;
    --panel-c:#B4485F;
    --on-dark:#fff;
    --on-dark-soft:#FFD9C8;
    --on-dark-line:rgba(255,255,255,.5);
    --on-dark-text:rgba(255,255,255,.9);
    /* ink for text placed on a white surface (a white button, a white input).
       These surfaces stay white in dark mode, so this must stay dark too. */
    --on-light-ink:#2B1A26;
    --on-light-strong:#4A2340;
    --nav-h:34px;   /* one height for every header control */
    /* One height for every button on the site. A control the page calls a
       button is the same box wherever it appears, so a row of them gathered
       from three different screens lines up — before this, .btn was 38px, a
       ghost 41px (its border, so even two buttons of the same kind differed),
       a .btn.small 32px, an admin table action 25px, and the account panel's
       "create a quiz" stood alone at 46px on a phone because that one phone
       rule raised it and its neighbours were left at 42.
       42px is the site's own ordinary-button size: it is what a phone already
       gave a button, and what the sign-up card's pair already used. Adopting
       it raises the small ones and brings that 46px button *down*, which is
       the direction the complaint was in.
       A min rather than a height, so a wrapped label grows the box instead of
       being clipped — at 320px some of these labels do wrap. */
    --btn-h:42px;
    /* the space between the appearance group and the account group: wider than
       the 10px inside a group, so the two read as two */
    --nav-seam:22px;
  }
  [data-theme="dark"]{
    /* brand panels stay dark: white text sits on them */
    --panel-a:#2A1723;--panel-b:#8E3348;--panel-c:#B4485F;
    --bg:#1C1218;
    --ink:#F3E8EF;
    --muted:#B49BAA;
    --wine:#DD7B90;
    --wine-deep:#B4485F;
    --plum:#F3E8EF;
    --gold:#E2A862;
    --blush:#3A2531;
    --card:#271A22;
    --line:#453040;
    --ok:#74C49A;
    --tint:221,123,144;
    --tint-deep:180,72,95;
    --field:#2F2130;
    --soft:#33222C;
    --soft-2:#38242E;
    --error-bg:#47222C;
    --error-ink:#F2A8B4;
    --share-bg:#302029;
    --track:#453040;
    --tag-alt-bg:#4A3A22;
    --tag-alt-ink:#E0B070;
    --header-bg:rgba(28,18,24,.88);
    --shadow:0 12px 32px rgba(0,0,0,.35);
  }
  *{box-sizing:border-box;margin:0;padding:0}
  html{scroll-behavior:smooth}
  body{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    background:var(--bg);color:var(--ink);line-height:1.6;-webkit-font-smoothing:antialiased;
    transition:background .25s ease,color .25s ease;
  }
  h1,h2,h3,h4,.serif{font-family:Georgia,"Iowan Old Style","Times New Roman",serif;font-weight:700;line-height:1.2}
  a{color:var(--wine);text-decoration:none}
  a:hover{text-decoration:underline}
  .container{max-width:1080px;margin:0 auto;padding:0 22px}
  .muted{color:var(--muted)}
  .center{text-align:center}
  .eyebrow{font-size:.78rem;letter-spacing:.16em;text-transform:uppercase;color:var(--wine);font-weight:700}

  /* ---------- header / footer ---------- */
  .site-header{
    position:sticky;top:0;z-index:50;
    background:var(--header-bg);backdrop-filter:blur(10px);
    border-bottom:1px solid var(--line);
  }
  /* height:auto with a min keeps the 66px bar when everything fits, but lets it
     grow instead of crushing the controls if the nav has to take a second row */
  .site-header .container{display:flex;align-items:center;justify-content:space-between;height:auto;min-height:66px;gap:14px}
  .site-header .nav-actions{flex:0 1 auto;min-width:0;justify-content:flex-end}
  .logo{display:flex;align-items:center;gap:10px;font-family:Georgia,serif;font-size:1.22rem;font-weight:700;color:var(--plum);white-space:nowrap}
  .logo:hover{text-decoration:none}
  .logo .heart{width:30px;height:30px;flex:0 0 auto}
  /* Two groups — preferences (gear) and the account (bell, balance, name) —
     with a wider gap between them than inside them. Wrapping is only allowed at
     that seam: if the header runs out of room it breaks into two rows, never
     mid-group. */
  .nav-actions{display:flex;gap:var(--nav-seam);align-items:center;flex-wrap:wrap;row-gap:6px}
  .nav-group{display:flex;gap:10px;align-items:center;flex-wrap:nowrap;min-width:0}
  /* the divider is what makes the seam read as a divide rather than a stray
     margin. It carries no gap of its own on the left, so the space either side
     of the rule is even. */
  .nav-user{padding-left:var(--nav-seam);border-left:1px solid var(--line)}
  .lang-switch{display:flex;gap:5px;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:4px}
  .lang-btn{
    border:none;background:transparent;border-radius:999px;padding:6px 11px;font-size:.82rem;font-weight:750;
    color:var(--muted);cursor:pointer;transition:all .15s ease;letter-spacing:.03em;
  }
  .lang-btn:hover{color:var(--wine)}
  .lang-btn.sel{background:linear-gradient(135deg,var(--wine-deep),var(--wine));color:#fff}
  .theme-btn{
    width:38px;height:38px;border-radius:50%;border:1px solid var(--line);background:var(--card);
    font-size:1.05rem;cursor:pointer;transition:transform .15s ease;display:flex;align-items:center;justify-content:center;
  }
  .theme-btn:hover{transform:rotate(-14deg) scale(1.06)}
  .prefs-wrap{position:relative;display:flex;align-items:center}
  .prefs-toggle{color:var(--plum)}
  .prefs-toggle svg{display:block;width:19px;height:19px;flex:0 0 auto}
  .prefs-toggle[aria-expanded="true"]{background:var(--soft);border-color:var(--wine)}
  .prefs-menu{
    position:absolute;top:calc(100% + 10px);right:0;z-index:90;
    width:min(350px,calc(100vw - 24px));padding:13px 15px;
    border:1px solid var(--line);border-radius:14px;background:var(--card);color:var(--ink);
    box-shadow:0 14px 38px rgba(36,20,29,.2);text-align:left;
  }
  .prefs-menu[hidden]{display:none}
  .prefs-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:7px 0}
  .prefs-label{flex:1 1 auto;min-width:90px;font-size:.84rem;font-weight:700;color:var(--ink)}
  .prefs-segment{display:flex;flex:0 0 auto;gap:2px;padding:3px;border:1px solid var(--line);border-radius:999px;background:var(--soft)}
  .prefs-choice{border:0;border-radius:999px;padding:6px 10px;background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:750;line-height:1.2;cursor:pointer}
  .prefs-choice:hover{color:var(--wine)}
  .prefs-choice[aria-pressed="true"]{background:linear-gradient(135deg,var(--wine-deep),var(--wine));color:#fff}
  .prefs-note,.prefs-status{font-size:.74rem;line-height:1.45;margin:8px 0 0}
  .prefs-note{color:var(--muted)}
  .prefs-status{color:var(--wine);font-weight:650}
  #navAccount{
    max-width:12rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    font-weight:700;color:var(--plum);
  }
  #navAccount[hidden]{display:none}
  /* balance pill, immediately left of the account chip */
  .credit-badge{
    flex:0 0 auto;
    border:1px solid var(--line);
    background:var(--card);color:var(--plum);
    text-decoration:none;
    transition:border-color .15s ease,transform .15s ease;
  }
  /* the global a:hover underlines every link; the pill is a button, not a link */
  .credit-badge, .credit-badge:hover, .credit-badge:focus{text-decoration:none}
  .credit-badge::before{content:"\25CF";font-size:.72rem;color:var(--wine);line-height:1}
  .credit-badge:hover{border-color:var(--wine);transform:translateY(-1px)}
  .credit-badge:focus-visible{outline:2px solid var(--wine);outline-offset:2px}
  .credit-badge[hidden]{display:none}
  /* the number keeps its weight, the unit rides along a shade lighter */
  .credit-badge .cb-num{font-weight:800}
  .credit-badge .cb-text{font-weight:600;color:var(--muted)}
  .credit-badge.empty .cb-num{font-weight:700}
  .credit-badge.unlimited{color:var(--wine)}
  .credit-badge.unlimited .cb-text{color:var(--wine)}
  .credit-badge.unlimited::before{content:"\221E";font-size:.95rem}
  .credit-badge.empty{color:var(--muted)}

  /* the packages section when arrived at from the balance pill */
  .buy-section{scroll-margin-top:90px;outline:none;border-radius:8px}
  .buy-section:focus-visible{outline:2px solid var(--wine);outline-offset:6px}
  /* a short glow when you are brought here by the balance pill, so it is clear
     where you landed */
  .buy-section.landed{animation:buyLanded 2.2s ease-out}
  @keyframes buyLanded{
    0%{box-shadow:0 0 0 0 rgba(var(--tint),.45)}
    35%{box-shadow:0 0 0 6px rgba(var(--tint),.16)}
    100%{box-shadow:0 0 0 0 rgba(var(--tint),0)}
  }
  @media (prefers-reduced-motion:reduce){ .buy-section.landed{animation:none} }

  /* invite / referral box on the account page */
  .referral-box{
    border:1px solid var(--line);border-radius:14px;
    padding:14px 16px 16px;background:rgba(255,255,255,.028);
  }
  .referral-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
  .referral-row .text-input{
    flex:1 1 220px;min-width:0;font-size:.9rem;
    font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  }

  /* gifting: the same box as the invite panel, with the confirm step inline so
     the sender never loses sight of who the credits are going to */
  .gift-box{
    border:1px solid var(--line);border-radius:14px;
    padding:14px 16px 16px;background:var(--soft);
  }
  .gift-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-top:8px}
  /* a promo code is an alternative to buying, so it sits with the packages —
     but as one row, not a card: most readers scroll past it */
  .promo-box{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
  .promo-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
  .promo-row .field-label{flex:0 0 auto}
  .promo-row .text-input{flex:1 1 160px;min-width:0;max-width:260px}
  .promo-row .btn{flex:0 0 auto}
  .gift-row > div:first-child{flex:1 1 200px;min-width:0}
  .gift-row .text-input{width:100%}
  /* where the balance came from: a table because it is read, not filled in,
     and the two columns that matter are the number and the verdict */
  .gift-sources{
    width:100%;border-collapse:collapse;margin-top:12px;
    font-size:.92rem;background:var(--card);border-radius:12px;overflow:hidden;
  }
  .gift-sources caption{
    caption-side:top;text-align:left;padding:0 0 8px;
    font-size:.86rem;font-weight:750;letter-spacing:.04em;text-transform:uppercase;
    color:var(--muted);
  }
  .gift-sources td{
    padding:9px 12px;border-top:1px solid var(--line);vertical-align:middle;
  }
  .gift-sources tr:first-child td{border-top:0}
  .gift-sources td:first-child{padding-left:14px}
  .gift-sources td:last-child{padding-right:14px;text-align:right}
  .gift-src-count{white-space:nowrap;font-weight:750;color:var(--ink)}
  @media (max-width:640px){
    .gift-sources td{padding:8px 8px}
    .gift-sources td:first-child{padding-left:10px}
    .gift-sources td:last-child{padding-right:10px}
  }
  .gift-confirm{
    border:1.5px solid rgba(var(--tint),.45);border-radius:14px;
    padding:14px 16px;background:var(--card);
  }
  .gift-confirm .quiz-nav{margin-top:10px}
  /* both instances sit in a box of their own; only the first needs the heading
     rhythm that .sec-title already gives it */
  #giftBoxBuy{margin-top:22px}
  @media (max-width:640px){
    .gift-row > div:first-child,.gift-row > div:last-child{flex:1 1 100%}
  }
  .referral-row .btn{flex:0 0 auto}
  .credit-badge.empty:hover{color:var(--wine)}
  .site-footer{margin-top:56px;padding:24px 0 30px;border-top:1px solid var(--line);text-align:center;color:var(--muted);font-size:.92rem}

  /* ---------- maintenance bar ---------- */
  .maint-bar{
    position:sticky;top:0;z-index:60;padding:10px 16px;text-align:center;
    background:var(--wine-deep);color:#fff;font-size:.9rem;font-weight:600;
    box-shadow:0 6px 18px rgba(43,26,38,.22);
  }
  .is-maintenance .btn.primary{filter:saturate(.5) brightness(.95)}

  /* ---------- notifications (bell, panel, toasts) ---------- */
  .notif-wrap{position:relative;display:flex}
  .notif-wrap[hidden]{display:none}
  .notif-btn{position:relative}
  .notif-count{
    position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;
    background:var(--wine);color:#fff;font-size:.7rem;font-weight:700;line-height:18px;text-align:center;
    box-shadow:0 0 0 2px var(--bg);
  }
  .notif-count[hidden]{display:none}
  .notif-btn.has-new{border-color:var(--wine)}
  .notif-panel{
    position:absolute;top:46px;right:0;width:min(340px,calc(100vw - 24px));max-height:min(70vh,440px);overflow:auto;
    background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 40px rgba(43,26,38,.18);
    z-index:60;text-align:left;
  }
  .notif-panel[hidden]{display:none}
  .notif-head{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:12px 14px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--card);
  }
  .notif-head strong{font-size:.95rem}
  .notif-clear{
    border:none;background:none;color:var(--wine);font-size:.82rem;font-weight:700;cursor:pointer;padding:2px 0;
  }
  .notif-clear[hidden]{display:none}
  .notif-clear:hover{text-decoration:underline}
  /* nothing left to clear: still there, visibly settled, and still clickable */
  .notif-clear.done{color:var(--muted);font-weight:600}
  .notif-clear.done:hover{text-decoration:none}
  /* the row holds a link and a dismiss button; the link keeps the whole width
     so the target stays big, and the button sits at the edge, out of the text */
  .notif-head-btns{display:flex;align-items:center;gap:12px}
  .notif-list{display:flex;flex-direction:column}
  .notif-row{display:flex;align-items:stretch;border-bottom:1px solid var(--soft-2)}
  .notif-row:last-child{border-bottom:none}
  .notif-item{
    flex:1 1 auto;min-width:0;
    display:flex;gap:10px;align-items:flex-start;padding:11px 4px 11px 14px;
    color:inherit;text-decoration:none;
  }
  .notif-row:last-child .notif-item{border-bottom:none}
  .notif-del{
    flex:0 0 auto;align-self:center;margin-right:8px;
    width:26px;height:26px;border-radius:50%;border:1px solid transparent;background:none;
    color:var(--muted);font-size:1.05rem;line-height:1;cursor:pointer;padding:0;
  }
  .notif-del:hover,.notif-del:focus-visible{background:var(--soft);border-color:var(--line);color:var(--wine)}
  .notif-clear-all{color:var(--muted)}
  .notif-clear-all:hover{color:var(--wine)}
  .notif-item:hover{background:var(--soft);text-decoration:none}
  .notif-avatar{
    flex:0 0 auto;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;
    background:linear-gradient(135deg,var(--wine-deep),var(--gold));color:#fff;font-weight:700;font-size:.85rem;
  }
  .notif-body{display:flex;flex-direction:column;gap:2px;min-width:0}
  .notif-text{font-size:.9rem;line-height:1.35}
  .notif-when{font-size:.76rem;color:var(--muted)}
  .notif-empty{margin:0;padding:26px 14px;text-align:center;color:var(--muted);font-size:.9rem}
  .notif-toasts{
    position:fixed;top:14px;right:14px;z-index:80;display:flex;flex-direction:column;gap:8px;
    width:min(320px,calc(100vw - 28px));pointer-events:none;
  }
  .notif-toast{
    pointer-events:auto;display:flex;align-items:center;gap:9px;text-align:left;cursor:pointer;
    background:var(--card);border:1px solid var(--line);border-left:3px solid var(--wine);border-radius:12px;
    padding:11px 13px;font:inherit;font-size:.88rem;color:var(--ink);box-shadow:0 14px 30px rgba(43,26,38,.16);
    opacity:0;transform:translateY(-6px);transition:opacity .2s ease,transform .2s ease;
  }
  .notif-toast.in{opacity:1;transform:none}
  .notif-toast-dot{
    flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--wine);
  }
  @media (max-width:760px){
    .notif-count{min-width:16px;height:16px;line-height:16px;font-size:.66rem}
    .notif-toasts{top:auto;bottom:14px;right:14px;left:14px;width:auto}
  }

  /* ---------- buttons ----------

     Every one of these is --btn-h tall, and that is the *only* thing that
     decides a button's height. The padding below is horizontal on purpose:
     with vertical padding still in play the height would be padding + border
     + line box, so a .ghost (border) came out 3px taller than a plain one and
     a wrapped label changed it again. Sized from the centre instead, the
     border is inside the box, the label cannot move it, and .small is a
     narrower button rather than a shorter one. */
  .btn{
    display:inline-flex;align-items:center;justify-content:center;gap:8px;
    border:none;border-radius:999px;cursor:pointer;font-size:1rem;font-weight:650;
    min-height:var(--btn-h);padding:0 22px;line-height:1.2;
    text-align:center;
    transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
    text-decoration:none;
  }
  .btn:hover{transform:translateY(-1px);text-decoration:none}
  .btn:disabled{opacity:.45;cursor:not-allowed;transform:none}
  .btn.primary{background:linear-gradient(135deg,var(--wine-deep),var(--wine));color:#fff;box-shadow:0 8px 22px rgba(var(--tint),.32)}
  .btn.primary:hover{box-shadow:0 12px 28px rgba(var(--tint),.42)}
  .btn.ghost{background:transparent;color:var(--wine);border:1.5px solid rgba(var(--tint),.35)}
  .btn.soft{background:var(--blush);color:var(--wine)}
  .btn.white{background:#fff;color:var(--on-light-strong);box-shadow:0 8px 22px rgba(0,0,0,.18)}
  /* smaller type in a closer-fitting pill: same height, less width */
  .btn.small{padding:0 16px;font-size:.9rem}

  /* ---------- hero ---------- */
  .hero{
    position:relative;overflow:hidden;color:#fff;
    background:
      radial-gradient(1100px 480px at 85% -10%, rgba(255,255,255,.16), transparent 60%),
      radial-gradient(900px 500px at -10% 110%, rgba(217,146,63,.30), transparent 55%),
      linear-gradient(135deg,var(--panel-a) 0%,var(--panel-b) 52%,var(--panel-c) 100%);
  }
  /* hero-inner and container are the SAME element, so a padding shorthand here
     replaces the container's side gutter rather than adding to it — the hero
     ran edge to edge, and on a phone the heading clipped at both sides. */
  .hero-inner{padding-top:56px;padding-bottom:62px;max-width:760px}
  .hero h1{font-size:clamp(2.05rem,4.6vw,3.25rem);letter-spacing:-.015em}
  .hero h1 em{font-style:italic;color:var(--on-dark-soft)}
  .hero .eyebrow{color:var(--on-dark-soft)}
  /* an all-white or all-transparent button sitting on the coloured hero */
  .btn.ghost.on-dark{color:var(--on-dark);border-color:var(--on-dark-line)}
  .btn.ghost.on-dark:hover{background:rgba(255,255,255,.12);border-color:var(--on-dark)}
  .panel-brand{
    background:linear-gradient(135deg,var(--panel-a),var(--panel-b) 55%,var(--panel-c));
    color:var(--on-dark);padding:36px 24px;
  }
  .panel-brand h2{color:var(--on-dark);font-size:clamp(1.55rem,2.8vw,2.05rem)}
  .panel-brand p{color:var(--on-dark-text)}
  .hero p.lead{margin-top:14px;font-size:clamp(1rem,1.9vw,1.14rem);color:var(--on-dark-text);max-width:620px}
  .hero-cta{margin-top:22px;display:flex;gap:12px;flex-wrap:wrap;align-items:center}
  .hero-note{margin-top:12px;font-size:.88rem;color:rgba(255,255,255,.78)}
  .code-box{
    margin-top:20px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;
    background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.28);
    padding:10px;border-radius:14px;max-width:480px;
  }
  .code-box input{
    flex:1 1 200px;min-width:0;border:none;border-radius:10px;padding:12px 14px;font-size:1rem;
    background:rgba(255,255,255,.95);color:var(--on-light-ink);
  }
  .code-box input:focus{outline:2px solid var(--on-dark-soft)}

  /* ---------- sections ---------- */
  section.block{padding:52px 0 4px}
  .section-head{max-width:680px}
  .section-head h2{font-size:clamp(1.55rem,2.9vw,2.1rem);margin-top:8px}
  .section-head p{margin-top:10px;color:var(--muted);font-size:1rem}

  .pick-grid{margin-top:26px;display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr))}
  .pick-card{
    background:var(--card);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow);
    border:1.5px solid transparent;display:flex;flex-direction:column;gap:10px;transition:border-color .15s ease, transform .15s ease;
  }
  .pick-card:hover{border-color:rgba(var(--tint),.45);transform:translateY(-2px)}
  .pick-tag{
    align-self:flex-start;font-size:.78rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;
    background:var(--blush);color:var(--wine);border-radius:999px;padding:6px 14px;
  }
  .pick-tag.spark{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}
  .pick-card h3{font-size:1.3rem}
  .pick-card p{color:var(--muted)}
  .pick-card .btn{align-self:flex-start;margin-top:6px}
  .pick-note{margin-top:12px;font-size:.88rem;color:var(--muted)}

  .seg{display:inline-flex;gap:6px;background:var(--blush);border-radius:999px;padding:5px;margin-top:16px}
  .seg-btn{
    border:none;background:transparent;border-radius:999px;padding:8px 16px;font-size:.88rem;font-weight:700;
    color:var(--wine);cursor:pointer;transition:all .15s ease;
  }
  .seg-btn.sel{background:var(--card);color:var(--wine);box-shadow:0 3px 10px rgba(74,35,64,.12)}

  /* The create/sign-in cards put two buttons in a .quiz-nav, and on a phone the
     generic rules below stretched each to half the card and 46px tall. In a
     narrow card that reads as two billboards under a short form: these two are
     a confirmation and its way out, so they stay ordinary button size and sit
     together on the right. Scoped with .quiz-nav because the two selectors have
     equal specificity — .auth-actions alone would lose to the later rule. */
  .quiz-nav.auth-actions{justify-content:flex-end;gap:10px}

  .pillars-grid{
    margin-top:26px;display:grid;gap:14px;
    grid-template-columns:repeat(auto-fill,minmax(min(310px,100%),1fr));
  }
  .pillar-card{
    background:var(--card);border-radius:var(--radius);padding:18px 18px 15px;
    box-shadow:var(--shadow);border:1px solid var(--line);
  }
  .pillar-card .num{
    display:inline-flex;align-items:center;justify-content:center;
    width:34px;height:34px;border-radius:10px;background:var(--blush);color:var(--wine);
    font-weight:800;font-size:.92rem;
  }
  .pillar-card h3{margin-top:8px;font-size:1.12rem}
  .pillar-card .ask{margin-top:6px;font-style:italic;color:var(--wine);font-family:Georgia,serif}
  .pillar-card p.blurb{margin-top:8px;color:var(--muted);font-size:.92rem}
  .pillar-card .sign{
    margin-top:10px;padding:8px 10px;border-radius:12px;background:var(--soft);
    font-size:.85rem;color:var(--wine);
  }

  .lens-grid{margin-top:26px;display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(195px,100%),1fr))}
  .lens-card{background:var(--card);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
  .lens-card .emoji{font-size:1.6rem}
  .lens-card h3{margin-top:10px;font-size:1.08rem}
  .lens-card p{margin-top:8px;color:var(--muted);font-size:.92rem}

  .how-grid{margin-top:26px;display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr))}
  .how-card{background:var(--card);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
  /* A 42px disc cannot carry the brand ramp. The hero and the closing panel are
     full-width and show the whole rise from --panel-a to --panel-c; a circle
     this size shows mostly the stop it starts on, and that stop is the one the
     dark theme moves to near-card-black — which is how the numbers ended up
     floating on a smudge over the card, only in dark mode.
     So it is a solid disc, and it flips with the mode instead of trying to
     gradient: --panel-b (the ramp's middle, identical in both modes) under white
     digits on light cards, --wine (which the dark theme lightens) under the dark
     on-light ink on dark cards. Both are measured in tools/test-header.js:
     at least 3:1 against the card and 4.5:1 for the digits, on all ten states. */
  .how-card .step-badge{
    width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;
    background:var(--panel-b);color:var(--on-dark);font-weight:800;
  }
  [data-theme="dark"] .how-card .step-badge{background:var(--wine);color:var(--on-light-ink)}
  .how-card h3{margin-top:10px;font-size:1.12rem}
  .how-card p{margin-top:8px;color:var(--muted);font-size:.95rem}

  .fact-row{margin-top:24px;display:flex;gap:12px;flex-wrap:wrap}
  .chip{
    background:var(--card);border:1px solid var(--line);border-radius:999px;padding:9px 18px;
    font-size:.92rem;color:var(--plum);font-weight:600;
  }

  /* ---------- cards / forms ---------- */
  .card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:24px}
  .narrow{max-width:680px;margin:0 auto}
  .quiz-wrap{padding:32px 0 12px}
  .field-label{display:block;font-weight:650;margin-bottom:8px}
  .text-input{
    width:100%;border:1.5px solid var(--line);border-radius:14px;padding:14px 16px;font-size:1.05rem;
    background:var(--field);color:var(--ink);
  }
  .text-input:focus{outline:none;border-color:var(--wine);box-shadow:0 0 0 4px rgba(var(--tint),.14)}
  .form-note{margin-top:12px;font-size:.92rem;color:var(--muted)}
  .error-msg{
    margin-top:14px;background:var(--error-bg);color:var(--error-ink);border-radius:12px;padding:12px 14px;font-size:.93rem;
    border:1px solid rgba(var(--tint),.25);
  }

  /* ---------- quiz steps ---------- */
  .progress{height:8px;background:var(--blush);border-radius:999px;overflow:hidden;margin:10px 0 6px}
  .progress .fill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--wine-deep),var(--gold));transition:width .35s ease}
  .step-label{display:flex;justify-content:space-between;gap:12px;font-size:.88rem;color:var(--muted);font-weight:650}

  .quiz-card h2{font-size:clamp(1.45rem,2.7vw,1.85rem);margin-top:10px}
  .pillar-ask{margin-top:8px;font-family:Georgia,serif;font-style:italic;font-size:1.12rem;color:var(--wine)}
  .pillar-blurb{margin-top:10px;color:var(--muted);max-width:62ch}
  .pillar-sign{
    margin-top:16px;padding:12px 16px;border-radius:14px;background:var(--soft-2);border-left:4px solid var(--gold);
    font-size:.92rem;color:var(--ink);
  }
  .questions{margin-top:20px;display:grid;gap:16px}
  .q-item{border-top:1px solid var(--line);padding-top:14px}
  .q-item:first-child{border-top:none;padding-top:0}
  .q-text{font-size:1.05rem;font-weight:600}
  .q-num{
    display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;
    border-radius:50%;background:var(--blush);color:var(--wine);font-size:.82rem;font-weight:800;
    margin-right:10px;vertical-align:middle;
  }
  .likert{margin-top:13px;display:flex;gap:10px;flex-wrap:wrap}
  .likert-opt{
    min-width:52px;height:52px;border-radius:14px;border:1.5px solid var(--line);
    background:var(--field);font-size:1.05rem;font-weight:700;color:var(--muted);cursor:pointer;
    transition:all .15s ease;flex:1 1 52px;max-width:86px;
  }
  .likert-opt:hover{border-color:var(--wine);color:var(--wine)}
  .likert-opt.sel{
    background:linear-gradient(135deg,var(--wine-deep),var(--wine));border-color:transparent;
    color:#fff;box-shadow:0 6px 16px rgba(var(--tint),.30);transform:translateY(-1px);
  }
  .likert-legend{margin-top:16px;font-size:.85rem;color:var(--muted)}
  .quiz-nav{margin-top:22px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
  .skip-link{
    background:none;border:none;color:var(--muted);cursor:pointer;font-size:.92rem;
    text-decoration:underline;padding:8px 0;font-weight:600;
  }
  .skip-link:hover{color:var(--wine)}

  /* scroll-to-unanswered highlight */
  @keyframes nudge{
    0%,100%{transform:translateX(0)}
    20%{transform:translateX(-7px)}
    40%{transform:translateX(7px)}
    60%{transform:translateX(-4px)}
    80%{transform:translateX(4px)}
  }
  .q-item.unanswered,.date-row.unanswered{
    outline:2.5px solid var(--wine);outline-offset:8px;border-radius:14px;
    animation:nudge .5s ease;
  }

  /* forced choice A/B */
  .choice{margin-top:13px;display:grid;grid-template-columns:1fr 1fr;gap:12px}
  .choice-opt{
    display:flex;align-items:center;gap:12px;text-align:left;
    border:1.5px solid var(--line);border-radius:16px;background:var(--field);
    padding:15px 16px;font-size:.97rem;font-weight:600;color:var(--ink);cursor:pointer;
    transition:all .15s ease;line-height:1.4;
  }
  .choice-opt:hover{border-color:var(--wine)}
  .choice-opt.sel{
    border-color:var(--wine);background:linear-gradient(135deg,rgba(var(--tint-deep),.14),rgba(var(--tint),.20));
    box-shadow:0 6px 16px rgba(var(--tint),.16);
  }
  .choice-key{
    flex:0 0 auto;width:30px;height:30px;border-radius:9px;background:var(--blush);color:var(--wine);
    display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.85rem;
  }
  .choice-opt.sel .choice-key{background:var(--wine);color:#fff}

  /* birthdate */
  .date-row{margin-top:14px;display:flex;gap:12px;flex-wrap:wrap}
  .date-row select{
    border:1.5px solid var(--line);border-radius:14px;padding:13px 14px;font-size:1.02rem;
    background:var(--field);color:var(--ink);min-width:130px;
  }
  .date-row select:focus{outline:none;border-color:var(--wine);box-shadow:0 0 0 4px rgba(var(--tint),.14)}

  /* ---------- share / invite hub ---------- */
  .link-list{margin-top:14px;display:grid;gap:10px}
  .account-quiz-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:14px 0 4px}
  .account-quiz-search-label{flex:0 0 100%;margin:0}
  .account-quiz-toolbar .text-input{flex:1 1 240px;max-width:420px;min-width:180px}
  .account-quiz-selection{font-size:.88rem;flex:1 1 auto}
  .account-quiz-delete-note{margin:4px 0 8px}
  .account-quiz-table-wrap{margin-top:8px}
  .account-quizzes-table{min-width:900px}
  .account-quiz-sort{appearance:none;border:0;padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;text-transform:inherit;cursor:pointer}
  .account-quiz-sort:hover{color:var(--wine)}
  .account-quiz-meta{display:block;margin-top:3px;font-size:.76rem;color:var(--muted);font-weight:400}
  .account-quiz-match{font-variant-numeric:tabular-nums;font-weight:700}
  .account-quiz-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
  .account-quiz-actions .btn{white-space:nowrap;flex:0 0 auto}
  .account-quiz-no-results{text-align:center;color:var(--muted);padding:22px!important}
  .link-row{
    display:flex;gap:10px;align-items:center;flex-wrap:wrap;
    border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:var(--field);
  }
  .link-row input{
    flex:1 1 220px;min-width:0;border:1.5px dashed var(--wine);border-radius:10px;padding:10px 12px;
    font-size:.88rem;background:var(--share-bg);color:var(--plum);font-weight:600;
  }
  /* A chip is one line, whatever is written in it, and every chip is the same
     height — the row reads across, so a chip that grows is a row that jumps.
     `white-space:nowrap` and an explicit line-height are what make that true
     rather than merely likely: without them a chip holding two words becomes
     two lines the moment the row runs short of room.

     The modifiers are named for what they mean, never for a page. `.waiting`
     used to be one, and the waiting-room page's own `.waiting{padding:52px
     0}` — later in this file, same specificity — quietly won the cascade and
     turned "User replied" into a chip 100px tall. */
  .status-chip{
    display:inline-flex;align-items:center;
    font-size:.78rem;line-height:1.35;font-weight:750;letter-spacing:.05em;text-transform:uppercase;
    white-space:nowrap;border-radius:999px;padding:5px 12px;flex:0 0 auto;
  }
  .status-chip.done{background:rgba(62,125,94,.15);color:var(--ok)}
  /* who owes whom an answer, which is not a status: open, solved and closed
     say where a ticket stands, this says whose move it is */
  .status-chip.needs-reply{background:var(--blush);color:var(--wine)}
  .status-chip.unused{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}
  /* Where a ticket stands, named after the state so a fourth is a new rule
     rather than a rewrite of a ternary in the markup. Open needs an answer,
     so it carries the accent; solved is the good ending, so it is green;
     closed is simply finished, and nothing about it asks to be looked at. */
  .status-chip.ticket-state-open{background:var(--blush);color:var(--wine)}
  .status-chip.ticket-state-solved{background:rgba(62,125,94,.15);color:var(--ok)}
  .status-chip.ticket-state-closed{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}

  /* Tickets. One row each, the state on the left where a queue puts it, and the
     whole row is the control that opens the conversation. */
  .ticket-list{display:grid;gap:10px}
  .ticket{border:1px solid var(--line);border-radius:14px;background:var(--field);overflow:hidden}
  .ticket[open]{border-color:var(--wine)}
  .ticket-head{
    display:flex;gap:10px;align-items:center;flex-wrap:wrap;
    padding:12px 14px;cursor:pointer;list-style:none;
  }
  .ticket-head::-webkit-details-marker{display:none}
  .ticket-head:hover{background:var(--share-bg)}
  .ticket-title{flex:1 1 190px;min-width:0;font-weight:650;color:var(--plum)}
  /* What the ticket is, beside the status instead of buried in the meta line.
     Outlined rather than filled, so it reads as a second rank of information
     next to the status chip rather than competing with it. It is also the only
     thing that names a ticket whose title was left blank, so it keeps the
     row's weight in that case. */
  .ticket-kind{
    font-size:.76rem;font-weight:650;letter-spacing:.03em;
    border-radius:999px;padding:4px 10px;flex:0 0 auto;
    border:1px solid var(--line);color:var(--muted);
  }
  /* Pushed right, so the row still reads left-to-right when there is no title
     to fill the middle. */
  .ticket-meta{font-size:.84rem;margin-left:auto}
  .ticket-body{padding:0 14px 14px;border-top:1px solid var(--line);margin-top:0}
  /* The status picker sits at the top of the ticket, above the conversation:
     it is a mark on the ticket as a whole, not part of the reply being
     written below it. Laid out as a row so the label and the select share the
     line, and with no top margin so it meets the head the way the log does. */
  .ticket-body .ticket-status{display:flex;align-items:center;gap:8px;padding:0}
  .ticket-status .text-input{flex:0 1 auto;min-width:8rem;padding:6px 8px}
  /* Who the ticket is about, and what can be done about them. One row, the
     name first because that is what the eye is looking for, then the actions
     — each of which appears only for somebody allowed to take it, so the row
     is as long as the reader's own permissions and no longer. */
  .ticket-mod{
    display:flex;align-items:center;gap:8px;flex-wrap:wrap;
    margin-top:10px;padding:8px 10px;
    border:1px solid var(--line);border-radius:10px;background:var(--share-bg);
  }
  /* Clearing several tickets at once. The bar sits with the tickets it acts
     on, and says how many it will take — the number is always exactly what
     pressing delete removes, so a filter narrows it rather than hiding it. */
  .ticket-bulk{
    display:flex;align-items:center;gap:10px;flex-wrap:wrap;
    margin:8px 0;padding:8px 10px;
    border:1px solid var(--line);border-radius:10px;background:var(--share-bg);
  }
  .ticket-bulk-all{display:inline-flex;align-items:center;gap:6px;font-size:.86rem;cursor:pointer}
  .ticket-bulk-all input{margin:0;cursor:pointer}
  .ticket-bulk-count{font-size:.86rem;color:var(--muted);margin-right:auto}
  .ticket-bulk-field{display:inline-flex;align-items:center;gap:6px;font-size:.86rem}
  .ticket-bulk-field .text-input{width:auto;min-width:0;padding:4px 6px;font-size:.86rem}
  .ticket-bulk-note{font-size:.86rem;color:var(--muted)}
  .ticket-bulk-note:empty{display:none}
  .ticket-head .ticket-select{margin:0 2px 0 0;flex:0 0 auto;cursor:pointer}
  .ticket-mod-who{
    font-size:.86rem;font-weight:700;color:var(--plum);
    margin-right:2px;overflow-wrap:anywhere;
  }
  /* same box as every other button, narrower type: a moderation row holds
     three of these side by side and their wording is short */
  .ticket-mod .btn{padding:0 12px;font-size:.8rem}
  .ticket-mod-status{font-size:.84rem;color:var(--muted)}
  /* the network or device picker, opened only when a ban is asked for */
  .ticket-mod-picker{
    margin-top:8px;padding:10px 12px;
    border:1px solid var(--line);border-radius:10px;
  }
  .ticket-mod-picker .text-input{max-width:22rem}
  .ticket .ticket-result{margin-left:10px;font-size:.86rem}

  /* ---- the conversation, drawn the way a chat draws one ----

     Each side of the box belongs to one side of the conversation, so whose
     turn it is needs no label. The log scrolls on its own rather than growing
     without limit: a long ticket would otherwise push the box you type in off
     the bottom of the screen. */
  /* How tall a conversation gets before it scrolls.

     The owner's number lives in one custom property on the document, so every
     conversation on the page reads the same value and pulling one edge moves
     them all without a re-render. The literal is what shows before the page
     has been told the number. */
  .chat-log{
    display:flex;flex-direction:column;gap:2px;
    margin-top:12px;padding:2px 2px 4px;
    max-height:var(--ticket-chat-max, 340px);overflow-y:auto;overscroll-behavior:contain;
    scrollbar-width:thin;
  }
  /* The edge under a conversation.

     Quiet, but not invisible: a handle nobody can find is a feature nobody
     uses, and this one has to be found before it can be dragged. So it is a
     solid bar rather than a hint of one, it is tall enough to catch a pointer
     coming past, and it says what it is on hover and on focus. */
  .chat-resize{
    height:14px;margin:-3px 0 3px;flex:0 0 auto;
    cursor:ns-resize;touch-action:none;border-radius:999px;
    background:transparent;position:relative;
  }
  .chat-resize::after{
    content:"";position:absolute;left:50%;top:50%;
    width:56px;height:4px;margin:-2px 0 0 -28px;
    border-radius:999px;background:var(--track);
  }
  .chat-resize:hover::after,.chat-resize:focus-visible::after{background:var(--wine)}
  .chat-resize:focus-visible{outline:2px solid var(--wine);outline-offset:2px}
  /* while a drag is in flight the pointer belongs to the edge, so nothing else
     on the page may select text or take the pointer for itself */
  body.chat-resizing{cursor:ns-resize;user-select:none}
  body.chat-resizing *{cursor:ns-resize !important}
  /* The box being sized, at the size being chosen.

     `max-height` alone cannot show a drag: a thread shorter than the cap does
     not move when the cap grows, so pulling downwards looked like nothing was
     happening. While the hand is down the box holds the size being chosen —
     up to the screen, so a long pull does not push the page off — and settles
     back to what the thread needs when it is let go. */
  body.chat-resizing .chat-log{min-height:min(var(--ticket-chat-max, 340px), 60vh)}
  /* ...and the number, because a box settling back afterwards is only honest
     if the size you chose was shown while you were choosing it. */
  body.chat-resizing::after{
    content:attr(data-chat-size);
    position:fixed;left:50%;bottom:18px;transform:translateX(-50%);
    z-index:90;pointer-events:none;white-space:nowrap;
    background:var(--plum);color:#fff;border-radius:999px;
    padding:5px 12px;font-size:.78rem;font-weight:750;letter-spacing:.04em;
    box-shadow:0 8px 22px rgba(43,26,38,.28);
  }
  .chat-row{display:flex;flex-direction:column;max-width:82%}
  .chat-row.is-mine{align-self:flex-end;align-items:flex-end}
  .chat-row.is-theirs{align-self:flex-start;align-items:flex-start}
  /* a run from the same person: only the last bubble names who said it, and the
     ones before it tuck in underneath rather than starting a new group */
  .chat-row.chat-starts{margin-top:10px}
  .chat-row.chat-starts:first-child{margin-top:0}
  .chat-meta{
    display:flex;gap:8px;align-items:baseline;
    font-size:.74rem;color:var(--muted);margin:0 4px 3px;
  }
  .chat-who{font-weight:750;letter-spacing:.03em}
  .chat-when{font-size:.72rem}
  .chat-bubble{
    padding:8px 12px;font-size:.92rem;line-height:1.45;
    white-space:pre-wrap;word-break:break-word;
    background:var(--card);border:1px solid var(--line);
  }
  /* the corners where a bubble meets the next one from the same person are
     squared off, so a run reads as one speech rather than several */
  .is-theirs .chat-bubble{border-radius:16px 16px 16px 4px}
  /* --wine-deep rather than --wine: in the dark theme --wine turns light pink,
     and white on it cannot be read. --wine-deep is the one the storefront
     already puts white text on. */
  .is-mine .chat-bubble{border-radius:16px 16px 4px 16px;background:var(--wine-deep);border-color:var(--wine-deep);color:#fff}
  .chat-row.chat-ends .chat-bubble{border-bottom-left-radius:16px}
  .is-mine.chat-ends .chat-bubble{border-bottom-right-radius:16px}
  .chat-bubble p{margin:0}
  .is-mine .chat-bubble a{color:#fff}

  /* ---- putting the packages in order ----

     Not `.pk-card`, which is the card a visitor buys from on the storefront —
     these are the rows of the admin's own editor. */
  .pkg-item{scroll-margin:20px 0}
  .pkg-grip{
    cursor:grab;user-select:none;line-height:1;
    font-size:1.05rem;color:var(--muted);letter-spacing:-2px;
    padding:2px 2px;border-radius:4px;
  }
  .pkg-grip:hover{color:var(--wine)}
  .pkg-grip:active{cursor:grabbing}
  /* only the handle starts a drag, so a click into one of the fields below
     still puts the caret where it was aimed rather than picking the row up */
  .pkg-item.pkg-dragging{opacity:.55;border-style:dashed}
  /* where the row would land: a line on the edge it would sit against */
  .pkg-item.pkg-over-before{box-shadow:0 -3px 0 -1px var(--wine)}
  .pkg-item.pkg-over-after{box-shadow:0 3px 0 -1px var(--wine)}
  .pkg-item .pkg-up,
  .pkg-item .pkg-down{padding:0 8px;font-size:.7rem}
  .pkg-item .pkg-up[disabled],
  .pkg-item .pkg-down[disabled]{opacity:.35;cursor:default}
  .custom-field-grip{
    cursor:grab;user-select:none;line-height:1;font-size:1.05rem;
    color:var(--muted);letter-spacing:-2px;padding:2px 2px;border-radius:4px;
  }
  .custom-field-grip:hover{color:var(--wine)}
  .custom-field-grip:active{cursor:grabbing}
  .custom-card-field.custom-field-dragging{opacity:.55;border-style:dashed}
  .custom-card-field.custom-field-drop-target{box-shadow:0 -3px 0 -1px var(--wine)}
  .custom-card-field .custom-field-up,
  .custom-card-field .custom-field-down{padding:0 8px;font-size:.7rem}
  .custom-card-field .custom-field-up[disabled],
  .custom-card-field .custom-field-down[disabled]{opacity:.35;cursor:default}
  .builtin-card-stage{margin-top:18px}
  .builtin-card-stage-title{margin:0 0 6px;color:var(--muted);font-size:.9rem;font-weight:700}
  .builtin-card-field-head,.builtin-card-option-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  .builtin-card-field-head{justify-content:space-between}
  .builtin-card-field-head label,.builtin-card-option-head label{display:flex;align-items:center;gap:5px;font-size:.86rem}
  .builtin-field-title{flex:1 1 180px;min-width:0}
  .builtin-card-field-order,.builtin-card-option-order{display:flex;gap:5px}
  .builtin-card-field-order .btn,.builtin-card-option-order .btn{padding:0 8px;font-size:.7rem}
  .builtin-card-field-order .btn[disabled],.builtin-card-option-order .btn[disabled]{opacity:.35;cursor:default}
  .builtin-field-details{margin-top:8px}
  .builtin-field-details>summary{cursor:pointer;color:var(--wine);font-size:.9rem;font-weight:650}
  .builtin-card-option code{font-size:.75rem;color:var(--muted);overflow-wrap:anywhere}
  .builtin-card-option{padding:12px}
  @media(max-width:560px){
    .builtin-card-field-head{align-items:flex-start}
    .builtin-field-title{flex-basis:100%}
    .builtin-card-option-head{align-items:flex-start}
  }

  /* ---- the box you type in ---- */
  .chat-composer{display:flex;gap:8px;align-items:flex-end;margin-top:12px}
  .chat-composer .chat-input{
    flex:1 1 auto;min-height:42px;max-height:160px;
    resize:none;overflow-y:auto;padding:10px 12px;line-height:1.4;
    border-radius:18px;
  }
  /* the send button sits beside the field, so it keeps its own corner radius
     to match the box it stands next to — but it is a button, and a button
     is --btn-h tall. It used to carry its own vertical padding, which made
     the one control in the composer a different height from every other. */
  .chat-composer .chat-send{flex:0 0 auto;border-radius:18px;padding:0 18px}
  .chat-composer .chat-send[disabled]{opacity:.6;cursor:default}
  /* the panels keep a status picker and a delete button around the composer */
  .ticket-body .chat-composer + .support-case-delete,
  .ticket-body .chat-composer + .staff-case-delete{margin-top:8px}

  /* Whose move it is. Reads at a glance without competing with the status
     chip, which is the leftmost thing in the row and stays the first thing
     the eye lands on. */
  .turn-chip{
    font-size:.74rem;font-weight:700;letter-spacing:.04em;
    border-radius:999px;padding:4px 10px;flex:0 0 auto;
    background:var(--tag-alt-bg);color:var(--tag-alt-ink);
  }
  .turn-chip.is-you{background:var(--blush);color:var(--wine)}

  /* The ticket filters, side by side: three stacked filter boxes used more
     height than the list they were filtering. */
  .support-filters{
    display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;margin:10px 0 4px;
  }
  .support-filters .filter-field{flex:1 1 180px;min-width:0}
  .support-filters .filter-field .text-input{width:100%}
  .support-filters .field-label{margin-bottom:4px}

  /* The answer box inside a panel ticket, which sits under the conversation
     rather than beside it. */
  .ticket-body .field-label{margin-top:10px}

  .guest-list{margin-top:14px;display:grid;gap:10px}
  .guest-card{
    display:flex;gap:14px;align-items:center;flex-wrap:wrap;
    background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px 15px;
  }
  .guest-card .g-name{font-weight:750;font-size:1.05rem;flex:1 1 140px}
  .guest-card .g-name small{display:block;font-weight:500;color:var(--muted);font-size:.82rem}

  /* ---------- results ---------- */
  .report{padding:32px 0 8px}
  .report-head h2{font-size:clamp(1.75rem,3.5vw,2.35rem);margin-top:8px}
  .report-head .sub{margin-top:8px;color:var(--muted)}
  .profile-ribbon{margin-top:12px;display:flex;gap:10px;flex-wrap:wrap}
  .ribbon-person{
    background:var(--card);border:1px solid var(--line);border-radius:999px;padding:9px 18px;
    font-size:.92rem;font-weight:650;color:var(--plum);display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  }
  .ribbon-person .who{color:var(--wine)}
  .ribbon-person .sep{color:var(--line)}
  .report-hero{
    margin-top:20px;display:flex;gap:26px;align-items:center;flex-wrap:wrap;
    background:
      radial-gradient(600px 300px at 90% 0%, rgba(217,146,63,.16), transparent 60%),
      var(--card);
  }
  .donut-wrap{position:relative;width:158px;height:158px;flex:0 0 auto}
  .donut{width:158px;height:158px;transform:rotate(-90deg)}
  .donut .bg{fill:none;stroke:var(--blush);stroke-width:13}
  .donut .fill{fill:none;stroke:url(#gradScore);stroke-width:13;stroke-linecap:round;transition:stroke-dashoffset 1s ease}
  .donut-center{
    position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  }
  .donut-center strong{font-family:Georgia,serif;font-size:2.15rem;line-height:1;color:var(--plum)}
  /* the score ring and the waiting heart used to be painted with fixed hex
     values, so they stayed wine under every other preset. CSS variables can
     drive SVG paint servers through stop-color:currentColor. */
  .grad-start{stop-color:var(--wine-deep)}
  .grad-end{stop-color:var(--gold)}
  .heart-fill{fill:var(--wine)}
  .donut-center span{font-size:.82rem;color:var(--muted);letter-spacing:.08em;text-transform:uppercase}
  .report-hero h3{font-size:1.55rem}
  .report-hero p{margin-top:10px;color:var(--muted);max-width:52ch}

  .stat-cards{margin-top:14px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr))}
  .stat{padding:15px 17px}
  .stat span{display:block;font-size:.85rem;color:var(--muted);font-weight:650;letter-spacing:.03em}
  .stat strong{display:block;margin-top:5px;font-family:Georgia,serif;font-size:1.45rem;color:var(--plum)}

  .report h3.block-title{margin-top:34px;font-size:1.35rem}
  .block-intro{margin-top:8px;color:var(--muted);max-width:64ch}
  /* the keep-this row at the top of a report */
  .report-actions{margin-top:16px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
  /* the waiting room: who is done, who is not. Deliberately not a progress
     bar — how far somebody has got is their business until they finish. */
  .waiting-checklist{display:grid;gap:2px}
  .wait-row{display:flex;align-items:center;gap:14px;padding:14px 4px;border-bottom:1px solid var(--line)}
  .wait-row:last-child{border-bottom:0}
  .wait-row .wait-mark{
    flex:0 0 auto;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
    font-size:1rem;font-weight:700;background:var(--soft);color:var(--muted);
  }
  .wait-row.done .wait-mark{background:rgba(62,125,94,.15);color:var(--ok)}
  .wait-row.pending .wait-mark{background:var(--blush);color:var(--wine)}
  .wait-row.declined .wait-mark{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}
  .wait-row strong{display:block;font-size:1.02rem}
  .wait-row small{display:block;color:var(--muted);font-size:.88rem}
  .pillar-rows{margin-top:14px;display:grid;gap:12px}
  .pillar-row{background:var(--card);border-radius:18px;padding:16px 18px;box-shadow:var(--shadow)}
  .pr-head{display:flex;align-items:center;gap:14px}
  .pr-head .pr-num{
    width:32px;height:32px;border-radius:10px;background:var(--blush);color:var(--wine);
    display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.9rem;flex:0 0 auto;
  }
  .pr-head .pr-title{flex:1 1 auto;min-width:0}
  .pr-head .pr-title strong{display:block;font-size:1.05rem}
  .pr-head .pr-title small{color:var(--muted);font-style:italic;font-family:Georgia,serif}
  .pr-score{font-family:Georgia,serif;font-size:1.5rem;font-weight:700;flex:0 0 auto}
  .pr-score.high{color:var(--ok)}
  .pr-score.mid{color:var(--gold)}
  .pr-score.low{color:var(--wine)}
  .bar{margin-top:10px;height:10px;border-radius:999px;background:var(--blush);overflow:hidden}
  .bar .bar-fill{height:100%;border-radius:999px;transition:width .8s ease}
  .bar .bar-fill.high{background:linear-gradient(90deg,#5FA97F,var(--ok))}
  .bar .bar-fill.mid{background:linear-gradient(90deg,#E7B26A,var(--gold))}
  .bar .bar-fill.low{background:linear-gradient(90deg,#D97A8B,var(--wine))}

  .track{position:relative;height:30px;margin-top:12px}
  .track .track-line{position:absolute;left:0;right:0;top:13px;height:4px;border-radius:999px;background:var(--track)}
  .track .track-ends{position:absolute;left:0;right:0;top:20px;display:flex;justify-content:space-between;font-size:.72rem;color:var(--muted)}
  .track .dot{
    position:absolute;top:2px;width:24px;height:24px;border-radius:50%;color:#fff;font-size:.72rem;font-weight:800;
    display:flex;align-items:center;justify-content:center;transform:translateX(-50%);box-shadow:0 3px 8px rgba(0,0,0,.18);
  }
  .track .dot.a{background:var(--wine)}
  .track .dot.b{background:var(--gold)}
  .pr-insight{margin-top:10px;font-size:.95rem;color:var(--muted);font-style:italic}
  .legend{display:flex;gap:18px;flex-wrap:wrap;margin-top:10px;font-size:.88rem;color:var(--muted);align-items:center}
  .legend .swatch{display:inline-flex;align-items:center;gap:7px}
  .legend .swatch i{width:12px;height:12px;border-radius:50%;display:inline-block}

  .two-col{margin-top:14px;display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
  .insight-block{padding:13px 0;border-top:1px solid var(--line)}
  .insight-block:first-of-type{border-top:none;padding-top:4px}
  .insight-block strong{font-size:1.05rem}
  .insight-block p{margin-top:6px;color:var(--muted);font-size:.95rem}

  .disclaimer{
    margin-top:20px;background:var(--soft);border:1px solid var(--line);border-radius:16px;
    padding:14px 18px;font-size:.92rem;color:var(--ink);
  }

  /* module report blocks */
  .duo{margin-top:14px;display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr))}
  .duo .card h4{font-size:1.22rem;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
  .tag{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    font-size:.72rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase;
    background:var(--blush);color:var(--wine);border-radius:999px;padding:4px 11px;
  }
  .tag.alt{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}
  .duo .card .lead-line{margin-top:10px;color:var(--muted)}
  .duo .card .tip{margin-top:12px;padding:12px 14px;border-radius:12px;background:var(--soft);font-size:.93rem}
  .duo .card .tip strong{color:var(--wine)}
  .pair-card{margin-top:12px}
  .pair-card .big-emoji{font-size:1.6rem;margin-right:8px}
  .mini-list{margin:12px 0 0;padding-left:20px;color:var(--muted)}
  .mini-list li{margin:8px 0}
  .letter-tags{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
  .letter-tag{
    border:1.5px solid var(--line);border-radius:11px;padding:7px 12px;font-size:.85rem;font-weight:700;
    color:var(--plum);background:var(--field);
  }
  .letter-tag.diff{border-color:rgba(var(--tint),.4);color:var(--wine);background:var(--soft)}
  .type-big{font-family:Georgia,serif;font-size:2rem;letter-spacing:.06em;color:var(--plum)}
  .sign-big{font-size:2.3rem;line-height:1}

  .waiting{padding:52px 0;text-align:center}
  .waiting .heart-pulse{width:58px;height:58px;margin:0 auto 14px;animation:pulse 1.6s ease-in-out infinite}
  @keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.12)}}
  .waiting h2{font-size:1.6rem}
  .waiting p{margin-top:12px;color:var(--muted)}

  .back-link{display:inline-block;margin-bottom:16px;font-weight:650}

  /* ---------- section headings ----------
     One step in the type scale for a heading inside a card, so a page does not
     drift between 1.05 and 1.15rem section by section. The spacing follows the
     same rhythm (18px when it starts a block, 24px between blocks). */
  .sec-title{font-size:1.08rem;margin:18px 0 0;line-height:1.3}
  .sec-title.gap{margin-top:24px}
  .sec-title:first-child{margin-top:0}

  /* ---------- header controls: one height ----------
     The balance pill, username chip, gear and bell all draw from --nav-h, so
     the top-right reads as a single line. Scoped to .site-header .nav-actions
     so it wins over generic button rules above, whatever their order. */
  .site-header .nav-actions .theme-btn,
  .site-header .nav-actions .notif-btn{width:var(--nav-h);height:var(--nav-h);font-size:.95rem;padding:0}
  /* The selector values now sit in the popover, not in the header row: let the
     language group size itself to its contents instead of --nav-h. */
  .site-header .nav-actions .prefs-menu .lang-switch{height:auto;min-height:0;padding:3px;align-items:center;gap:2px}
  .site-header .nav-actions .prefs-menu .lang-btn{height:27px;padding:0 8px;font-size:.76rem}
  .site-header .nav-actions .nav-chip{
    height:var(--nav-h);padding:0 13px;border-radius:999px;line-height:1;
    display:inline-flex;align-items:center;gap:6px;
    font-size:.86rem;font-weight:700;white-space:nowrap;
    /* The username chip is a .btn, and .btn now has a min-height. A min
       beats a height, so without this the chip would grow to the button
       size and drag the whole header with it. The header was already one
       height before any of this (--nav-h, deliberately smaller than a
       page button) and stays that way. */
    min-height:0;
  }
  /* Signing out puts `hidden` back on the balance pill, and this rule's
     `display:inline-flex` would otherwise outrank `.credit-badge[hidden]` —
     the pill stayed on screen, empty, for a signed-out visitor. */
  .site-header .nav-actions .nav-chip[hidden]{display:none}
  .site-header .nav-actions #navAccount.nav-chip{max-width:12rem;font-weight:700;color:var(--plum)}

  @media (max-width:640px){
    :root{--nav-h:30px}
    .hero-inner{padding-top:42px;padding-bottom:52px}
    .hero-cta .btn{width:100%}
    .card{padding:24px 20px}
    .report-hero{gap:22px}
    .pr-score{font-size:1.25rem}
    .quiz-nav .btn{flex:1 1 140px}
    .auth-actions .btn{flex:0 0 auto}
    .choice{grid-template-columns:1fr}
    #navAccount{max-width:7.5rem}
    .site-header .nav-actions .nav-chip{padding:0 10px;font-size:.8rem}
    /* the groups get closer on a phone (the divider still separates them), and
       the language switch tightens rather than pushing the header wider */
    :root{--nav-seam:10px}
    .site-header .nav-actions .lang-btn{padding:0 8px;font-size:.76rem}
    .site-header .nav-actions .nav-prefs,
    .site-header .nav-actions .nav-user{gap:6px}
    /* "3 credits" would push the header wide on a phone; "3" plus the dot is
       enough, and the full wording stays in the tooltip and the aria-label.
       (This block used to repeat its last line outside the comment, which made
       that stray text part of this rule's selector and got the rule thrown
       away — so phones showed the long label and the header ran wide.) */
    .credit-badge .cb-text{display:none}
    .setting-box{padding:12px 12px 14px;border-radius:12px}
  }
  /* ---- quiz maker panel + admin ---- */
  .panel-actions{margin-top:22px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr))}
  .panel-action{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:6px}
  .panel-action h3{font-size:1.05rem}
  .panel-action p{color:var(--muted);font-size:.9rem;flex:1}
  .panel-action .btn{align-self:flex-start;margin-top:6px}
  .kv{margin-top:14px;display:grid;gap:8px}
  .kv-row{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;font-size:.95rem}
  .kv-row .k{color:var(--muted);min-width:120px;font-weight:650}
  /* Audit trails: one line per event. The columns are fixed so a page of them
     reads straight down — the eye finds the date, the action and the detail in
     the same place on every row instead of parsing each line again. The status
     text that used to sit under the summary ("Succeeded · HTTP 200 · POST")
     is gone; only a refusal is named, in --error-ink, so it stands out. */
  .audit-row{display:grid;grid-template-columns:auto minmax(150px,max-content) minmax(110px,1fr) auto minmax(0,1.5fr);gap:6px 20px;align-items:baseline;padding:7px 0;border-bottom:1px solid var(--line)}
  .audit-row:last-child{border-bottom:0}
  .audit-at{display:flex;gap:8px;align-items:baseline;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
  .audit-what{font-weight:650}
  .audit-facts{color:var(--muted);min-width:0;overflow-wrap:anywhere}
  .audit-failed{color:var(--error-ink);font-weight:700;white-space:nowrap}
  .audit-row.is-failed .audit-what{color:var(--error-ink)}
  /* ---- the address groups the audit is folded into ----
     A `<details>` rather than a div with a class: the open/closed state is
     then the element's own, it is keyboard-operable and announced as a
     disclosure without a line of JavaScript, and it survives being re-rendered
     because the attribute is what the styling reads. */
  .audit-group-wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:0 12px;border-bottom:1px solid var(--line)}
  .audit-group-wrap:last-child{border-bottom:0}
  .audit-group-wrap.has-actions .audit-group{grid-column:1;grid-row:1;min-width:0;border-bottom:0}
  .audit-group-wrap:not(.has-actions) .audit-group{grid-column:1/-1}
  .audit-group{border-bottom:0}
  .audit-group-head{
    display:flex;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:wrap;
    padding:10px 0;cursor:pointer;list-style:none;
  }
  /* the default triangle is replaced by one that matches the type */
  .audit-group-head::-webkit-details-marker{display:none}
  .audit-group-head::before{
    content:"\25B8";color:var(--wine);font-size:.8rem;line-height:1;
    transition:transform .15s ease;
  }
  .audit-group[open]>.audit-group-head::before{transform:rotate(90deg)}
  .audit-group-head:hover .audit-group-ip{color:var(--wine)}
  .audit-group-ip{
    font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
    font-weight:650;color:var(--plum);overflow-wrap:anywhere;
  }
  .audit-group-count{color:var(--muted);font-size:.86rem;white-space:nowrap;margin-left:auto}
  .audit-group-actions{grid-column:2;grid-row:1;align-self:start;display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;padding:8px 0}
  .audit-group-actions .btn{font-size:.78rem;padding:0 9px;line-height:1.25}
  .audit-group-action-status{margin:0 0 6px 20px;color:var(--muted);font-size:.86rem}
  .audit-group-action-status:empty{display:none}
  .audit-device-picker{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:minmax(160px,1fr) auto;align-items:end;gap:10px;padding:0 0 10px 20px}
  .audit-device-picker[hidden]{display:none}
  .audit-device-picker .field-label{margin:0}
  .audit-device-picker-actions{display:flex;flex-wrap:wrap;gap:7px}
  /* the rows inside a group sit under it, so the indent says they belong to
     the address above rather than to the page */
  .audit-group-body{padding:0 0 6px 20px}
  .audit-group[open]>.audit-group-body{border-top:1px solid var(--line)}
  /* Shared disclosure groups used by the remaining Admin → Logs views. The
     individual rows stay in the DOM inside the disclosure; expanding one is
     for convenience, never a destructive filter. */
  .admin-log-group{display:block;border-bottom:1px solid var(--line)}
  .admin-log-group>summary{display:flex;align-items:center;gap:10px;padding:10px 12px;cursor:pointer;list-style:none;color:var(--plum);font-weight:650;overflow-wrap:anywhere}
  .admin-log-group>summary::-webkit-details-marker{display:none}
  .admin-log-group>summary::before{content:"\25B8";color:var(--wine);font-size:.8rem;transition:transform .15s ease}
  .admin-log-group[open]>summary::before{transform:rotate(90deg)}
  .admin-log-group-count{margin-left:auto;color:var(--muted);font-size:.84rem;font-weight:500;white-space:nowrap}
  .admin-log-row-origin{display:block;margin-top:3px;color:var(--muted);font-size:.76rem;font-weight:600;letter-spacing:.015em;overflow-wrap:anywhere}
  .admin-log-group-body{padding:0 12px 10px 26px}
  .admin-log-single{border-bottom:1px solid var(--line);padding:4px 0 8px}
  .admin-log-attribution{padding:4px 12px;color:var(--muted);font-size:.78rem;font-weight:650;letter-spacing:.02em;overflow-wrap:anywhere}
  .admin-log-origin-row td{background:var(--soft);color:var(--muted);font-size:.78rem;font-weight:650}
  .admin-log-group-row>td{padding:0!important}
  .admin-log-nested{min-width:760px;margin:0}
  .admin-log-nested tr:last-child td{border-bottom:0}
  .admin-log-group-body .site-alert-lines{margin:0;padding-left:1.4rem}
  .admin-log-group-body .site-alert-lines li{padding:5px 0;overflow-wrap:anywhere}
  @media (max-width:680px){
    .admin-log-group>summary{align-items:flex-start;flex-wrap:wrap;padding:10px}
    .admin-log-group-count{margin-left:0}
    .admin-log-group-body{padding-left:20px}
  }
  @media (pointer:coarse){
    /* a thumb needs a taller target than a row of text */
    .audit-group-head{padding:13px 0}
  }
  @media(max-width:680px){
    .audit-group-wrap.has-actions{grid-template-columns:minmax(0,1fr)}
    .audit-group-wrap.has-actions .audit-group-actions{grid-column:1;grid-row:2;padding:0 0 9px 20px}
    .audit-device-picker{grid-column:1;grid-row:3;grid-template-columns:minmax(0,1fr);padding-left:20px}
  }
  .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.86em;letter-spacing:.02em;background:var(--field);border:1px solid var(--line);border-radius:8px;padding:3px 8px;color:var(--plum);word-break:break-all}
  .badge{display:inline-flex;align-items:center;gap:5px;font-size:.72rem;font-weight:750;letter-spacing:.06em;text-transform:uppercase;border-radius:999px;padding:4px 10px}
  .badge.couple{background:var(--blush);color:var(--wine)}
  .badge.spark{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}
  .badge.done{background:var(--ok-bg);color:var(--ok-ink)}
  .badge.wait{background:var(--blush);color:var(--wine)}
  .toolbar{margin-top:20px;display:flex;gap:10px;flex-wrap:wrap;align-items:center}
  .toolbar .search-input{flex:1 1 200px;border:1.5px solid var(--line);border-radius:12px;padding:10px 14px;font-size:.95rem;background:var(--field);color:var(--ink)}
  .toolbar select{border:1.5px solid var(--line);border-radius:12px;padding:10px 12px;font-size:.92rem;background:var(--field);color:var(--ink)}
  .table-wrap{margin-top:16px;overflow-x:auto;border:1px solid var(--line);border-radius:16px;background:var(--card)}
  .admin-table{width:100%;border-collapse:collapse;font-size:.92rem;min-width:760px}
  .admin-table th{text-align:left;font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:12px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
  .admin-table td{padding:11px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
  .admin-table tr:last-child td{border-bottom:none}
  .admin-table tbody tr:hover{background:var(--soft)}
  /* payment state chip: green once the credits are on the account, amber while
     the provider is still settling it, muted once it is a dead end */
  .adm-state{display:inline-block;padding:3px 9px;border-radius:999px;font-size:.78rem;font-weight:600;border:1px solid var(--line)}
  .adm-state.ok{color:var(--ok);border-color:var(--ok)}
  .adm-state.warn{color:var(--gold);border-color:var(--gold)}
  .adm-state.off{color:var(--muted)}
  .admin-table .cell-actions{display:flex;gap:5px;flex-wrap:nowrap;align-items:center}
  .admin-table .cell-actions .btn{
    padding:0 11px;font-size:.78rem;border-radius:999px;
    white-space:nowrap;flex:0 0 auto;
  }
  .admin-table td:last-child{white-space:nowrap}
  .admin-table tr.admw-open{background:var(--soft)}
  .admw-edit-row>td{padding:0;border-bottom:1px solid var(--line)}
  .admw-edit-row:hover{background:transparent}
  .admw-edit{
    display:flex;flex-direction:column;gap:8px;padding:12px 14px 14px;
    border-left:3px solid var(--wine);background:var(--card);
  }
  .admw-edit-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;font-size:.92rem}
  .admw-edit-head .muted{font-size:.82rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all}
  .admw-edit-field{display:flex;flex-direction:column;max-width:360px;width:100%}
  .admw-edit-field .form-note{margin-top:6px;font-size:.84rem}
  .admw-edit-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  .admw-edit-actions .error-msg{margin:0}
  .admw-edit-actions .form-note{margin:0}
  .admin-accounts-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:8px 0 12px}
  .admin-account-cell{min-width:220px;max-width:360px;vertical-align:middle}
  .admin-account-line{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
  .admin-username{font-weight:650;font-size:.95rem;color:var(--plum);word-break:break-word;line-height:1.3;white-space:nowrap}
  button.admin-username{background:none;border:0;padding:0;text-align:left;text-decoration:underline;cursor:pointer;font-family:inherit}
  .admin-id{font-size:.8rem;opacity:.8;word-break:break-all;white-space:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.02em}
  .admin-account-meta{margin-top:6px}
  .adm-live{
    display:inline-flex;align-items:center;gap:6px;
    font-size:.72rem;font-weight:750;letter-spacing:.08em;text-transform:uppercase;
    color:var(--ok);background:color-mix(in srgb, var(--ok) 14%, transparent);
    border:1px solid color-mix(in srgb, var(--ok) 35%, transparent);
    border-radius:999px;padding:4px 10px;
  }
  .adm-live::before{
    content:"";width:7px;height:7px;border-radius:50%;background:var(--ok);
    box-shadow:0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent);
    animation:admPulse 1.8s ease-out infinite;
  }
  @keyframes admPulse{
    0%{box-shadow:0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent)}
    70%{box-shadow:0 0 0 8px transparent}
    100%{box-shadow:0 0 0 0 transparent}
  }
  .bulk-bar{margin-top:12px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:.92rem;color:var(--muted)}
  .answer-grid{margin-top:10px;display:grid;gap:6px;grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr))}
  .answer-row{display:flex;gap:8px;align-items:baseline;font-size:.82rem;border:1px solid var(--line);border-radius:10px;padding:6px 9px;background:var(--field)}
  .answer-row .aq{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
  .answer-row .av{font-weight:800;color:var(--plum)}
  .profile-line{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}
  .checkcell input{width:17px;height:17px;accent-color:var(--wine)}
  .stat-strip{margin-top:16px;display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(150px,100%),1fr))}
  .stat-strip .card{padding:14px 16px}
  .stat-strip strong{display:block;font-family:Georgia,serif;font-size:1.35rem;color:var(--plum);margin-top:4px}
  .field-row{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));margin-top:12px}
  /* trends: one small series per card, drawn as inline SVG so the panel
     carries no charting dependency for five lines of numbers */
  .trend-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));margin-top:4px}
  .trend-card{padding:14px 16px;display:grid;gap:6px;justify-items:start}
  .trend-card strong{font-family:Georgia,serif;font-size:1.5rem;color:var(--plum);line-height:1}
  .trend-card .spark{width:100%;max-width:132px;height:34px;overflow:visible}
  .spark-line{fill:none;stroke:var(--wine);stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
  .spark-area{fill:rgba(var(--tint),.18);stroke:none}
  .danger-zone{margin-top:18px;border:1.5px solid rgba(var(--tint),.35);border-radius:16px;padding:18px;background:var(--soft)}
  .danger-zone h3{color:var(--wine);font-size:1.05rem}
  .sum-list{margin-top:12px;display:grid;gap:2px}
  .sum-row{display:flex;justify-content:space-between;align-items:baseline;gap:14px;border-bottom:1px dashed var(--line);padding:8px 0}
  .sum-row:last-child{border-bottom:none}
  .sum-row small{display:block;font-size:.85rem;color:var(--muted);font-weight:400;margin-top:2px}
  .note-area{width:100%;min-height:150px;border:1.5px solid var(--line);border-radius:14px;padding:14px 16px;font-size:1rem;font-family:inherit;background:var(--field);color:var(--ink);resize:vertical;line-height:1.55}
  .note-area:focus{outline:2px solid var(--gold);outline-offset:1px}
  /* dating card */
  .attr-grid{display:grid;gap:14px 18px;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));margin-top:4px;align-items:start}
  .attr-field{display:flex;flex-direction:column;gap:6px}
  .attr-field .field-label{margin:0;line-height:1.3;min-height:2.6em;display:flex;align-items:flex-end}
  .attr-req{color:var(--wine)}
  .attr-sec{margin-top:24px}
  .attr-sec h3{font-size:1.02rem;display:flex;align-items:center;gap:10px}
  .attr-sec h3::after{content:"";flex:1;height:1px;background:var(--line)}
  .attr-card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:18px 20px}
  .attr-row{display:grid;grid-template-columns:minmax(120px,1.1fr) 1fr 1fr;gap:8px 14px;padding:7px 0;border-bottom:1px dashed var(--line);font-size:.93rem;align-items:baseline}
  .attr-row:last-child{border-bottom:0}
  .attr-row .k{color:var(--muted);font-size:.85rem}
  .attr-row .v{font-weight:500}
  .attr-row .v.none{color:var(--muted);font-weight:400}
  .attr-row .v .ok{color:var(--ok);margin-left:6px;font-size:.85rem}
  /* "this part is not evidence" — the zodiac wears one wherever it appears,
     because it sits beside four lenses that genuinely have research behind
     them and should not be able to borrow their authority by proximity */
  .fun-badge{
    display:inline-flex;align-items:center;gap:7px;margin-bottom:12px;
    padding:5px 13px;border-radius:999px;font-size:.76rem;font-weight:700;
    letter-spacing:.08em;text-transform:uppercase;
    background:var(--tag-alt-bg);color:var(--tag-alt-ink);border:1px solid rgba(150,96,31,.28);
  }
  .fun-badge .fun-mark{font-size:.92rem;letter-spacing:0}
  .flag-chip{display:block;margin:8px 0;padding:10px 14px;border-radius:10px;font-size:.92rem;background:var(--soft);border:1px solid var(--line)}
  .flag-chip.warn{background:rgba(180,60,80,.08);border-color:rgba(180,60,80,.3);color:var(--wine)}
  .flag-chip.good{background:rgba(90,150,90,.08);border-color:rgba(90,150,90,.3)}
  .attr-field.unanswered select,.attr-field.unanswered input{border-color:var(--wine)}
  .custom-card-choice-options{display:flex;flex-wrap:wrap;gap:8px 14px}
  .custom-card-choice-option{display:flex;align-items:center;gap:6px;font-size:.92rem}
  select.text-input{appearance:auto;cursor:pointer}
  .attr-row.solo{grid-template-columns:minmax(120px,1.1fr) 1fr}
  /* credit packages */
  .pk-grid{margin-top:16px;display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr))}
  .pk-grid.pk-grid-scroll{
    grid-template-columns:none;grid-auto-flow:column;
    grid-auto-columns:minmax(220px,32%);
    overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;
    scrollbar-width:thin;padding:12px 3px 16px;
  }
  .pk-grid.pk-grid-scroll>.pk-card{min-width:0;scroll-snap-align:start}
  .pk-card{position:relative;background:var(--card);border:1.5px solid var(--line);border-radius:16px;padding:20px 16px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px}
  .pk-card.best{border-color:var(--gold);box-shadow:0 6px 20px rgba(217,146,63,.18)}
  .pk-card.unl{background:linear-gradient(160deg,var(--plum),var(--wine-deep));color:#fff;border-color:transparent}
  .pk-card.unl .pk-sub{color:rgba(255,255,255,.85)}
  .pk-title{font-size:1.05rem}
  .pk-price-row{display:flex;align-items:baseline;justify-content:center;gap:.45rem;flex-wrap:wrap}
  .pk-table-wrap{margin-top:12px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card)}
  .pk-table{width:100%;border-collapse:collapse;font-size:.92rem}
  .pk-table th{text-align:left;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:10px 14px;background:rgba(0,0,0,.04);border-bottom:1px solid var(--line)}
  .pk-table td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
  .pk-table tr:last-child td{border-bottom:none}
  .pk-td-name{font-weight:600;min-width:7rem}
  .pk-td-detail{color:var(--muted);font-size:.88rem}
  .pk-td-price{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600}
  .pk-price-inline{display:inline-flex;align-items:baseline;justify-content:flex-end;gap:.4rem;flex-wrap:wrap}
  .pk-price-amt{font-variant-numeric:tabular-nums}
  .pk-price-row .pk-price-inline{justify-content:center}
  .pk-row-unl .pk-td-name{color:var(--plum)}
  .pk-discount{font-family:system-ui,-apple-system,sans-serif;font-size:1rem;font-weight:800;color:#1f7a45;background:rgba(31,122,69,.12);border-radius:999px;padding:.15em .55em;line-height:1.2}
  [data-theme="dark"] .pk-discount{color:#7dffa8;background:rgba(125,255,168,.14)}
  .pk-card.unl .pk-discount{color:#b8f0c8;background:rgba(184,240,200,.18)}
  .pk-sub{font-size:.85rem;color:var(--muted);flex:1}
  .pk-badge{position:absolute;top:-10px;right:12px;font-size:.68rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:var(--gold);color:#fff;border-radius:999px;padding:3px 9px}
  .pk-badge.best{background:var(--wine)}
  .pk-badge.save{background:var(--plum)}
  .pk-card .btn{width:100%;margin-top:8px}

  /* ---------- payment method chooser (modal) ---------- */
  .modal-backdrop{
    position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;
    padding:20px;background:rgba(43,26,38,.55);backdrop-filter:blur(4px);animation:modalFade .16s ease;
  }
  [data-theme="dark"] .modal-backdrop{background:rgba(0,0,0,.64)}
  .modal{
    position:relative;width:100%;max-width:430px;max-height:calc(100vh - 40px);overflow:auto;
    background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
    box-shadow:var(--shadow);padding:26px 24px 22px;animation:modalRise .2s ease;
  }
  .modal-title{font-size:1.35rem;margin-top:6px}
  .modal-sub{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-top:8px;font-size:.94rem;color:var(--muted)}
  .modal-sub span{min-width:0}
  .modal-price{color:var(--ink);font-family:Georgia,serif;font-size:1.2rem;white-space:nowrap}
  .modal-close{
    position:absolute;top:10px;right:12px;width:34px;height:34px;border:none;border-radius:50%;
    background:var(--soft);color:var(--muted);font-size:1.3rem;line-height:1;cursor:pointer;
  }
  .modal-close:hover{background:var(--blush);color:var(--wine)}
  .pm-list{display:flex;flex-direction:column;gap:10px;margin-top:16px}
  .pm-option{
    display:flex;align-items:center;gap:13px;width:100%;text-align:left;font:inherit;color:inherit;
    background:var(--soft);border:1.5px solid var(--line);border-radius:14px;padding:13px 15px;cursor:pointer;
    transition:border-color .15s ease,background .15s ease,transform .15s ease;
  }
  .pm-option:hover:not(:disabled){border-color:rgba(var(--tint),.55);background:var(--blush);transform:translateY(-1px)}
  .pm-option:disabled{opacity:.55;cursor:progress}
  .pm-option:focus-visible{outline:2px solid rgba(var(--tint),.6);outline-offset:2px}
  .pm-icon{
    flex:0 0 auto;width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;
    background:linear-gradient(135deg,var(--wine-deep),var(--wine));color:#fff;font-weight:800;font-size:1.05rem;
  }
  .pm-option[data-p="paypal"] .pm-icon{background:linear-gradient(135deg,#003087,#0070E0)}
  .pm-option[data-p="crypto"] .pm-icon{background:linear-gradient(135deg,#A9761B,var(--gold))}
  .pm-text{display:flex;flex-direction:column;gap:1px;flex:1 1 auto;min-width:0}
  .pm-text strong{font-size:1rem}
  .pm-text small{color:var(--muted);font-size:.82rem}
  .pm-arrow{color:var(--muted);font-size:1.05rem}
  .pm-option:hover:not(:disabled) .pm-arrow{color:var(--wine)}
  .pm-note{margin-top:12px}
  .pm-note:empty{display:none}
  .pm-cancel{width:100%;margin-top:12px}
  #pmError .error-msg{margin-top:12px}
  @keyframes modalFade{from{opacity:0}to{opacity:1}}
  @keyframes modalRise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
  @media (prefers-reduced-motion:reduce){.modal,.modal-backdrop{animation:none}}
  /* ---- responsive: scale on any device ---- */
  html{-webkit-text-size-adjust:100%}
  img,svg{max-width:100%}
  button,.btn{touch-action:manipulation}
  @media (max-width:760px){
    /* the header takes a second row here: the logo on one line, the two groups
       on the next, spread to the edges. Nothing is crushed, and the seam still
       separates appearance from account. */
    .site-header .container{height:auto;min-height:58px;padding-top:8px;padding-bottom:8px;flex-wrap:wrap;row-gap:6px}
    .site-header .nav-actions{flex:1 1 100%;justify-content:space-between}
    .prefs-menu{left:0;right:auto}
    /* no rule here: the groups are pushed to opposite edges, and if they wrap
       onto separate lines a left border would hang at the row's edge */
    .site-header .nav-user{padding-left:0;border-left:none}
    .hero-inner{padding-top:36px;padding-bottom:44px}
    .attr-grid{grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr))}
    .attr-row,.attr-row.solo{grid-template-columns:1fr 1fr}
    .attr-row .k{grid-column:1/-1}
    .pr-head{flex-wrap:wrap}
    .pr-score{margin-left:auto}
    .link-row{flex-direction:column;align-items:stretch}
    .link-row input{width:100%}
    /* Nothing here sets a button height. There used to be three rules on
       this line — 42px for .btn, 46px for .quiz-nav .btn, 42px for
       .auth-actions — so on a phone the same button was two heights
       depending on which row it happened to sit in, and the panel's
       "create a quiz" was the visibly big one. One token decides it
       now; the only thing left to say here is about width. */
    .auth-actions .btn{flex:0 0 auto}
    .likert-opt{min-width:50px;min-height:48px}
    .kv-row .k{min-width:96px}
    /* too narrow for columns: the line still holds one event, stacked, and the
       detail sits under it rather than being cut off */
    .audit-row{grid-template-columns:auto 1fr;gap:2px 12px}
    .audit-what{grid-column:2}
    .audit-failed{grid-column:2;justify-self:start}
    .audit-facts{grid-column:2;word-break:break-word}
    .sum-row{flex-wrap:wrap;gap:4px 14px}
    .seg{max-width:100%}
    .seg-btn{white-space:normal}

    /* ---- compact ----
       A phone shows the same page through a shorter window, so the air that
       separates one part from the next is the first thing to give. Every
       number below is that spacing and nothing else: nothing is hidden,
       nothing loses a control, and the order stays the same. */
    .container{padding:0 16px}
    /* the sticky bar is taken out of every scroll on a phone, so it is held
       to the smallest two rows that still fit the controls */
    .site-header .container{min-height:52px;padding-top:6px;padding-bottom:6px;row-gap:4px}
    section.block{padding:32px 0 2px}
    /* and the same off the boxes themselves: 22px of padding around a card is
       a room the phone does not have to give, and the text never touched it */
    .pick-card{padding:18px}
    .how-card{padding:16px}
    .pillar-card{padding:15px 15px 13px}
    .lens-card{padding:15px}
    .attr-card{padding:15px 16px}
    .panel-action{padding:15px}
    .stat,.trend-card{padding:13px 15px}
    .panel-brand{padding:26px 16px}
    .referral-box,.gift-box{padding:12px 13px 14px}
    .gift-confirm{padding:12px 13px}
    .chip,.ribbon-person{padding:7px 14px}
    .notif-empty{padding:18px 12px}
    .hero-inner{padding-top:30px;padding-bottom:36px}
    .hero-cta{margin-top:16px}
    .code-box{margin-top:16px}
    .toolbar{margin-top:14px}
    .promo-box{margin-top:14px;padding-top:12px}
    .site-footer{margin-top:34px;padding:18px 0 22px}
    .waiting{padding:34px 0}
    .report{padding:20px 0 6px}
    .quiz-wrap{padding:20px 0 8px}
    .report h3.block-title{margin-top:24px}
    .report-hero{margin-top:14px;gap:16px}
    .attr-sec{margin-top:18px}
    .sec-title.gap{margin-top:18px}
    .pick-grid,.pillars-grid,.lens-grid,.how-grid{margin-top:18px}
    .questions{gap:13px}
    .q-item{padding-top:11px}
    .pillar-row{padding:13px 14px}
    .disclaimer{margin-top:16px;padding:12px 14px}
    .danger-zone{margin-top:14px;padding:14px}
    .admin-settings-card{padding:16px 14px}
    .setting-box{margin-top:10px}
    .modal{padding:20px 18px 18px}
    .modal-sub{flex-wrap:wrap}
    .activity-row{padding:10px 12px}

    /* ---- no zoom on focus ----
       Mobile Safari blows the whole page up the moment a field whose text it
       thinks is small is focused, and does not zoom back out. 16px is the
       line it draws, so the four controls styled below it are raised to it
       here; the full wording that made them small is intact. */
    .toolbar .search-input,
    .toolbar select,
    .referral-row .text-input,
    .link-row input{font-size:1rem}
  }
  @media (max-width:420px){
    .hero h1{font-size:1.85rem}
    .hero-cta .btn{width:100%}
    .card{padding:20px 16px}
    .attr-row,.attr-row.solo{grid-template-columns:1fr}
    .attr-row .k{grid-column:auto}
    .pk-grid{grid-template-columns:1fr 1fr;gap:12px}
    .pk-card{padding:16px 10px}
    .pk-title{font-size:.95rem}
    .quiz-nav{flex-direction:column-reverse}
    .quiz-nav .btn{width:100%}
    .donut-wrap{width:126px;height:126px}
    .pr-score{font-size:1.2rem}
    /* the narrowest phones: a little more air out of the same page, and the
       last few things that would otherwise wrap unevenly */
    .quiz-wrap{padding:18px 0 8px}
    .ticket-head{padding:10px 12px}
    .ticket-body{padding:0 12px 12px}
    .guest-card{padding:10px 12px}
    .flag-chip{padding:8px 12px}
    /* five answers in one row rather than three and two: the scale is a
       single gesture, and a wrapped one reads as two questions */
    .likert{gap:8px}
    .likert-opt{flex:1 1 40px;min-width:40px;max-width:none}
    /* three date menus: two to a line, each as wide as it can be */
    .date-row{gap:8px}
    .date-row select{min-width:0;flex:1 1 calc(50% - 4px)}
    /* the ledger of a report, on one line each */
    .activity-row{grid-template-columns:auto 1fr;gap:10px}
    .activity-row .when{white-space:normal}
  }

  /* Below 360px — a 320px phone, the narrowest screen still worth drawing —
     16px a side is a tenth of the width spent on margin. 12px keeps a real
     gutter and gives the text the rest. */
  @media (max-width:360px){
    .container{padding:0 12px}
  }

  /* ---- phones ----

     Two things a narrow screen asks for that a wide one does not. */
  @media (max-width:640px){
    /* The payment chooser as a sheet rather than a floating box. Centred in
       the middle of a phone it is a small window with a page behind it, and
       its own scroll inside the page's scroll; brought to the bottom edge it
       is the shape a phone user already expects, is reachable with a thumb,
       and can be dismissed by the same gesture that opened it. */
    .modal-backdrop{align-items:flex-end;padding:0}
    .modal{
      max-width:none;border-radius:var(--radius) var(--radius) 0 0;
      max-height:88vh;padding:22px 16px 18px;
      /* the page behind must not scroll under a sheet that is open */
      overscroll-behavior:contain;
    }
  }
  /* A finger is not a cursor. Only the controls the desktop made small for a
     mouse grow here — the buttons already meet this size, so nothing else
     moves and the page does not get taller. */
  @media (pointer:coarse){
    .notif-del{width:32px;height:32px;font-size:1.15rem}
    .checkcell input{width:20px;height:20px}
    /* the package reorder arrows, which a mouse can hit at 20px and a thumb
       cannot */
    .pkg-item .pkg-up,.pkg-item .pkg-down{padding:0 11px;font-size:.78rem}
    .admin-subtab{min-height:34px}
    /* the edge under a conversation: a thumb needs more than a mouse to find
       fourteen pixels, and it drags the page instead of the edge if it misses */
    .chat-resize{height:20px;margin:-6px 0 6px}
  }

  /* ---------------- theme presets (admin-selectable via site settings) ----------------
     [data-preset] on <html> recolors the brand palette. Dark mode overrides below. */
  [data-preset="champagne"]{
    --panel-a:#3A2A12;--panel-b:#7C5A1E;--panel-c:#A67C2E;
    --wine:#A67C2E;--wine-deep:#7C5A1E;--blush:#F3EAD8;--soft:#F8F2E4;--soft-2:#F5EDDB;--share-bg:#FBF6EC;
    --tint:166,124,46;--tint-deep:124,90,30;
  }
  [data-theme="dark"][data-preset="champagne"]{
    --panel-a:#2E2413;--panel-b:#7C5A1E;--panel-c:#A67C2E;
    --wine:#D9B36A;--wine-deep:#A67C2E;--blush:#2E2513;--soft:#2C2416;--soft-2:#332A1B;--share-bg:#2A2212;
    --tint:217,179,106;--tint-deep:166,124,46;
  }
  [data-preset="midnight"]{
    --panel-a:#1B2338;--panel-b:#2B4275;--panel-c:#3E5FA8;
    --wine:#3E5FA8;--wine-deep:#2B4275;--blush:#E4EAF6;--soft:#EEF2FA;--soft-2:#E9EFF9;--share-bg:#F4F7FC;
    --tint:62,95,168;--tint-deep:43,66,117;
  }
  [data-theme="dark"][data-preset="midnight"]{
    --panel-a:#1B2338;--panel-b:#2B4275;--panel-c:#3E5FA8;
    --wine:#8CA9E4;--wine-deep:#3E5FA8;--blush:#1B2338;--soft:#1D2539;--soft-2:#222B42;--share-bg:#19202F;
    --tint:140,169,228;--tint-deep:62,95,168;
  }
  [data-preset="forest"]{
    --panel-a:#16281E;--panel-b:#1F5C3C;--panel-c:#2F7D55;
    --wine:#2F7D55;--wine-deep:#1F5C3C;--blush:#E2F0E7;--soft:#EDF6F0;--soft-2:#E7F2EA;--share-bg:#F2F8F4;
    --tint:47,125,85;--tint-deep:31,92,60;
  }
  [data-theme="dark"][data-preset="forest"]{
    --panel-a:#16281E;--panel-b:#1F5C3C;--panel-c:#2F7D55;
    --wine:#6FBF95;--wine-deep:#2F7D55;--blush:#16281E;--soft:#182A20;--soft-2:#1D3226;--share-bg:#15241B;
    --tint:111,191,149;--tint-deep:47,125,85;
  }
  [data-preset="violet"]{
    --panel-a:#241A33;--panel-b:#57337A;--panel-c:#7A4FA3;
    --wine:#7A4FA3;--wine-deep:#57337A;--blush:#EDE4F5;--soft:#F4EEF9;--soft-2:#F0E9F6;--share-bg:#F8F4FB;
    --tint:122,79,163;--tint-deep:87,51,122;
  }
  [data-theme="dark"][data-preset="violet"]{
    --panel-a:#241A33;--panel-b:#57337A;--panel-c:#7A4FA3;
    --wine:#B28BDD;--wine-deep:#7A4FA3;--blush:#241A33;--soft:#261C36;--soft-2:#2C2140;--share-bg:#221831;
    --tint:178,139,221;--tint-deep:122,79,163;
  }

  /* announcement banner (site settings) */
  .site-banner{
    background:linear-gradient(135deg,var(--wine-deep),var(--wine));color:#fff;
    text-align:center;padding:10px 16px;font-size:.95rem;font-weight:600;
    position:sticky;top:0;z-index:60;
  }


  /* ---- admin full-width shell + tabs ---- */
  .admin-shell{max-width:none;width:100%;padding:28px 28px 40px}
  @media (max-width:760px){.admin-shell{padding:18px 14px 28px}}
  /* the account panel's four tabs. Same look as the admin tabs on purpose — one
     site, one idea of what a tab is — but a separate class so the two can move
     independently (the admin strip sits on a page with no card around it). */
  .wallet-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:18px 0 0;border-bottom:1px solid var(--line)}
  .wallet-tab{
    appearance:none;border:none;background:transparent;cursor:pointer;
    font:inherit;font-size:.92rem;font-weight:650;color:var(--muted);
    padding:10px 14px;border-bottom:2px solid transparent;margin-bottom:-1px;
    border-radius:8px 8px 0 0;
  }
  .wallet-tab:hover{color:var(--plum);background:var(--soft)}
  .wallet-tab.sel{color:var(--wine);border-bottom-color:var(--wine);background:transparent}
  .wallet-tab:focus-visible{outline:2px solid var(--wine);outline-offset:-2px}
  .wallet-pane{display:none;margin-top:18px}
  .wallet-pane.sel{display:block}
  /* the first heading inside a pane should not add a gap the pane already has */
  .wallet-pane > .sec-title:first-child,
  .wallet-pane > .buy-section > .sec-title:first-child{margin-top:0}
  @media (max-width:640px){
    .wallet-tabs{gap:0}
    .wallet-tab{padding:9px 10px;font-size:.86rem;flex:1 1 auto;justify-content:center;text-align:center}
  }
  .admin-tabs{display:flex;gap:6px;flex-wrap:wrap;margin:18px 0 8px;border-bottom:1px solid var(--line);padding-bottom:0}
  .admin-tab{
    appearance:none;border:none;background:transparent;cursor:pointer;
    font:inherit;font-size:.92rem;font-weight:650;color:var(--muted);
    padding:10px 14px;border-bottom:2px solid transparent;margin-bottom:-1px;
  }
  .admin-tab:hover{color:var(--plum)}
  .admin-tab.sel{color:var(--wine);border-bottom-color:var(--wine)}
  /* An unread count badge on a top-level admin tab. */
  .admin-tab-badge{
    display:inline-block;min-width:1.35em;margin-left:6px;padding:1px 5px;
    font-size:.72rem;font-weight:750;line-height:1.35;text-align:center;
    color:#fff;background:var(--wine);border-radius:999px;vertical-align:1px;
  }
  .admin-pane{display:none;margin-top:18px}
  .admin-pane.sel{display:block}
  /* The Logs index and its selected feed sit side by side. On smaller screens
     the index stays first, with the selected log directly below it. */
  .admin-log-layout{display:grid;grid-template-columns:minmax(220px,280px) minmax(0,1fr);gap:20px;align-items:start;margin-top:8px}
  .admin-log-sidebar,.admin-log-content{min-width:0}
  .admin-log-unread-note{margin:6px 0 10px}
  .admin-log-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 12px}
  .admin-log-heading>.block-title{margin:0;flex:0 1 auto}
  .admin-log-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}
  .admin-log-actions .btn{white-space:nowrap}
  .admin-log-actions #secSeen{margin-left:4px}
  .admin-log-search{width:auto;flex:0 1 210px;min-width:150px;max-width:240px;padding:8px 11px;font-size:.9rem}
  .admin-log-payment-filters{flex:1 1 100%;align-items:flex-end}
  .admin-log-filter{display:flex;flex-direction:column;gap:4px;margin:0;color:var(--muted);font-size:.74rem;font-weight:650}
  .admin-log-filter .text-input{width:auto;min-width:132px;padding:7px 10px;font-size:.86rem}
  .admin-log-filter input[type="date"]{min-width:168px}
  .admin-log-index{
    width:100%;max-width:none;min-width:0;margin:0;
    border:1px solid var(--line);border-radius:12px;border-collapse:separate;
    border-spacing:0;overflow:hidden;background:var(--card);
  }
  .admin-log-index th,.admin-log-index td{padding:0;border-bottom:1px solid var(--line)}
  .admin-log-index tr:last-child th,.admin-log-index tr:last-child td{border-bottom:0}
  .admin-log-index th{text-align:left;font-size:.95rem;letter-spacing:normal;text-transform:none;color:var(--ink);white-space:normal}
  .admin-log-index-button{
    display:block;width:100%;appearance:none;border:0;border-radius:0;background:transparent;
    padding:11px 12px;color:var(--ink);font:inherit;font-weight:650;text-align:left;cursor:pointer;
  }
  .admin-log-index-button:hover,.admin-log-index-button.sel{background:var(--soft);color:var(--wine)}
  .admin-log-index-button:focus-visible{outline:2px solid var(--wine);outline-offset:-3px;position:relative}
  .admin-log-index-count{
    width:1%;padding:11px 10px!important;text-align:right;white-space:nowrap;
    color:var(--muted);font-variant-numeric:tabular-nums;
  }
  @media(max-width:760px){.admin-log-layout{grid-template-columns:minmax(0,1fr);gap:14px}}
  /* the numbers under a promo code: what it has actually done, not what it is
     set to do. Values are tabular so a counter ticking up does not shift the
     labels beside it. */
  .promo-stats{
    display:flex;flex-wrap:wrap;gap:10px 22px;margin-top:12px;padding:10px 12px;
    border:1px solid var(--line);border-radius:12px;background:var(--soft);
  }
  .promo-stat{display:flex;flex-direction:column;gap:2px;min-width:72px}
  .promo-stat-label{font-size:.7rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
  .promo-stat-value{font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink);white-space:nowrap}
  /* the ledger of one account, opened under its row in the accounts table */
  .ledger-list{display:grid;gap:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--card)}
  .ledger-line{display:grid;grid-template-columns:auto 150px 110px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:9px 12px;border-bottom:1px solid var(--line);font-size:.86rem}
  .ledger-line:last-child{border-bottom:none}
  .ledger-line .when{color:var(--muted);font-size:.78rem;white-space:nowrap}
  .ledger-line .kind{font-weight:650}
  .ledger-line .amt{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
  .ledger-line .amt.up{color:var(--ok)}
  .ledger-line .amt.down{color:var(--wine)}
  .ledger-line.kept{background:var(--soft)}
  .ledger-line .kept-note{font-size:.72rem;color:var(--muted);text-transform:lowercase}
  @media (max-width:640px){
    .ledger-line{grid-template-columns:auto minmax(0,1fr) auto;gap:4px 10px}
    .ledger-line .admw-log-select{grid-column:1;grid-row:1}
    .ledger-line .when,.ledger-line .kind,.ledger-line .note{grid-column:2}
    .ledger-line .amt{grid-row:1;grid-column:3}
    .ledger-line .kept-note,.ledger-line .admw-log-del{grid-column:3}
  }
  .activity-feed{display:grid;gap:0;margin-top:12px;border:1px solid var(--line);border-radius:16px;background:var(--card);overflow:hidden}
  .activity-row{display:grid;grid-template-columns:minmax(8.5rem,12rem) minmax(0,1fr);gap:12px;padding:12px 16px;border-bottom:1px solid var(--line);font-size:.9rem;align-items:baseline}
  .activity-row:last-child{border-bottom:none}
  .activity-row .when{color:var(--muted);font-size:.8rem;white-space:nowrap;font-variant-numeric:tabular-nums}
  .activity-row .what{color:var(--ink);min-width:0;overflow-wrap:anywhere}
  @media (max-width:640px){
    .activity-row{grid-template-columns:minmax(0,1fr);gap:4px}
    .activity-row .when{white-space:normal}
  }
  .activity-row .what strong{font-weight:650}
  /* a gift is the one money movement between two members, so it gets a marker
     in the feed — scanning for "who gave what to whom" should not require
     reading every row */
  .activity-row .act-flag{
    display:inline-block;padding:1px 7px;border-radius:999px;margin-right:2px;
    background:var(--soft);border:1px solid var(--line);color:var(--wine);
    font-size:.72rem;font-weight:700;letter-spacing:.02em;text-transform:lowercase;
  }
  /* a refusal is not a movement, so it is marked apart from the gift pill */
  .activity-row .act-flag.limit{color:var(--muted);border-style:dashed}
  .risk-badge{display:inline-flex;align-items:center;gap:4px;font-size:.68rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;border-radius:999px;padding:3px 8px}
  .risk-badge.high{background:var(--error-bg);color:var(--error-ink)}
  .risk-badge.mid{background:var(--tag-alt-bg);color:var(--tag-alt-ink)}
  .compare-bar{margin-top:14px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}

  .admin-subtabs{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0 16px}
  .admin-subtab{
    appearance:none;cursor:pointer;font:inherit;font-size:.86rem;font-weight:650;
    color:var(--muted);background:var(--soft);border:1px solid var(--line);
    border-radius:999px;padding:7px 14px;
  }
  .admin-subtab:hover{color:var(--plum);border-color:var(--plum)}
  .admin-subtab.sel{color:#fff;background:var(--wine);border-color:var(--wine)}
  .admin-subpane{display:none}
  .admin-subpane.sel{display:block}
  .admin-settings-card{padding:20px 22px}
  /* ---------- settings: one bordered box per section ---------- */
  .setting-box{
    border:1px solid var(--line);border-radius:14px;
    padding:14px 16px 16px;margin-top:14px;background:rgba(255,255,255,.028);
  }
  .setting-box:first-of-type{margin-top:2px}
  .setting-box-title{
    display:flex;align-items:center;gap:8px;margin:0 0 4px;
    font-size:.78rem;letter-spacing:.16em;text-transform:uppercase;
    color:var(--wine);font-weight:700;
  }
  .setting-box-title::before{
    content:"";flex:0 0 auto;width:4px;height:15px;border-radius:2px;
    background:linear-gradient(180deg,var(--wine),var(--wine-deep));
  }
  .setting-box .attr-grid{margin-top:10px}
  .admin-settings-actions{margin-top:18px;padding-top:14px;border-top:1px solid var(--line);display:flex;gap:12px;align-items:center;flex-wrap:wrap}

/* Public ad positions share the same layout in every supported placement. */
.ad-page-layout{display:grid;grid-template-columns:var(--ad-left,0) minmax(0,1fr) var(--ad-right,0);grid-template-areas:"header header header" "left content right" "footer footer footer"}
.ad-page-layout.has-ad-left{--ad-left:min(180px,17vw)}
.ad-page-layout.has-ad-right{--ad-right:min(180px,17vw)}
.ad-page-content{grid-area:content;min-width:0}
.ad-slot{min-width:0;padding:8px}
.ad-slot[hidden]{display:none}
.ad-slot-header{grid-area:header;max-width:1080px;width:100%;margin:auto}
.ad-slot-footer{grid-area:footer;max-width:1080px;width:100%;margin:auto}
.ad-slot-left{grid-area:left}.ad-slot-right{grid-area:right}
.ad-slot .form-note{margin:0 0 4px}
.ad-slot iframe{display:block;width:100%;min-height:250px;border:0;background:#fff}
@media(max-width:760px){
  .ad-page-layout{grid-template-columns:minmax(0,1fr);grid-template-areas:"header" "left" "content" "right" "footer"}
  .ad-slot-left,.ad-slot-right{width:100%;max-width:1080px;margin:auto}
}
.ad-slot-inline{max-width:1080px;width:100%;margin:12px auto}
.ad-visual-picker{display:grid;grid-template-columns:minmax(64px,1fr) minmax(0,4fr) minmax(64px,1fr);gap:6px;align-items:start;margin:10px 0;padding:10px;border:1px solid var(--border,#ccc);border-radius:8px}
.ad-visual-picker .ad-picker-header,.ad-visual-picker .ad-picker-footer{grid-column:1/-1}
.ad-picker-center{min-width:0}.ad-picker-block{padding:20px 10px;margin:6px 0;border:1px solid var(--border,#ccc);border-radius:6px;background:var(--bg,#f5f1f2)}
.ad-picker-choice{display:block;width:100%;padding:8px 4px;border:1px dashed currentColor;border-radius:5px;cursor:pointer;background:transparent;color:inherit;font:inherit;overflow-wrap:anywhere}
.ad-picker-choice[aria-pressed="true"]{border-style:solid;outline:2px solid var(--wine,#aa4961);font-weight:bold}
@media(max-width:760px){.ad-visual-picker{grid-template-columns:1fr}.ad-visual-picker .ad-picker-header,.ad-visual-picker .ad-picker-footer{grid-column:auto}.ad-picker-left{order:1}.ad-picker-center{order:2}.ad-picker-right{order:3}.ad-picker-footer{order:4}}

/* ============================================================
   PRINT — the report as something you can keep
   ============================================================
   The report is the whole point of the site, and it used to exist only
   inside a browser tab: printing it took the header, the buttons and the
   "create a new check" link along with it, and in dark mode it printed
   white ink on white paper.

   These rules fire on paper only. Everything on screen is untouched. The
   principle is that a printed report is a document, not a web page: it
   keeps the content and drops the controls that only mean something on
   a live page — navigation, share buttons, anything that is a link to
   somewhere else. The disclaimer is kept deliberately: it is the part
   that says what this report is and is not, and that belongs on the
   copy people keep far more than it belongs on the screen. */

@media print {
  /* Ink on paper is always the light palette, whatever the screen theme.
     Dark mode is a screen preference; paper has no such preference. */
  :root, [data-theme="dark"] {
    --bg:#fff; --ink:#1c1218; --muted:#5c4752; --card:#fff;
    --line:#d9c7bf; --soft:#faf3ef; --soft-2:#f6eae4; --shadow:none;
    --wine:#8E3348; --wine-deep:#8E3348; --plum:#4A2340; --gold:#96601F;
    --ok:#3E7D5E; --track:#efe2dc; --tag-alt-bg:#f3e8d6; --tag-alt-ink:#96601F;
    --error-bg:#fbe9ec; --error-ink:#8E2438;
  }

  /* Chrome that is only chrome: it exists to move around a live site. */
  .site-header, .site-footer, .site-banner, .ad-slot, .ad-page-layout > .ad-slot-left,
  .ad-page-layout > .ad-slot-right, .notif-panel, .notif-wrap,
  .back-link, .nav-actions, .theme-btn, .lang-switch,
  .print-hide, .no-print { display:none !important; }

  html, body { background:#fff !important; color:#1c1218 !important; }
  body { font-size:11pt; line-height:1.45; }
  .container { max-width:none; padding:0; margin:0; }

  /* Nothing that is a control survives: a printed button cannot be
     pressed, and a printed invite link cannot be clicked. */
  button, .btn, .quiz-nav, .compare-bar, .attr-sec .quiz-nav { display:none !important; }
  /* ...except a link is sometimes the content: the invite and share URLs
     are meant to be copied off the page, so their text is kept and only
     the button beside them goes. */
  .mono, .share-link-url { display:block !important; }

  /* Cards keep their shape but lose the drop shadow, which prints as a
     grey smudge on most printers. */
  .card, .stat, .guest-card, .insight-block, .pillar-row, .attr-card {
    box-shadow:none !important;
    border:1px solid var(--line);
    break-inside:avoid; page-break-inside:avoid;
  }
  /* A heading stranded at the foot of a page, separated from the thing
     it introduces, is the most common ugliness in a printed report. */
  h2, h3, .block-title, .sec-title { break-after:avoid; page-break-after:avoid; }
  .pillar-row, .insight-block, .stat, .sum-row { break-inside:avoid; page-break-inside:avoid; }

  /* Two columns fit badly down a page of paper; one column reads. */
  .two-col, .duo, .stat-cards, .pk-grid, .attr-grid {
    grid-template-columns:1fr !important;
    display:block !important;
  }
  .two-col > *, .duo > *, .stat-cards > * { margin-bottom:10pt; }

  /* The score ring is animation on screen and a flat number on paper:
     the dashoffset animates in, so it is forced to its final value. */
  .donut .fill { transition:none !important; }
  .donut-wrap, .donut, .heart-pulse, .heart { break-inside:avoid; }
  .heart-pulse { animation:none !important; }

  /* The report opens with its title, not with a page of header. */
  .report, .report-head { padding-top:0 !important; margin-top:0 !important; }
  .report-head h2 { font-size:20pt; }
  .eyebrow { font-size:8pt; }
  .disclaimer { margin-top:16pt; border-top:1px solid var(--line); padding-top:8pt; }

  /* A link that is left blue and underlined invites a click that paper
     cannot honour; its URL is appended instead. */
  a { color:#1c1218 !important; text-decoration:none !important; }
  .report a[href^="http"]::after { content:" (" attr(href) ")"; font-size:8pt; color:#5c4752; }

  @page { margin:16mm 14mm; }
}

/* Shareable links stay readable beside the QR that opens them. */
.share-qr{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  width:max-content;max-width:100%;margin:10px auto 0;padding:10px 12px;
  border:1px solid var(--line);border-radius:12px;background:var(--card);
}
.share-qr img{display:block;width:min(180px,100%);height:auto;aspect-ratio:1;border-radius:6px;background:#fff}
.share-qr-caption{font-size:.8rem;color:var(--muted);text-align:center}
.account-quiz-share{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.account-quiz-share-details{position:relative}
.account-quiz-share summary{list-style:none;cursor:pointer}
.account-quiz-share summary::-webkit-details-marker{display:none}
.account-quiz-share-content{width:min(360px,80vw);margin-top:8px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}
.account-quiz-share-content > .text-input{display:block;width:100%;min-width:0}
.account-quiz-share-content .share-qr{margin-top:10px}

/* Answer review is deliberately scannable: section headings are visible,
   while each set of choices can be opened only when someone wants to inspect it. */
.answer-review-section{margin-top:18px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}
.answer-review-section h3{margin:0 0 10px;font-size:1.05rem}
.answer-review-group{margin-top:8px;border:1px solid var(--line);border-radius:10px;background:var(--card);overflow:hidden}
.answer-review-group summary{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;cursor:pointer;font-weight:650}
.answer-review-group summary small{color:var(--muted);font-weight:500;white-space:nowrap}
.answer-review-list{display:grid;gap:0;margin:0;padding:0 12px 10px;list-style:none}
.answer-review-item{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,.45fr);gap:8px;padding:8px 0;border-top:1px dashed var(--line);font-size:.9rem}
.answer-review-item small{display:block;margin-top:3px;color:var(--muted)}
.answer-review-item strong{text-align:right;color:var(--plum)}
.answer-review-answer-skipped{color:var(--muted)!important;font-style:italic}
.review-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
@media(max-width:640px){
  .account-quiz-share-content{width:min(320px,78vw)}
  .answer-review-item{grid-template-columns:minmax(0,1fr)}
  .answer-review-item strong{text-align:left}
}
