/* Profile sections (ui/profile.js), the profile picker (ui/chooser.js) and the
   drawn × of close and remove buttons. Loaded after session6.css. */

/* ---- the drawn cross (ui/icons.js svgIcon('x')): centered in its button --- */
.x-close, .card > .x, .xb-x, .ps-x, .ch-del { display: grid; place-items: center; padding: 0; }
.x-close .ui-ico, .card > .x .ui-ico { width: 18px; height: 18px; }
.xb-x .ui-ico, .ps-x .ui-ico, .ch-del .ui-ico { width: 14px; height: 14px; }

/* ---- profile pills (ui/profile.js): one flow, choices side by side ---------- */
.pflow { display: flex; flex-wrap: wrap; gap: 4px; }
.psec {
  position: relative; display: flex; align-items: stretch; flex: 0 0 auto; min-height: 34px;
  border-radius: 9px; background: rgba(0, 0, 0, 0.3); overflow: hidden;
}
.psec.enter { animation: pop-in 0.3s var(--ease-bounce); }
.ps-open { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 0; text-align: left; white-space: nowrap; }
.ps-cont .ps-open { padding-left: 8px; }
.ps-cat {
  align-self: stretch; flex: none; display: grid; place-items: center; margin: -4px 3px -4px 0; padding: 0 6px 0 8px;
  background: linear-gradient(var(--wt, transparent), var(--wt, transparent)), rgba(0, 0, 0, 0.32);
  border-right: 1px solid rgba(212, 246, 255, 0.16);
  box-shadow: inset 3px 0 0 var(--wc, transparent);
}
.ps-cont { box-shadow: inset 3px 0 0 var(--wc, transparent); }
.ps-cat .ps-ico { width: 20px; height: 20px; }
.ps-items { display: flex; flex-wrap: nowrap; gap: 5px; align-items: center; }
.ps-items.words { gap: 0.3em; }
.pi { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; }
/* every choice's text in one format: regular and white (2026-10-13) */
.ps-txt { font-size: 12.5px; font-weight: 400; color: var(--text); white-space: nowrap; }
.pw { font-size: 12.5px; font-weight: 400; color: var(--text); }
.ps-empty { color: var(--muted); font-size: 12.5px; padding: 0 2px; white-space: nowrap; }
.ps-flag { display: inline-flex; }
.psec .pchip { font-size: 11px; padding: 0 5px; height: 21px; max-width: none; }
.psec .pc-ico { display: inline-flex; }
.psec .pc-ico .xi { width: 15px; height: 15px; }
.psec .pc-txt { max-width: none; overflow: visible; white-space: nowrap; font-weight: 400; color: var(--text); }
.psec .fs-kid { margin-left: -5px; }
.ps-x { flex: none; width: 30px; margin-left: -4px; color: var(--muted); }
.ps-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
/* an extra's editor in its pop-up */
.xmodal-card .xblock { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.xmodal-card .xb-head { padding-right: 36px; }
.menu-sep { height: 1px; margin: 4px 8px; background: rgba(255, 255, 255, 0.08); }
.extras-menu { overflow-y: auto; }

/* ---- extras: notes ---------------------------------------------------------- */
.ab-body { position: relative; }
.ab-in {
  width: 100%; resize: vertical; min-height: 64px; padding: 8px 10px 18px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid transparent; color: var(--text); font: 400 14px var(--font);
}
.ab-in:focus { outline: none; border-color: rgba(255, 230, 0, 0.55); }
.ab-in::placeholder { color: var(--faint); }
.ab-count { position: absolute; right: 9px; bottom: 7px; font-size: 10px; color: var(--muted); }
.ab-count.full { color: var(--yellow); }

/* ---- the profile picker ---------------------------------------------------- */
.chooser { container-type: inline-size; }
.ch-head { display: flex; flex-direction: column; gap: 8px; }
.ch-row1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-right: 40px; }
.ch-title { margin: 0; font-size: 18px; font-weight: 600; flex: 1 1 auto; min-width: 0; }
.ch-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ch-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ch-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 10px;
  background: var(--surface3); color: var(--accent); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.ch-btn .ui-ico { width: 16px; height: 16px; flex: none; }
