/* «Созвездие: солнце и острова» (tree_islands*.js, tree_ring.js,
   docs/studio-features/18-constellation-islands.md). Свой файл рядом с
   tree.css, тот же слой responsive.
   Цвет — только человек (чипы, гребёнки, аватары, дуги островов одного
   человека); вид связи цветом не кодируется — плашкой словом и значком
   (у людей и видов связи были одни оттенки: дуга «Samir» цвета Adnan).
   Акцент — только корень и выбор.
   Верх — сетка областей: солнце 280 px слева, справа заголовок, сводка,
   чипы и ответ; уже 900 px — солнце 240 px, чипы и ответ во всю ширину под
   ним; телефон — солнце по центру, липкие чипы одной строкой с прокруткой
   вбок (экран не закрывают). Острова — flex-wrap, ширину короткого задаёт
   JS; телефон 375 px — сетка в 3 колонки, ничего шире экрана (min-width: 0,
   переносы, без фиксированных ширин больше 343 px). Подписи — dir="auto" +
   unicode-bidi: plaintext, две строки, выравнивание — как у всего вида
   (влево). Фокус виден; при reduced-motion — без анимаций. */
@layer responsive {
.ti { min-width: 0; --ti-c: 96px; --ti-stick: var(--topbar-h, 64px); }
/* Шапка телефона и портретного планшета (.m-header, sticky) — 60 px без выреза. */
@media (max-width: 767px), (max-width: 1024px) and (orientation: portrait) {
    .ti { --ti-stick: calc(var(--safe-top, 0px) + 60px); }
}
.ti * { min-width: 0; }
.ti button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.ti-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; }

