/* Виды древа и настройки аккаунта (задача 121). Цвета — из переменных styles.css. */
.tv{position:relative}
.tv-modes{display:flex;gap:4px;flex-wrap:wrap;padding:10px 14px 0;border-bottom:1px solid var(--line);background:var(--paper)}
.tv-modes button{min-height:42px;border:0;border-bottom:3px solid transparent;border-radius:10px 10px 0 0;background:none;padding:8px 14px;font-size:14px;color:var(--muted)}
.tv-modes button.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:700;background:#fbeee4}
.tv-mode-select{display:none;padding:10px 12px 0}
.tv-hint{display:none}
.tv-viewport{position:relative;height:max(440px,calc(100dvh - 400px));overflow:hidden;cursor:grab;touch-action:none;outline:none;user-select:none;-webkit-user-select:none;
  background-color:#fffcf7;background-image:radial-gradient(#cbbca84d .8px,transparent .8px);background-size:22px 22px;border-top:1px solid var(--line)}
.tv-viewport:focus-visible{box-shadow:inset 0 0 0 3px #5e7f8a}
.tv-viewport.tv-dragging{cursor:grabbing}
.tv-stage{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform}
.tv-stage.tv-anim{transition:transform .28s ease}
.tv-svg{display:block;overflow:visible}
.tv-lines{position:absolute;left:0;top:0;pointer-events:none}
.tv-link{fill:none;stroke:#c5a793;stroke-width:1.6}
.tv-couple{stroke:#b9836b;stroke-width:2.2}
.tv-row-label{font-size:12px;fill:#a2917f;letter-spacing:1px;text-transform:uppercase}
.tv-card{position:absolute;width:176px;height:84px;padding:10px 12px;cursor:pointer;transition:box-shadow .15s,border-color .15s}
.tv-card strong{font-size:13px;line-height:1.35}
.tv-card .avatar{width:40px;height:40px;font-size:16px}
.tv-card.tv-dead{background:#fbf6ef}
.tv-card.tv-focus{border:2px solid var(--accent)}
.tv-card.tv-spouse{border-style:dashed}
.tv-card.tv-sib{opacity:.92}
.tv-card:hover{border-color:var(--accent)}
.tv-selected.tv-card{border:2px solid var(--accent);box-shadow:0 0 0 5px #a7483226,0 6px 20px #34292318}
.tv-hit.tv-card{background:#fff2c9;border-color:#d9a63a}
/* Веер */
.tv-fan-seg path{fill:#f3e3d6;stroke:#fffcf7;stroke-width:2;cursor:pointer;transition:fill .15s}
.tv-fan-seg.pat path{fill:#f1dccd}.tv-fan-seg.mat path{fill:#e3e9dc}
.tv-fan-seg.f.pat path{fill:#f6e4d9}.tv-fan-seg.m.mat path{fill:#dbe4d4}
.tv-fan-seg:hover path,.tv-fan-seg:focus path{fill:#f2c9b3}
.tv-fan-seg.tv-selected path{fill:#e9b49a;stroke:var(--accent)}
.tv-fan-seg.tv-hit path{fill:#ffe9a8}
.tv-fan-me path{fill:var(--accent)!important}.tv-fan-me text{fill:#fff!important}
.tv-fan-seg text{font-size:13px;fill:var(--ink);text-anchor:middle;pointer-events:none;font-weight:700}
.tv-fan-seg .tv-fan-y,.tv-fan-y{font-size:11px;font-weight:400;fill:var(--muted)}
.tv-fan-small{font-size:11px!important;font-weight:400!important}
.tv-fan-empty{fill:none;stroke:#e6d8cb;stroke-dasharray:3 4}
.tv-fan-note{font-size:13px;fill:var(--muted)}
/* Во времени */
.tv-grid{stroke:#eadfd3;stroke-width:1}.tv-gen-sep{stroke:#dccbbb}
.tv-axis{font-size:12px;fill:var(--muted)}
.tv-now{stroke:var(--accent);stroke-width:1.5;stroke-dasharray:4 4}.tv-now-t{fill:var(--accent)}
.tv-life{cursor:pointer}
.tv-life rect{fill:#cfe0e5;stroke:#9bb8c1}.tv-life.f rect{fill:#f2d6ca;stroke:#d7a894}
.tv-life.unknown rect{fill-opacity:.35;stroke-dasharray:4 3}
.tv-life-name{font-size:13px;fill:var(--ink)}.tv-life-years{font-size:11px;fill:var(--ink);pointer-events:none}
.tv-life:hover rect,.tv-life:focus rect{stroke:var(--accent);stroke-width:2}
.tv-life.tv-selected rect{stroke:var(--accent);stroke-width:2.5}.tv-life.tv-selected .tv-life-name{font-weight:700;fill:var(--accent)}
.tv-life.tv-hit rect{fill:#ffe9a8}
/* Ветви */
.tv-flow .tv-body{padding:8px 18px 18px;max-height:min(70vh,780px);overflow:auto;border-top:1px solid var(--line)}
.tv-flow .tv-controls{display:none}
.tv-root{max-width:520px}
.tv-branches,.tv-branches ul{list-style:none;margin:0;padding:0}
.tv-branches ul{margin-left:22px;padding-left:16px;border-left:2px solid #ead9cb}
.tv-branches li{margin:4px 0}
.tv-branches summary{cursor:pointer;list-style-position:outside;padding:2px 0}
.tv-br-person{display:inline-flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.tv-br-name{min-height:36px;padding:4px 10px;border-radius:8px;border:1px solid transparent;background:none;font-weight:700;color:var(--ink)}
.tv-br-name.small{font-weight:400;min-height:32px;padding:2px 6px}
.tv-br-name.tv-selected{border-color:var(--accent);background:#fbeee4}.tv-br-name.tv-hit{background:#fff2c9}
.tv-br-years,.tv-br-count{font-size:12px;color:var(--muted)}.tv-br-sp{font-size:13px;color:var(--muted)}
.tv-br-count{margin-left:10px}
/* Выбранный человек и кнопки масштаба */
.tv-selbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:#fbf2e8;border-top:1px solid var(--line);padding:10px 18px}
.tv-sel-who strong{display:block;font-size:15px}.tv-sel-who small{color:var(--muted);font-size:12px}
.tv-sel-actions{display:flex;gap:6px;flex-wrap:wrap}.tv-sel-actions button{min-height:42px;padding:8px 14px;font-size:13px}
.tv-controls{position:absolute;right:14px;top:62px;display:flex;align-items:center;gap:4px;background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:3px;z-index:2}
.tv-controls button{min-height:40px;min-width:40px;padding:4px 10px;border:0;font-size:13px}
.tv-pct{font-size:12px;color:var(--muted);min-width:42px;text-align:center}
.tv-empty{padding:40px;text-align:center;color:var(--muted)}
.tree-panel:fullscreen{overflow:auto;border-radius:0;background:var(--bg)}
.tree-panel:fullscreen .tv-viewport{height:calc(100vh - 160px)}
/* Настройки аккаунта */
.settings{display:grid;grid-template-columns:repeat(auto-fill,minmax(380px,1fr));gap:18px;align-items:start}
.settings .panel p{font-size:14px}
.settings h3{margin:18px 0 8px;font-size:15px}
.choice{border:0;padding:0;margin:8px 0 14px;display:flex;flex-wrap:wrap;gap:8px}
.choice legend{font-size:14px;font-weight:700;margin-bottom:8px}
.choice label{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px 14px;cursor:pointer;background:white}
.choice input{width:18px;min-height:18px;accent-color:var(--accent)}
.choice label:has(input:checked){border-color:var(--accent);background:#fbeee4}
.settings-trees{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.settings-trees li{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:14px}
button.profile{width:100%;text-align:left;border:0;border-top:1px solid var(--line);border-radius:0;background:none;padding:20px 4px 6px;min-height:0}
button.profile:hover{background:#f2dfd1}button.profile.active{background:#f2dfd1}
button.profile small{display:block}
/* Размер текста (настройки) */
:root[data-text-size=l] body{zoom:1.12}:root[data-text-size=xl] body{zoom:1.25}
@media(max-width:760px){
  .tv-modes{display:none}.tv-mode-select{display:block}
  .tv-viewport{height:60vh;min-height:360px}
  .tv-selbar{padding:8px 10px}.tv-sel-actions button{min-height:40px;padding:6px 10px;font-size:12px}
  .tv-controls{right:8px;top:62px}.tv-controls [data-z=sel],.tv-controls [data-z=full]{display:none}
  .settings{grid-template-columns:1fr}
}
/* Страница древа компактнее: древо помещается в экран без прокрутки страницы */
.page:has(.tv:not(.tv-flow)) .page-heading{margin-bottom:12px}
.page:has(.tv:not(.tv-flow)) .page-heading h1{font-size:32px;margin:4px 0 0}
.page:has(.tv:not(.tv-flow)) .page-heading p{display:none}
.page:has(.tv:not(.tv-flow)) .stats{padding-bottom:12px}

/* Замечания к сайту 13.10 (задача 122): группы людей, календарь дат, карта мест. */
.pg-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:14px;color:var(--muted);margin-bottom:6px}
.pg-bar select{min-height:42px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink)}
.pg{margin-top:18px}.pg-title{font-family:var(--serif);font-weight:400;font-size:20px;margin:0 0 10px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.pg-title span{font-family:inherit;font-size:14px;color:var(--muted)}
.dates-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:18px;align-items:start}
.cal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}.cal-head h2{margin:0;font-size:22px;text-align:center}
.cal-nav{min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--paper);font-size:22px;line-height:1;color:var(--ink)}
.cal-table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:4px}
.cal-table th{font-size:12px;font-weight:600;color:var(--muted);padding:2px 0}.cal-table th:nth-child(n+6){color:var(--accent)}
.cal-table td{padding:0}
.cal-day{position:relative;width:100%;min-height:46px;padding:4px 0;border:1px solid transparent;border-radius:10px;background:var(--bg);color:var(--ink);font-size:15px;font-variant-numeric:tabular-nums}
.cal-day:hover{border-color:var(--line)}
.cal-day.has{background:var(--soft);font-weight:700}
.cal-day i{position:absolute;left:50%;bottom:4px;transform:translateX(-50%);min-width:7px;height:7px;border-radius:4px;background:var(--accent);font-style:normal;font-size:9px;line-height:7px;color:#fff}
.cal-day i:not(:empty){min-width:14px;height:12px;line-height:12px;border-radius:6px;bottom:2px}
.cal-day.today{border:2px solid var(--green);color:var(--green)}
.cal-day.sel{background:var(--accent);color:#fff}.cal-day.sel i{background:#fff;color:var(--accent)}
.cal-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;font-size:13px;color:var(--muted);margin:8px 4px}
.cal-dot{display:inline-block;width:8px;height:8px;border-radius:4px;background:var(--accent);vertical-align:middle}
.cal-today-mark{display:inline-block;width:14px;height:14px;border:2px solid var(--green);border-radius:4px;vertical-align:middle}
.cal-notes{border-top:1px solid var(--line);margin-top:8px;padding-top:4px}.cal-notes h3{font-size:16px;margin:12px 0 8px}
.cal-note{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:10px 12px;margin:6px 0;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink)}
.cal-note strong{display:block;font-size:14px}.cal-note small{display:block;color:var(--muted);font-size:13px;margin-top:2px}
.cal-kind{flex-shrink:0;width:10px;height:10px;border-radius:5px;background:var(--accent)}.cal-kind.death{background:#7d6a5e}.cal-kind.event{background:var(--green)}
.places{display:grid;gap:18px}.places-map-panel{padding:0;overflow:hidden}
.places-map{height:min(520px,60vh);min-height:320px;background:#efe8df}
.places-note{margin:0;padding:8px 16px}
.place-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px}
.place-pin{background:none;border:0}
.place-pin span{display:block;width:26px;height:26px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--accent);border:3px solid #fff;box-shadow:0 2px 6px #0004}
.place-pin.burial span{background:#5e4b40}
.leaflet-container{font:inherit}.leaflet-popup-content{font-size:14px;line-height:1.4}
@media(max-width:900px){.dates-grid{grid-template-columns:1fr}}
@media(max-width:420px){.cal-table{border-spacing:2px}.cal-day{min-height:40px;font-size:14px}.cal-head h2{font-size:18px}}
