/* ===========================================================
   Портал пам'яті — оболонка сайту і три дизайн-теми.
   Завантажується ПІСЛЯ main.css і перевизначає токени.
   =========================================================== */

/* ---------- 1. Строга (граніт, сутінки) ---------- */
body[data-design="strict"] {
  --ground: #12141c;
  --ground-2: #191c27;
  --ink: #E6E2D8;
  --ink-2: rgba(230, 226, 216, 0.74);
  --ink-3: rgba(230, 226, 216, 0.46);
  --amber: #C9A96A;
  --amber-ink: #DCC08A;
  --amber-soft: rgba(201, 169, 106, 0.30);
  --orn: #B0925C;
  --glass: rgba(20, 23, 34, 0.55);
  --glass-strong: rgba(16, 18, 27, 0.86);
  --glass-edge: rgba(230, 226, 216, 0.14);
  --glass-edge-2: rgba(230, 226, 216, 0.07);
  --field: rgba(230, 226, 216, 0.05);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  --text-glow: 0 1px 14px rgba(6, 7, 12, 0.7);
  --halo: rgba(10, 12, 18, 0.8);
  --blurv: blur(22px) saturate(1.05);
  --radius: 3px;
  --stone-a: #22242e; --stone-b: #0e0f14;
}
/* ---------- 2. Повітряна (хмари, рідке скло) ---------- */
body[data-design="air"] {
  --ground: #E7EFF8;
  --ground-2: #F4F8FC;
  --ink: #1E2A40;
  --ink-2: rgba(30, 42, 64, 0.80);
  --ink-3: rgba(30, 42, 64, 0.56);
  --amber: #B8862F;
  --amber-ink: #8A6118;
  --amber-soft: rgba(184, 134, 47, 0.24);
  --orn: #C09A46;
  --glass: rgba(255, 255, 255, 0.45);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-edge-2: rgba(30, 42, 64, 0.10);
  --field: rgba(255, 255, 255, 0.55);
  --shadow: 0 24px 60px rgba(80, 110, 150, 0.22), 0 2px 8px rgba(80, 110, 150, 0.12);
  --text-glow: 0 1px 12px rgba(255, 255, 255, 0.9);
  --halo: rgba(255, 255, 255, 0.94);
  --blurv: blur(26px) saturate(1.9);
  --radius: 18px;
  --stone-a: #2b3a52; --stone-b: #16202f;
}
/* ---------- 3. Класика (тепла глибина, без 3D) ---------- */
body[data-design="classic"] {
  --ground: #E9E1D1;
  --ground-2: #F3EDE0;
  --ink: #2E2519;
  --ink-2: rgba(46, 37, 25, 0.82);
  --ink-3: rgba(46, 37, 25, 0.55);
  --amber: #8A5A2B;
  --amber-ink: #6B451F;
  --amber-soft: rgba(138, 90, 43, 0.20);
  --orn: #8A6A45;
  --glass: rgba(252, 248, 239, 0.86);
  --glass-strong: rgba(250, 245, 235, 0.96);
  --glass-edge: rgba(46, 37, 25, 0.18);
  --glass-edge-2: rgba(46, 37, 25, 0.09);
  --field: rgba(46, 37, 25, 0.05);
  --shadow: 0 18px 44px rgba(90, 70, 45, 0.22);
  --text-glow: none;
  --halo: rgba(250, 245, 235, 0.95);
  --blurv: none;
  --radius: 2px;
  --stone-a: #4a4034; --stone-b: #241d15;
}
body[data-design="air"] .ctl, body[data-design="classic"] .ctl { text-shadow: none; }
body[data-design="classic"] .bar-top > *, body[data-design="air"] .bar-top > * { text-shadow: var(--text-glow); }

/* ---------- каркас екранів ---------- */
.screen { position: fixed; inset: 0; z-index: 30; overflow-y: auto; overscroll-behavior: contain;
  background: transparent; display: none; }
body[data-screen="intro"] #scr-intro,
body[data-screen="auth"] #scr-auth,
body[data-screen="design"] #scr-design,
body[data-screen="geo"] #scr-geo,
body[data-screen="place"] #scr-place,
body[data-screen="profile"] #scr-profile { display: block; animation: scr-in .5s cubic-bezier(.2,.8,.2,1) both; }
body[data-screen="portal"] .screen { display: none; }
@keyframes scr-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }
#scr-place .wrap, #scr-profile .wrap, #scr-geo .wrap { background: linear-gradient(var(--ground) 0 100%); box-shadow: 0 0 60px 40px var(--ground); }
#scr-place .wrap, #scr-profile .wrap { min-height: 100vh; }
.screen-head { padding: 96px 0 26px; }
.screen-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3.4vw, 40px); margin: 0 0 8px; text-wrap: balance; letter-spacing: .005em; }
.screen-head p { color: var(--ink-2); max-width: 62ch; margin: 0; font-size: 15.5px; }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs button { color: var(--ink-3); border-bottom: 1px solid transparent; }
.crumbs button:hover { color: var(--ink); border-bottom-color: var(--amber); }
.crumbs i { font-style: normal; opacity: .5; }

