/* =====================================================================
   Izimpande zaKithi — Visual Refresh v1 (Campaign Pack 1 look)
   Additive skin: load AFTER styles.css. Remove the <link> to revert.
   Changes only colours, type, radius, shadow and motion. No layout,
   no logic, no element hiding.
   ===================================================================== */
/* Fonts are loaded by <link> tags in the page head (faster than @import). */

:root{
  /* Brand palette (from campaign art) */
  --bg:#f6f1e6;            /* warm parchment, was #f7f4ed */
  --surface:#fffdf9;       /* paper, was #fff */
  --ink:#17261f;           /* deep green-black, was slate #1f2937 */
  --muted:#5b6a62;         /* green-grey, was slate #64748b */
  --line:#e6dccb;          /* warm hairline, was slate #e2e8f0 */
  --brand:#1d4f38;         /* forest green, was emerald #065f46 */
  --brand-2:#2b6a4c;
  --brand-tint:#eef5ef;
  --gold:#a8761e;
  --gold-2:#c99a3e;
  --gold-tint:#f6ecd6;
  --danger:#b42318;
  --shadow:0 1px 2px rgba(23,38,31,.04),0 10px 30px -12px rgba(23,38,31,.16);
  --shadow-lift:0 2px 4px rgba(23,38,31,.05),0 18px 40px -16px rgba(23,38,31,.28);

  /* Type: one step larger everywhere (readability for elders) */
  --font-body:"Figtree",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-display:"Outfit","Figtree",system-ui,sans-serif;
  --type-label:.72rem;     /* was .66rem */
  --type-action:.9rem;     /* was .82rem */
  --type-card-name:1.02rem;/* was .96rem */
  --type-card-meta:.8rem;  /* was .74rem */
  --type-nav:.92rem;       /* was .86rem */
  --type-utility:.82rem;   /* was .76rem */
}

/* ---------- Base ---------- */
body{
  font-family:var(--font-body);
  color:var(--ink);
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(201,154,62,.16), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, rgba(43,106,76,.08), transparent 60%),
    var(--bg);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
  line-height:1.5;
}
h1,h2,h3,.panel h2,.modal-header h2,#selected-name{
  font-family:var(--font-display);
  letter-spacing:-.015em;
  color:var(--ink);
}
button,input,select,textarea{font-family:inherit}
:focus-visible{outline:3px solid var(--gold-2);outline-offset:2px;border-radius:8px}

/* ---------- Header ---------- */
.site-header{
  background:rgba(255,253,249,.86);
  -webkit-backdrop-filter:saturate(1.4) blur(10px);
  backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--line);
  box-shadow:0 1px 0 rgba(201,154,62,.25);
}
.brand strong{font-family:var(--font-display);font-weight:700;font-size:1.08rem;letter-spacing:-.01em}
.brand small{color:var(--muted)}

