/* The relatives' chat (notes/2026-10-16-family-chat-mockup.html): rooms beside the feed; one column on narrow screens. */
.tabs [data-view="chat"]{display:inline-flex;align-items:center;gap:6px}
.tabs [data-view="chat"][hidden]{display:none}
.chat-count,.chat-badge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;box-sizing:border-box;border-radius:999px;background:#a3412f;color:#fff;font-size:11px;font-weight:700;line-height:1}
.chat-count[hidden]{display:none}
#chatView{padding-top:18px}
.chat-page{display:grid;grid-template-columns:320px minmax(0,1fr);height:min(76vh,780px);min-height:440px;background:var(--white);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.chat-side{display:flex;flex-direction:column;min-width:0;border-inline-end:1px solid var(--line);background:var(--white)}
.chat-side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px}
.chat-side-head h2{margin:0;font-size:20px}
/* Two neat buttons of one size on one row (Andrew 17.10): the whole family; a person or a group. */
.chat-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:0 14px 12px}.chat-actions .button{width:100%;min-height:40px;padding:6px 8px;font-size:13px;line-height:1.2}
.chat-no-account{align-self:center}
.chat-rooms{flex:1;overflow:auto}
.chat-section{margin:0;padding:10px 14px 4px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border-top:1px solid var(--line)}
.chat-room-item{display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:2px 10px;align-items:center;width:100%;padding:10px 14px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--ink);font:inherit;text-align:start;cursor:pointer}
.chat-room-item:hover{background:#f6f8f1}
.chat-room-item.is-active{background:#edf3e8}
.chat-room-item .chat-avatar{grid-row:span 3}
.chat-room-name{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-room-item.has-unread .chat-room-name{font-weight:750}
.chat-room-when{color:var(--muted);font-size:11px;text-align:end;white-space:nowrap}
.chat-room-last{grid-column:2;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:13px}
.chat-room-flag{grid-column:2;color:var(--muted);font-size:11px}
.chat-room-item .chat-badge{grid-column:3;grid-row:2;justify-self:end}
.chat-avatar{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#edf3e8;border:1px solid #cbd9c5;color:var(--green);font-weight:700;font-size:13px;box-sizing:border-box}
.chat-avatar-family{background:var(--green);border-color:var(--green);color:#fffefa}
.chat-avatar-group{background:#f0ead9;border-color:#e3d6b4;color:#7b6431}
.chat-main{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--paper)}
.chat-placeholder{margin:auto;padding:20px;text-align:center}
.chat-head{display:flex;align-items:center;gap:12px;padding:12px 20px;border-bottom:1px solid var(--line);background:var(--white)}
.chat-head-text{flex:1;min-width:0}
.chat-head h3{margin:0;font-size:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head p{margin:2px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-head-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px}
.chat-head-tools .button{flex:0 0 auto;height:34px;padding:6px 12px}
.chat-mute{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}
.chat-back{display:none;flex:0 0 auto;width:40px;height:40px;border:1px solid #c4d4bc;border-radius:50%;background:#edf3e8;color:var(--green);font-size:18px;cursor:pointer}
.chat-feed{flex:1;min-height:0;overflow:auto;padding:16px 20px;display:flex;flex-direction:column;gap:10px}
.chat-feed:focus-visible{outline:2px solid var(--green);outline-offset:-2px}
.chat-empty{margin:auto;text-align:center}
.chat-day{align-self:center;margin:4px 0}
.chat-day span{display:inline-block;font-size:11px;color:var(--muted);background:var(--white);border:1px solid var(--line);border-radius:999px;padding:2px 12px}
.chat-event{align-self:center;margin:0;max-width:85%;font-size:12px;color:var(--muted);text-align:center;font-style:italic}
/* Andrew 17.10: the whole conversation at the start edge (left in ru/en, right in he); one's own pressed to the edge in
   colour, the others' indented and light; bigger text on a tablet and a computer; the actions on a tap or hover. */
.chat-msg{display:flex;align-self:flex-start;max-width:min(76%,680px)}
.chat-msg.is-mine{align-self:flex-start}
.chat-msg:not(.is-mine){margin-inline-start:min(16%,150px)}
.chat-bubble{min-width:0;padding:8px 12px;background:var(--white);border:1px solid var(--line);border-radius:14px}
.chat-msg.is-mine .chat-bubble{background:#d9ead0;border-color:#b7d0aa}
.chat-msg:not(.is-mine):not(.is-hidden):not(.is-gone) .chat-bubble{background:#fff;border-color:#d8cfbd}
.chat-msg.is-gone .chat-bubble{background:transparent;border-style:dashed}
.chat-msg.is-hidden .chat-bubble{background:#f7ece8;border-color:#e2c1b8}
.chat-meta{display:flex;flex-wrap:wrap;gap:4px 8px;margin:0;font-size:11px;color:var(--muted)}
.chat-meta b{color:var(--ink);font-weight:650}
.chat-hidden-mark{color:#a3412f}
.chat-text{margin:2px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;line-height:1.45}
.chat-text a{color:var(--green)}
.chat-gone{margin:2px 0 0;color:var(--muted);font-style:italic;font-size:13px}
.chat-tools{margin:4px 0 0;display:none;gap:10px}
.chat-msg.is-open .chat-tools,.chat-msg:focus-within .chat-tools{display:flex}
@media(hover:hover){.chat-msg:hover .chat-tools{display:flex}}
.chat-msg{cursor:default;-webkit-touch-callout:none}
.chat-tool{padding:0;border:0;background:none;color:var(--muted);font:inherit;font-size:11px;text-decoration:underline;cursor:pointer}
.chat-tool:hover{color:var(--ink)}
.chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;align-items:end;padding:12px 20px;border-top:1px solid var(--line);background:var(--white)}
.chat-compose textarea{box-sizing:border-box;width:100%;min-height:46px;max-height:180px;margin:0;padding:11px 12px;border:1px solid #8a9389;border-radius:12px;background:var(--paper);color:var(--ink);font:inherit;font-size:16px;line-height:1.4;resize:none}
.chat-compose .button{flex:0 0 auto;height:42px}
.chat-hint{grid-column:1/-1;margin:0}
.chat-note{margin:0;padding:12px 20px;border-top:1px solid var(--line);background:var(--white)}
.chat-dialog{width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box}
.chat-rooms-hint{margin:0;padding:10px 14px 12px;border-top:1px solid var(--line)}
.chat-dialog h2{margin-top:0}
.chat-people{display:grid;gap:2px;max-height:min(46vh,360px);overflow:auto;margin:8px 0 12px;padding:6px 8px;border:1px solid var(--line);border-radius:10px}
.chat-people .check[hidden]{display:none}
/* The people window: never taller than what the browser shows; the list scrolls; «Отмена» | «Написать» always seen. */
.chat-pick-dialog[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(min(100dvh,var(--family-vh,100dvh)) - 24px);padding-bottom:0}
.chat-pick{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.chat-pick-head{flex:none}.chat-pick-head h2{margin-top:0}
.chat-pick .chat-people{flex:1 1 auto;min-height:88px;max-height:none;margin:8px 0 10px}
.chat-pick-title{display:grid;gap:4px;flex:none;margin:0 0 8px}.chat-pick-title[hidden]{display:none}.chat-pick .chat-history{flex:none}.chat-pick .chat-dialog-status{flex:none;margin:0 0 6px}.chat-pick .chat-dialog-status:empty{display:none}
.chat-pick-foot{flex:none;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0 calc(16px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line)}
.chat-pick-foot .button{min-height:44px;margin:0}.chat-pick-foot [value=ok]{min-width:44%;font-size:16px;font-weight:700}
/* A short window (a phone on its side with the toolbars): everything above scrolls, the bottom row stays. */
@media (max-height:480px){.chat-pick-dialog[open]{padding-top:12px}.chat-pick{overflow:auto}.chat-pick .chat-people{flex:none;min-height:0;overflow:visible}.chat-pick-head p{margin:4px 0}.chat-pick-foot{position:sticky;bottom:0;background:var(--white);padding:8px 0 calc(10px + env(safe-area-inset-bottom,0px))}}
.chat-history{margin:0 0 12px;border:1px solid var(--line);border-radius:10px;padding:8px 12px}
.chat-dialog-status{min-height:1.2em;color:#a3412f}
.chat-members{list-style:none;margin:0 0 14px;padding:0;display:grid;gap:6px}
.chat-members li{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}
.chat-rename{display:grid;gap:8px;margin-bottom:12px}
@media(max-width:700px){
 #chatView{padding-top:10px}
 .chat-page{grid-template-columns:minmax(0,1fr);height:calc(100dvh - 190px);min-height:420px}
 .chat-page.room-open .chat-side{display:none}
 .chat-page:not(.room-open) .chat-main{display:none}
 .chat-side{border-inline-end:0}
 .chat-back{display:grid;place-items:center}
 .chat-head{padding:10px 12px;flex-wrap:wrap}
 .chat-head-tools{width:100%;justify-content:flex-start}
 .chat-feed{padding:12px}
 .chat-msg{max-width:86%}
 .chat-msg:not(.is-mine){margin-inline-start:10%}
 .chat-text{font-size:16px}
 .chat-chips{padding:8px 12px 0}
 .chat-compose{padding:10px 12px}
 .chat-compose textarea{font-size:16px}
 .chat-hint{display:none}
 /* A phone (the audit 18.10): «Отправить» as an arrow, so the field has the width; the room's buttons on one scrolling row. */
 #chatSend{width:46px;min-width:46px;padding:0;font-size:0;display:grid;place-items:center}
 #chatSend::after{content:'➤';font-size:20px;line-height:1}
 html[dir=rtl] #chatSend::after{transform:scaleX(-1)}
 .chat-head-tools{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
}
/* A low window (a phone on its side): the room fits the screen, the field stays on it. */
@media(max-height:500px){.chat-page{height:calc(min(100dvh,var(--family-vh,100dvh)) - 16px);min-height:0}.chat-chips{display:none}}

/* The envelope in the header (Andrew 17.10): the unread count; it blinks when something new came, a list under it. */
.chat-envelope-wrap{position:relative;display:inline-flex}
.chat-envelope-wrap[hidden]{display:none}
.chat-envelope{position:relative;display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid #cbb68b66;border-radius:10px;background:transparent;color:#f4eddf;cursor:pointer}
.chat-envelope svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.chat-envelope-count{position:absolute;top:-6px;inset-inline-end:-6px;min-width:18px;height:18px;padding:0 4px;box-sizing:border-box;border-radius:999px;background:#a3412f;color:#fff;font-size:10px;font-weight:700;line-height:18px;text-align:center}
.chat-envelope.is-new{animation:chat-envelope-blink 1.2s ease-in-out infinite}
@keyframes chat-envelope-blink{0%,100%{background:transparent}50%{background:#cbb68b55}}
@media(prefers-reduced-motion:reduce){.chat-envelope.is-new{animation:none;background:#cbb68b55}}
.chat-envelope-menu{position:absolute;top:calc(100% + 8px);inset-inline-end:0;z-index:60;width:min(360px,calc(100vw - 32px));max-height:min(70vh,520px);overflow:auto;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--white);color:var(--ink);box-shadow:0 12px 40px #263b3030}
.chat-envelope-head{margin:4px 8px 6px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.chat-envelope-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;width:100%;padding:8px;border:0;border-radius:8px;background:transparent;color:var(--ink);font:inherit;text-align:start;cursor:pointer}
.chat-envelope-item:hover,.chat-envelope-item:focus-visible{background:#edf3e8}
.chat-envelope-who{font-weight:650;font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-envelope-when{font-size:11px;color:var(--muted);white-space:nowrap}
.chat-envelope-text{grid-column:1/-1;font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-envelope-all{width:100%;margin-top:4px;padding:8px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--green);font:inherit;font-size:13px;font-weight:650;cursor:pointer}
.chat-msg.is-target .chat-bubble{outline:2px solid var(--gold);outline-offset:2px}

/* 0.1.185: photos, quotes, reactions, quick replies, family lines, notification levels. */
.chat-notify{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}
.chat-notify select{height:34px;padding:4px 8px;border:1px solid #c4d4bc;border-radius:8px;background:var(--white);color:var(--ink);font:inherit;font-size:12px}
.chat-photos{display:grid;gap:4px;margin:4px 0;max-width:360px}
.chat-photos-2,.chat-photos-4{grid-template-columns:1fr 1fr}
.chat-photos-3{grid-template-columns:1fr 1fr 1fr}
.chat-photo{display:block;padding:0;border:0;border-radius:10px;overflow:hidden;background:#e8ece4;cursor:zoom-in}
.chat-photo img{display:block;width:100%;height:auto;max-height:320px;object-fit:cover}
.chat-photos-2 .chat-photo img,.chat-photos-3 .chat-photo img,.chat-photos-4 .chat-photo img{aspect-ratio:1;height:100%}
.chat-quote{display:grid;gap:1px;width:100%;margin:2px 0 4px;padding:4px 8px;border:0;border-inline-start:3px solid var(--green);border-radius:6px;background:#00000008;color:var(--ink);font:inherit;font-size:12px;text-align:start;cursor:pointer}
.chat-quote span{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-reactions{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 0}
.chat-reaction{min-height:26px;padding:0 8px;border:1px solid var(--line);border-radius:999px;background:var(--white);font:inherit;font-size:12px;cursor:pointer}
.chat-reaction[aria-pressed="true"]{border-color:var(--green);background:#edf3e8}
.chat-react-picker{display:inline-flex;gap:2px;padding:2px;border:1px solid var(--line);border-radius:999px;background:var(--white);box-shadow:0 6px 18px #263b3020}
.chat-react-picker button{width:34px;height:34px;border:0;border-radius:50%;background:transparent;font-size:18px;cursor:pointer}
.chat-react-picker button[aria-pressed="true"],.chat-react-picker button:hover{background:#edf3e8}
.chat-chips:empty{display:none}.chat-chips{padding:8px 20px 0;border-top:1px solid var(--line);background:var(--white)}
.chat-quick{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.chat-quick-item{flex:none;min-height:34px;padding:4px 12px;border:1px solid #c4d4bc;border-radius:999px;background:#edf3e8;color:var(--green);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.chat-family-line{font-style:normal;color:var(--ink);background:#f0ead9;border-radius:10px;padding:6px 12px}
.chat-person{padding:0;border:0;background:none;color:var(--green);font:inherit;text-decoration:underline;cursor:pointer}
.chat-greet{height:30px;margin-inline-start:8px;padding:4px 12px;vertical-align:middle}
.chat-compose{grid-template-columns:auto auto minmax(0,1fr) auto}
.chat-photo-pick{display:grid;place-items:center;width:42px;height:42px;border:1px solid #c4d4bc;border-radius:12px;background:#edf3e8;font-size:20px;cursor:pointer}
.chat-reply-bar,.chat-attached{grid-column:1/-1;display:flex;align-items:center;gap:8px}
.chat-reply-bar[hidden],.chat-attached[hidden]{display:none}
.chat-reply-text{flex:1;min-width:0;padding:4px 8px;border-inline-start:3px solid var(--green);background:#00000008;border-radius:6px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-attached-item{position:relative}
.chat-attached-item img{display:block;width:56px;height:56px;object-fit:cover;border-radius:8px}
.chat-attached-item .chat-tool{position:absolute;top:-6px;inset-inline-end:-6px;width:20px;height:20px;border-radius:50%;background:var(--white);border:1px solid var(--line);text-decoration:none}
@media(max-width:700px){.chat-photos{max-width:100%}}

/* 0.1.187: translations. */
.chat-tr{margin:2px 0 0;font-size:11px;color:var(--muted)}
.chat-tr .chat-tool{font-size:11px}
.chat-letters-off{margin:0 0 10px;padding:8px 10px;border-radius:10px;background:#f6efe0;color:#7a5a24;font-size:13px}
/* The smiley button and panel (0.1.193). */
.chat-emoji{flex:0 0 auto;width:42px;height:42px;padding:0;border:1px solid #8a9389;border-radius:12px;background:var(--paper);font-size:22px;line-height:1;cursor:pointer}.chat-emoji[aria-expanded=true]{background:#edf3e8}
.chat-emoji-panel{box-sizing:border-box;padding:6px;border:1px solid var(--line);border-radius:14px;background:var(--white);box-shadow:0 12px 40px #263b3030}
.chat-emoji-tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);padding-bottom:4px}.chat-emoji-tabs button{flex:1;min-width:0;padding:0;min-height:34px;border:0;border-radius:8px;background:none;font-size:18px;cursor:pointer}.chat-emoji-tabs [aria-selected=true]{background:#edf3e8}
.chat-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));align-content:start;gap:2px;height:200px;max-height:200px;overflow:hidden auto;padding-top:4px}.chat-emoji-grid button{min-width:0;padding:0;min-height:38px;border:0;border-radius:8px;background:none;font-size:22px;cursor:pointer}.chat-emoji-grid button:hover,.chat-emoji-grid button:focus-visible{background:#edf3e8}.chat-emoji-grid p{grid-column:1/-1;margin:8px;color:var(--muted);font-size:13px}
.chat-compose>.chat-photo-pick,.chat-compose>.chat-emoji{align-self:end;width:46px;height:46px;margin:0;box-sizing:border-box}
/* «На экран „Домой“» (0.1.194): the account's section, the steps window, the once-only bar. */
.family-install-box{margin:0 0 14px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#fffdf7}.family-install-box h3{margin:0 0 6px}.family-install-box p{margin:0 0 10px;color:var(--muted)}
.family-install-dialog{width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box;border:0;border-radius:18px;padding:20px}.family-install-dialog::backdrop{background:rgba(20,26,22,.45)}
.family-install-dialog h2{margin:0 0 8px}.family-install-dialog h3{margin:16px 0 6px;font-size:16px}.family-install-steps{margin:0;padding:0;list-style:none;display:grid;gap:8px}
.family-install-steps li{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:#f7f9f4}.family-install-ico{flex:none;width:26px;height:26px;fill:none;stroke:#365c48;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.family-install-steps li span .family-install-ico{width:18px;height:18px;vertical-align:-4px}
.family-install-note{font-size:13px;color:var(--muted)}.family-install-actions{margin:14px 0 0}.family-install-done,.family-install-copy{min-height:44px;padding:8px 18px;border:0;border-radius:12px;background:#365c48;color:#fff;font:inherit;font-weight:700;cursor:pointer}
.family-install-bar{position:fixed;z-index:70;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));max-width:520px;margin:0 auto;display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:14px;background:#253f34;color:#f4eddf;box-shadow:0 10px 30px rgba(0,0,0,.25);font-size:15px}
.family-install-bar span{flex:1;min-width:0}.family-install-bar button{flex:none;min-height:40px;padding:0 12px;border:0;border-radius:10px;background:#f4eddf;color:#253f34;font:inherit;font-weight:700}.family-install-bar [data-install-bar-x]{background:transparent;color:#f4eddf;font-size:22px;padding:0 6px}
/* «Сайт обновился» (0.1.195): a small bar at the top; «Обновить» reloads, «×» hides it for half an hour. */
.family-update-bar{position:fixed;z-index:95;top:calc(8px + env(safe-area-inset-top,0px));left:12px;right:12px;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:8px;padding:8px 10px 8px 14px;border-radius:14px;background:#253f34;color:#f4eddf;box-shadow:0 10px 30px rgba(0,0,0,.25);font-size:15px}
.family-update-bar span{flex:1;min-width:0}.family-update-bar button{flex:none;min-height:40px;padding:0 14px;border:0;border-radius:10px;background:#f4eddf;color:#253f34;font:inherit;font-weight:700;cursor:pointer}.family-update-bar .family-update-later{background:transparent;color:#f4eddf;font-size:22px;padding:0 6px}
/* Enter / Shift+Enter is a keyboard's hint: not on a touch screen without one (the audit 18.10, A мелкое 18). */
@media (hover:none){.chat-hint{display:none}}
/* A low window: «Сайт обновился» at the bottom, the header's buttons stay free (the audit 18.10, A мелкое 19). */
@media (max-height:500px){.family-update-bar{top:auto;bottom:calc(var(--tabs-h,0px) + 8px + env(safe-area-inset-bottom,0px))}}