.ch-btn.on { background: rgba(255, 230, 0, 0.16); color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255, 230, 0, 0.45); }
.ch-btn:disabled { opacity: 0.4; }
.ch-order { height: 40px; }
.ch-done { height: 40px; }
/* narrow sheets: the title takes row 1, the tools row 2; labels give way to icons */
.ch-title { flex: 0 1 auto; }
.ch-row1 .ch-count { flex: 1 1 auto; }
@container (max-width: 420px) {
  .ch-tools { width: 100%; }
  .ch-order .ch-lbl, .ch-clear .ch-lbl { display: none; }
}
@container (max-width: 300px) {
  .ch-tools .ch-lbl { display: none; }
}
.ch-body .pick { min-height: 44px; }
.ch-body .ch-ico { width: 30px; flex: none; display: grid; place-items: center; }
.ch-body .ch-ico .xi { width: 26px; height: 26px; }
/* a toast while a sheet with an entry field is open sits above the field */
.sheet-wrap:has(.ch-foot) ~ .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
.ch-body .pname { flex: 1; min-width: 0; }
.ch-star { color: var(--yellow); font-size: 15px; margin-right: 30px; }
.ch-body .pick:not(.sel) .ch-star { margin-right: 6px; }
.ch-sec {
  margin: 10px 4px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.ch-sec:first-child { margin-top: 2px; }
.ch-custom { cursor: pointer; padding-right: 8px; }
.ch-custom .pname { font-style: italic; }
.ch-del { flex: none; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); margin-right: 26px; }
.ch-custom:not(.sel) .ch-del { margin-right: 0; }
.ch-del:hover { background: var(--surface3); color: var(--text); }
.ch-foot {
  display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #2c2c33; background: #131316;
}
.ch-add { flex: 1; }
.ch-add-in {
  width: 100%; height: 40px; border-radius: 12px; padding: 0 12px;
  background: #1d1d22; border: 1.5px solid #2e2e35; color: var(--text); font: 400 15px var(--font);
}
.ch-add-in:focus { outline: none; border-color: rgba(255, 230, 0, 0.55); }
.ch-plus {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--yellow); color: #111;
}
.ch-plus .ui-ico { width: 20px; height: 20px; }

/* ---- the event browser (ui/picker.js) in the picker's header layout -------- */
.picker .ch-row1 .hist { margin-right: 0; }
.picker .sheet-body .ch-sec { grid-column: 1 / -1; }
.picker .list .pname { flex: 1; min-width: 0; }
.picker .list .ch-star { margin-right: 30px; }
.picker .list .pick:not(.sel) .ch-star { margin-right: 6px; }
.picker .grid .ch-star { position: absolute; top: 2px; left: 5px; margin: 0; font-size: 11px; }
.picker .ch-star[hidden] { display: none; }
.picker .seg { flex: none; }
.ev-info p.ev-help { color: var(--accent); -webkit-line-clamp: 2; }
@container (max-width: 520px) {
  .picker .ch-order .ch-lbl { display: none; }
}
@container (max-width: 420px) {
  .picker .ch-row1 .ch-count { flex: 0 1 auto; }
  .picker .ch-tools { width: auto; margin-left: auto; }
  .picker .ch-tools .ch-lbl { display: none; }
}

