/* Apixmed Prism · «23 пари» · адвент-календар 2026 · прод-сторінка
   Увесь календар на одному екрані: верхня стрічка з каріограмою + мозаїка з 24 віконець на решту висоти. */

@font-face { font-family: "Raleway"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../assets/fonts/raleway-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../assets/fonts/raleway-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../assets/fonts/raleway-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../assets/fonts/raleway-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../assets/fonts/inter-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../assets/fonts/inter-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../assets/fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../assets/fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --navy-950: #071A24;
  --navy-900: #0B2532;
  --navy-800: #133547;
  --navy-700: #1B4A63;
  --blue-600: #2A77A0;
  --blue-500: #3C8DB6;
  --link: #1E658C;
  --teal-500: #429DB5;
  --sky-400: #7FB6D2;
  --sky-300: #A8CEE2;
  --sky-200: #C0DFEF;
  --sky-100: #DFF0F8;
  --ice: #F4FCFF;
  --peach: #FFB575;
  --peach-500: #FF9D45;
  --peach-600: #D9772F;
  --peach-700: #A54A12;
  --peach-100: #FFF1E2;
  --ink: #143647;
  --ink-2: #2F4B5A;
  --muted: #56707E;
  --line: rgba(19, 53, 71, .18);
  --line-2: rgba(19, 53, 71, .11);
  --r-xl: 14px;
  --r-lg: 10px;
  --shadow-1: 0 1px 2px rgba(11, 37, 50, .04), 0 10px 28px rgba(11, 37, 50, .07);
  --shadow-2: 0 2px 6px rgba(11, 37, 50, .06), 0 26px 60px rgba(11, 37, 50, .16);
  --font-head: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --win-r: 8px;
  --gap: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 8% -8%, #EFF9FD 0%, rgba(239, 249, 253, 0) 62%),
    linear-gradient(165deg, #D3E9F3 0%, #AFD2E4 46%, #8BBCD4 100%);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -.01em; font-feature-settings: "lnum" 1; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 3px; border-radius: 4px; }
.noscript { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; padding: 14px 18px; border-radius: 7px; background: #fff; box-shadow: var(--shadow-2); font-size: 14px; }

/* ---------- Каркас: стрічка + полотно на всю висоту екрана ---------- */
.app { position: relative; z-index: 1; height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; opacity: .45; }

/* ---------- Верхня стрічка ---------- */
.strip { position: relative; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: clamp(14px, 2.2vw, 34px); row-gap: 4px; padding: 8px max(20px, env(safe-area-inset-right)) 6px max(20px, env(safe-area-inset-left)); background: rgba(250, 254, 255, .92); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); border-bottom: 1px solid var(--line); box-shadow: 0 6px 22px rgba(11, 37, 50, .09); }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { height: 28px; width: auto; max-width: none; flex: none; }
.brand .sep { width: 1px; height: 28px; background: var(--line); flex: none; }
.brand .ttl { min-width: 0; }
.brand .ttl b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 18px; line-height: 1.1; color: var(--navy-900); white-space: nowrap; }
.brand .ttl small { display: block; margin-top: 2px; font-family: var(--font-body); font-weight: 400; font-size: 12px; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.meta { display: flex; align-items: center; gap: 8px; }
/* Коли в стрічці тісно, вона по черзі ховає підзаголовок, підписи й лічильник (поступ показує сама каріограма) */
.strip.t1 .brand .ttl small { display: none; }
.strip.t2 .pill .lbl { display: none; }
.strip.t3 .prog { display: none; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--ink); white-space: nowrap; }
.pill b { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; color: var(--navy-900); }
.pill svg { width: 18px; height: 18px; flex: none; }
.pill.date { background: var(--navy-900); border-color: transparent; color: rgba(255, 255, 255, .86); }
.pill.date b { color: #fff; }
.pill.date.is-preview { background: #FFE8D0; border-color: var(--peach-600); color: #6B3A10; }
.pill.date.is-preview b { color: #4A2609; }
.pill.date a { color: inherit; text-decoration: none; margin: 0 -5px 0 2px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: rgba(122, 69, 23, .12); font-size: 14px; line-height: 1; }
.pill.date a:hover { background: var(--peach); }
.icon-btn { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--navy-900); transition: background .2s, transform .2s; flex: none; }
.icon-btn:hover { background: var(--sky-100); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

/* Каріограма у стрічці */
.karyo { position: relative; height: 64px; min-width: 0; max-width: 900px; width: 100%; justify-self: center; }
.karyo svg { display: block; overflow: visible; }
.k { cursor: pointer; outline: none; }
.k .k-bg { fill: transparent; transition: fill .2s; }
.k .body { fill: #93AAB6; stroke: transparent; stroke-width: 1.3; transition: fill .3s, stroke .3s; }
.k .ring { fill: none; stroke: #93AAB6; transition: stroke .3s; }
.k .k-lab { font-family: var(--font-body); font-weight: 500; fill: #5E7887; text-anchor: middle; transition: fill .2s; }
.k.avail .body { fill: #fff; stroke: var(--link); }
.k.avail .ring { stroke: var(--link); }
.k.avail .k-lab { fill: var(--navy-800); font-weight: 600; }
.k.open .body { fill: url(#kGrad); stroke: transparent; }
.k.open .ring { stroke: #23709D; }
.k.open .k-lab { fill: var(--navy-900); font-weight: 700; }
.k.today .body { fill: url(#kGradT); stroke: #B95A1B; }
.k.today .ring { stroke: #B95A1B; }
.k.today.open .body { fill: url(#kGrad); stroke: transparent; }
.k.today.open .ring { stroke: #23709D; }
.k.today .k-lab { fill: var(--peach-700); font-weight: 700; }
.k.today .k-bg { fill: rgba(255, 157, 69, .22); }
.k:hover .k-bg, .k.hot .k-bg { fill: rgba(30, 101, 140, .14); }
.k:focus-visible .k-bg { fill: rgba(30, 101, 140, .14); stroke: var(--link); stroke-width: 1.6; }
.k.locked { cursor: default; }
.k.locked:hover .k-bg, .k.locked.hot .k-bg { fill: rgba(19, 53, 71, .08); }
.k-tip { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: max-content; max-width: min(300px, calc(100vw - 24px)); padding: 8px 12px; border-radius: 5px; background: var(--navy-800); color: #fff; font-size: 12.5px; line-height: 1.35; box-shadow: var(--shadow-2); opacity: 0; transform: translate(-50%, -4px); pointer-events: none; transition: opacity .18s, transform .18s; }
.k-tip.show { opacity: 1; transform: translate(-50%, 0); }
.k-tip b { font-family: var(--font-head); font-weight: 600; font-size: 13.5px; display: block; }
.k-tip em { font-family: var(--font-head); font-style: italic; font-weight: 600; color: var(--peach); }
.k-tip span { color: rgba(255, 255, 255, .74); }

/* ---------- Полотно з віконцями ---------- */
.board { min-height: 0; padding: 12px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.panel { height: 100%; padding: 12px; border-radius: 14px; color: #fff; background: radial-gradient(900px 500px at 8% 0%, rgba(66, 157, 181, .2), rgba(66, 157, 181, 0) 70%), radial-gradient(700px 600px at 100% 100%, rgba(42, 119, 160, .24), rgba(42, 119, 160, 0) 70%), linear-gradient(160deg, #05131B 0%, #09212E 55%, #0F3347 100%); box-shadow: 0 2px 6px rgba(11, 37, 50, .1), 0 26px 60px rgba(11, 37, 50, .3); }
.wins { height: 100%; display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 5), minmax(0, 1fr)); gap: var(--gap); }
.win { position: relative; min-width: 0; min-height: 0; border-radius: var(--win-r); container-type: size; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 18ms); }
.win.open { z-index: 3; }
.wins :focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: var(--win-r); }
.win.shake { animation: shake .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* Усередині віконця */
.inside { --chr: clamp(18px, 15cqmin, 44px); position: absolute; inset: 0; border-radius: inherit; overflow: hidden; text-align: left; background: linear-gradient(160deg, #FFFFFF, #E2F0F8); color: var(--navy-900); box-shadow: inset 0 8px 22px rgba(11, 37, 50, .24), inset 0 0 0 1px rgba(255, 255, 255, .5); padding: clamp(8px, 8cqmin, 14px) clamp(7px, 7cqmin, 14px) clamp(7px, 7cqmin, 12px) 25%; display: flex; flex-direction: column; opacity: 0; transition: opacity .35s .12s; }
.win.open .inside { opacity: 1; }
.in-kick { display: block; font-size: clamp(10px, 7.4cqmin, 12px); font-weight: 500; color: var(--link); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: clamp(20px, 19cqmin, 28px); }
.in-kick .ks { display: none; }
.in-gene { display: block; font-family: var(--font-head); font-style: italic; font-weight: 600; font-size: clamp(12px, min(11.5cqw, 24cqh), 46px); color: var(--navy-900); line-height: 1.08; margin-top: 2px; white-space: nowrap; }
.in-ttl { font-size: clamp(11.5px, 5cqmin, 15.5px); line-height: 1.3; color: var(--ink-2); margin-top: .45em; padding-right: calc(var(--chr) + 6px); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s12 .in-ttl { -webkit-line-clamp: 5; }
.s22 .in-ttl { -webkit-line-clamp: 4; max-width: 24ch; }
.in-chr { position: absolute; right: clamp(8px, 7cqmin, 16px); top: clamp(34px, 26cqmin, 52px); bottom: clamp(8px, 7cqmin, 16px); width: var(--chr); display: block; }
.in-chr svg, .f-chr svg { width: 100%; height: 100%; display: block; }
/* кнопка зі стрілкою: однаковий розмір на всіх віконцях, хоч якими великими вони є */
.in-go { margin-top: auto; align-self: flex-start; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--navy-800); color: #fff; transition: background .2s; }
.in-go svg { width: 14px; height: 14px; flex: none; transition: transform .2s; }
.inside:hover .in-go { background: var(--link); }
.inside:hover .in-go svg { transform: translateX(2px); }
.shut { position: absolute; top: clamp(4px, 5cqmin, 9px); right: clamp(4px, 5cqmin, 9px); width: clamp(20px, 17cqmin, 26px); height: clamp(20px, 17cqmin, 26px); border-radius: 6px; background: rgba(19, 53, 71, .12); color: var(--navy-800); font-size: clamp(14px, 11cqmin, 17px); line-height: 1; display: none; place-items: center; z-index: 2; transition: background .2s; }
.win.open .shut { display: grid; }
.shut:hover { background: var(--peach); color: var(--navy-900); }

/* Стулка з датою */
.flap { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; text-align: left; padding: clamp(7px, 8cqmin, 15px) clamp(9px, 9cqmin, 17px); color: #fff; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; transform-origin: 0 50%; transform: perspective(600cqw) rotateY(0deg); transition: transform .8s var(--ease), box-shadow .5s, filter .4s; background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 32%), linear-gradient(160deg, #2A7BA6 0%, #164F74 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .42), 0 8px 20px rgba(2, 12, 18, .5); }
.win:nth-child(3n) .flap { background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 32%), linear-gradient(160deg, #24809A 0%, #135A72 100%); }
.win:nth-child(4n+2) .flap { background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 32%), linear-gradient(160deg, #216B97 0%, #113C5E 100%); }
.flap::before { content: ""; position: absolute; inset: clamp(4px, 4.5cqmin, 7px); border-radius: calc(var(--win-r) - 5px); border: 1.5px dashed rgba(255, 255, 255, .44); pointer-events: none; }
.flap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 19, 25, .1), rgba(4, 19, 25, .62)); opacity: 0; transition: opacity .6s; pointer-events: none; }
@media (hover: hover) { .win:not(.open):not(.locked) .flap:hover { transform: perspective(600cqw) rotateY(-16deg); } }
.win.open .flap { transform: perspective(600cqw) rotateY(-82deg); box-shadow: 16px 0 28px rgba(4, 19, 25, .4); }
.win.open .flap::after { opacity: 1; }
.f-num { display: block; font-family: var(--font-head); font-weight: 350; line-height: .92; letter-spacing: -.04em; font-size: clamp(24px, 44cqmin, 128px); }
.s21 .f-num { font-size: clamp(26px, 50cqmin, 128px); }
.f-date { display: block; margin-top: .35em; font-size: clamp(10px, 8.4cqmin, 13px); line-height: 1.2; color: rgba(255, 255, 255, .95); white-space: nowrap; }
.f-date i { font-style: normal; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .22); font-size: .92em; }
.f-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; min-height: 0; max-width: 100%; }
.f-lock { display: none; width: clamp(11px, 9.5cqmin, 16px); height: clamp(11px, 9.5cqmin, 16px); color: rgba(255, 255, 255, .9); flex: none; }
.f-lock svg { width: 100%; height: 100%; display: block; }
.win.locked .f-lock { display: block; }
.f-note { font-size: clamp(10px, 7cqmin, 12px); font-weight: 500; line-height: 1.2; padding: 3px 9px; border-radius: 6px; background: var(--peach); color: var(--navy-900); white-space: nowrap; }
.f-now { display: none; font-size: clamp(10px, 7cqmin, 12px); font-weight: 600; line-height: 1.2; padding: 3px 9px; border-radius: 6px; background: var(--navy-900); color: #fff; white-space: nowrap; }
.win.today .f-now { display: inline-block; }
.f-chr { position: absolute; right: clamp(7px, 8cqmin, 16px); top: clamp(7px, 8cqmin, 16px); bottom: clamp(7px, 8cqmin, 16px); width: clamp(13px, 17cqmin, 46px); display: block; pointer-events: none; }
/* Замкнені віконця: приглушене тло, щоб доступні й сьогоднішнє читалися з першого погляду */
.wins:not(.pre) .win.locked .flap { cursor: default; color: rgba(255, 255, 255, .7); background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 32%), linear-gradient(160deg, #1A3D52 0%, #112E3D 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 4px 12px rgba(2, 12, 18, .35); }
.wins:not(.pre) .win.locked .flap::before { border-color: rgba(255, 255, 255, .22); }
.wins:not(.pre) .win.locked .f-date { color: rgba(255, 255, 255, .64); }
.wins:not(.pre) .win.locked .f-chr { opacity: .55; }
.wins:not(.pre) .win.locked .f-note { opacity: .82; }
.win.locked .flap { cursor: default; }

/* Віконце дня: єдиний теплий акцент на полотні */
.win.today .flap { color: var(--navy-900); background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 38%), linear-gradient(160deg, #FFC48C 0%, #FFA552 58%, #F18943 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), 0 0 0 3px rgba(255, 181, 117, .5), 0 10px 26px rgba(2, 12, 18, .55); }
.win.today .flap::before { border-color: rgba(11, 37, 50, .34); }
.win.today .f-date { color: rgba(11, 37, 50, .88); }
.win.today .f-date i { background: rgba(11, 37, 50, .14); }
.win.today .f-note { background: rgba(255, 255, 255, .88); }
.win.today .f-chr path { fill: var(--navy-900); }
.win.today .f-chr circle { stroke: var(--navy-900); }
.win.today:not(.open)::after { content: ""; position: absolute; inset: -3px; border-radius: calc(var(--win-r) + 3px); border: 2px solid var(--peach); opacity: 0; pointer-events: none; z-index: 4; animation: ping 2.6s ease-out 1s infinite; }
@keyframes ping { 0% { opacity: .75; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.07); } }
.win.hot:not(.open) .flap { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 4px rgba(255, 255, 255, .2), 0 6px 18px rgba(4, 19, 25, .3); }
.win.hot.open .inside { box-shadow: inset 0 8px 22px rgba(11, 37, 50, .24), inset 0 0 0 2px var(--blue-600); }

/* Малі віконця: лишаємо головне */
@container (max-width: 150px) {
  .f-num { font-weight: 400; }
  .in-chr { display: none; }
  .in-ttl { padding-right: 0; }
}
@container (max-width: 178px) {
  .in-kick .kf { display: none; }
  .in-kick .ks { display: inline; }
  .in-ttl { hyphens: auto; -webkit-hyphens: auto; }
  .f-date i { display: none; }
}
@container (max-height: 118px) {
  .in-ttl { display: none; }
  .win .f-foot .f-note, .win.today .f-foot .f-now { display: none; }
}
@container (max-height: 66px) {
  .f-date { display: none; }
}
@container (max-width: 112px) {
  .in-kick { display: none; }
  .in-gene { margin-top: clamp(16px, 20cqh, 24px); }
}
/* Низькі віконця (малий телефон, Telegram): кнопка зі стрілкою стає в один ряд із зірочкою, назва гена під ними.
   Хрестик «зачинити» тут ховаємо, щоб кнопка лишалася тієї самої величини, що й на великих віконцях. */
@container (max-height: 78px) {
  .in-kick { display: none; }
  .in-go { position: absolute; left: 25%; top: clamp(4px, 5cqmin, 9px); margin: 0; }      /* 25% — місце, прикрите відчиненими дверцятами */
  .in-gene { margin-top: 0; padding-top: calc(clamp(4px, 5cqmin, 9px) + 30px); font-size: 12px; line-height: 1; }
  .inside { padding-top: 0; }
  .win.open .shut { display: none; }
  .wins .win.open .star { right: clamp(4px, 5cqmin, 9px); }
}
/* у невисоких великих віконцях назва дня коротша, щоб не наїжджати на кнопку */
@container (max-height: 140px) {
  .s12 .in-ttl, .s22 .in-ttl { -webkit-line-clamp: 2; }
}
/* найвужчі віконця (телефон 320 px): довгі назви генів на кшталт TAS2R38 мають уміститися */
@container (max-width: 84px) and (max-height: 78px) {
  .in-gene { font-size: 10.5px; letter-spacing: -.02em; }
}

/* ---------- Модальне вікно ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(4, 16, 23, .64); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.overlay.open { display: flex; animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { position: relative; width: min(1120px, 100%); max-height: min(92vh, 980px); max-height: min(92dvh, 980px); display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--ice); box-shadow: 0 40px 120px rgba(7, 26, 36, .45); overflow: hidden; animation: pop .45s var(--ease) both; }
.sheet.narrow { width: min(640px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(22px) scale(.975); } to { opacity: 1; transform: none; } }
.m-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line-2); background: rgba(255, 255, 255, .7); }
.m-day { font-family: var(--font-head); font-weight: 600; font-size: 15px; padding: 6px 14px; border-radius: 6px; background: var(--navy-900); color: #fff; white-space: nowrap; }
.m-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.m-head .sp { flex: 1; }
.m-head .icon-btn { width: 40px; height: 40px; border-radius: 6px; }
.m-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 28px 30px 34px; overscroll-behavior: contain; }
.m-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 30px; align-items: start; }
.c-side { position: sticky; top: 0; }
/* Ліва панель картки: кілька «слайдів» в одній клітинці, видно той, що відповідає секції праворуч */
.c-side.docked { max-height: calc(min(92dvh, 980px) - 130px); overflow-y: auto; scrollbar-width: thin; }      /* на низькому екрані панель прокручується сама */
.c-stage { display: grid; }
.c-slide { grid-area: 1 / 1; min-width: 0; align-self: start; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .28s, transform .28s, visibility 0s .28s; }
.c-slide.on { opacity: 1; visibility: visible; transform: none; transition: opacity .28s, transform .28s; }
.c-slide > .viz { margin-top: 0; }
.c-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.c-tabs[hidden] { display: none; }
.c-tabs button { flex: 1 1 0; min-width: 0; padding: 7px 8px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; font: 700 12px/1.2 var(--font-body); color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 0 rgba(11, 37, 50, .08); transition: background .2s, color .2s, border-color .2s; }
.c-tabs button:hover { border-color: var(--sky-300); color: var(--navy-900); }
.c-tabs button.on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.c-tabs button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.c-fig { padding: 14px 14px 12px; border-radius: 10px; background: linear-gradient(180deg, #FFFFFF, #F5FAFD); border: 1px solid var(--line-2); box-shadow: 0 1px 0 rgba(11, 37, 50, .08), 0 14px 34px rgba(11, 37, 50, .1); }
.c-lbl { display: block; margin-bottom: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.c-fig .bd-stage { height: min(430px, 50vh); }
.c-fig .bd-pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; font-size: 11px; }
.c-fig .bd-credit { margin-top: 9px; }
.dock-ph { display: none; }
@media (prefers-reduced-motion: reduce) { .c-slide, .c-slide.on { transition: none; transform: none; } }
.c-more { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.rubric { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--link); }
.rubric i { width: 38px; height: 6px; border-radius: 3px; background: var(--peach-500); }
.m-title { font-size: clamp(28px, 3.6vw, 46px); font-weight: 400; letter-spacing: -.025em; color: var(--navy-900); margin: 12px 0 12px; }
.standfirst { font-family: var(--font-head); font-size: 19px; font-weight: 500; line-height: 1.38; color: var(--ink); max-width: 46ch; }
.prose { display: grid; gap: 12px; font-size: 15.5px; color: var(--ink-2); line-height: 1.62; }
.sect { margin-top: 22px; }
.sect > h4 { font-size: 13.5px; font-weight: 600; color: var(--link); margin-bottom: 8px; font-family: var(--font-body); letter-spacing: 0; }
.callout { margin-top: 16px; padding: 14px 16px 14px 18px; border-radius: 7px; background: var(--peach-100); border-left: 4px solid var(--peach-500); font-size: 14.5px; color: #4F2F14; line-height: 1.5; }
.callout b { font-weight: 600; display: block; margin-bottom: 2px; color: #7A4517; font-size: 13px; }
.caveat { font-size: 13px; color: var(--muted); line-height: 1.45; }
.hf { margin-top: 10px; padding: 8px 11px; border-radius: 4px; background: #fff; border-left: 3px solid var(--peach-500); font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.src { margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.src b { font-weight: 500; color: var(--ink-2); }
.next { margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; background: var(--sky-100); font-size: 13px; color: var(--navy-700); }
.next svg { width: 15px; height: 15px; flex: none; }
.disc { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line); color: var(--navy-800); font-size: 12px; font-weight: 500; line-height: 1.3; }
.chip em { font-style: italic; font-family: var(--font-head); font-weight: 600; color: var(--link); }
.chip.hero { border-color: var(--peach-600); background: var(--peach-100); }
.chart-slot { margin-top: 14px; min-height: 40px; }
.chart-slot svg { display: block; overflow: visible; max-width: 100%; }
.anim .fadein { opacity: 0; animation: fade .6s ease forwards; animation-delay: calc(.2s + var(--i, 0) * 18ms); }
.anim .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-out 1.2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.4); opacity: 0; } }

/* Портрет хромосоми */
.ideo { border-radius: var(--r-lg); padding: 22px 22px 16px; color: #fff; background: radial-gradient(600px 300px at 15% 0%, rgba(66, 157, 181, .35), rgba(66, 157, 181, 0) 70%), linear-gradient(160deg, #0B2532, #133547 60%, #1B4A63); box-shadow: var(--shadow-2); }
.ideo .big { font-family: var(--font-head); font-weight: 200; font-size: 92px; line-height: .9; letter-spacing: -.04em; }
.ideo .big small { font-size: 16px; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, .7); margin-left: 10px; }
.ideo .chart-slot { margin: 14px 0 4px; }
.ideo .i-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.ideo .i-facts div { padding: 10px 12px; border-radius: 6px; background: rgba(255, 255, 255, .09); }
.ideo .i-facts b { display: block; font-family: var(--font-head); font-weight: 500; font-size: clamp(17px, 4.6vw, 21px); white-space: nowrap; }
.ideo .i-facts span { font-size: 12px; color: rgba(255, 255, 255, .8); line-height: 1.3; display: block; }
.ideo .i-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: rgba(255, 255, 255, .82); margin-top: 12px; }
.ideo .i-leg span { display: inline-flex; align-items: center; gap: 7px; }
.ideo .i-leg .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--peach); display: inline-block; }
.ideo .i-leg .bar { display: inline-block; width: 16px; height: 12px; border-radius: 3px; background: linear-gradient(90deg, #7CCBE0 0 6px, #0B2532 6px 8.5px, #7CCBE0 8.5px); }
.geneline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.geneline em { font-family: var(--font-head); font-style: italic; font-weight: 600; font-size: 30px; color: var(--link); letter-spacing: -.01em; }
.geneline span { font-size: 13px; color: var(--muted); }

/* Про календар */
.about h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 400; letter-spacing: -.025em; color: var(--navy-900); margin: 12px 0 12px; }
.about .lede { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.about ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.about li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: 7px; background: #fff; box-shadow: var(--shadow-1); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.about li::before { counter-increment: s; content: counter(s); width: 34px; height: 34px; border-radius: 5px; display: grid; place-items: center; background: var(--sky-100); color: var(--link); font-family: var(--font-head); font-weight: 500; font-size: 17px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 9px; height: 20px; border-radius: 2px; display: inline-block; background: #93AAB6; }
.legend i.a { background: #fff; box-shadow: inset 0 0 0 1.4px var(--link); }
.legend i.o { background: linear-gradient(180deg, #3C8DB6, #154B6B); }
.legend i.t { background: var(--peach-500); box-shadow: inset 0 0 0 1.4px #B95A1B; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 6px; background: rgba(19, 53, 71, .07); color: var(--ink); font-size: 13.5px; font-weight: 500; transition: background .2s, transform .2s; }
.btn:hover { background: rgba(19, 53, 71, .13); }
.btn:active { transform: scale(.97); }

.toast { position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 80; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 6px; background: var(--navy-800); color: #fff; font-size: 14px; text-align: center; box-shadow: var(--shadow-2); border: 1px solid rgba(255, 255, 255, .16); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Адаптивність ---------- */
@media (max-width: 1499px) {
  .prog .lbl, .brand .ttl small { display: none; }
}
@media (max-width: 1179px) {
  .strip { grid-template-columns: minmax(0, 1fr) auto; }
  .karyo { grid-column: 1 / -1; grid-row: 2; height: 54px; max-width: 1000px; }
  .brand .ttl small { display: block; }
}
@media (max-width: 860px) {
  .m-grid { display: flex; flex-direction: column; gap: 20px; }
  .m-grid > .col { display: contents; }
  .c-head { order: 1; }
  .c-stage { order: 2; }
  .c-tabs { display: none; }
  .c-body { order: 3; }
  .c-more { order: 4; margin-top: 0; }
  .c-side { position: static; }
}
@media (max-width: 700px) {
  :root { --win-r: 7px; --gap: 8px; }
  .board { padding: 10px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .panel { padding: 9px; border-radius: 11px; }
  .strip { padding: 8px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); column-gap: 8px; }
  .brand { gap: 10px; }
  .brand img { height: 23px; }
  .brand .sep { height: 22px; }
  .brand .ttl b { font-size: 16px; }
  .brand .ttl small { display: none; }
  .karyo { height: 46px; }
  .pill { height: 32px; padding: 0 10px; font-size: 12.5px; }
  .pill .lbl { display: none; }
  .icon-btn { width: 32px; height: 32px; }
  .overlay { padding: 0; align-items: flex-end; }
  .sheet, .sheet.narrow { width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 12px 12px 0 0; }
  .m-body { padding: 20px 16px 28px; }
  .m-head { padding: 10px 10px 10px 14px; }
  .ideo .big { font-size: 68px; }
}
@media (max-width: 480px) {
  :root { --win-r: 6px; --gap: 6px; }
  .panel { padding: 7px; border-radius: 9px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 3px; }   /* на телефоні назва стоїть під логотипом */
  .brand img { height: 17px; }
  .brand .sep { display: none; }
  .brand .ttl b { font-size: 12.5px; line-height: 1; color: var(--link); }
}
/* Низькі екрани (телефон горизонтально, невисокі вікна): стрічка в один рядок */
@media (max-height: 560px) and (min-width: 640px) {
  .strip { grid-template-columns: auto minmax(0, 1fr) auto; padding-top: 5px; padding-bottom: 3px; }
  .karyo { grid-column: auto; grid-row: auto; height: 40px; }
  .brand .ttl small { display: none; }
  .brand img { height: 22px; }
  .board { padding-top: 8px; padding-bottom: 8px; }
  .panel { padding: 8px; border-radius: 10px; }
  :root { --gap: 7px; --win-r: 6px; }
}
@media (max-height: 560px) and (min-width: 640px) and (max-width: 900px) {
  .brand .sep, .brand .ttl { display: none; }
  .pill .lbl, .prog { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #snow { display: none; }
}

/* Зірочка: позначка дня, який читач хоче запам’ятати */
.star { position: absolute; top: clamp(4px, 5cqmin, 9px); right: clamp(4px, 5cqmin, 9px); width: clamp(20px, 17cqmin, 26px); height: clamp(20px, 17cqmin, 26px); display: grid; place-items: center; border-radius: 6px; z-index: 4; color: rgba(255, 255, 255, .5); transition: color .2s, transform .15s, right .25s; }
.star svg { width: 78%; height: 78%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.star:hover { color: #fff; transform: scale(1.14); }
.star:focus-visible { outline: 2px solid var(--peach-500); outline-offset: 1px; }
.win.open .star { right: calc(clamp(4px, 5cqmin, 9px) * 2 + clamp(20px, 17cqmin, 26px)); color: rgba(19, 53, 71, .42); }
.win.open .star:hover { color: var(--navy-900); }
.win.starred .star, .win.open.starred .star { color: #FFC94A; }
.win.starred .star svg { fill: currentColor; stroke: #8A5A00; stroke-width: .9; filter: drop-shadow(0 1px 1px rgba(11, 37, 50, .35)); }
.star-btn svg { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.star-btn[aria-pressed="true"] { background: #FFF6DA; border-color: #E2B33A; color: #C88A00; }
.star-btn[aria-pressed="true"] svg { fill: #FFC94A; stroke: #8A5A00; stroke-width: .9; }
.k .k-star { display: none; fill: #FFC94A; stroke: #fff; stroke-width: 1.6; paint-order: stroke; }
.k.starred .k-star { display: block; }
@media (max-width: 460px) { .m-head .m-sub { display: none; } }

/* Назва гена або алеля в тексті (js/calendar.js, gi) */
.gn { font-style: italic; font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit; }