/* ---------- фон екранів залежно від теми ---------- */
.screen-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
body { background: var(--ground); }
.screen-bg .layer { position: absolute; inset: -10%; background-size: cover; background-position: center; }
body[data-design="strict"] .screen-bg { background:
  radial-gradient(120% 80% at 50% -10%, #1d2130 0%, #12141c 60%, #0c0e14 100%); }
body[data-design="air"] .screen-bg { background:
  radial-gradient(110% 80% at 50% -5%, #ffffff 0%, #dfeaf7 45%, #cbdcf0 100%); }
body[data-design="classic"] .screen-bg { background:
  radial-gradient(120% 90% at 50% 0%, #f6f0e3 0%, #e9e1d1 60%, #ddd2bd 100%); }
/* фотофон теми — м'яко, під контентом */
.screen-bg .photo { position: absolute; inset: 0; background-size: cover; background-position: center top;
  mask-image: linear-gradient(#000 0%, #000 42%, transparent 88%);
  -webkit-mask-image: linear-gradient(#000 0%, #000 42%, transparent 88%); }
body[data-design="strict"] .screen-bg .photo { background-image: var(--img-strict); opacity: .62; }
body[data-design="air"] .screen-bg .photo { background-image: var(--img-air); opacity: .78; }
body[data-design="classic"] .screen-bg .photo { background-image: var(--img-classic); opacity: .68; }
/* силует горизонту знизу — глибина на всіх екранах */
.screen-bg .sil { position: absolute; left: -2%; right: -2%; bottom: 0; height: 34vh;
  -webkit-mask-image: var(--sil-mid); mask-image: var(--sil-mid);
  -webkit-mask-size: cover; mask-size: cover; -webkit-mask-position: bottom center; mask-position: bottom center; }
body[data-design="strict"] .screen-bg .sil { background: #0a0c12; opacity: .85; }
body[data-design="air"] .screen-bg .sil { background: #7d92ad; opacity: .30; }
body[data-design="classic"] .screen-bg .sil { background: #6f6450; opacity: .42; }
.screen-bg::after { content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.06) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.05) 0 1px, transparent 1px);
  background-size: 140px 140px, 200px 200px; }
/* хмари для повітряної */
body[data-design="air"] .screen-bg .cloud { position: absolute; border-radius: 50%; filter: blur(28px);
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,255,255,0) 70%); animation: drift 60s linear infinite; }
@keyframes drift { from { transform: translateX(-8vw); } to { transform: translateX(8vw); } }
/* туман для строгої */
body[data-design="strict"] .screen-bg .cloud { position: absolute; border-radius: 50%; filter: blur(40px);
  background: radial-gradient(circle, rgba(120,132,160,.20), rgba(120,132,160,0) 70%); animation: drift 90s linear infinite; }
body[data-design="classic"] .screen-bg .cloud { display: none; }

/* ---------- вхідний екран ---------- */
#scr-intro .hero { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; padding: 110px 0 40px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 6vw, 68px); line-height: 1.06; margin: 0 0 22px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; display: block; color: var(--amber-ink); }
.hero .lede { max-width: 60ch; color: var(--ink-2); font-size: clamp(15px, 1.5vw, 17.5px); line-height: 1.62; margin: 0 0 14px; }
.hero .lede + .lede { color: var(--ink-3); }
.hero .cta-row { display: flex; align-items: center; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.btn-lg { padding: 14px 30px; border: 1px solid var(--amber); border-radius: var(--radius); background: var(--amber-soft);
  color: var(--ink); font-size: 16px; transition: background .35s, transform .35s, box-shadow .35s; }
.btn-lg:hover { background: var(--amber); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 30px var(--amber-soft); }
body[data-design="air"] .btn-lg { backdrop-filter: var(--blurv); -webkit-backdrop-filter: var(--blurv); }
.link-quiet { color: var(--ink-3); font-size: 14.5px; border-bottom: 1px solid var(--glass-edge-2); padding-bottom: 2px; }
.link-quiet:hover { color: var(--ink); border-bottom-color: var(--amber); }
.how { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding: 30px 0 90px; }
.how::before { content: ""; position: absolute; inset: -24px -50px 40px; z-index: -1; border-radius: 40px;
  background: radial-gradient(ellipse 70% 90% at 50% 45%, var(--ground) 45%, transparent 85%); }
.how-item { padding-top: 18px; border-top: 1px solid var(--glass-edge-2); }
.how-item .n { font-family: var(--serif); font-size: 13px; color: var(--amber-ink); letter-spacing: .12em; }
.how-item h3 { font-family: var(--serif); font-weight: 500; font-size: 19px; margin: 8px 0 6px; }
.how-item p { color: var(--ink-3); font-size: 14.5px; margin: 0; line-height: 1.55; }

/* ---------- авторизація ---------- */
.card-mid { max-width: 430px; margin: 0 auto; padding: 30px 30px 26px; background: var(--glass-strong);
  border: 1px solid var(--glass-edge); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
  backdrop-filter: var(--blurv); -webkit-backdrop-filter: var(--blurv); }
#scr-auth .wrap { padding-top: 12vh; padding-bottom: 60px; }
.card-mid h1 { font-family: var(--serif); font-weight: 500; font-size: 27px; margin: 0 0 6px; }
.card-mid .sub { color: var(--ink-3); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }
.prov { display: flex; flex-direction: column; gap: 10px; }
.prov button { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--glass-edge);
  border-radius: var(--radius); color: var(--ink); background: var(--field); font-size: 15px; transition: border-color .25s, background .25s; }
.prov button:hover { border-color: var(--amber); background: var(--amber-soft); }
.prov svg { width: 20px; height: 20px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--glass-edge-2); }
.fine { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin: 18px 0 0; }
.fine.warn { color: var(--amber-ink); }

/* ---------- вибір теми ---------- */
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 70px; }
.dcard { border: 1px solid var(--glass-edge); border-radius: calc(var(--radius) + 4px); overflow: hidden; text-align: left;
  background: var(--glass); transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .4s; display: flex; flex-direction: column; }
.dcard:hover { transform: translateY(-4px); border-color: var(--amber); box-shadow: var(--shadow); }
.dcard.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.dpreview { position: relative; height: 190px; overflow: hidden; }
.dpreview .mon-mini { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: 88px; }
.dpreview .glare { position: absolute; inset: 0; }
/* прев'ю: строга */
.dp-strict { background: linear-gradient(180deg, #2a2f42 0%, #1a1e2b 55%, #14161f 100%); }
.dp-strict .glare { background: radial-gradient(60% 40% at 50% 78%, rgba(201,169,106,.28), transparent 70%); }
.dp-strict .rain { position: absolute; inset: 0; background-image: linear-gradient(105deg, transparent 0 48%, rgba(255,255,255,.16) 48% 50%, transparent 50%);
  background-size: 26px 100%; animation: rain 1.6s linear infinite; opacity: .5; }
@keyframes rain { to { background-position: -52px 120px; } }
/* прев'ю: повітряна */
.dp-air { background: linear-gradient(180deg, #cfe2f5 0%, #eaf3fb 45%, #fbf6ea 100%); }
.dp-air .glare { background: radial-gradient(50% 60% at 50% 20%, rgba(255,255,255,.95), transparent 70%); animation: pulse 6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .75; } 50% { opacity: 1; } }
.dp-air .liquid { position: absolute; left: 50%; top: 26%; width: 120px; height: 120px; transform: translateX(-50%);
  border-radius: 50%; background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.15));
  box-shadow: inset 0 2px 12px rgba(255,255,255,.9), inset 0 -8px 20px rgba(140,170,210,.35), 0 8px 26px rgba(120,150,190,.25);
  backdrop-filter: blur(4px); animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0) } 50% { transform: translateX(-50%) translateY(-8px) } }
/* прев'ю: класика */
.dp-classic { background: linear-gradient(180deg, #d9cdb4 0%, #ece3d2 60%, #f5efe2 100%); }
.dp-classic .par { position: absolute; inset: 0; }
.dp-classic .par span { position: absolute; bottom: 0; left: 0; right: 0; background: #b9ab8d; }
.dp-classic .par .l1 { height: 46px; clip-path: polygon(0 60%,14% 30%,28% 55%,44% 22%,60% 50%,76% 28%,90% 52%,100% 36%,100% 100%,0 100%); opacity: .5; }
.dp-classic .par .l2 { height: 30px; background: #9c8e70; opacity: .7; }
.dp-classic .par .l3 { height: 14px; background: #7d7057; }
.dcard .dbody { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dcard h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 0; }
.dcard p { color: var(--ink-3); font-size: 14px; margin: 0; line-height: 1.5; flex: 1; }
.dcard .tag { font-size: 12px; color: var(--amber-ink); }
.dcard .pick { align-self: flex-start; margin-top: 10px; padding: 8px 16px; border: 1px solid var(--amber); border-radius: var(--radius); color: var(--ink); }

/* ---------- географія ---------- */
.geo-search { width: 100%; max-width: 420px; margin-bottom: 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding-bottom: 70px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--glass-edge);
  border-radius: var(--radius); background: var(--glass); text-align: left; transition: border-color .25s, transform .25s, background .25s; }
.tile:hover { border-color: var(--amber); transform: translateY(-2px); }
.tile .flag { width: 26px; height: 18px; border-radius: 2px; flex: none; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 0 0 1px var(--glass-edge-2); }
.tile .flag i { flex: 1; }
.tile .t { flex: 1; min-width: 0; }
.tile .t b { display: block; font-weight: 500; font-size: 15.5px; }
.tile .t small { color: var(--ink-3); font-size: 12.5px; }
.tile .cnt { font-family: var(--serif); font-size: 17px; color: var(--amber-ink); }

/* ---------- населений пункт ---------- */
#scr-place .screen-head { padding-bottom: 14px; }
.toolbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 0 12px; margin-bottom: 6px; background: var(--ground); box-shadow: 0 10px 18px -12px var(--ground); }
.toolbar input, .toolbar select { padding: 7px 10px; font-size: 13.5px; }
.toolbar .chip { padding: 7px 12px; }
.seg button { padding: 7px 11px; font-size: 13px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.seg { display: flex; border: 1px solid var(--glass-edge); border-radius: var(--radius); overflow: hidden; }
.seg button { padding: 8px 13px; font-size: 13.5px; color: var(--ink-3); border-right: 1px solid var(--glass-edge-2); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { color: var(--ink); background: var(--amber-soft); }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-3); font-size: 13.5px; margin-bottom: 18px; }
.stat-line b { color: var(--ink); font-weight: 500; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 18px 14px; padding-bottom: 40px; align-items: start; }
.pcard { max-width: 190px; width: 100%; margin: 0 auto; }
.pcard { position: relative; text-align: center; background: none; border: 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.pcard:hover { transform: translateY(-5px); }
.pcard .mon { width: 100%; display: block; filter: drop-shadow(0 12px 22px rgba(0,0,0,.30)); }
body[data-design="air"] .pcard .mon { filter: drop-shadow(0 12px 22px rgba(90,120,160,.22)); }
body[data-design="classic"] .pcard .mon { filter: drop-shadow(0 10px 18px rgba(90,70,45,.22)); }
.pcard .nm { font-family: var(--serif); font-size: 15px; line-height: 1.2; }
.pcard .nm small { display: block; font-family: var(--sans); font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.pcard .yrs { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pcard .badge { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 10.5px; padding: 1px 8px;
  border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-edge-2); color: var(--ink-3); white-space: nowrap; }

/* монумент — кольори за темою */
.mon .shadow { fill: rgba(0,0,0,.30); }
.mon .stone { stroke: var(--glass-edge); stroke-width: 1; }
.mon .cr { fill: var(--stone-b); stroke: var(--amber-soft); stroke-width: 1; }
.mon .ln { stroke: var(--amber); stroke-width: 2; opacity: .8; }
.mon .ln.gold { stroke: var(--orn); stroke-width: 2.5; }
.mon .rim { stroke: var(--amber); stroke-width: 1.4; opacity: .85; }
.mon .base { fill: var(--stone-a); } .mon .base2 { fill: var(--stone-b); }
.mon .flow ellipse { fill: rgba(255,255,255,.14); } .mon .flow circle { fill: #f4f1e6; }
.mon .lant rect { fill: var(--stone-b); stroke: var(--glass-edge); } .mon .lant path { stroke: var(--glass-edge); fill: none; }
.mon .flame { fill: #ffce8a; }
.mon .plus { stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
body[data-design="air"] .mon .shadow { fill: rgba(90,120,160,.18); }
body[data-design="classic"] .mon .shadow { fill: rgba(90,70,45,.18); }

/* родинна група */
.fam { position: relative; border: 1px solid var(--amber-soft); border-radius: var(--radius);
  padding: 34px 16px 16px; margin: 2px 0 8px; min-width: 0; }
.fam .fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 18px 14px; align-items: start; }
.orn-corner { position: absolute; width: 54px; height: 54px; fill: none; stroke: var(--orn); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.orn-corner .fill { fill: var(--orn); stroke: none; }
.orn-corner.tl { top: -1px; left: -1px; }
.orn-corner.tr { top: -1px; right: -1px; transform: scaleX(-1); }
.orn-corner.bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.orn-corner.br { bottom: -1px; right: -1px; transform: scale(-1,-1); }
.fam-title { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--ground);
  padding: 0 14px; display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 17px; white-space: nowrap; }
.orn-flourish { width: 46px; height: 13px; fill: none; stroke: var(--orn); stroke-width: 1.4; }
.orn-flourish .fill { fill: var(--orn); stroke: none; }
.orn-flourish.flip { transform: scaleX(-1); }

/* ---------- профіль ---------- */
.prof-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.prof-ring { width: 92px; height: 92px; flex: none; position: relative; }
.prof-ring svg { transform: rotate(-90deg); }
.prof-ring circle { fill: none; stroke-width: 5; }
.prof-ring .bg { stroke: var(--glass-edge-2); }
.prof-ring .fg { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.prof-ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; }
.prof-meta b { font-family: var(--serif); font-size: 22px; font-weight: 500; display: block; }
.prof-meta span { color: var(--ink-3); font-size: 14px; }
.rules { display: flex; flex-direction: column; gap: 2px; margin-bottom: 30px; }
.rule { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--glass-edge-2); }
.rule b { font-weight: 500; }
.rule .pt { font-family: var(--serif); color: var(--amber-ink); font-size: 16px; }
.rule small { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; }

/* ---------- обговорення ---------- */
.talk-item { padding: 14px 0; border-top: 1px solid var(--glass-edge-2); }
.talk-item .who { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.talk-item p { margin: 0 0 6px; }
.talk-re { margin: 8px 0 0 18px; padding-left: 12px; border-left: 1px solid var(--glass-edge-2); }
.talk-form { margin-top: 14px; }

/* ---------- верхня панель у режимі оболонки ---------- */
body:not([data-screen="portal"]) .bar-top { background: linear-gradient(var(--ground) 55%, transparent); }
body:not([data-screen="portal"]) .family, body:not([data-screen="portal"]) .hint,
body:not([data-screen="portal"]) #world { display: none !important; }
body[data-screen="intro"] .bar-top .nav, body[data-screen="auth"] .bar-top .nav,
body[data-screen="design"] .bar-top .nav { visibility: hidden; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--glass-edge);
  border-radius: 20px; font-size: 13px; color: var(--ink-2); background: var(--glass); }
.chip b { color: var(--amber-ink); font-family: var(--serif); font-size: 14px; }
.chip:hover { border-color: var(--amber); color: var(--ink); }
#btnBack { display: none; }
body[data-screen="portal"] #btnBack { display: inline-flex; }

/* ---------- класика: паралакс-портал ---------- */
#classic { position: fixed; inset: 0; z-index: 10; display: none; overflow-y: auto; background: var(--ground); }
body[data-screen="portal"][data-design="classic"] #classic { display: block; }
.par-stage { position: relative; height: 74vh; min-height: 460px; overflow: hidden; }
.par-stage .pl { position: absolute; inset: -6% -4%; background-size: cover; background-position: center bottom; will-change: transform; }
.par-sky { background: linear-gradient(180deg, #cdd9e4 0%, #e8e0cf 62%, #ded2b8 100%) center/cover, var(--img-classic) center/cover; background-blend-mode: normal; }
.par-sky { background-image: var(--img-classic); background-size: cover; background-position: center 30%; }
.par-mask { position: absolute; left: -4%; right: -4%; bottom: 0; -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-position: bottom center; mask-position: bottom center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.par-hill { height: 46%; background: #b3a98f; opacity: .8; -webkit-mask-image: var(--sil-far); mask-image: var(--sil-far); }
.par-mid { height: 40%; background: #6f6650; -webkit-mask-image: var(--sil-mid); mask-image: var(--sil-mid); }
.par-fore { height: 26%; background: #40392b; -webkit-mask-image: var(--sil-fore); mask-image: var(--sil-fore); }
.par-mon { position: absolute; left: 50%; bottom: 6%; width: min(340px, 46vw); transform: translateX(-50%); }
.par-cap { position: absolute; left: 0; right: 0; bottom: 26px; text-align: center; font-family: var(--serif);
  font-size: clamp(20px, 3vw, 30px); color: #fff; text-shadow: 0 2px 18px rgba(40,30,15,.7); }
.par-cap small { display: block; font-family: var(--sans); font-size: 13.5px; opacity: .85; margin-top: 4px; }
.cl-body { max-width: 760px; margin: 0 auto; padding: 26px 28px 90px; }
.cl-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px auto 6px; position: relative; z-index: 2; justify-content: center; max-width: 860px; padding: 0 20px; }
.cl-act { padding: 10px 16px; border: 1px solid var(--glass-edge); border-radius: var(--radius); background: var(--glass-strong);
  color: var(--ink); font-size: 14px; box-shadow: var(--shadow); }
.cl-act:hover { border-color: var(--amber); }
.cl-body h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 30px 0 10px; }
.cl-body p { color: var(--ink-2); line-height: 1.65; margin: 0 0 12px; max-width: 64ch; }
.cl-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cl-gal img { width: 100%; border-radius: var(--radius); display: block; }

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .wrap { padding: 0 18px; }
  .screen-head { padding: 84px 0 18px; }
  .how, .designs { grid-template-columns: 1fr; gap: 16px; }
  .dpreview { height: 150px; }
  .grid, .fam .fam-grid { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 14px 10px; }
  .pcard { max-width: 160px; }
  .fam { grid-column: span 2 !important; padding: 32px 10px 12px; }
  .fam { padding: 36px 12px 14px; }
  .orn-corner { width: 40px; height: 40px; }
  #scr-place { padding-bottom: 70px; }
  .screen { padding-bottom: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .dp-strict .rain, .dp-air .liquid, .dp-air .glare, .screen-bg .cloud { animation: none !important; }
  .pcard:hover, .dcard:hover, .tile:hover { transform: none; }
}

/* видимість елементів світу поза порталом */
.nav-world { display: none !important; }
body[data-screen="portal"] .nav-world { display: inline-flex !important; }
body[data-screen="portal"] .mobile-nav .nav-world { display: flex !important; }
#loader { display: none !important; }
body[data-screen="portal"][data-design="strict"] #loader:not(.gone),
body[data-screen="portal"][data-design="air"] #loader:not(.gone) { display: grid !important; z-index: 28; }
body[data-screen="portal"] .screen-bg { display: none; }
body[data-design="classic"] #world { display: none !important; }
.bar-top { z-index: 40; }
.mobile-nav { z-index: 41; }
.toast { z-index: 60; } .modal-wrap { z-index: 70; }
.sheet { z-index: 50; }

/* ===== жива пам'ять ===== */
.screen-head p.live { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.screen-head p.live b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.screen-head p.live i { color: var(--ink-3); font-style: normal; }
.lit-n { display: inline-flex; align-items: center; gap: 7px; }
.lit-n .fl { width: 7px; height: 11px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: linear-gradient(#fff2cf, var(--amber) 55%, #b9702a); box-shadow: 0 0 10px 2px rgba(232,168,83,.45);
  animation: flick 2.6s ease-in-out infinite; }
@keyframes flick { 0%,100% { transform: scaleY(1) translateY(0); opacity: 1 } 42% { transform: scaleY(1.14) translateY(-1px); opacity: .88 } 70% { transform: scaleY(.94); opacity: 1 } }
.quiet-n { color: var(--ink-3); }

/* картка: свічка та знаки уваги */
.pcard .mon-box { position: relative; display: block; }
.pcard .cndl { position: absolute; right: 4px; bottom: 20px; width: 30px; height: 30px; padding: 0; cursor: pointer;
  border: 1px solid var(--glass-edge); border-radius: 50%; background: var(--glass); backdrop-filter: var(--blurv);
  display: grid; place-items: center; opacity: 0; transform: scale(.85); transition: .22s; }
.pcard:hover .cndl, .pcard .cndl.on, .pcard:focus-within .cndl { opacity: 1; transform: scale(1); }
.pcard .cndl svg { width: 13px; height: 16px; }
.pcard .cndl .f { fill: none; stroke: var(--ink-3); stroke-width: 1.3; }
.pcard .cndl .b { fill: none; stroke: var(--ink-3); stroke-width: 1.3; }
.pcard .cndl:hover .f, .pcard .cndl:hover .b { stroke: var(--amber); }
.pcard .cndl.on { border-color: var(--amber-soft); box-shadow: 0 0 16px rgba(232,168,83,.30); }
.pcard .cndl.on .f { fill: var(--amber); stroke: none; animation: flick 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.pcard .cndl.on .b { fill: var(--ink-3); stroke: none; opacity: .5; }
.pcard.lit .mon { filter: drop-shadow(0 12px 22px rgba(0,0,0,.30)) drop-shadow(0 0 16px rgba(232,168,83,.22)); }
body[data-design="air"] .pcard.lit .mon { filter: drop-shadow(0 12px 22px rgba(90,120,160,.22)) drop-shadow(0 0 16px rgba(232,168,83,.30)); }
.pcard .sg { display: flex; justify-content: center; gap: 9px; font-size: 11px; color: var(--ink-3); min-height: 14px; }
.pcard .sg i { display: inline-flex; align-items: center; gap: 3px; font-style: normal; }
.pcard .sg svg { width: 10px; height: 12px; fill: var(--amber-soft); }
.pcard .sg b { font-weight: 400; font-variant-numeric: tabular-nums; }
.pcard .sg.empty { font-size: 10.5px; opacity: .5; }
.pcard .ev { font-size: 11.5px; color: var(--amber); }
.pcard.mark .mon { filter: drop-shadow(0 12px 22px rgba(0,0,0,.30)) drop-shadow(0 0 14px rgba(232,168,83,.18)); }

/* сьогодні згадують */
.today { margin: 4px 0 22px; padding: 16px 0 6px; border-top: 1px solid var(--glass-edge-2); border-bottom: 1px solid var(--glass-edge-2); }
.today h2 { font-family: var(--serif); font-weight: 500; font-size: 17px; margin: 0 0 12px; color: var(--ink-2); }
.today-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.today .tw { flex: 0 0 148px; }
.today .pcard { max-width: 148px; }

/* стрічка */
.feed { position: fixed; top: 0; right: 0; bottom: 0; padding-top: 56px; width: min(380px, 92vw); z-index: 60;
  background: var(--glass); backdrop-filter: var(--blurv); border-left: 1px solid var(--glass-edge);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .26s ease; }
.feed.open { transform: none; }
.feed-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--glass-edge-2); }
.feed-head b { font-family: var(--serif); font-weight: 500; font-size: 17px; }
.feed .x { background: none; border: 0; color: var(--ink-3); font-size: 15px; cursor: pointer; padding: 4px 6px; }
.feed .x:hover { color: var(--ink); }
.feed-list { overflow-y: auto; padding: 6px 10px 20px; }
.feed .fd { display: grid; grid-template-columns: 22px 1fr auto; gap: 9px; align-items: start; width: 100%; text-align: left;
  background: none; border: 0; padding: 9px 8px; border-radius: var(--radius); cursor: pointer; color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.feed .fd:hover { background: var(--glass-2); color: var(--ink); }
.feed .fd b { font-weight: 500; color: var(--ink); }
.feed .fd em { font-style: normal; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.feed .k { width: 18px; height: 18px; border-radius: 50%; margin-top: 1px; background: var(--glass-2); border: 1px solid var(--glass-edge-2); position: relative; }
.feed .k::after { content: ''; position: absolute; inset: 0; margin: auto; }
.feed .k-candle::after { width: 5px; height: 8px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: var(--amber); }
.feed .k-flower::after { width: 7px; height: 7px; border-radius: 50%; background: #e8e2d2; box-shadow: -4px 2px 0 -1px #cfc7b4, 4px 2px 0 -1px #cfc7b4; }
.feed .k-word::after { width: 9px; height: 7px; border-radius: 2px; border: 1px solid var(--ink-3); }
.feed .k-photo::after { width: 9px; height: 8px; border-radius: 1px; border: 1px solid var(--ink-3); border-top-width: 3px; }
.feed .k-care::after { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--amber-soft); border-top-color: transparent; }
.feed-soon { padding: 12px 14px; border-bottom: 1px solid var(--glass-edge-2); }
.feed-soon > b { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; font-weight: 400; }
.feed .fs { display: flex; justify-content: space-between; gap: 10px; width: 100%; background: none; border: 0; cursor: pointer;
  padding: 6px 4px; text-align: left; color: var(--ink-2); font-size: 13px; }
.feed .fs:hover { color: var(--ink); }
.feed .fs em { font-style: normal; font-size: 11.5px; color: var(--amber-soft); white-space: nowrap; }

/* догляд */
.who-line { font-family: var(--serif); font-size: 16px; margin: 0 0 4px; }
.near { font-size: 13px; color: var(--ink-2); margin: 0 0 14px; }
.near b { color: var(--amber); }
.srv { display: grid; gap: 6px; margin-bottom: 14px; }
.srv-i { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; cursor: pointer;
  padding: 9px 11px; border: 1px solid var(--glass-edge-2); border-radius: var(--radius); transition: .16s; }
.srv-i:hover { border-color: var(--glass-edge); background: var(--glass-2); }
.srv-i:has(input:checked) { border-color: var(--amber-soft); background: var(--glass-2); }
.srv-i input { accent-color: var(--amber); width: 15px; height: 15px; }
.srv-i .b b { display: block; font-size: 13.5px; font-weight: 500; }
.srv-i .b small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.srv-i em { font-style: normal; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.actions .total { margin-right: auto; font-size: 13px; color: var(--ink-2); }
.actions .total b { font-size: 15px; color: var(--ink); }
.modal textarea { width: 100%; background: var(--glass-2); border: 1px solid var(--glass-edge-2); border-radius: var(--radius);
  color: var(--ink); padding: 9px 11px; font: inherit; font-size: 13.5px; resize: vertical; }

@media (max-width: 720px) {
  .today .tw { flex: 0 0 128px; } .today .pcard { max-width: 128px; }
  .pcard .cndl { opacity: 1; transform: none; width: 26px; height: 26px; }
}
.mon .lit-g .halo { fill: rgba(232,168,83,.20); }
.mon .lit-g .cw { fill: #efe7d6; opacity: .9; }
.mon .lit-g .cf { fill: #ffce8a; animation: flick 2.4s ease-in-out infinite; transform-origin: 132px 196px; }
.mon.lit .lant .flame { fill: #ffd79c; }
.today .tw-when { display: block; text-align: center; font-size: 11.5px; color: var(--amber); margin-top: 4px; line-height: 1.3; }
.today.now h2 { color: var(--ink); }
.chip.live-chip { position: relative; }
.chip .dot { position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.feed .fd span { display: block; }
.feed .fd small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
/* портал: сліди уваги */
.cl-visits { max-width: 760px; margin: 0 auto; padding: 6px 20px 0; }
.cl-visits h3 { font-family: var(--serif); font-weight: 500; font-size: 16px; margin: 0 0 8px; color: var(--ink-2); display: flex; align-items: center; gap: 12px; }
.cl-visits h3 b { font-size: 12.5px; font-weight: 400; color: var(--amber); }
.cl-visits ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cl-visits li { display: grid; grid-template-columns: 20px 1fr auto; gap: 9px; align-items: center; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.cl-visits li em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.cl-visits .k { width: 16px; height: 16px; border-radius: 50%; background: var(--glass-2); border: 1px solid var(--glass-edge-2); position: relative; }
.cl-visits .k::after { content: ''; position: absolute; inset: 0; margin: auto; }
.cl-visits .k-candle::after { width: 5px; height: 7px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: var(--amber); }
.cl-visits .k-flower::after { width: 6px; height: 6px; border-radius: 50%; background: #e8e2d2; box-shadow: -3px 2px 0 -1px #cfc7b4, 3px 2px 0 -1px #cfc7b4; }
.cl-visits .k-word::after { width: 8px; height: 6px; border-radius: 2px; border: 1px solid var(--ink-3); }
.cl-visits .k-photo::after { width: 8px; height: 7px; border-radius: 1px; border: 1px solid var(--ink-3); border-top-width: 3px; }
.cl-visits .k-care::after { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--amber-soft); border-top-color: transparent; }
.orders { display: grid; gap: 8px; margin-bottom: 22px; }
.order { border: 1px solid var(--glass-edge-2); border-radius: var(--radius); padding: 11px 13px; background: var(--glass-2); }
.order b { display: block; font-family: var(--serif); font-weight: 500; font-size: 15px; }
.order span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.order em { display: block; font-style: normal; font-size: 11.5px; color: var(--amber-soft); margin-top: 4px; }
.hero-live { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.tile .lit-b { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--amber);
  font-variant-numeric: tabular-nums; margin-right: 12px; }
.tile .lit-b .fl { width: 6px; height: 9px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: linear-gradient(#fff2cf, var(--amber) 55%, #b9702a); box-shadow: 0 0 7px 1px rgba(232,168,83,.45); }

/* ===== майстер створення порталу ===== */
.modal.wide { width: min(900px, calc(100vw - 32px)); max-width: none; padding: 0; overflow: hidden; border-radius: var(--radius); }
.nw { display: grid; grid-template-columns: 232px 1fr; min-height: 480px; }
.nw-side { padding: 22px 18px; border-right: 1px solid var(--glass-edge-2); background: var(--glass-2); display: flex; flex-direction: column; gap: 16px; }
.nw-prev { width: 148px; margin: 0 auto; }
.nw-prev .mon { width: 100%; display: block; filter: drop-shadow(0 10px 20px rgba(0,0,0,.28)); }
.nw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.nw-steps li { counter-increment: s; font-size: 13px; color: var(--ink-3); display: flex; gap: 9px; align-items: baseline; }
.nw-steps li::before { content: counter(s, decimal-leading-zero); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nw-steps li.on { color: var(--ink); } .nw-steps li.on::before { color: var(--amber); }
.nw-steps li.done { color: var(--ink-2); } .nw-steps li.done::before { color: var(--amber-soft); }
.nw-side .link-quiet { margin-top: auto; text-align: left; }
.nw-main { padding: 22px 24px 18px; display: flex; flex-direction: column; }
.nw-main h2 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 0 0 2px; }
.nw-main h2 small { font-size: 12.5px; color: var(--ink-3); font-family: var(--sans); margin-left: 8px; }
.nw-main h3 { font-size: 13px; font-weight: 400; color: var(--ink-3); margin: 0 0 16px; }
.nw-main h4 { font-family: var(--serif); font-weight: 500; font-size: 15px; margin: 16px 0 8px; }
.nw-body { flex: 1; overflow-y: auto; max-height: 46vh; padding-right: 4px; }
.nw .actions { margin-top: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.modal .field label { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.modal .field { margin-bottom: 12px; }
.modal input[type="text"], .modal input:not([type]), .modal select {
  width: 100%; background: var(--glass-2); border: 1px solid var(--glass-edge-2); border-radius: var(--radius);
  color: var(--ink); padding: 8px 10px; font: inherit; font-size: 13.5px; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--amber-soft); }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; margin: 4px 0 12px; }
.check input { accent-color: var(--amber); width: 15px; height: 15px; }
.seg.small button { font-size: 12.5px; padding: 6px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { background: var(--glass-2); border: 1px solid var(--glass-edge-2); border-radius: var(--radius);
  color: var(--ink-2); font: inherit; font-size: 12.5px; padding: 6px 11px; cursor: pointer; transition: .16s; }
.chip-s:hover { color: var(--ink); border-color: var(--glass-edge); }
.chip-s[aria-pressed="true"] { color: var(--ink); border-color: var(--amber-soft); background: var(--glass); }
.tpl-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.tpl-c { flex: 0 0 86px; background: none; border: 1px solid transparent; border-radius: var(--radius);
  padding: 6px 4px; cursor: pointer; color: var(--ink-3); font: inherit; font-size: 11px; text-align: center; transition: .16s; }
.tpl-c .mon { width: 100%; display: block; }
.tpl-c:hover { color: var(--ink-2); border-color: var(--glass-edge-2); }
.tpl-c.on { color: var(--ink); border-color: var(--amber-soft); background: var(--glass-2); }
.dup-card { display: flex; align-items: center; gap: 14px; margin: 10px 0 16px; }
.dup-card .mon { width: 96px; }
.dup-card b { font-family: var(--serif); font-weight: 500; font-size: 16px; }
@media (max-width: 760px) {
  .nw { grid-template-columns: 1fr; }
  .nw-side { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--glass-edge-2); padding: 12px 14px; }
  .nw-prev { width: 76px; margin: 0; } .nw-steps { flex: 1; grid-template-columns: 1fr 1fr; gap: 4px; }
  .nw-side .link-quiet { margin: 0; }
  .row3, .row2 { grid-template-columns: 1fr 1fr; }
  .nw-body { max-height: 52vh; }
}
.nw .seg, .modal .seg { display: inline-flex; width: auto; }
.modal label.btn { display: inline-block; cursor: pointer; border: 1px solid var(--glass-edge); border-radius: var(--radius);
  background: var(--glass-2); color: var(--ink-2); padding: 8px 14px; font-size: 13px; }
.modal label.btn:hover { color: var(--ink); border-color: var(--amber-soft); }
.modal .upload { margin-bottom: 6px; }