/* ---- graphs menu: Your Graphs / Examples ---------------------------------- */
.pre-sec { margin: 8px 8px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pre-sec:first-child { margin-top: 2px; }
.pre-item { cursor: pointer; }
.pre-new .pre-avatar { color: var(--yellow); }
.pre-new .pre-avatar .ui-ico { width: 18px; height: 18px; }
.pre-del { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.pre-del .ui-ico { width: 14px; height: 14px; }
.pre-del:hover { background: var(--surface3); color: var(--text); }
.pre-btn .pre-label { display: inline; max-width: 64px; }
@media (min-width: 840px) { .pre-btn .pre-label { max-width: 160px; } }
@media (max-width: 420px) { .pre-btn .pre-label { display: none; } }
.preset-banner { flex-wrap: wrap; }
.preset-banner .pb-txt { flex: 1 1 180px; }

/* ---- in-app browsers: the confirmation page (inapp.js, decision O5) -------- */
body.inapp-on #app, body.inapp-on .rail, body.inapp-on .share-fab, body.inapp-on #btnShare, body.inapp-on #btnPoster, body.inapp-on .fabs { display: none !important; }
#inappHost { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.inapp { max-width: 420px; display: flex; flex-direction: column; gap: 18px; text-align: center; }
.ia-logo { font-size: 26px; font-weight: 700; }
.ia-logo b { color: var(--yellow); font-weight: 700; }
.ia-logo i { font-style: normal; color: var(--accent); }
.ia-text { margin: 0; font-size: 17px; line-height: 1.45; }
.ia-buttons { display: flex; flex-direction: column; gap: 10px; }
.ia-buttons .btn { height: auto; min-height: 48px; padding: 10px 16px; white-space: normal; line-height: 1.3; justify-content: center; }
.ia-steps { display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--muted); }
.ia-steps p { margin: 0; }
.ia-step { color: var(--text); font-weight: 600; }
.ia-addr { display: flex; gap: 8px; }
.ia-addr input { flex: 1; min-width: 0; height: 40px; border-radius: 10px; padding: 0 10px; background: #1d1d22; border: 1.5px solid #2e2e35; color: var(--text); font: 400 14px var(--font); }

/* ---- the visitor's age question (ui/aboutme.js); dev marks on mock ads ------ */
.aboutme-card .am-age { width: 100%; height: 44px; margin: 6px 0 12px; border-radius: 12px; padding: 0 12px;
  background: #1d1d22; border: 1.5px solid #2e2e35; color: var(--text); font: 500 18px var(--font); }
.aboutme-card .actions .btn { flex: 1; justify-content: center; }
.mock-slot { position: relative; }
.ad-flags { position: absolute; right: 6px; bottom: 4px; font-size: 10px; font-weight: 700; color: var(--yellow); opacity: 0.8; }

/* ---- statistics (stats/panel.js) ------------------------------------------------ */
.stats-cta { display: flex; justify-content: center; margin: 6px 0 10px; }
.stats-q { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.stats-mark { font-weight: 700; font-size: 13px; }
.stats-mark.yes { color: #5fd38a; }
.stats-mark.no { color: #ff7a7a; }
.stats-choice { display: flex; gap: 10px; margin-bottom: 12px; }
.stats-choice .btn { flex: 1; justify-content: center; background: var(--surface3); color: var(--text); }
.stats-choice .stats-yes.on { background: #2f8f57; color: #fff; }
.stats-choice .stats-no.on { background: #9b3b3b; color: #fff; }
.stats-card p.stats-consent { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.stats-card .stats-show, .studio .stats-row { width: 100%; justify-content: center; }
.studio .stats-row { margin-top: 6px; }

/* ---- legal pages: section headings ---- */
.pg-h2 { margin: 22px 0 6px; font-size: 18px; font-weight: 600; }
.stats-card p.stats-preview { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: rgba(255, 230, 0, 0.08); color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255, 230, 0, 0.3); }

/* ---- close buttons (2026-10-11): 48 px circles with a ring, the cross centred
   in its own hit area and drawn above whatever sits next to it; rows beside a
   close button keep clear of it (touch screens move taps to the nearest button) */
.x-close, .card > .x {
  width: 48px; height: 48px; border-radius: 50%; z-index: 5; touch-action: manipulation;
  color: var(--text); background: var(--surface2); box-shadow: inset 0 0 0 1.5px rgba(212, 246, 255, 0.3);
}
.x-close .ui-ico, .card > .x .ui-ico { width: 27px; height: 27px; }
.x-close { top: 6px; right: 8px; }
.card > .x { top: 8px; right: 8px; }
.x-close:hover, .card > .x:hover { color: var(--yellow); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 0, 0.6); }
.sheet-head .ch-row1, .sheet-head .sheet-title { padding-right: 58px; }
.card h3 { padding: 0 54px; }
.studio.has-tabs .st-tabs { margin-right: 54px; }

/* ---- toasts on the editor sit above Share My Life! (and the poster button) */
body:not(.on-page) .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
body.poster-on:not(.on-page) .toast { bottom: calc(134px + env(safe-area-inset-bottom)); }
@media (min-width: 840px) { body:not(.on-page) .toast { bottom: calc(90px + env(safe-area-inset-bottom)); } }
@media (min-width: 1200px) { body.poster-on:not(.on-page) .toast { bottom: calc(144px + env(safe-area-inset-bottom)); } }

/* ---- Contribute Your Statistics: the whole row, faint yellow with a plain
   border (like the Synthetic People box); every few seconds it shines bright
   yellow and pops, to draw the eye (2026-10-13; not with reduced motion) */
.stats-cta .btn, .stp-cta .btn {
  width: 100%; justify-content: center; position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid rgba(255, 230, 0, 0.32); background: rgba(255, 230, 0, 0.07); color: #fff0a0;
  animation: cta-pop 7s ease-in-out 2s infinite;
}
.stats-cta .btn::after, .stp-cta .btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 236, 80, 0.5) 50%, transparent 70%);
  transform: translateX(-110%); animation: cta-shine 7s ease-in-out 2s infinite;
}
@keyframes cta-pop {
  0%, 80%, 100% { scale: 1; border-color: rgba(255, 230, 0, 0.32); background-color: rgba(255, 230, 0, 0.07); box-shadow: none; color: #fff0a0; }
  86% { scale: 1.03; border-color: #ffe600; background-color: rgba(255, 230, 0, 0.22); box-shadow: 0 0 22px rgba(255, 230, 0, 0.45); color: #ffe600; }
  92% { scale: 1; }
}
@keyframes cta-shine { 0%, 79% { transform: translateX(-110%); } 93%, 100% { transform: translateX(110%); } }
@media (prefers-reduced-motion: reduce) {
  .stats-cta .btn, .stp-cta .btn, .stats-cta .btn::after, .stp-cta .btn::after { animation: none; }
}

/* ---- Statistics in the top bar (left of the presets) */
.top-stats { height: 36px; padding: 0 10px; gap: 6px; border: 1.5px solid var(--line); font-size: 14px; color: var(--text); }
.top-stats:hover { color: var(--yellow); }
.top-stats .ts-ico { font-family: var(--emoji-font); font-size: 16px; line-height: 1; }
@media (max-width: 560px) { .top-stats { width: 36px; padding: 0; justify-content: center; } .top-stats .ts-lbl { display: none; } }
@media (max-width: 380px) { .top-stats { width: 32px; } }
@media (max-width: 380px) { /* the top bar keeps its seven parts on one row */
  .topbar { padding: 0 6px; gap: 4px; }
  .logo { font-size: 16.5px; }
  .pre-btn, .lang-btn { padding: 0 5px; }
}

/* ---- pills (2026-10-11): the type's name and icon in the tinted part; every
   choice in its own subpill, nearly as tall as the pill; Notes in one subpill */
.ps-open { padding: 3px 6px 3px 0; }
.ps-cat { display: flex; align-items: center; gap: 6px; margin: -3px 5px -3px 0; padding: 0 8px 0 10px; }
.ps-lbl { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.psec .ps-items > .pi, .psec .ps-items.words {
  height: 28px; padding: 0 9px; border-radius: 8px; font-size: 12.5px;
  background: rgba(0, 0, 0, 0.26); box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.2);
}
.psec .ps-items.words > .pi { height: auto; padding: 0; background: none; box-shadow: none; }
.psec .pchip { max-width: none; }
.psec .pc-ico .xi { width: 17px; height: 17px; }
.ps-cont .ps-open { padding-left: 6px; }

/* ---- categories in pop-ups (2026-10-11): a rounded box each, the title in a pill */
.cat-box { margin: 8px 0; padding: 8px 6px 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.1); }
.cat-box:first-child { margin-top: 2px; }
.cat-box.plain { padding-top: 6px; }
.cat-pill {
  display: inline-flex; align-items: center; height: 24px; margin: 0 0 6px 4px; padding: 0 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text);
  background: rgba(212, 246, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.2);
}
.cat-items { display: flex; flex-direction: column; gap: 2px; }
.picker .sheet-body.grid { display: block; }
.picker .grid .cat-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }

/* ---- Ancestry: a slider per country in its picker; shares in the pills ---- */
.ch-panel .cat-items { gap: 6px; padding: 2px 4px 4px; }
.anc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(90px, 1.3fr) 46px; align-items: center; gap: 10px; min-height: 40px; }
.anc-name { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anc-row input[type=range] { width: 100%; accent-color: var(--yellow); }
.anc-pct { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.anc-pct.bad { color: #ff6b6b; }
.anc-pct.ok { color: #5fd38a; }
.ch-note { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #2c2c33; background: #1a1215; color: #ff8a8a; font-size: 14px; font-weight: 600; text-align: center; }
.ch-back { flex: none; }
.extras-menu .cat-box { margin: 4px 2px; padding: 6px 4px 4px; }
.extras-menu .cat-box:first-child { margin-top: 2px; }
/* a pill with one long choice (e.g. "Residence: United Kingdom — England" on a phone)
   keeps to its row: the choice's text ends with an ellipsis instead of overflowing */
.psec { max-width: 100%; }
.pflow.pf-natural .psec { max-width: none; } /* while splitPills() measures */
.ps-open { min-width: 0; }
.ps-items { min-width: 0; }
.psec .ps-items > .pi { min-width: 0; max-width: 100%; }
.psec .ps-items > .pi .ps-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