/* Крошки «Сделать центром». */
.ti-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.ti-crumbs li { display: inline-flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.ti-crumbs li + li::before { content: '→'; color: var(--text-dim); }
.ti-crumb { min-height: 32px; padding: 2px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-card); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.ti-crumb-cur { font-weight: 600; color: var(--text-strong); font-size: 13px; unicode-bidi: plaintext; }

/* Верх: солнце слева, справа заголовок, сводка, чипы, ответ (сетка областей). */
.ti-top { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 28px; align-items: start; margin: 0 0 20px;
    grid-template-rows: repeat(6, auto) 1fr;
    grid-template-areas: "sun title" "sun summary" "sun chips" "sun answer" "sun with" "sun tools" "sun ."; }
.ti-sun { grid-area: sun; position: relative; width: 280px; aspect-ratio: 1; }
.ti-ring { display: block; width: 100%; height: auto; overflow: visible; }
.ti-disc { fill: var(--bg-elev); stroke: var(--border); stroke-width: 1; }
.ti-groove { fill: none; stroke: var(--border-soft); stroke-width: 1; }
.ti-hand { stroke: var(--accent-strong); stroke-width: 3; stroke-linecap: round; }
.ti-arc path { fill: none; }
.ti-arc-hit { stroke: transparent; stroke-width: 30; pointer-events: stroke; }
.ti-arc-a, .ti-arc-b { stroke: var(--ti-k, var(--text-dim)); stroke-width: 14; pointer-events: none; }
.ti-arc-b { opacity: 0.45; }
.ti-arc.oc .ti-arc-a, .ti-arc.oc .ti-arc-b { stroke-dasharray: 4 3; }
.ti-ticks { stroke: var(--bg); stroke-width: 1.4; pointer-events: none; }
.ti-arc { cursor: pointer; outline: none; transition: opacity 0.15s; }
.ti-arc.dim, .ti-ring.hov .ti-arc:not(.hot) { opacity: 0.25; }
.ti-ring.hov .ti-av:not(.hot) { opacity: 0.35; }
.ti-arc:focus-visible .ti-arc-hit { stroke: var(--accent-strong); stroke-opacity: 0.35; }
/* Кегли — в единицах viewBox 300: на солнце 240 px (×0,8) подпись не мельче 11 px. */
.ti-arc-label { fill: var(--text); font-size: 14px; font-weight: 600; pointer-events: none; }
.ti-now-tick { stroke: var(--accent-strong); stroke-width: 1.5; stroke-dasharray: 3 2; }
.ti-now-year { fill: var(--accent-text); font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.ti-av { cursor: pointer; outline: none; }
.ti-av-hit { fill: transparent; }
.ti-av-s { fill: var(--p); fill-opacity: 0.28; stroke: var(--p); stroke-width: 2; }
.ti-av.dashed .ti-av-s { stroke-dasharray: 3 2; }
.ti-av.on .ti-av-s { stroke: var(--text-strong); stroke-width: 3; fill-opacity: 0.6; }
.ti-av:focus-visible .ti-av-s { stroke: var(--accent-strong); stroke-width: 3; }
.ti-av-t { fill: var(--text-strong); font-size: 12px; font-weight: 700; pointer-events: none; }
.ti-av-t.l3 { font-size: 10px; }
.ti-av-more circle { fill: var(--bg-elev); stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 3 2; }
.ti-av-more text { fill: var(--text-mid, var(--text)); font-size: 12px; font-weight: 700; }
.ti-sun-root { position: absolute; left: 50%; top: 50%; width: 16%; aspect-ratio: 1; transform: translate(-50%, -50%);
    padding: 0; border: 2px solid var(--accent-strong); border-radius: 6px; background: hsl(20 28% 22%);
    overflow: hidden; cursor: pointer; }
.ti-sun-root .ti-mono b { font-size: 18px; }

/* Обложка: монограмма всегда под картинкой (общий резолвер «Карьер»). */
.ti .tc-cover { position: absolute; inset: 0; width: 100%; height: 100%; flex: none; border-radius: inherit;
    background: transparent; }
.ti .tc-cover-empty::before { content: none; }
.ti .tc-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ti .tc-cover-img.tc-wait { visibility: hidden; }
.ti-cov:has(.tc-wait) .ti-mono { opacity: 0.6; }   /* обложка ещё в пути — монограмма бледнее (12.10) */
.ti-cov:has(.tc-wait) .tc-cover { outline: 1px dashed rgba(255, 255, 255, 0.5); outline-offset: -5px; }   /* и пунктир: второй признак */
.ti-mono { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding-bottom: 14px; color: rgba(255, 255, 255, 0.74); }
.ti-sun-root .ti-mono { padding-bottom: 0; }
.ti-mono b { font-size: 34px; font-weight: 700; line-height: 1; }
.ti-mono i { font-family: var(--font-mono); font-size: 11px; font-style: normal; opacity: 0.85; }

/* Шапка. */
.ti-title { grid-area: title; margin: 6px 0 8px; font-size: 20px; color: var(--text-strong); overflow-wrap: anywhere;
    unicode-bidi: plaintext; text-align: left; }
.ti-summary { grid-area: summary; margin: 0 0 10px; color: var(--text-mid, var(--text)); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ti-chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ti-chipw { display: inline-flex; align-items: stretch; max-width: 100%; }
.ti-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 8px;
    border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-card); color: var(--text);
    font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.ti-chip:hover { border-color: var(--border-strong); }
.ti-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text-strong); }
.ti-chip.zero { border-style: dashed; color: var(--text-dim); }
.ti-cn { min-width: 0; overflow-wrap: anywhere; }
.ti-dot { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; background: var(--p); }
.ti-dot.sq { border-radius: 4px; }
.ti-dot.dashed { background: transparent; border: 2px dashed var(--p); }
.ti-cnt { flex: none; white-space: nowrap; overflow-wrap: normal; color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }
.ti .tree-chip-page { min-width: 36px; flex: none; }
.ti-answer { grid-area: answer; margin: 10px 0 0; color: var(--text-strong); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ti-answer:empty { display: none; }
.ti-clear { min-width: 28px; min-height: 28px; margin-left: 4px; border: 1px solid var(--border); border-radius: 50%;
    background: transparent; color: var(--text-mid, var(--text)); cursor: pointer; }
.ti-with { grid-area: with; margin: 4px 0 0; color: var(--text-mid, var(--text)); font-size: 13px; overflow-wrap: anywhere; }
.ti-tools { grid-area: tools; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; }
.ti-hint { font-size: 12px; }

/* Острова: заглушка content-visibility — по рядам острова (--ti-ih); прокрутка
   к острову снимает её (.ti-cv-off), отступ сверху — шапка (и липкие чипы). */
.ti-sea { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
.ti-isle, .ti-list, .ti-lagoon { max-width: 100%; scroll-margin-top: calc(var(--ti-stick) + 8px); }
.ti-isle { position: relative; flex: 1 1 100%; padding: 12px 16px 14px; border: 1px solid var(--border-strong);
    border-radius: 14px; background: var(--bg-card); content-visibility: auto;
    contain-intrinsic-size: auto 320px auto var(--ti-ih, 260px); transition: opacity 0.15s; }
.ti-sea.ti-cv-off .ti-isle { content-visibility: visible; }
.ti-isle.dim { opacity: 0.35; }
.ti-isle.flash { animation: ti-flash 1.2s ease-out; }
@keyframes ti-flash { 0% { box-shadow: 0 0 0 3px var(--accent-strong); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ti-ih { margin: 0 0 10px; font: inherit; }
.ti-ihead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; margin: 0; padding: 0;
    border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ti-isle.closed .ti-ih { margin: 0; }
.ti-comb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ti-slot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--p); }
.ti-s-sq { border-radius: 2px; }
.ti-s-ring { background: transparent; border: 2px solid var(--p); }
.ti-s-dia { border-radius: 1px; transform: rotate(45deg) scale(0.82); }
.ti-slot.half { background: linear-gradient(90deg, var(--p) 50%, transparent 50%); border: 1px solid var(--p); }
.ti-slot.hot { outline: 2px solid var(--text-strong); outline-offset: 1px; }
.ti-tier { color: var(--text-dim); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.ti-formula { flex: 1 1 100%; color: var(--text-strong); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.ti-meta { flex: 1 1 100%; color: var(--text-dim); font-size: 12px; }
.ti-covs { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ti-covs > li { flex: 0 0 var(--ti-c); width: var(--ti-c); }
.ti-tile { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0; border: 0; background: none;
    color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ti-cov { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
    background: hsl(var(--ti-h, 20) 28% 22%); transition: transform 0.12s; }
.ti-cov::after { content: ''; position: absolute; inset: 0; z-index: 1; border: 2px solid var(--border-strong);
    border-radius: inherit; pointer-events: none; }
.ti-tile.oc .ti-cov::after { border-style: dashed; }
.ti-tile:hover .ti-cov { transform: translateY(-2px); }
.ti-tile:focus-visible { outline: none; }
.ti-tile:focus-visible .ti-cov, .ti-tile.lit .ti-cov { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.ti-tile.dim { opacity: 0.3; }
.ti-tile.unk .ti-cov { outline: 2px dashed var(--border-strong); outline-offset: 2px; }
.ti-tile.no .ti-cov { filter: grayscale(1); opacity: 0.45; }
.ti-badge { position: absolute; left: 4px; bottom: 4px; z-index: 2; padding: 1px 6px; border-radius: 4px;
    background: rgba(0, 0, 0, 0.74); color: #fff; font-size: 10px; }
.ti-marks { position: absolute; right: 4px; top: 4px; z-index: 2; padding: 0 4px; border-radius: 4px;
    background: rgba(0, 0, 0, 0.74); color: var(--success); font-size: 12px; letter-spacing: 1px; }
.ti-cap { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; line-height: 1.3; }
.ti-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-strong); unicode-bidi: plaintext; overflow-wrap: anywhere; }
.ti-y { color: var(--text-dim); font-size: 11px; unicode-bidi: plaintext; overflow-wrap: anywhere; }
/* ◆ — год корня между «до» и «после»: пунктир акцента с подписью. */
.ti-covs > li.ti-now { flex: 0 0 56px; width: 56px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding-top: calc(var(--ti-c) / 2 - 20px); background: linear-gradient(var(--accent-strong), var(--accent-strong))
    center top / 2px calc(var(--ti-c) / 2 - 22px) no-repeat; text-align: center; }
.ti-now-d { color: var(--accent-strong); font-size: 14px; line-height: 1; }
.ti-now-y { color: var(--accent-text); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.ti-now-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-dim); font-size: 10px; unicode-bidi: plaintext; overflow-wrap: anywhere; }
/* Сам корень в стволе — «этот альбом» (17.10): рамка и плашка акцента. */
.ti-tile.ti-root .ti-cov::after { border-color: var(--accent-strong); border-width: 3px; }
.ti-badge-root { border: 1px solid var(--accent-strong); color: var(--accent-strong); font-weight: 600; }
.ti-tile.ti-root .ti-y { color: var(--accent-text); }
.ti-row-root .ti-t { color: var(--accent-text); font-weight: 600; }
/* Честная строка ствола (root.cat_rest): альбомы под этим именем, не подтверждённые правилами тёзок. */
.ti-cat-rest { margin: 10px 0 0; color: var(--text-mid, var(--text)); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ti-cat-rest.ti-cat-alone { flex: 1 1 100%; margin: 0; padding: 8px 16px; border: 1px dashed var(--border-strong); border-radius: 14px; }
.ti-more { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1;
    border: 1px dashed var(--border-strong); border-radius: 6px; background: var(--bg-elev); color: var(--text-mid, var(--text));
    font: inherit; font-size: 14px; cursor: pointer; }

/* Лагуна раскрытой ветки — под островом, уголок-связка. */
.ti-lagoon { flex: 1 1 100%; margin: -6px 0 0 24px; padding: 10px 0 0 14px; border-left: 1.5px solid var(--border-strong);
    border-bottom: 1.5px solid var(--border-strong); border-bottom-left-radius: 14px; }
.ti-lg-head { margin: 0 0 8px; color: var(--text-mid, var(--text)); font-size: 13px; overflow-wrap: anywhere; outline: none; }
.ti-lg-head:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.ti-lg-body { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 12px; }
.ti-lg-wait { flex: 1 1 100%; margin: 0; color: var(--text-dim); font-size: 13px; }
.ti-lg-fail { flex: 1 1 100%; margin: 0; color: var(--warning); overflow-wrap: anywhere; }
.ti-skel { display: flex; flex-wrap: wrap; gap: 12px; }
.ti-skel span { width: var(--ti-c); aspect-ratio: 1; border-radius: 6px; background: var(--bg-elev);
    animation: ti-pulse 1.4s ease-in-out infinite; }
@keyframes ti-pulse { 50% { opacity: 0.45; } }

/* «Списком». */
.ti-list { flex: 1 1 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.ti-list-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 6px; font-size: 15px;
    color: var(--text-strong); overflow-wrap: anywhere; outline: none; }
.ti-list ol { margin: 0; padding-left: 22px; }
.ti-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 32px; padding: 2px 0; border: 0;
    background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ti-row .ti-t { -webkit-line-clamp: 3; }
.ti-row.dim { opacity: 0.4; }
.ti-row.lit .ti-t { color: var(--accent-text); }

/* Фильтры и легенда вида: виды связи — отдельные чипы со значком. */
.ti-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.ti-kchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-card); color: var(--text);
    font: inherit; font-size: 13px; cursor: pointer; }
.ti-kchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text-strong); }
.ti-kchip:not(.on) { opacity: 0.6; }
.ti-kchip:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.ti-sw { display: inline-block; width: 20px; text-align: center; }
.ti-legend .ti-lg { display: inline-block; width: 11px; height: 11px; --p: var(--text-mid, var(--text)); background: var(--p); border-radius: 50%; }
.ti-legend .ti-lg.ti-s-sq { border-radius: 2px; }
.ti-legend .ti-lg.ti-s-ring { background: transparent; border: 2px solid var(--p); }
.ti-legend .ti-lg.ti-s-dia { border-radius: 1px; transform: rotate(45deg) scale(0.82); }

/* Уже 900 px: солнце 240 px, справа заголовок и сводка; чипы, ответ и
   инструменты — во всю ширину под ними (а не столбиком в узкой колонке). */
@media (max-width: 899px) {
    .ti-top { grid-template-columns: 240px minmax(0, 1fr); column-gap: 20px; grid-template-rows: auto auto 1fr repeat(4, auto);
        grid-template-areas: "sun title" "sun summary" "sun ." "chips chips" "answer answer" "with with" "tools tools"; }
    .ti-sun { width: 240px; }
    .ti-chips { margin-top: 12px; }
}
/* Телефон: солнце 240 px над островами, липкие чипы одной строкой, сетка в 3 колонки. */
@media (max-width: 599px) {
    /* Обёртки верха — без своих коробок: липкие чипы держатся всю ленту
       островов (липкий элемент не выходит из рамки родителя). */
    .ti-topbox, .ti-top { display: contents; }
    .ti-sun { width: 240px; margin: 0 auto 12px; }
    .ti-title { margin: 0 0 6px; font-size: 17px; }
    .ti-summary, .ti-with { margin: 0 0 8px; }
    .ti-answer { margin: 4px 0 6px; }
    /* Одна строка ~48 px с прокруткой вбок: при прокрутке островов чипы не
       закрывают треть экрана. */
    .ti-chips { position: sticky; top: var(--ti-stick); z-index: 3; flex-wrap: nowrap; overflow-x: auto;
        overscroll-behavior-x: contain; scrollbar-width: none; margin: 0; padding: 6px 0;
        background: var(--bg); box-shadow: 0 1px 0 var(--border-soft); }
    .ti-chips::-webkit-scrollbar { display: none; }
    .ti-chipw { flex: none; }
    .ti-chip { white-space: nowrap; }
    .ti-isle, .ti-list, .ti-lagoon { scroll-margin-top: calc(var(--ti-stick) + 56px); }
    .ti-tools { margin: 8px 0 14px; }
    .ti-sea { gap: 12px; }
    .ti-isle { padding: 10px 10px 12px; }
    .ti-covs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .ti-covs > li { width: auto; flex: none; }
    .ti-covs > li.ti-now { grid-column: 1 / -1; width: auto; flex-direction: row; justify-content: center; gap: 8px;
        padding: 2px 0; background: none; border-top: 1.5px dashed var(--accent-strong); }
    .ti-mono b { font-size: 26px; }
    /* Острова без выбранных людей — строка 44 px: гребёнка и формула. */
    .ti-isle.dim { padding: 0 10px; opacity: 1; }
    .ti-isle.dim .ti-covs, .ti-isle.dim .ti-tier, .ti-isle.dim .ti-meta { display: none; }
    .ti-isle.dim .ti-ih { margin: 0; }
    .ti-isle.dim .ti-ihead { flex-wrap: nowrap; min-height: 42px; opacity: 0.55; }
    .ti-isle.dim .ti-comb { flex-wrap: nowrap; flex: none; }
    .ti-isle.dim .ti-formula { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
    .ti-lagoon { margin-left: 8px; padding-left: 10px; }
    .ti-skel span { width: 30%; }
}
@media (prefers-reduced-motion: reduce) {
    .ti-isle, .ti-arc, .ti-cov, .ti-skel span, .ti-isle.flash { transition: none; animation: none; }
    .ti-tile:hover .ti-cov { transform: none; }
}
} /* ── end @layer responsive ── */