/* ---------- Buttons ---------- */
.button{
  border-radius:999px;
  min-height:44px;                 /* WCAG / thumb-friendly */
  padding:10px 18px;
  font-weight:700;
  letter-spacing:.005em;
  transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.button:hover:not(:disabled){transform:translateY(-1px)}
.button:active:not(:disabled){transform:translateY(0)}
.button-primary{
  background:linear-gradient(180deg,var(--brand-2),var(--brand));
  color:#fff;
  box-shadow:0 8px 18px -10px rgba(29,79,56,.75);
}
.button-primary:hover:not(:disabled){box-shadow:0 12px 24px -10px rgba(29,79,56,.8)}
.button-secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}
.button-secondary:hover:not(:disabled){border-color:var(--gold-2);background:#fff}
.button-ghost{color:var(--brand)}
.button-danger{background:var(--surface);color:var(--danger);border-color:#f3c9c4}
.button-small{min-height:38px;padding:7px 14px;font-size:.85rem}

/* Hero calls-to-action on the empty state get the campaign gold */
.empty-state-actions .button-primary{
  background:linear-gradient(180deg,#c48e2c,#9c6c19);
  box-shadow:0 10px 22px -10px rgba(156,108,25,.8);
}

/* ---------- Panels, cards, labels ---------- */
.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
}
.eyebrow{color:var(--gold);font-family:var(--font-display);font-weight:700;letter-spacing:.14em}
.gen-label{color:var(--gold);font-family:var(--font-display);font-weight:700}

.tree-chip{
  background:linear-gradient(160deg,var(--brand-2),var(--brand));
  border-radius:16px;
  box-shadow:0 8px 18px -10px rgba(29,79,56,.7);
}

/* Search & people list */
.search-wrap input,
.modal-card input,.modal-card select,.modal-card textarea{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  min-height:44px;
  font-size:1rem;                 /* stops iOS zoom-on-focus */
  transition:border-color .15s, box-shadow .15s;
}
.search-wrap input:focus,
.modal-card input:focus,.modal-card select:focus,.modal-card textarea:focus{
  outline:none;border-color:var(--brand-2);
  box-shadow:0 0 0 4px rgba(43,106,76,.14);
}
.person-row{background:var(--surface);border-color:var(--line);border-radius:14px}
.person-row:hover{border-color:var(--gold-2)}
.person-row.active{background:var(--brand-tint);border-color:var(--brand-2);box-shadow:0 0 0 1px rgba(29,79,56,.12)}

/* ---------- Tree canvas & person nodes ---------- */
.canvas-wrap{
  background:
    radial-gradient(rgba(168,118,30,.22) 1px, transparent 1.2px) 0 0 / 22px 22px,
    linear-gradient(180deg,#fffdf8,#fbf6ec);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:inset 0 1px 0 #fff, var(--shadow);
}
.node{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 1px 2px rgba(23,38,31,.05);
}
.node:hover{transform:translateY(-2px);box-shadow:var(--shadow-lift);border-color:#d9c9a8}
.node.active{
  border-color:var(--gold-2);
  background:#fffaf0;
  box-shadow:0 0 0 3px rgba(201,154,62,.28), var(--shadow-lift);
}
.node .name,.node .name-button{font-family:var(--font-display);font-weight:600;color:var(--ink)}
.node .aka{color:#8a5a12}       /* izibongo: warm gold-brown, was purple */
.node .meta{color:var(--muted)}

/* ---------- Modals ---------- */
.modal::backdrop{
  background:rgba(14,33,24,.55);
  -webkit-backdrop-filter:blur(3px);
  backdrop-filter:blur(3px);
}
.modal-card{background:var(--surface);border-radius:26px;box-shadow:0 30px 80px -20px rgba(14,33,24,.45)}
.modal-header{background:var(--surface)}
.modal-actions{border-top-color:var(--line)}

/* ---------- Footer ---------- */
.app-footer-rule{background:linear-gradient(90deg,transparent,rgba(201,154,62,.55),transparent)}
.app-footer-meta{color:var(--muted)}
.app-footer-brand,.app-footer-meta strong{color:var(--brand)}

@media (prefers-reduced-motion:reduce){
  .button,.node,.person-row{transition:none}
  .button:hover,.node:hover{transform:none}
}

/* Lighthouse fixes */
/* Contrast: tagline on #f7f3e9 (entry-brand) and the empty-state card. #4f5e56 = 6.2:1; the refreshed --muted alone is 5.2:1, original slate was 4.3:1 (fail). */
.entry-brand small,.empty-state-brand small{color:#4f5e56}
/* Contrast: eyebrow gold #a8761e is ~3.9:1; #8a5a12 is ~5.8:1. Button gradient darkened so white text stays above 4.5:1. */
.eyebrow,.gen-label{color:#8a5a12}
.empty-state-actions .button-primary{background:linear-gradient(180deg,#9a6b18,#82560f)}

/* QA fixes 2026-11-11: modal header/actions stay reachable in narrow or short viewports (items 7, 18) */
dialog.modal{max-height:100dvh}
.modal-card{max-height:calc(100dvh - 24px);overscroll-behavior:contain}
.modal-card>.modal-header,.modal-card .modal-header:first-child{position:sticky;top:-22px;z-index:3;margin:-22px -22px 0;padding:18px 22px 10px;background:var(--surface,#fff)}
.modal-card .modal-actions{position:sticky;bottom:-22px;z-index:3;margin-left:-22px;margin-right:-22px;padding:12px 22px 16px;background:var(--surface,#fff);flex-wrap:wrap}
.modal-card .icon-button{min-width:40px;min-height:40px;flex:0 0 auto}
@media (max-width:860px){
  .modal-card .form-grid{grid-template-columns:1fr}
  .modal-card .modal-actions .button{flex:1 1 140px}
}
/* in-page confirm dialog (item 2) */
dialog.iz-confirm{width:min(460px,calc(100vw - 24px))}
.iz-confirm .modal-card{width:100%}
.iz-confirm-body p{margin:0 0 8px;line-height:1.45}
.iz-confirm .modal-actions{position:static;margin:16px 0 0;padding:14px 0 0}

/* C22.38.1: small-screen dialogs. The sticky header + sticky actions left only a thin scroll window on phones with large system text. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media (max-width:680px){
  .modal-card{--mpad:14px;font-size:.92rem}
  .modal-card>.modal-header,.modal-card .modal-header:first-child{top:calc(var(--mpad)*-1);margin:calc(var(--mpad)*-1) calc(var(--mpad)*-1) 0;padding:12px var(--mpad) 6px}
  .modal-card .modal-actions{bottom:calc(var(--mpad)*-1);margin-left:calc(var(--mpad)*-1);margin-right:calc(var(--mpad)*-1);padding:8px var(--mpad) calc(10px + env(safe-area-inset-bottom,0px))}
  /* Form dialogs: primary + secondary action share one pinned row instead of two stacked rows. */
  .modal-card form .modal-actions{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px}
  .modal-card form .modal-actions .button{width:auto;flex:1 1 120px;min-height:44px}
  .modal-card form .modal-actions .button-primary{flex:2 1 150px}
  /* Signed-in account menu has many buttons: let it scroll with the content, never pin a tall block. */
  #auth-signed-in .auth-account-actions{position:static;margin:12px 0 0;padding:0}
  /* Sign-in dialog: drop the repeated branding and intro text so the form gets the room. */
  .auth-card .entry-brand,.auth-card .modal-header .eyebrow,.auth-card .modal-header>div>.muted{display:none}
  .auth-mode-toggle{display:grid;grid-template-columns:auto 1fr 1fr;gap:6px;margin:8px 0 2px}
  .auth-mode-toggle .button{font-size:.78rem;line-height:1.15;padding:7px 8px;min-height:40px}
  /* Tighter, capped text so large system font sizes still fit. */
  .modal-card .form-grid{gap:10px}
  .modal-card label{font-size:.85rem}
  .modal-card .muted,.modal-card small{font-size:.78rem;line-height:1.3}
  .modal-card input,.modal-card select,.modal-card textarea{font-size:16px;padding:9px 10px}
}

/* C22.38.2: one button scale on phones. Same height, same type, same shape in every dialog; menus are single-column rows. */
:root{--iz-btn-h:44px;--iz-row-h:52px;--iz-gap:8px;--iz-btn-fs:.9rem}
@media (max-width:680px){
  .modal-card .button,.modal-card .button-small{min-height:var(--iz-btn-h);padding:8px 14px;font-size:var(--iz-btn-fs);line-height:1.15;border-radius:999px}
  /* Sign-in / create / link tabs: equal-width segmented row, equal heights. */
  .auth-mode-toggle{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:8px 0 2px}
  .auth-mode-toggle .button{width:100%;padding:6px 4px;font-size:.82rem;min-height:var(--iz-btn-h);display:flex;align-items:center;justify-content:center;text-align:center}
  /* Signed-in account menu: one column of full-width rows with a chevron, like a settings list. */
  #auth-signed-in .auth-account-actions{display:flex;flex-direction:column;gap:6px;position:static;margin:12px 0 0;padding:0;background:transparent}
  #auth-signed-in .auth-account-actions .button{flex:0 0 auto;height:auto;width:100%;min-height:var(--iz-row-h);display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:0 16px;border-radius:14px;text-align:left;font-size:var(--iz-btn-fs);white-space:nowrap}
  #auth-signed-in .auth-account-actions .button::after{content:"\203A";margin-left:auto;font-size:1.3rem;line-height:1;color:var(--muted,#64748b)}
  #auth-signed-in .auth-account-actions .access-request-badge{margin-left:2px}
  #auth-signed-in .auth-account-actions .access-request-badge[hidden]{display:none!important}
  #auth-signed-in .auth-account-actions #access-dashboard-open{order:-1}
  #auth-signed-in .auth-account-actions #auth-logout{margin-top:6px}
}

/* C22.38.7: header = brand + language + account + menu. Tree chip, Family Tree | My Family, Share, then Outline / Spouses switches sit in the tree toolbar. */
.stage-top{flex-wrap:wrap}
.preview-toolbar{flex:1 1 100%;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.preview-toolbar .toolbar-left,.preview-toolbar .toolbar-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.tree-switch-chip{display:inline-flex;align-items:center;gap:8px;min-height:var(--iz-btn-h,44px);padding:0 16px;border-radius:999px;border:1px solid #86b6a4;background:#ecfdf5;color:#065f46;font-weight:700;font-size:var(--iz-btn-fs,.9rem);max-width:100%}
.tree-switch-chip #tree-switch-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:46vw}
.tree-switch-chip .chip-caret{font-size:.8em}
.seg-toggle{position:relative;display:inline-flex;align-items:center;gap:2px;flex-wrap:nowrap;background:#fff;border:1px solid #e2e8f0;border-radius:999px;padding:3px;justify-content:flex-start}
.seg-toggle .button{border-radius:999px;border:0;min-height:36px;box-shadow:none}
.seg-toggle .seg-caret{padding-inline:8px 12px;margin-left:-6px;min-width:0}
.my-family-menu{position:absolute;top:calc(100% + 8px);left:0;z-index:60;min-width:240px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 14px 30px -16px rgba(15,23,42,.45);padding:6px;display:flex;flex-direction:column}
.my-family-menu[hidden]{display:none}
.my-family-menu button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:48px;padding:8px 12px;border:0;border-radius:10px;background:transparent;text-align:left;font:inherit;color:#1f2937;cursor:pointer}
.my-family-menu button span{font-weight:700;font-size:.9rem}
.my-family-menu button small{font-size:.72rem;color:#55627a}
.my-family-menu button[aria-checked="true"]{background:#ecfdf5;color:#065f46}
.preview-toolbar .preview-spouse-toggle{font-size:.78rem;font-weight:700;gap:8px}
.preview-toolbar .preview-spouse-toggle small{display:none}
@media(max-width:680px){
  .preview-toolbar{justify-content:flex-start}
  .preview-toolbar .toolbar-right{width:100%;justify-content:flex-start;gap:18px}
  .preview-toolbar .preview-spouse-toggle{width:auto;padding-top:0}
  .seg-toggle .button{min-height:38px;padding-inline:12px}
}

/* C22.38.7: keep the new toolbar immune to the older phone grid rules */
.preview-toolbar .seg-toggle{display:inline-flex!important;width:auto!important;grid-template-columns:none!important}
.preview-toolbar .seg-toggle .button{font-size:.82rem!important;white-space:nowrap!important;min-height:36px!important;padding:6px 14px!important}
.preview-toolbar .seg-toggle .seg-caret{padding:6px 10px 6px 4px!important}
.preview-toolbar .preview-spouse-toggle{width:auto!important;padding-top:0!important}
.preview-toolbar .toolbar-left{max-width:100%}

/* C22.38.7: notification bell sits before the account button; its count replaces the account badge */
.notif-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:0;border-radius:999px}
.notif-bell[hidden]{display:none}
.notif-bell-count{position:absolute;top:-6px;right:-6px;min-width:20px;height:20px;padding:0 5px;box-sizing:border-box;border-radius:999px;background:#b45309;color:#fff;font:800 11px/20px Inter,system-ui,sans-serif;text-align:center;border:2px solid #fffdf8}
.notif-bell-count[hidden]{display:none}
#account-button.has-access-alert::after{display:none!important}

/* C22.38.13: Account chip = two-letter initials + "Account" (constant width), header buttons at 50% size on desktop */
#account-button.account-chip{flex-direction:row;gap:8px;height:36px;min-height:36px;padding:3px 14px 3px 4px;background:#065f46;border-color:#065f46;color:#fff;line-height:1}
#account-button.account-chip:hover{background:#054c39}
.acct-initials{flex:0 0 auto;width:28px;height:28px;border-radius:50%;background:#ecfdf5;color:#065f46;font-weight:800;font-size:.7rem;letter-spacing:.02em;display:inline-flex;align-items:center;justify-content:center}
.acct-label{font-size:.84rem;font-weight:700;color:#fff}

/* C22.38.16: one uniform height for every left toolbar button; icons on the tree chip and Share;
   right side back to two rows (switches above zoom), both smaller than the left buttons. */
.preview-toolbar{align-items:flex-start}
.preview-toolbar .toolbar-left{gap:10px;align-items:center}
.preview-toolbar .toolbar-left>*{height:42px;min-height:42px;box-sizing:border-box}
.preview-toolbar .tree-switch-chip{padding:0 16px;font-size:.84rem}
.preview-toolbar .seg-toggle{padding:3px;gap:2px}
.preview-toolbar .seg-toggle .button{height:34px!important;min-height:34px!important;padding:0 16px!important;font-size:.84rem!important;display:inline-flex;align-items:center}
.preview-toolbar .seg-toggle .seg-caret{padding:0 10px 0 6px!important;margin-left:-8px}
.preview-toolbar .share-family-control{display:inline-flex;align-items:center;gap:8px;padding:0 18px;font-size:.84rem;border-radius:999px}
.preview-toolbar .tree-switch-chip::before,
.preview-toolbar .share-family-control::before{
  content:"";flex:0 0 auto;width:17px;height:17px;background-color:currentColor;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;
  -webkit-mask-size:contain;mask-size:contain;
}
.preview-toolbar .tree-switch-chip::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%279%27%20y%3D%273%27%20width%3D%276%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%2716%27%20width%3D%276%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%2715%27%20y%3D%2716%27%20width%3D%276%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M12%208v4M6%2016v-2h12v2%27%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%279%27%20y%3D%273%27%20width%3D%276%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%2716%27%20width%3D%276%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Crect%20x%3D%2715%27%20y%3D%2716%27%20width%3D%276%27%20height%3D%275%27%20rx%3D%271%27%2F%3E%3Cpath%20d%3D%27M12%208v4M6%2016v-2h12v2%27%2F%3E%3C%2Fsvg%3E")}
.preview-toolbar .share-family-control::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2718%27%20cy%3D%275%27%20r%3D%273%27%2F%3E%3Ccircle%20cx%3D%276%27%20cy%3D%2712%27%20r%3D%273%27%2F%3E%3Ccircle%20cx%3D%2718%27%20cy%3D%2719%27%20r%3D%273%27%2F%3E%3Cpath%20d%3D%27m8.6%2013.5%206.8%204M15.4%206.5l-6.8%204%27%2F%3E%3C%2Fsvg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2718%27%20cy%3D%275%27%20r%3D%273%27%2F%3E%3Ccircle%20cx%3D%276%27%20cy%3D%2712%27%20r%3D%273%27%2F%3E%3Ccircle%20cx%3D%2718%27%20cy%3D%2719%27%20r%3D%273%27%2F%3E%3Cpath%20d%3D%27m8.6%2013.5%206.8%204M15.4%206.5l-6.8%204%27%2F%3E%3C%2Fsvg%3E")}

.preview-toolbar .toolbar-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px;background:transparent;border:0;padding:0;flex-wrap:nowrap}
.preview-toolbar .toolbar-switches{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:0 14px;height:32px;box-sizing:border-box}
.preview-toolbar .preview-spouse-toggle{font-size:.72rem;gap:7px;padding-top:0;width:auto}
.preview-toolbar .preview-switch{width:28px;height:16px}
.preview-toolbar .preview-switch:after{width:12px;height:12px;left:2px;top:2px}
.preview-toolbar .preview-spouse-toggle input:checked+.preview-switch:after{transform:translateX(12px)}
.preview-toolbar .tree-canvas-controls{
  position:static!important;margin:0!important;top:auto!important;left:auto!important;right:auto!important;
  height:34px;box-sizing:border-box;display:flex;align-items:center;gap:4px;padding:0 6px;
  border:1px solid var(--line);border-radius:999px;background:#fff;backdrop-filter:none;-webkit-backdrop-filter:none;
}
.preview-toolbar .tree-canvas-control{width:26px;height:26px;min-height:26px;padding:0;border-radius:50%;font-size:.8rem;display:inline-flex;align-items:center;justify-content:center}
.preview-toolbar .tree-canvas-reset{display:inline-flex!important;width:26px;padding:0;font-size:.9rem}
.preview-toolbar .tree-zoom-level{min-width:38px;text-align:center;font-size:.72rem}
@media(max-width:680px){
  .preview-toolbar{align-items:stretch}
  .preview-toolbar .toolbar-right{width:100%;align-items:flex-start;gap:8px}
  .preview-toolbar .toolbar-switches{height:36px}
  .preview-toolbar .toolbar-left>*{height:40px;min-height:40px}
}

/* C22.38.18: page toolbar refinement. One 40 px height for every control, soft 12 px corners instead of pills,
   proportional padding, even 12 px gaps, flat green active state; a hairline divider then separates the toolbar
   from the tree workspace. */
.preview-toolbar{align-items:center;gap:12px;margin-top:14px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.preview-toolbar .toolbar-left{gap:12px;align-items:center}
.preview-toolbar .toolbar-left>*{height:40px!important;min-height:40px!important;box-sizing:border-box;margin:0}
.preview-toolbar .tree-switch-chip,
.preview-toolbar .share-family-control{
  display:inline-flex;align-items:center;gap:8px;padding:0 16px;border-radius:18px;
  font-size:.84rem;font-weight:700;line-height:1;box-shadow:none;transform:none!important;
}
.preview-toolbar .tree-switch-chip{background:var(--brand-tint);border:1px solid rgba(43,106,76,.32);color:var(--brand)}
.preview-toolbar .tree-switch-chip:hover{border-color:var(--brand-2);background:#e4efe6}
.preview-toolbar .tree-switch-chip .chip-caret{margin-left:2px;opacity:.7}
.preview-toolbar .share-family-control{background:var(--surface);border:1px solid var(--line);color:var(--ink)}
.preview-toolbar .share-family-control:hover:not(:disabled){border-color:var(--gold-2);background:#fff}
.preview-toolbar .tree-switch-chip::before,
.preview-toolbar .share-family-control::before{width:16px;height:16px}
.preview-toolbar .seg-toggle{padding:3px!important;gap:2px;border-radius:18px;border:1px solid var(--line);background:var(--surface)}
.preview-toolbar .seg-toggle .button{
  height:32px!important;min-height:32px!important;padding:0 14px!important;border-radius:15px!important;
  font-size:.84rem!important;font-weight:700;line-height:1;box-shadow:none!important;transform:none!important;
}
.preview-toolbar .seg-toggle .button-primary{background:var(--brand);color:#fff}
.preview-toolbar .seg-toggle .button-secondary{background:transparent;color:var(--ink)}
.preview-toolbar .seg-toggle .button-secondary:hover:not(:disabled){background:var(--brand-tint)}
.preview-toolbar .seg-toggle .seg-caret{padding:0 10px 0 4px!important;margin-left:-4px}
.main-stage .tree-viewport-shell{margin-top:16px}

/* C22.38.20: "Cream to sage" strip (option C) with light controls; 18 px toolbar corners kept from C22.38.19.
   C22.38.18: tree strip on top of the canvas: Outline / Spouses switches (left), zoom controls (right).
   Ivory bar with soft corners; zoom is one bordered group with a clear % readout and a separate reset.
   It sits inside .tree-viewport-shell, so the right-hand dock overlays it like the tree. */
.tree-viewport-shell{display:flex;flex-direction:column}
.tree-viewport-shell>.tree-strip{
  flex:0 0 auto;position:relative;z-index:2;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  height:42px;padding:0 8px 0 16px;box-sizing:border-box;
  background:linear-gradient(90deg,#fbf6ec 0%,var(--gold-tint) 55%,#e6eee2 100%);border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
}
.tree-viewport-shell>.tree-strip::-webkit-scrollbar{display:none}
.tree-viewport-shell>.tree-strip+.canvas-wrap{
  flex:1 1 auto;height:auto!important;
  margin-top:0!important;border-top-left-radius:0!important;border-top-right-radius:0!important;
}
.tree-strip-group{display:flex;align-items:center;flex:0 0 auto}
.tree-strip-switches{gap:20px}
/* switches */
.tree-strip .preview-spouse-toggle{
  position:relative;width:auto!important;padding:0!important;gap:8px;justify-content:flex-start!important;
  font-size:.78rem;font-weight:600;color:var(--muted);white-space:nowrap;min-height:32px;
}
.tree-strip .preview-spouse-toggle small{display:none}
.tree-strip .preview-spouse-toggle:has(input:checked)>span:first-child{color:var(--ink)}
.tree-strip .preview-switch{width:32px;height:18px;border-radius:999px;background:#d9d1c2;box-shadow:inset 0 0 0 1px rgba(23,38,31,.08);transition:background-color .18s ease}
.tree-strip .preview-switch:after{width:14px;height:14px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(23,38,31,.25);transition:transform .18s ease}
.tree-strip .preview-spouse-toggle input:checked+.preview-switch{background:var(--brand-2)}
.tree-strip .preview-spouse-toggle input:checked+.preview-switch:after{transform:translateX(14px)}
.tree-strip .preview-spouse-toggle:hover .preview-switch{box-shadow:inset 0 0 0 1px var(--gold-2)}
.tree-strip .preview-spouse-toggle input:focus-visible+.preview-switch{outline:2px solid var(--gold-2);outline-offset:2px}
/* zoom group */
.tree-strip .tree-canvas-controls{
  position:static!important;top:auto!important;left:auto!important;right:auto!important;
  margin:0!important;padding:0!important;gap:8px;width:auto;height:auto;
  border:0!important;border-radius:0!important;background:transparent!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:none!important;
}
.tree-strip .tree-canvas-control{
  display:inline-flex!important;align-items:center;justify-content:center;
  width:30px!important;min-width:30px!important;height:28px!important;min-height:0!important;padding:0!important;
  border:1px solid var(--line)!important;border-radius:0!important;background:#fffdf8;box-shadow:none!important;transform:none!important;
  color:var(--brand);font:700 1rem/1 Inter,system-ui,sans-serif;cursor:pointer;transition:background-color .15s ease,color .15s ease;
}
.tree-strip #tree-zoom-out{border-radius:10px 0 0 10px!important;border-right:0!important;margin-right:-8px}
.tree-strip #tree-zoom-in{border-radius:0 10px 10px 0!important;border-left:0!important;margin-left:-8px}
.tree-strip .tree-zoom-level{
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  min-width:52px;height:28px;padding:0 6px;border:1px solid var(--line);background:var(--gold-tint);
  color:var(--ink);font-size:.74rem;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:.02em;
}
.tree-strip .tree-canvas-control:hover{background:var(--brand-tint)}
.tree-strip .tree-canvas-control:active{background:#d9e8dc}
.tree-strip .tree-canvas-control:focus-visible{outline:2px solid var(--gold-2);outline-offset:1px;position:relative;z-index:1}
.tree-strip .tree-canvas-reset{border-radius:10px!important;color:var(--gold);font-size:1.05rem}
.tree-strip .tree-canvas-reset:hover{background:var(--gold-tint);color:#7a5414}
@media(max-width:680px){
  .preview-toolbar{margin-top:10px;padding-bottom:12px;gap:10px}
  .preview-toolbar .toolbar-left{gap:8px}
  .preview-toolbar .tree-switch-chip,.preview-toolbar .share-family-control{padding:0 14px}
  .main-stage .tree-viewport-shell{margin-top:12px}
  .tree-viewport-shell>.tree-strip{height:46px;gap:8px;padding:0 6px 0 10px;border-radius:14px 14px 0 0}
  .tree-viewport-shell>.tree-strip+.canvas-wrap{min-height:0!important}
  .tree-strip-switches{gap:12px}
  .tree-strip .preview-spouse-toggle{gap:6px}
  .tree-strip .tree-canvas-controls{gap:6px}
  .tree-strip #tree-zoom-out{margin-right:-6px}
  .tree-strip #tree-zoom-in{margin-left:-6px}
  .tree-strip .tree-canvas-control{width:32px!important;min-width:32px!important;height:32px!important}
  .tree-strip .tree-zoom-level{min-width:44px;height:32px}
}

/* C22.38.17: account / Admin Console buttons: no lift or drop shadow on hover, deep orange fill instead */
#account-button:hover:not(:disabled),#account-button.account-chip:hover,
#open-admin-console:hover:not(:disabled){
  background:#c2410c!important;border-color:#c2410c!important;color:#fff!important;
  box-shadow:none!important;transform:none!important;
}
/* C22.38.29: no drop shadow on the account button in any state (it kept the .button-primary resting shadow). */
#account-button,#account-button:hover,#account-button:focus,#account-button:active,#account-button.account-chip,#account-button.account-button-signed{box-shadow:none!important}
#account-button:active:not(:disabled),#open-admin-console:active:not(:disabled){background:#9a3412!important;border-color:#9a3412!important}
#account-button.account-chip:hover .acct-label{color:#fff}
#account-button.account-chip:hover .acct-initials{background:#fff7ed;color:#9a3412}

/* C22.38.22: all four edges feathered so the image's own pale background melts into the page.
   C22.38.20: landing key visual, washed out in warm sepia, behind the Live Preview title (right-hand corner).
   It fades in from the left and out before the toolbar, never takes clicks, and is hidden on phones.
   Option 4 (full-width watermark) would be: left:0;width:100%;opacity:.14;mask fading top-to-bottom only. */
/* C22.38.21: the stage-top layer must sit above the tree strip (z 2) so its menus (My Family, etc.) drop over it;
   5 stays below the dock overlay (15+). */
.main-stage>.stage-top{position:relative;isolation:isolate;z-index:5}
.main-stage>.stage-top::before{
  content:"";position:absolute;z-index:-1;top:-8px;right:0;width:58%;height:calc(100% + 8px);pointer-events:none;
  background:url("assets/key-visual-every-face.webp") right center/cover no-repeat;
  filter:grayscale(1) sepia(.55) contrast(.8) brightness(1.12);opacity:.38;
  -webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 40%,#000 72%,transparent 100%),linear-gradient(180deg,transparent 0%,#000 22%,#000 58%,transparent 100%);
  mask-image:linear-gradient(90deg,transparent 0%,#000 40%,#000 72%,transparent 100%),linear-gradient(180deg,transparent 0%,#000 22%,#000 58%,transparent 100%);
  -webkit-mask-composite:source-in;mask-composite:intersect;
}
@media(max-width:760px){.main-stage>.stage-top::before{display:none}}

/* C22.38.26: Selected Person panel, option A2 (mockup https://claude.ai/artifact/KnM8Bqp5mLo5bh8rEGz4p3).
   Type scale: 17 name / 12 chips + details / 11 labels / 10 action words. Hidden buttons (role rules in app.js) drop out
   and the rest close up; a section whose buttons are all hidden disappears. Same ids and data-* hooks as before. */
#selected-person.sp{display:grid;gap:14px;margin-top:10px}
#selected-person.sp[hidden]{display:none}
.sp-who{display:flex;align-items:center;gap:10px;min-width:0}
.sp-av{flex:0 0 auto;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--gold-tint);border:1px solid #ecd9b4;color:var(--gold);font:700 13px/1 var(--font-display)}
.sp-id{min-width:0}
#selected-person #selected-name{margin:0;font:700 17px/1.2 var(--font-display);color:var(--ink);overflow-wrap:anywhere}
#selected-person .sp-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:4px 0 0}
#selected-person #selected-meta{font-size:12px;line-height:1.2;color:var(--muted)}
#selected-person #selected-code{margin:0;padding:4px 6px;border-radius:6px;background:var(--brand-tint);color:var(--brand);font:700 10px/1 Inter,system-ui,sans-serif;letter-spacing:.04em}
.sp-lbl{display:flex;align-items:center;gap:8px;margin:0 0 8px;font:700 11px/1 Inter,system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.sp-lbl::after{content:"";flex:1;border-top:1px solid var(--line)}
.sp-add{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px}
.sp-chip{height:28px;min-height:0;padding:0 4px;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:500 12px/1 Inter,system-ui,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;box-shadow:none;transform:none;transition:background-color .15s,border-color .15s,color .15s}
.sp-chip:hover{border-color:var(--brand-2);background:var(--brand-tint);color:var(--brand)}
.sp-chip-primary{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
.sp-chip-primary:hover{background:var(--brand-2);border-color:var(--brand-2);color:#fff}
.sp-w4{grid-column:span 3}.sp-w3{grid-column:span 4}.sp-w2{grid-column:span 6}
.sp-suggest{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px}
.sp-suggest .sp-chip{height:32px;font-weight:600;color:var(--brand)}
.sp-sec:not(:has(button:not([hidden]))){display:none}
.sp-actions{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px}
.sp-act{height:48px;min-height:0;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--brand);cursor:pointer;box-shadow:none;transform:none;transition:background-color .15s,border-color .15s}
.sp-act svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sp-act span{font:600 10px/1 Inter,system-ui,sans-serif;color:var(--ink);letter-spacing:-.01em}
.sp-act:hover{background:var(--brand-tint);border-color:var(--brand-2)}
.sp-act-danger{color:var(--danger,#b42318);border-color:#f1cdc8}
.sp-act-danger span{color:var(--danger,#b42318)}
.sp-act-danger:hover{background:#fdf0ee;border-color:var(--danger,#b42318)}
.sp-chip:focus-visible,.sp-act:focus-visible{outline:2px solid var(--gold-2);outline-offset:2px}
.sp-chip[hidden],.sp-act[hidden]{display:none}

/* C22.38.26: Search & People and Navigate Relatives tidied to match: 11 px section labels, 12 px text,
   slim 8-10 px corners, quieter rows and chips. */
#mobile-panel-people .search-wrap{gap:6px;margin:4px 0 10px}
#mobile-panel-people #people-search{height:34px;padding:0 10px;border-radius:10px;font-size:12px;border:1px solid var(--line);background:#fff}
#mobile-panel-people #clear-search{height:34px;min-height:34px;padding:0 12px;border-radius:10px;font-size:12px;font-weight:600;box-shadow:none;transform:none}
#mobile-panel-people .people-list{gap:6px}
#mobile-panel-people .person-row{padding:7px 10px;border-radius:10px;box-shadow:none}
#mobile-panel-people .person-row .person-name-link{font:600 13px/1.25 var(--font-display)}
#mobile-panel-people .person-row small{font-size:11px;margin-top:2px}
#relative-nav.relative-nav{gap:12px}
#relative-nav .relative-group{gap:6px}
#relative-nav .relative-group>strong{display:flex;align-items:center;gap:8px;font:700 11px/1 Inter,system-ui,sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
#relative-nav .relative-group>strong::after{content:"";flex:1;border-top:1px solid var(--line)}
#relative-nav .relative-buttons{gap:6px}
#relative-nav .relative-chip{height:28px;padding:0 10px;display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:500 12px/1 Inter,system-ui,sans-serif}
#relative-nav .relative-chip:hover{border-color:var(--brand-2);background:var(--brand-tint);color:var(--brand)}
#relative-nav .relative-buttons .muted{font-size:12px}
