/* Design tokens: colours, type, spacing, radii, sizes.
   Shared foundations adapted from the approved prototype; legacy aliases follow. */
:root {
  /* Brand colours */
  --c-primary: #1b7f55;
  --c-primary-dark: #14603f;
  --c-primary-ink: #ffffff;
  --c-lime: #bceb91;
  --c-call-bg: #0f4d36;
  --c-call-accent: #3fae80;

  /* Surfaces */
  --c-bg: #f4f8f5;
  --c-surface: #ffffff;
  --c-tint: #e6efe8;
  --c-tint-strong: #d3e4d8;
  --c-line: #dbe5de;
  --c-overlay: rgb(8 24 16 / 0.55);

  /* Text */
  --c-text: #10231a;
  --c-text-2: #55695d;
  --c-text-3: #7a8b80;
  --c-disabled-bg: #bcd6c8;

  /* Status */
  --c-danger: #a52a20;
  --c-danger-bg: #fbe6e3;
  --c-danger-ink: #ffffff;
  --c-warn: #8a5a00;
  --c-warn-bg: #fdf0d2;
  --c-ok: #1b7f55;
  --c-focus: #0b57d0;

  /* Avatar palette (circle = person) */
  --c-av-green: #1b7f55;
  --c-av-amber: #c47f17;
  --c-av-blue: #3a6ea5;
  --c-av-plum: #8a4f7d;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-base: 1.45;

  /* Spacing scale (4px step) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Radii: circle = person, rounded rect = action, capsule = state */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Sizes */
  --size-tap: 48px;
  --size-icon: 22px;
  --size-avatar-sm: 32px;
  --size-avatar-md: 48px;
  --size-avatar-lg: 88px;
  --size-avatar-xl: 128px;
  --size-rail: 72px;
  --size-panel: 380px;
  --size-tabbar: 64px;
  --size-topbar: 56px;
  --size-dialog: 440px;
  --size-form: 440px;
  --size-thread: 760px;

  /* Elevation and motion */
  --shadow-dialog: 0 12px 40px rgb(8 24 16 / 0.25);
  --shadow-toast: 0 6px 20px rgb(8 24 16 / 0.2);
  --t-fast: 120ms ease;

  /* Safe areas (notches, home indicator) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}


/* Existing screen layouts keep their geometry during component migration. */
:root { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--c-text); background: var(--c-bg); color-scheme: light; --green: var(--c-primary); --dark: var(--c-primary-dark); --line: var(--c-line); --muted: var(--c-text-2); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh-base); }
.app-loading { min-height:100dvh; display:grid; place-items:center; padding:24px; color:var(--c-primary-dark); background:var(--c-bg); font-size:14px; }
.container { width: 100%; min-height: 100dvh; margin: auto; padding-bottom: 24px; }
header { background: var(--green); color: white; padding: 40px 24px 32px; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: white; color: var(--green); font-size: 38px; margin-bottom: 20px; }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: .15em; color: #bfE6d1; }
h1 { font-size: 30px; letter-spacing: -.035em; margin: 8px 0; }
h2 { font-size: 20px; margin: 0 0 16px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--green); margin: 28px 0 12px; }
p { line-height: 1.55; }
.intro { font-size: 15px; color: #d5f0e2; max-width: 360px; margin-bottom: 0; }
.small { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 8px 0 16px; }
.panel { background: white; border-radius: 12px; padding: 24px; margin: 16px; }
#authSection { margin: 0; border-radius: 24px 24px 0 0; padding: 28px 24px; }
.container:has(#authSection:not([hidden])) { background: white; }
#authSection > .small { display: none; }
#authSection > #authMessage:not(:empty) { display: block; margin-top: 12px; }
label { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin: 16px 0 6px; }
input { width: 100%; min-width: 0; min-height: var(--size-tap); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); background: var(--c-surface); color: inherit; font: inherit; font-size: 16px; }
input::placeholder { color: var(--c-text-2); }
input[aria-invalid="true"] { border-color: var(--c-danger); }
input[readonly] { font-size: 13px; background: var(--c-bg); }
button { width: 100%; min-height: var(--size-tap); margin-top: 10px; padding: var(--sp-3) var(--sp-4); border: 0; border-radius: var(--r-md); background: var(--green); color: var(--c-primary-ink); font: inherit; font-size: var(--fs-md); font-weight: var(--fw-semibold); cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast); }
button:hover { background: var(--dark); }
button:disabled { opacity: .5; cursor: default; }
button:disabled:hover { cursor: not-allowed; }
.secondary { background: var(--c-tint); color: var(--dark); }
.secondary:hover { background: var(--c-tint-strong); }
.danger { background: var(--c-danger-bg); color: var(--c-danger); }
.danger:hover { background: #f8d6d2; }
.text-button, #authToggle { background: transparent; color: var(--green); }
.text-button:hover, #authToggle:hover { background: var(--c-tint); }
input:focus-visible, button:focus-visible, a:focus-visible, [role="tabpanel"]:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
 button { transition: none; }
}
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; inset: 2px 2px 2px auto; width: 44px; min-height: 0; margin: 0; padding: 8px; display: grid; place-items: center; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--c-tint); }
.error, #contactError { color: var(--c-danger); font-size: 13px; }
.error:empty, #contactError:empty { display: none; }
.home-link { display: block; color: var(--green); text-align: center; margin-top: 18px; font-size: 14px; }
.footer-note { font-size: 11px; color: var(--muted); text-align: center; padding: 20px 16px; margin: 0; }
#status, #notify { margin: 16px; padding: 12px 16px; font-size: 14px; overflow-wrap: anywhere; background: #ddf3e4; border-radius: 16px 16px 16px 4px; }
#status:empty, #notify:empty { display: none; }
#notify { color: var(--dark); }
audio { display: none; }
.container[data-authenticated="true"] { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.container[data-authenticated="true"] > header { padding: 16px 20px; }
.container[data-authenticated="true"] > header .brand-mark, .container[data-authenticated="true"] > header .eyebrow, .container[data-authenticated="true"] > header .intro { display: none; }
.container[data-authenticated="true"] > header h1 { font-size: 20px; margin: 0; }
.account-tabs { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: flex; padding: 4px 8px calc(8px + env(safe-area-inset-bottom, 0px)); background: white; border-top: 1px solid var(--c-line); }
.account-tabs button { flex: 1; min-width: 0; padding: 12px 2px; margin: 0; background: transparent; color: #5b6f64; border-radius: 0; border-top: 3px solid transparent; font-size: 12px; }
.account-tabs button[aria-selected="true"] { border-color: var(--green); color: var(--green); }
.account-tabs button:hover { background: var(--c-bg); }
.contact-row { display: flex; align-items: center; gap: 8px; padding: 14px 0; border-bottom: 1px solid #e6efea; }
.contact-row > .contact-person { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; font-weight: 600; }
.contact-row > .contact-person::before { content: attr(data-initial); display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; color: white; background: var(--c-av-green); font-size: 18px; }
.contact-row:nth-child(3n + 2) > p::before { background: #c9822b; }
.contact-row:nth-child(3n + 3) > p::before { background: #3a8fb7; }
.contact-row > button { width: auto; flex-shrink: 0; min-height: 44px; margin: 0; padding: 8px; font-size: 12px; }
.contact-row > .text-button { color: var(--muted); font-size: 11px; }
#openContact.new-contact-row { display: flex; align-items: center; gap: 10px; width: calc(100% + 32px); min-height: 68px; margin: 0 -16px; padding: 12px 16px; border: 0; border-radius: 0; background: white; color: var(--c-text); font-size: 16px; font-weight: 600; text-align: left; }
#openContact.new-contact-row:hover { background: var(--c-bg); }
.new-contact-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--c-tint); color: var(--c-primary); display: grid; place-items: center; }
.new-contact-name { flex: 1; min-width: 0; }
.new-contact-plus { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--c-tint); color: var(--c-primary); display: flex; align-items: center; justify-content: center; }
.new-contact-avatar svg, .new-contact-plus svg { display: block; flex: none; }
#callHistory { white-space: pre-line; background: var(--c-bg); border-radius: 12px; padding: 12px; line-height: 2; overflow-wrap: anywhere; }
#callHistory:empty { display: none; }
#inboxStatus { font-size: 12px; margin-top: 16px; }
.avatar { border-radius: 50%; display: grid; place-items: center; background: var(--c-av-green); color: white; font-weight: 600; }
.profile-avatar { width: 96px; height: 96px; margin: 28px auto 20px; font-size: 40px; }
.account { text-align: center; }
#accountEmail { display: block; overflow-wrap: anywhere; font-size: 18px; font-weight: 600; margin-bottom: 24px; }
#logout { background: var(--c-danger-bg); color: var(--c-danger); }
.diagnostics-heading { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
textarea { width: 100%; border: 0; border-radius: 12px; background: var(--c-text); color: #bfe6d1; font: 11px/1.6 Consolas, monospace; padding: 14px; resize: vertical; }
#clearLogs { color: var(--c-danger); }
dialog { width: min(var(--size-dialog), calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-6); border: 0; border-radius: var(--r-lg); background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-dialog); }
dialog::backdrop { background: var(--c-overlay); }
#incomingSection { border: 2px solid var(--c-focus); }
#incomingCaller { font-size: 20px; overflow-wrap: anywhere; }
.call-surface { margin: 16px; border-radius: 16px; background: var(--c-call-bg); color: white; padding: 40px 20px 24px; text-align: center; }
.call-avatar { width: 112px; height: 112px; margin: 0 auto 24px; font-size: 44px; }
#callName { overflow-wrap: anywhere; font-size: 26px; }
.call-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.call-controls button { width: auto; flex: 1; max-width: 240px; font-size: 13px; }
#mute { background: #1f6b4e; color: white; }
#hangup { background: #d63c30; color: white; }
@media (min-width: 800px) {
 .container { max-width: 1120px; min-height: 100dvh; display: grid; grid-template-columns: 280px minmax(0,1fr); align-content: start; background: var(--c-bg); }
 .container > header { grid-column: 1; grid-row: 1 / span 6; padding: 64px 28px; min-height: 100dvh; }
 #authSection, #inviteSection { grid-column: 2; width: min(440px, calc(100% - 64px)); margin: 72px auto 16px; border-radius: 16px; }
 #accountSection { grid-column: 2; grid-row: 1; padding: 28px; }
 #accountSection > .panel { max-width: 600px; margin: 0 auto; }
 .container[data-authenticated="true"] > header { grid-row: 1 / span 8; padding: 28px 20px; }
 .container[data-authenticated="true"] { padding-bottom: 0; }
 .account-tabs { left: max(0px, calc((100vw - 1120px) / 2)); right: auto; top: 90px; bottom: auto; width: 280px; padding: 12px; display: flex; flex-direction: column; background: transparent; border: 0; }
 .account-tabs button { flex: none; text-align: left; padding: 16px; color: #d5f0e2; border: 0; border-radius: 12px; margin-bottom: 6px; font-size: 14px; }
 .account-tabs button[aria-selected="true"], .account-tabs button:hover { background: var(--c-primary-dark); color: white; }
 .call-surface, #incomingSection { grid-column: 2; margin: 0 28px 16px; }
 #status, #notify, .footer-note { grid-column: 2; margin-left: 28px; margin-right: 28px; }
 .footer-note { margin-top: 24px; }
}
@media (max-width: 360px) { .panel { padding: 16px; margin: 12px; } .contact-row { gap: 4px; } .contact-row > .contact-person { font-size: 14px; gap: 6px; } .contact-row > .contact-person::before { width: 32px; height: 32px; flex-basis: 32px; font-size: 14px; } .account-tabs button { font-size: 11px; } }
.contact-row > button[data-call] { width: 44px; height: 44px; border-radius: 50%; font-size: 0; padding: 0; }
.contact-row > button[data-call]::before { content: ""; display: block; margin: auto; width: 20px; height: 20px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.call-controls #mute, .call-controls #hangup { flex: none; width: 68px; height: 68px; border-radius: 50%; font-size: 0; display: grid; place-items: center; }
#mute::before { content: ""; width: 28px; height: 28px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
#mute[data-muted="true"] { outline: 2px solid white; background: var(--c-danger); }
#hangup::before { content: ""; width: 28px; height: 28px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' d='M3 14c5-5 13-5 18 0l-2 3-4-1v-3a10 10 0 0 0-6 0v3l-4 1z'/%3E%3C/svg%3E") center / contain no-repeat; }
.call-controls { margin-top: 32px; }
#desktopWelcome { display: none; }
/* Desktop layouts follow the two-pane web boards in the supplied mockup. */
@media (min-width: 900px) {
 .container { max-width: none; grid-template-columns: 360px minmax(0, 1fr); min-height: 100dvh; }
 .container:not([data-authenticated="true"]) { grid-template-columns: minmax(360px, 46%) minmax(0, 1fr); }
 .container:not([data-authenticated="true"]) > header { padding: max(80px, 18vh) 64px 48px; }
 .container:not([data-authenticated="true"]) > header h1 { font-size: 36px; }
 .container:not([data-authenticated="true"]) #authSection { margin-top: max(64px, 14vh); }
 .container[data-authenticated="true"] { grid-template-rows: 112px minmax(400px, 1fr) auto auto auto; }
 .container[data-authenticated="true"] > header { grid-column: 1; grid-row: 1; min-height: 0; padding: 16px; border-right: 1px solid var(--c-line); }
 .container[data-authenticated="true"] > header h1 { font-size: 20px; }
 .account-tabs { position: fixed; left: 0; top: 56px; bottom: auto; right: auto; width: 360px; height: 56px; display: flex; flex-direction: row; padding: 0 8px; border: 0; background: var(--green); }
 .account-tabs button { flex: 1; min-width: 0; margin: 0; padding: 12px 2px; text-align: center; font-size: 12px; border-radius: 0; border-bottom: 3px solid transparent; color: #bfe6d1; }
 .account-tabs button[aria-selected="true"], .account-tabs button:hover { background: transparent; border-bottom-color: white; color: white; }
 #accountSection { display: contents; }
 #accountSection > .panel { grid-column: 2; grid-row: 2; width: min(440px, calc(100% - 64px)); max-width: none; margin: auto; align-self: center; }
 #accountSection > #contactsSection { grid-column: 1; grid-row: 2 / span 4; width: 360px; min-height: calc(100dvh - 112px); margin: 0; padding: 16px; border-radius: 0; border-right: 1px solid var(--c-line); align-self: stretch; background: white; }
 #contactsSection > h2 { display: none; }
 #contactsSection > .small { font-size: 12px; }
 .contact-row { margin: 0 -16px; padding: 12px 16px; }
 #desktopWelcome { grid-column: 2; grid-row: 2; margin: auto; padding: 32px; text-align: center; color: var(--muted); }
 .container[data-authenticated="true"][data-tab="contacts"][data-call="false"] #desktopWelcome { display: block; }
 .welcome-symbol { width: 100px; height: 100px; display: grid; place-items: center; margin: 0 auto 24px; background: #ddf3e4; color: var(--green); border-radius: 50%; font-size: 52px; }
 #desktopWelcome h2 { color: var(--dark); font-size: 26px; }
 #desktopWelcome p { font-size: 15px; }
 .container[data-authenticated="true"] .call-surface { grid-column: 2; grid-row: 3; width: min(440px, calc(100% - 64px)); margin: 16px auto; }
 .container[data-authenticated="true"][data-tab="contacts"] .call-surface { grid-row: 1 / span 2; width: 100%; min-height: calc(100dvh - 120px); margin: 0; border-radius: 0; padding-top: max(80px, 18vh); }
 .container[data-tab="contacts"] .call-avatar { width: 140px; height: 140px; font-size: 56px; }
 .container[data-tab="contacts"] .call-controls { margin-top: 56px; gap: 40px; }
 #incomingSection { grid-column: 2; grid-row: 1 / span 2; width: min(440px, calc(100% - 64px)); margin: auto; z-index: 2; }
 .container:has(#incomingSection:not([hidden])) #desktopWelcome { display: none; }
 #status { grid-column: 2; grid-row: 4; width: fit-content; max-width: calc(100% - 64px); margin: 16px auto; }
 #notify { grid-column: 2; grid-row: 5; width: fit-content; max-width: calc(100% - 64px); margin: 8px auto; }
 .footer-note { grid-column: 2; grid-row: 6; margin: 0; }
}
.call-status { color: #bfe6d1; font-size: 15px; margin: 8px 0 0; }
.call-controls #mute, .call-controls #hangup { position: relative; margin-bottom: 28px; }
.call-controls #mute::after, .call-controls #hangup::after { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 400; color: #bfe6d1; }
#mute::after { content: "Микрофон"; }
#hangup::after { content: "Завершить"; }
@media (min-width: 900px) {
 .container[data-authenticated="true"][data-tab="contacts"][data-call="true"] .call-surface { position: fixed; left: 360px; right: 0; top: 0; bottom: 0; width: auto; min-height: 100dvh; margin: 0; border-radius: 0; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; }
 .container[data-tab="contacts"] #callName { margin: 0; font-size: 30px; }
 .container[data-tab="contacts"] .call-controls { flex: none; width: 100%; }
 .container[data-tab="contacts"][data-call="true"] > #status, .container[data-tab="contacts"][data-call="true"] > .footer-note { display: none; }
}
/* Keep call notices above the selected page on both layouts. */
@media (min-width: 800px) {
 .container[data-authenticated="true"] .call-surface { grid-row: 1; }
 .container[data-authenticated="true"] #accountSection { grid-row: 2; }
 .container[data-authenticated="true"] > #status { grid-row: 2; }
 .container[data-authenticated="true"]:has(.call-surface:not([hidden])) #accountSection { grid-row: 3; }
 #incomingSection { grid-row: 1; align-self: start; }
}
@media (min-width: 900px) {
 .container[data-authenticated="true"] .call-surface { grid-row: 1; }
 .container[data-authenticated="true"] #accountSection { grid-row: auto; }
 .container[data-authenticated="true"] > #status { grid-row: 3; }
 #incomingSection { grid-row: 1; margin: 16px auto; }
}
.call-dropdown { margin: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.call-dropdown > summary { cursor: pointer; padding: 16px; min-height: 52px; color: var(--dark); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.call-dropdown > summary:focus-visible { outline: 3px solid var(--c-focus); outline-offset: -3px; }
.call-dropdown > .call-surface { margin: 0; border-radius: 0; }
.call-dropdown > #incomingSection { margin: 0; border: 0; border-radius: 0; }
@media (min-width: 800px) {
 .call-dropdown { grid-column: 2; grid-row: 1; width: min(600px, calc(100% - 48px)); margin: 16px auto; align-self: start; z-index: 3; }
 .container[data-authenticated="true"]:has(.call-dropdown:not([hidden])) #accountSection { grid-row: 2; }
}
@media (min-width: 900px) {
 .container[data-authenticated="true"]:has(.call-dropdown:not([hidden])) #accountSection { grid-row: auto; }
 .call-dropdown .call-surface { position: static !important; width: 100% !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 28px 20px !important; border-radius: 0 !important; }
 .call-dropdown #incomingSection { width: 100%; margin: 0; }
 .call-dropdown .call-avatar { width: 88px !important; height: 88px !important; font-size: 36px !important; }
 .call-dropdown .call-controls { margin-top: 24px !important; }
 .container[data-tab="contacts"][data-call="true"] > #status { display: block; }
}
/* Incoming calls block interaction with the application until answered or declined. */
dialog#incomingSection { position: fixed; inset: 0; width: min(380px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 32px 24px; border: 0; border-radius: 20px; background: #fff; text-align: center; z-index: auto; }
dialog#incomingSection::backdrop { background: #0f1e17b3; backdrop-filter: blur(4px); }
.incoming-symbol { display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto 24px; border-radius: 50%; background: #ddf3e4; color: var(--c-primary); font-size: 36px; }
dialog#incomingSection h2 { font-size: 22px; }
dialog#incomingSection #incomingCaller { margin: 12px 0 24px; }
body:has(dialog#incomingSection[open]) { overflow: hidden; }
.profile-subtitle, .profile-presence { color: var(--muted); font-size: 14px; }
.profile-card { margin-top: 24px; }
.room-symbol { display: none; }
@media (min-width: 900px) {
 .container { grid-template-columns: 340px minmax(0, 1fr); }
 .account-tabs { width: 340px; }
 #accountSection > #contactsSection { width: 340px; padding-bottom: 164px; }
 #accountSection > #profileSection:not([hidden]) { align-self: start; justify-self: start; width: min(610px, calc(100% - 100px)); margin: 40px 50px; padding: 0; background: transparent; }
 #profileSection h2 { font-size: 28px; margin-bottom: 4px; }
 .profile-subtitle { margin: 0 0 24px; font-size: 15px; }
 .profile-card { display: flex; align-items: center; gap: 20px; margin: 0; background: white; border-radius: 16px; padding: 24px; }
 .profile-avatar { width: 80px; height: 80px; flex: 0 0 80px; margin: 0; font-size: 36px; }
 .account { text-align: left; min-width: 0; }
 #accountEmail { margin: 0; font-size: 20px; }
 .profile-presence { margin: 4px 0 0; }
 #accountSection > #roomSection { background: transparent; text-align: center; width: min(520px, calc(100% - 64px)); padding: 0; }
 .room-symbol { display: grid; place-items: center; width: 112px; height: 112px; margin: 0 auto 28px; background: #ddf3e4; border-radius: 50%; font-size: 56px; color: var(--green); }
 #roomSection h2 { font-size: 30px; margin-bottom: 12px; }
 #roomSection .small { font-size: 16px; }
 #createRoom { max-width: 320px; margin-top: 18px; }
 .container[data-authenticated="true"][data-host-room="true"] #roomSection { display: none; }
 .container[data-authenticated="true"][data-host-room="true"] .call-surface { position: fixed; inset: 0 0 0 340px; width: auto; min-height: 100dvh; margin: 0; border-radius: 0; padding: 40px 32px 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; }
 .container[data-host-room="true"] .call-avatar { width: 128px; height: 128px; font-size: 48px; }
 .container[data-host-room="true"] .call-controls { width: 100%; margin-top: 40px; gap: 70px; }
 .container[data-host-room="true"] #status, .container[data-host-room="true"] > .footer-note { display: none; }
 #roomInfo { width: min(640px, calc(100% - 64px)); position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); padding: 20px; background: #155f43; color: #bfe6d1; border-radius: 16px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; text-align: left; }
 #roomInfo label, #roomInfo p { grid-column: 1 / -1; margin: 0; color: #bfe6d1; }
 #roomInfo label { margin-bottom: 0; }
 #roomLink { background: var(--c-call-bg); border-color: var(--c-focus); color: white; }
 #copyLink, #shareRoom { width: 48px; height: 48px; margin: 0; padding: 0; font-size: 0; background: #1f6b4e; color: white; }
 #copyLink::before { content: "⧉"; font-size: 24px; }
 #shareRoom::before { content: "↥"; font-size: 24px; }
 #roomInfo .small { font-size: 12px; }
 .container[data-authenticated="true"][data-tab="contacts"][data-call="true"] .call-surface { left: 340px; }
}

@media (min-width: 900px) { #profileSection > #logout { display: none; } }
#mute[data-muted="true"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 9v2a3 3 0 0 0 5.1 2.1M15 9.4V6a3 3 0 0 0-5.5-1.7M5 11a7 7 0 0 0 12 4.9M19 11a7 7 0 0 1-.5 2.6M12 18v3M3 3l18 18'/%3E%3C/g%3E%3C/svg%3E"); }
#mute[data-muted="true"]::after { content: "Микрофон выключен"; }
/* Contact lists scroll independently of the application chrome. */
.contacts-scroll { min-height: 0; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #a6c9b6 transparent; }
@media (min-width: 900px) {
 body:has(.container[data-authenticated="true"]) { overflow: hidden; }
 .container[data-authenticated="true"] { height: 100dvh; overflow: hidden; }
 .container[data-authenticated="true"] > header { position: fixed; top: 0; left: 0; width: 340px; height: 56px; z-index: 11; }
 #accountSection > #contactsSection { position: fixed; top: 112px; bottom: 60px; left: 0; width: 340px; min-height: 0; height: auto; padding: 16px 16px 0; display: flex; flex-direction: column; overflow: hidden; }
 #contactsSection > .small { flex-shrink: 0; }
 .contacts-scroll { flex: 1; overflow-y: auto; margin: 0 -16px; padding: 0 16px 16px; }
 #inboxStatus { flex: none; margin: 0 -16px; padding: 12px 16px; border-top: 1px solid #e6efea; background: white; }
 #accountSection > .panel:not(#contactsSection) { max-height: calc(100dvh - 96px); overflow-y: auto; }
}
@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab="contacts"][data-call="false"] { height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
 .container[data-authenticated="true"][data-tab="contacts"][data-call="false"] > header { flex: none; }
 .container[data-tab="contacts"][data-call="false"] #accountSection { flex: 1; min-height: 0; display: flex; flex-direction: column; }
 .container[data-tab="contacts"][data-call="false"] #contactsSection { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 0; }
 .container[data-tab="contacts"][data-call="false"] .contacts-scroll { flex: 1; overflow-y: auto; }
 .container[data-tab="contacts"][data-call="false"] > .footer-note { display: none; }
 .container[data-tab="contacts"][data-call="false"] #inboxStatus { flex: none; margin-bottom: 0; }
}
/* Quiet repeating line art behind the content, with opaque cards above it. */
.container[data-authenticated="true"] {
 background-color: #e7eee3;
 background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'280'%20height%3D'240'%20viewBox%3D'0%200%20280%20240'%3E%3Cg%20fill%3D'none'%20stroke%3D'%2395ae97'%20stroke-opacity%3D'.22'%20stroke-width%3D'1.5'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'm30%2032%2034-12-12%2034-7-15-15-7Zm15%207%2019-19M124%2030c-12-15-27%204%200%2020%2027-16%2012-35%200-20ZM218%2021l3%209%2010%201-8%206%202%2010-8-6-9%205%203-10-7-7%2010%201Z'%2F%3E%3Crect%20x%3D'78'%20y%3D'100'%20width%3D'31'%20height%3D'22'%20rx%3D'8'%2F%3E%3Cpath%20d%3D'm85%20122-2%208%2011-8M86%20110h1m7%200h1m7%200h1M177%2089v24a7%207%200%201%201-4-6M177%2089l13-3v10l-13%203M31%20163l4%208%209%201-7%207%202%209-8-5-9%205%202-9-7-7%2010-1ZM120%20183c-13-15-27%204%200%2020%2027-16%2012-35%200-20ZM218%20166c-7-6-17%200-12%209l13%2017%2016-15c7-8-2-17-10-12l-7%208M61%20210l5%205m-5%200%205-5M244%20100l5%205m-5%200%205-5M145%20143l4%204m-4%200%204-4'%2F%3E%3Ccircle%20cx%3D'26'%20cy%3D'104'%20r%3D'4'%2F%3E%3Ccircle%20cx%3D'154'%20cy%3D'66'%20r%3D'3'%2F%3E%3Ccircle%20cx%3D'252'%20cy%3D'218'%20r%3D'4'%2F%3E%3C%2Fg%3E%3Cg%20id%3D%22cucumber-pattern%22%20opacity%3D%22.22%22%20transform%3D%22translate(204%2062)%20scale(.19)%22%20fill%3D%22none%22%20stroke%3D%22%2395ae97%22%20stroke-width%3D%227%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M35%2020c-7-2-15%203-15%2012%200%2034%2042%2076%2076%2076%209%200%2014-8%2012-15l-5-17c-2-6-8-9-14-6l-13%207C65%2072%2056%2063%2051%2052l7-13c3-6%200-12-6-14Z%22%2F%3E%3Cpath%20d%3D%22M34%2020c-1-6%202-9%206-9M39%2037l1%201M48%2061l1%201M67%2080l1%201M91%2087l1%201%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
 background-repeat: repeat;
}
@media (min-width: 900px) {
 #accountSection > #profileSection:not([hidden]) { display: block; }
}
@media (min-width: 900px) {
 .container[data-authenticated="true"][data-tab="profile"][data-call="false"] #desktopWelcome { display: block; }
 .container:has(#incomingSection:not([hidden])) #desktopWelcome { display: none; }
 #desktopWelcome { max-width: 520px; }
}
/* Contact calls use the same full-size call surface as invitation rooms. */
@media (min-width: 900px) {
 .container[data-authenticated="true"][data-direct-call="true"] .call-surface { position: fixed; inset: 0 0 0 340px; width: auto; height: 100dvh; min-height: 0; margin: 0; border-radius: 0; padding: 40px 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; background: var(--c-call-bg); z-index: 2; }
 .container[data-direct-call="true"] .call-avatar { flex: 0 0 128px; width: 128px; height: 128px; font-size: 48px; }
 .container[data-direct-call="true"] #callName { margin: 0; font-size: 30px; }
 .container[data-direct-call="true"] .call-status { max-width: 600px; }
 .container[data-direct-call="true"] .call-controls { flex: none; width: 100%; margin-top: 40px; gap: 70px; }
 .container[data-direct-call="true"] > #status, .container[data-direct-call="true"] > .footer-note { display: none !important; }
}
.settings-title { font-size: 28px; margin-bottom: 4px; }
.settings-intro { margin-top: 0; }
.settings-microphone { padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings-microphone h2, .settings-logs h2 { font-size: 18px; margin-bottom: 6px; }
.settings-microphone .small { margin: 0; }
.settings-logs { padding: 20px 0; border-bottom: 1px solid var(--line); }
.settings-logs .diagnostics-heading { padding: 0; margin: 0 0 6px; border: 0; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.settings-actions button { width: auto; margin: 0; }
@media (min-width: 900px) {
 .container[data-tab="diagnostics"] { background-image: none; background-color: var(--c-bg); }
 #accountSection > #diagnostics { width: calc(100% - 100px); max-width: none; max-height: calc(100dvh - 80px); margin: 40px 50px; padding: 0; align-self: start; justify-self: start; background: transparent; }
 #diagnostics .settings-intro { font-size: 15px; margin-bottom: 24px; }
 .settings-microphone { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
 .settings-microphone > div { max-width: 600px; }
 .settings-microphone .small, .settings-logs > .small { font-size: 14px; }
 .settings-microphone #testMic { flex: 0 0 220px; width: 220px; margin: 0; min-height: 44px; }
 .settings-logs > .small { max-width: 620px; }
 .settings-logs label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
 #logOutput { display: block; height: 260px; min-height: 160px; max-height: 40dvh; resize: vertical; }
 .settings-actions button { min-height: 44px; }
 #copyLogs { padding: 12px 24px; }
 #clearLogs { padding: 12px 24px; }
}
/* Use one shared outer edge for every part of the desktop sidebar. */
@media (min-width: 900px) {
 .container[data-authenticated="true"] > header,
 .container[data-authenticated="true"] > .account-tabs,
 #accountSection > #contactsSection {
  box-sizing: border-box;
  width: 340px;
  border-right: 1px solid var(--c-line);
  background-clip: padding-box;
 }
}
/* Incoming call banner: a native modal retains focus trapping and background blocking. */
dialog#incomingSection { inset: 0 0 auto; width: 100%; max-width: none; max-height: 100dvh; margin: 0; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px; border: 0; border-bottom: 1px solid var(--c-focus); border-radius: 0 0 20px 20px; background: var(--c-call-bg); color: white; text-align: left; }
dialog#incomingSection::backdrop { background: #142b22a6; backdrop-filter: none; }
.incoming-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
dialog#incomingSection .incoming-symbol { width: 48px; height: 48px; flex: 0 0 48px; margin: 0; background: var(--c-av-green); color: white; font-size: 20px; font-weight: 600; }
.incoming-heading { min-width: 0; }
dialog#incomingSection h2 { margin: 0 0 2px; color: #bfe6d1; font-size: 13px; font-weight: 650; text-transform: uppercase; }
dialog#incomingSection #incomingCaller { margin: 0; color: white; font-size: 20px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.incoming-actions { display: flex; gap: 12px; margin-top: 14px; }
.incoming-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1; width: auto; min-height: 48px; margin: 0; padding: 12px; border-radius: 28px; font-size: 16px; }
.incoming-actions svg { flex-shrink: 0; }
.incoming-actions #declineCall { background: #d63c30; color: white; }
.incoming-actions #declineCall:hover { background: #bc3026; }
.incoming-actions #acceptCall { background: #48c28d; color: #083b29; }
.incoming-actions #acceptCall:hover { background: #64d2a3; }
@media (min-width: 800px) {
 dialog#incomingSection { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 24px; border-radius: 0; }
 .incoming-identity { flex: 1; }
 .incoming-actions { flex-shrink: 0; gap: 16px; margin: 0; }
 .incoming-actions button { flex: none; padding-inline: 24px; }
}
/* Mobile account screen layout. */
@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab="profile"] { min-height: 100dvh; padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px)); background: var(--c-bg); }
 .container[data-tab="profile"] > header { height: 56px; padding: 16px; }
 .container[data-tab="profile"] > header h1 { display: none; }
 .container[data-tab="profile"] > header::before { content: "Мой аккаунт"; display: block; color: white; font-size: 20px; line-height: 24px; font-weight: 650; }
 #accountSection > #profileSection { margin: 0; padding: 32px 16px 24px; background: transparent; border-radius: 0; }
 #profileSection > h2 { display: none; }
 #profileSection .profile-card { margin: 0; padding: 0; background: transparent; display: block; text-align: center; }
 #profileSection .profile-avatar { width: 96px; height: 96px; margin: 0 auto 14px; font-size: 40px; }
 #profileSection .account { text-align: center; }
 #profileSection #accountEmail { margin: 0; font-size: 18px; font-weight: 600; }
 #profileSection .profile-presence { margin: 4px 0 0; font-size: 13px; }
 .profile-logout-bar { position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 9; padding: 12px 16px; background: white; }
 .profile-logout-bar #logout { min-height: 44px; margin: 0; padding: 12px; border-radius: 12px; color: var(--c-danger); background: var(--c-danger-bg); font-size: 14px; }
 .container[data-tab="profile"] > .footer-note { display: none; }
 .container[data-tab="profile"] .account-tabs { min-height: calc(68px + env(safe-area-inset-bottom, 0px)); }
}
/* Mobile invitation room: centered creation and a full-height call screen. */
@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab="room"] { min-height: 100dvh; padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); background: var(--c-bg); }
 .container[data-tab="room"] > header { height: 56px; padding: 16px; }
 .container[data-tab="room"] > header h1 { display: none; }
 .container[data-tab="room"] > header::before { content: "Комната"; display: block; font-size: 20px; line-height: 24px; font-weight: 650; }
 .container[data-tab="room"] > .footer-note { display: none; }
 .container[data-tab="room"] .account-tabs { min-height: calc(68px + env(safe-area-inset-bottom, 0px)); }
 .container[data-tab="room"][data-call="false"] #roomSection { min-height: calc(100dvh - 124px - env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 32px 24px; background: transparent; text-align: center; }
 #roomSection .room-symbol { display: grid; place-items: center; width: 104px; height: 104px; flex: 0 0 104px; margin: 0 auto 24px; border-radius: 50%; background: #ddf3e4; color: var(--green); }
 #roomSection h2 { font-size: 26px; margin-bottom: 10px; }
 #roomSection > .small { font-size: 15px; margin: 0 0 28px; max-width: 380px; }
 #createRoom { max-width: 320px; min-height: 52px; margin: 0; border-radius: 16px; font-size: 16px; }
 .container[data-tab="room"][data-host-room="true"] #roomSection, .container[data-tab="room"][data-host-room="true"] > #status { display: none; }
 .container[data-tab="room"][data-host-room="true"] .call-surface { min-height: calc(100dvh - 124px - env(safe-area-inset-bottom, 0px)); margin: 0; padding: 52px 16px 20px; border-radius: 0; display: flex; flex-direction: column; align-items: center; }
 .container[data-tab="room"][data-host-room="true"] .call-avatar { width: 112px; height: 112px; flex: 0 0 112px; font-size: 0; margin-bottom: 20px; background: var(--c-av-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='white' stroke-width='4' stroke-linecap='round'%3E%3Ccircle cx='32' cy='22' r='9'/%3E%3Cpath d='M14 52a18 18 0 0 1 36 0'/%3E%3C/g%3E%3C/svg%3E") center / 64px no-repeat; }
 .container[data-tab="room"][data-host-room="true"] #callName { margin: 0 0 8px; font-size: 27px; }
 .container[data-tab="room"][data-host-room="true"] .call-status { margin: 0; font-size: 14px; }
 .container[data-tab="room"][data-host-room="true"] .call-controls { flex: none; width: 100%; gap: 60px; margin: 36px 0 40px; }
 .container[data-tab="room"][data-host-room="true"] #hangup::after { content: "Закрыть комнату"; }
 #roomInfo { width: 100%; margin-top: auto; padding: 16px; border-radius: 16px; background: #155f43; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; text-align: left; }
 #roomInfo label, #roomInfo p { grid-column: 1 / -1; margin: 0; color: #bfe6d1; }
 #roomInfo label { font-size: 13px; }
 #roomInfo .small { font-size: 12px; }
 #roomLink { min-height: 48px; color: white; background: var(--c-call-bg); border-color: var(--c-focus); padding: 10px; }
 #copyLink, #shareRoom { width: 48px; height: 48px; margin: 0; padding: 0; background: #1f6b4e; color: white; font-size: 0; }
 #copyLink::before { content: "⧉"; font-size: 24px; }
 #shareRoom::before { content: "↥"; font-size: 24px; }
}
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e6efea; line-height: 1.4; }
.history-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.history-state { flex-shrink: 0; color: var(--green); font-size: 12px; }
.history-state[data-state="declined"], .history-state[data-state="missed"] { color: #d63c30; }
@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab="contacts"] { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); background: var(--c-bg); }
 .container[data-tab="contacts"] > header { height: 56px; padding: 16px; }
 .container[data-tab="contacts"] > header h1 { display: none; }
 .container[data-tab="contacts"] > header::before { content: "Контакты"; display: block; font-size: 20px; line-height: 24px; font-weight: 650; }
 .container[data-tab="contacts"] #contactsSection { margin: 0; padding: 0; background: transparent; border-radius: 0; }
 #contactsSection > h2 { display: none; }
 #contactsSection > .small { padding: 12px 16px; margin: 0; flex: none; }
 #openContact.new-contact-row { width: 100%; margin: 0; padding: 10px 16px; }
 .new-contact-avatar { width: 48px; height: 48px; flex-basis: 48px; }
 .contacts-scroll { padding: 0; }
 .contact-row { margin: 0; padding: 10px 16px; border: 0; background: white; }
 .contact-row > .contact-person::before { width: 48px; height: 48px; flex-basis: 48px; }
 .contact-row > .text-button { font-size: 10px; padding: 4px; }
 .contacts-scroll > h3 { margin: 0; padding: 20px 16px 8px; font-size: 13px; font-weight: 600; }
 #callHistory { margin: 0; padding: 0; border-radius: 0; background: white; white-space: normal; }
 .history-row { padding: 12px 16px; font-size: 13px; }
 .container[data-tab="contacts"] #inboxStatus { padding: 8px 16px; font-size: 11px; }
 dialog#contactDialog { inset: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 24px); margin: 0; padding: 36px 24px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: 24px 24px 0 0; }
 dialog#contactDialog::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 2px; background: var(--c-line); }
 dialog#contactDialog::backdrop { background: #142b22a6; }
 #contactDialogTitle { margin-bottom: 20px; }
 #contactDialog input { min-height: 48px; }
 #addContact { background: var(--green); color: white; margin-top: 16px; font-size: 16px; }
 #closeContact { width: 100%; margin-top: 12px; }
}
/* Mobile direct-call layout. */
@media (max-width: 899px) {
 body:has(.container[data-direct-call="true"]) { overflow: hidden; }
 .container[data-direct-call="true"] .call-surface { position: fixed; inset: 0; z-index: 20; width: 100%; height: 100dvh; min-height: 0; margin: 0; padding: max(40px, env(safe-area-inset-top, 0px)) 24px calc(76px + env(safe-area-inset-bottom, 0px)); border-radius: 0; background: var(--c-call-bg); display: flex; flex-direction: column; align-items: center; overflow-y: auto; }
 .container[data-direct-call="true"] .call-avatar { width: 132px; height: 132px; flex: 0 0 132px; margin: clamp(16px, 14dvh, 110px) auto 24px; font-size: 52px; }
 .container[data-direct-call="true"] #callName { margin: 0 0 8px; font-size: 28px; font-weight: 700; }
 .container[data-direct-call="true"] .call-status { margin: 0; color: #bfe6d1; font-size: 16px; }
 .container[data-direct-call="true"] .call-controls { flex: none; width: 100%; gap: 48px; margin: auto 0 0; padding-top: 64px; }
 .container[data-direct-call="true"] .call-controls #mute, .container[data-direct-call="true"] .call-controls #hangup { width: 68px; height: 68px; margin-bottom: 8px; }
 .container[data-direct-call="true"] .account-tabs, .container[data-direct-call="true"] > #status, .container[data-direct-call="true"] > .footer-note { display: none; }
 .container[data-direct-call="true"] #playAudio { flex: 0 0 100%; max-width: 280px; background: #1f6b4e; color: white; }
}
/* Mobile settings: separate microphone and connection-log cards. */
@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab="diagnostics"] { display: block; min-height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); background: #e6efe8; font-family: Inter, Arial, sans-serif; }
 .container[data-tab="diagnostics"] > header { height: 56px; min-height: 0; padding: 16px; }
 .container[data-tab="diagnostics"] > header h1 { display: none; }
 .container[data-tab="diagnostics"] > header::before { content: "Настройки"; display: block; font-size: 20px; line-height: 24px; font-weight: 700; }
 .container[data-tab="diagnostics"] #accountSection { display: block; padding: 0; }
 .container[data-tab="diagnostics"] > #status { margin: 12px 12px 0; padding: 14px 16px; border-radius: 18px; font-size: 14px; line-height: 20px; }
 #accountSection > #diagnostics { margin: 0; padding: 12px; border-radius: 0; background: transparent; }
 #diagnostics > .settings-title, #diagnostics > .settings-intro { display: none; }
 #diagnostics .settings-microphone, #diagnostics .settings-logs { padding: 20px; border: 0; border-radius: 16px; background: white; }
 #diagnostics .settings-logs { margin-top: 12px; }
 #diagnostics .settings-microphone h2, #diagnostics .settings-logs h2 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
 #diagnostics .small { margin: 0 0 14px; font-size: 14px; line-height: 20px; color: #3e5247; }
 #diagnostics #testMic, #diagnostics #enableIncomingSound { height: 48px; margin: 0 0 8px; padding: 0 8px; font-size: 15px; font-weight: 700; background: #ddf0e4; color: var(--c-primary-dark); }
 #diagnostics #incomingSoundStatus { margin: 4px 0 0; }
 #diagnostics label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
 #diagnostics #logOutput { display: block; height: 110px; min-height: 110px; margin: 0 0 12px; padding: 12px; border-radius: 10px; font-size: 11px; line-height: 16px; resize: vertical; }
 #diagnostics .settings-actions { display: flex; flex-direction: column; gap: 0; margin: 0; }
 #diagnostics .settings-actions button { width: 100%; min-height: 48px; margin: 0; font-size: 16px; }
 #diagnostics #clearLogs { height: 44px; min-height: 44px; margin-top: 4px; font-size: 15px; font-weight: 600; }
 .container[data-tab="diagnostics"] > .footer-note { display: none; }
 .container[data-tab="diagnostics"] .account-tabs { top: auto; bottom: 0; left: 0; right: 0; width: auto; display: flex; flex-direction: row; background: white; border-top: 1px solid var(--c-line); height: calc(64px + env(safe-area-inset-bottom, 0px)); min-height: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); }
 .container[data-tab="diagnostics"] .account-tabs button { flex: 1; min-width: 0; margin-top: -1px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 0; border-top: 3px solid transparent; font-size: 13px; font-weight: 500; color: #3e5247; }
 .container[data-tab="diagnostics"] .account-tabs button[aria-selected="true"] { border-top-color: var(--c-primary); color: var(--c-primary-dark); background: var(--c-tint); font-weight: 600; }
}
/* Mobile sign-in and registration layout. */
@media (max-width: 899px) {
 .container:has(#authSection:not([hidden])) { display: flex; flex-direction: column; min-height: 100dvh; padding: 0; background: var(--green); }
 .container:has(#authSection:not([hidden])) > header { flex: none; min-height: 320px; padding: 72px 24px 88px; background: var(--green); }
 .container:has(#authSection:not([hidden])) .brand-mark { width: 72px; height: 72px; margin: 0 0 20px; }
 .container:has(#authSection:not([hidden])) .eyebrow { display: none; }
 .container:has(#authSection:not([hidden])) h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.25; font-weight: 700; }
 .container:has(#authSection:not([hidden])) .intro { max-width: 360px; margin: 0; font-size: 15px; line-height: 22px; color: #d5f0e2; }
 #authSection:not([hidden]) { flex: 1; margin: 0; padding: 28px 24px 0; border-radius: 24px 24px 0 0; background: white; }
 #authTitle { margin: 0 0 18px; font-size: 20px; font-weight: 700; }
 #authForm label { margin-top: 16px; margin-bottom: 6px; font-size: 13px; }
 #authForm label:first-child { margin-top: 0; }
 #authForm input { height: 48px; min-height: 48px; font-size: 16px; }
 #passwordHint { margin: 8px 0 16px; font-size: 13px; }
 #authSubmit { margin: 0; min-height: 48px; font-size: 16px; }
 #authToggle { min-height: 48px; margin: 8px 0 0; padding: 12px 0; font-size: 15px; }
 #authError { margin: 8px 0 0; padding-bottom: 8px; }
 .container:has(#authSection:not([hidden])) > #status { display: none; }
 .container:has(#authSection:not([hidden])) > .footer-note { flex: none; margin: 0; padding: 12px 24px calc(24px + env(safe-area-inset-bottom, 0px)); background: white; font-size: 12px; }
}
@media (max-width: 899px) and (max-height: 640px) {
 .container:has(#authSection:not([hidden])) > header { min-height: 0; padding-top: 32px; padding-bottom: 32px; }
}
@media (max-width: 899px) {
 .container:has(#authSection:not([hidden])) > header { min-height: 339px; padding-bottom: 88px; }
 .container:has(#authSection:not([hidden])) > header::before { content: none; }
 .container:has(#authSection:not([hidden])) > header h1 { display: block; }
 .container:has(#authSection:not([hidden])) #authTitle { line-height: 24px; letter-spacing: -.02em; }
 .container:has(#authSection:not([hidden])) #authForm label { line-height: 18px; }
 .container:has(#authSection:not([hidden])) #authToggle { font-size: 16px; }
}
@media (max-width: 899px) and (max-height: 640px) {
 .container:has(#authSection:not([hidden])) > header { min-height: 0; padding: 32px 24px; }
}
#contactEmpty { padding: 16px; margin: 0; line-height: 1.55; }

@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'280'%20height%3D'240'%20viewBox%3D'0%200%20280%20240'%3E%3Cg%20fill%3D'none'%20stroke%3D'%2395ae97'%20stroke-opacity%3D'.22'%20stroke-width%3D'1.5'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'm30%2032%2034-12-12%2034-7-15-15-7Zm15%207%2019-19M124%2030c-12-15-27%204%200%2020%2027-16%2012-35%200-20ZM218%2021l3%209%2010%201-8%206%202%2010-8-6-9%205%203-10-7-7%2010%201Z'%2F%3E%3Crect%20x%3D'78'%20y%3D'100'%20width%3D'31'%20height%3D'22'%20rx%3D'8'%2F%3E%3Cpath%20d%3D'm85%20122-2%208%2011-8M86%20110h1m7%200h1m7%200h1M177%2089v24a7%207%200%201%201-4-6M177%2089l13-3v10l-13%203M31%20163l4%208%209%201-7%207%202%209-8-5-9%205%202-9-7-7%2010-1ZM120%20183c-13-15-27%204%200%2020%2027-16%2012-35%200-20ZM218%20166c-7-6-17%200-12%209l13%2017%2016-15c7-8-2-17-10-12l-7%208M61%20210l5%205m-5%200%205-5M244%20100l5%205m-5%200%205-5M145%20143l4%204m-4%200%204-4'%2F%3E%3Ccircle%20cx%3D'26'%20cy%3D'104'%20r%3D'4'%2F%3E%3Ccircle%20cx%3D'154'%20cy%3D'66'%20r%3D'3'%2F%3E%3Ccircle%20cx%3D'252'%20cy%3D'218'%20r%3D'4'%2F%3E%3C%2Fg%3E%3Cg%20id%3D%22cucumber-pattern%22%20opacity%3D%22.22%22%20transform%3D%22translate(204%2062)%20scale(.19)%22%20fill%3D%22none%22%20stroke%3D%22%2395ae97%22%20stroke-width%3D%227%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M35%2020c-7-2-15%203-15%2012%200%2034%2042%2076%2076%2076%209%200%2014-8%2012-15l-5-17c-2-6-8-9-14-6l-13%207C65%2072%2056%2063%2051%2052l7-13c3-6%200-12-6-14Z%22%2F%3E%3Cpath%20d%3D%22M34%2020c-1-6%202-9%206-9M39%2037l1%201M48%2061l1%201M67%2080l1%201M91%2087l1%201%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); background-repeat: repeat; }
}
.contacts-scroll > .call-history-title { margin: 24px 0 10px; padding: 0; color: var(--c-text); font-size: 18px; font-weight: 650; letter-spacing: normal; text-transform: none; background: transparent; border: 0; border-radius: 0; }
#callHistoryEmpty { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
@media (max-width: 899px) {
 .contacts-scroll > .call-history-title { margin: 24px 16px 10px; padding: 0; }
 #callHistoryEmpty { margin: 0 16px 16px; }
}
.contacts-scroll > .contacts-list-title { margin: 12px 0; padding: 0; color: var(--c-text); font-size: 18px; font-weight: 650; letter-spacing: normal; text-transform: none; }
.contact-row > button[data-call] { border-radius: 12px; background: var(--c-tint); color: var(--c-primary-dark); }
.contact-row > button[data-call]:hover { background: #cfe7da; }
.contact-row > .text-button { margin-left: 12px; padding: 8px; min-height: 44px; color: var(--c-danger); }
@media (max-width: 899px) {
 .contacts-scroll > .contacts-list-title { margin: 16px; padding: 0; }
 .contact-row { gap: 10px; }
 .contact-row > .text-button { margin-left: 12px; padding: 8px; font-size: 11px; }
}
@media (max-width: 360px) {
 .contact-row { gap: 6px; }
 .contact-row > .text-button { margin-left: 6px; padding: 6px; }
}
.delete-contact-actions { display: flex; gap: 12px; }
.delete-contact-actions button { flex: 1; }
#deleteContactName { overflow-wrap: anywhere; }
/* Muting is a reversible state; reserve red for ending the call. */
#mute[data-muted="true"] { background: #dce5e0; color: #173f30; outline: none; }
#mute[data-muted="true"]:hover { background: #c5d4cc; }
.history-state { color: #59675f; cursor: default; text-decoration: none; }
/* The optional sound permission action must not squeeze the caller identity. */
dialog#incomingSection > #incomingEnableSound { width: auto; min-height: 40px; margin: 12px 0 0; padding: 10px 16px; background: var(--c-tint); color: var(--c-primary-dark); font-size: 14px; }
@media (min-width: 800px) {
 dialog#incomingSection { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; }
 dialog#incomingSection > .incoming-identity { grid-column: 1; min-width: 0; }
 dialog#incomingSection > .incoming-actions { grid-column: 2; grid-row: 1; }
 dialog#incomingSection > #incomingEnableSound { grid-column: 1 / -1; justify-self: end; max-width: 320px; margin: 0; }
 dialog#incomingSection .incoming-heading { overflow: hidden; }
 dialog#incomingSection #incomingCaller { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 799px) {
 dialog#incomingSection > #incomingEnableSound { width: 100%; }
}

/* Desktop authentication follows the web sign-in board; mobile keeps its own layout. */
@media (min-width: 900px) {
 .container:has(#authSection:not([hidden])) {
  grid-template-columns: minmax(0, calc(50% + 96px)) minmax(0, 1fr);
  grid-template-rows: minmax(100dvh, auto);
  padding-bottom: 0;
  background: var(--c-bg);
  font-family: Inter, Arial, sans-serif;
 }
 .container:has(#authSection:not([hidden])) > header {
  grid-column: 1;
  grid-row: 1;
  min-height: 100dvh;
  padding: 48px 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
 }
 .container:has(#authSection:not([hidden])) .brand-mark { width: 88px; height: 88px; flex: 0 0 88px; margin: 0; }
 .container:has(#authSection:not([hidden])) .eyebrow { display: none; }
 .container:has(#authSection:not([hidden])) > header h1 { margin: 28px 0 12px; font-size: 44px; font-weight: 700; line-height: normal; letter-spacing: normal; }
 .container:has(#authSection:not([hidden])) .intro { margin: 0; max-width: 420px; font-size: 18px; line-height: 28px; }
 .container:has(#authSection:not([hidden])) .intro::after { content: " Только голос."; }
 .container #authSection:not([hidden]) {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: min(464px, calc(100% - 64px));
  margin: 32px auto;
  padding: 32px;
  border-radius: 16px;
  background: white;
 }
 #authSection:not([hidden]) #authTitle { margin: 0 0 20px; font-size: 22px; line-height: normal; font-weight: 700; }
 #authSection:not([hidden]) label { margin: 16px 0 6px; font-size: 13px; line-height: normal; }
 #authSection:not([hidden]) label:first-child { margin-top: 0; }
 #authSection:not([hidden]) input { height: 48px; padding: 0 14px; font-size: 16px; }
 #authSection:not([hidden]) .password-field input { padding-right: 48px; }
 #authSection:not([hidden]) #passwordHint { margin: 8px 0 16px; font-size: 13px; line-height: normal; color: #5b6f64; }
 #authSection:not([hidden]) #authSubmit { margin: 0; font-size: 16px; }
 #authSection:not([hidden]) #authToggle { margin: 8px 0 0; font-size: 16px; }
 #authSection:not([hidden]) #authError { margin: 0; }
 #authSection:not([hidden]) #authError:not(:empty) { margin-top: 12px; }
 .container:has(#authSection:not([hidden])) > #status[data-auth-hint="true"],
 .container:has(#authSection:not([hidden])) > .footer-note { display: none; }
}

.contact-row > .contact-delete { position: relative; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; margin-left: 0; padding: 0; border-radius: 12px; background: transparent; color: var(--c-danger); font-size: 0; }
.contact-row > .contact-delete::before { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M9 6V4h6v2M5 6l1 14h12l1-14M10 10v6m4-6v6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
.contact-row > .contact-delete:hover { background: var(--c-danger-bg); }
.call-main { display: contents; }
.call-controls #mute::before, .call-controls #hangup::before { position: absolute; inset: 0; margin: auto; pointer-events: none; }
.room-waiting-label, .room-note-mobile, .room-action-icon { display: none; }
/* Mobile boards 11–13: incoming call, invitation and created room. */
@media (max-width: 899px) {
 dialog#incomingSection { display: block; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px; border-radius: 0 0 20px 20px; font-family: Inter, Arial, sans-serif; border-bottom-color: var(--c-av-green); }
 dialog#incomingSection::backdrop { background: rgba(15, 30, 23, .6); }
 dialog#incomingSection .incoming-identity { margin-bottom: 12px; }
 dialog#incomingSection .incoming-symbol { font-size: 18px; }
 dialog#incomingSection h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
 dialog#incomingSection #incomingCaller { font-size: 18px; font-weight: 700; line-height: normal; }
 dialog#incomingSection .incoming-actions { margin: 0; gap: 12px; }
 dialog#incomingSection .incoming-actions button { height: 48px; padding: 0 8px; border-radius: 24px; font-size: 15px; font-weight: 700; }
 dialog#incomingSection .incoming-actions svg { width: 22px; height: 22px; }
 dialog#incomingSection #acceptCall { background: #4cc38a; color: #0b2e1f; }
 dialog#incomingSection > .incoming-identity, dialog#incomingSection > .incoming-actions { grid-column: auto; grid-row: auto; }
 .container[data-authenticated="true"][data-tab="room"] { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); font-family: Inter, Arial, sans-serif; background-color: #e6efe8; }
 .container[data-tab="room"] > header { flex: none; min-height: 0; }
 .container[data-tab="room"] > header::before { font-weight: 700; }
 .container[data-tab="room"] #accountSection { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
 .container[data-tab="room"][data-call="false"] { height: 100dvh; min-height: 0; overflow: hidden; }
 .container[data-tab="room"][data-call="false"] #roomSection { flex: 1; min-height: 0; padding: 24px 32px; overflow-y: auto; }
 .container[data-tab="room"] .room-symbol { width: 104px; height: 104px; flex: 0 0 104px; margin: 0; }
 .container[data-tab="room"] .room-symbol svg { width: 38px; height: 38px; }
 .container[data-tab="room"] #roomSection h2 { margin: 24px 0 10px; font-size: 26px; font-weight: 700; letter-spacing: normal; }
 .container[data-tab="room"] #roomSection > .small { margin: 0 0 24px; font-size: 15px; line-height: 22px; color: #3e5247; }
 .container[data-tab="room"] #createRoom { width: 100%; max-width: 320px; height: 52px; margin: 0; border-radius: 14px; font-size: 16px; }
 .container[data-tab="room"] .account-tabs { top: auto; bottom: 0; left: 0; right: 0; width: auto; display: flex; flex-direction: row; background: white; border-top: 1px solid var(--c-line); height: calc(64px + env(safe-area-inset-bottom, 0px)); min-height: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); }
 .container[data-tab="room"] .account-tabs button { margin-top: -1px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; color: #3e5247; }
 .container[data-tab="room"] .account-tabs button[aria-selected="true"] { color: var(--c-primary-dark); background: var(--c-tint); font-weight: 600; }
 .container[data-tab="room"][data-host-room="true"] { height: 100dvh; min-height: 0; overflow: hidden; }
 .container[data-tab="room"][data-host-room="true"] #accountSection { display: none; }
 .container[data-tab="room"][data-host-room="true"] .call-surface { flex: 1; width: 100%; min-height: 0; margin: 0; padding: 0; overflow-y: auto; }
 .container[data-tab="room"][data-host-room="true"] .call-main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 24px 16px; }
 .container[data-tab="room"][data-host-room="true"] .call-avatar { width: 112px; height: 112px; flex: 0 0 112px; margin: 0; background-size: 48px; }
 .container[data-tab="room"][data-host-room="true"] #callName { margin: 20px 0 0; font-size: 26px; line-height: normal; font-weight: 700; }
 .container[data-tab="room"][data-host-room="true"] .call-status,
 .container[data-tab="room"][data-host-room="true"] .room-waiting-label { margin: 6px 0 0; font-size: 14px; line-height: normal; color: #bfe6d1; }
 .container[data-tab="room"][data-host-room="true"] #callStatus[data-waiting-for-guest="true"] { display: none; }
 .container[data-tab="room"][data-host-room="true"] #callStatus[data-waiting-for-guest="true"] + .room-waiting-label { display: block; }
 .container[data-tab="room"][data-host-room="true"] .call-controls { flex: none; width: auto; gap: 40px; margin: 28px 0 0; padding: 0; }
 .container[data-tab="room"][data-host-room="true"] .call-controls #mute,
 .container[data-tab="room"][data-host-room="true"] .call-controls #hangup { width: 64px; height: 64px; margin: 0 0 23px; padding: 0; }
 .container[data-tab="room"][data-host-room="true"] #mute::before,
 .container[data-tab="room"][data-host-room="true"] #hangup::before { width: 26px; height: 26px; }
 .container[data-tab="room"][data-host-room="true"] #hangup::after { content: "Закрыть"; }
 .container[data-tab="room"][data-host-room="true"] #roomInfo { flex: none; width: 100%; margin: 0; padding: 16px; border-radius: 16px 16px 0 0; background: var(--c-primary-dark); }
 .container[data-tab="room"][data-host-room="true"] #roomInfo label { font-size: 13px; font-weight: 600; }
 .container[data-tab="room"][data-host-room="true"] #roomLink { padding: 0 12px; font-size: 13px; background: #0b3d2b; border-color: var(--c-av-green); color: var(--c-tint); }
 .container[data-tab="room"][data-host-room="true"] #roomInfo .small { margin: 2px 0 0; font-size: 12px; line-height: 17px; }
 .container[data-tab="room"][data-host-room="true"] .room-note-long,
 .container[data-tab="room"][data-host-room="true"] .room-privacy-note { display: none; }
 .container[data-tab="room"][data-host-room="true"] .room-note-mobile { display: inline; }
 .container[data-tab="room"][data-host-room="true"] #copyLink,
 .container[data-tab="room"][data-host-room="true"] #shareRoom { display: grid; place-items: center; }
 .container[data-tab="room"][data-host-room="true"] #copyLink::before,
 .container[data-tab="room"][data-host-room="true"] #shareRoom::before { content: none; }
 .container[data-tab="room"][data-host-room="true"] .room-action-icon { display: block; }
}

@media (max-width: 899px) { .container[data-authenticated="true"][data-tab="room"], .container[data-authenticated="true"][data-tab="diagnostics"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20aria-hidden%3D%22true%22%20width%3D%22252%22%20height%3D%22216%22%20viewBox%3D%220%200%20252%20216%22%3E%3Cdefs%3E%3Cpattern%20id%3D%22p%22%20width%3D%22252%22%20height%3D%22216%22%20patternUnits%3D%22userSpaceOnUse%22%3E%3Cg%20stroke%3D%22%23CFDDD3%22%20stroke-width%3D%221.6%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20transform%3D%22translate(20%2018)%22%20d%3D%22M12%2020s-7-4.5-7-10a4%204%200%200%201%207-2.5A4%204%200%200%201%2019%2010c0%205.5-7%2010-7%2010z%22%3E%3C%2Fpath%3E%3Cpath%20transform%3D%22translate(84%2062)%22%20d%3D%22M12%203l2.6%206%206.4.5-5%204.5%201.6%206.5-5.6-3.5-5.6%203.5%201.6-6.5-5-4.5%206.4-.5z%22%3E%3C%2Fpath%3E%3Cpath%20transform%3D%22translate(146%2014)%22%20d%3D%22M3%2011l18-8-6%2018-3-7-9-3z%22%3E%3C%2Fpath%3E%3Cg%20transform%3D%22translate(18%20112)%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2212%22%20rx%3D%225%22%3E%3C%2Frect%3E%3Cpath%20d%3D%22M8%2017v4l4-4%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(150%20118)%22%3E%3Cpath%20d%3D%22M9%2018V6l10-2v12%22%3E%3C%2Fpath%3E%3Ccircle%20cx%3D%226.5%22%20cy%3D%2218%22%20r%3D%222.5%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2216.5%22%20cy%3D%2216%22%20r%3D%222.5%22%3E%3C%2Fcircle%3E%3C%2Fg%3E%3Cpath%20transform%3D%22translate(204%20160)%22%20d%3D%22M12%2020s-7-4.5-7-10a4%204%200%200%201%207-2.5A4%204%200%200%201%2019%2010c0%205.5-7%2010-7%2010z%22%3E%3C%2Fpath%3E%3Ccircle%20cx%3D%22110%22%20cy%3D%2230%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3Cpath%20d%3D%22M60%20170l6%206m0-6l-6%206%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cg%20id%3D%22cucumber-pattern%22%20transform%3D%22translate(204%2062)%20scale(.19)%22%20fill%3D%22none%22%20stroke%3D%22%23CFDDD3%22%20stroke-width%3D%227%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M35%2020c-7-2-15%203-15%2012%200%2034%2042%2076%2076%2076%209%200%2014-8%2012-15l-5-17c-2-6-8-9-14-6l-13%207C65%2072%2056%2063%2051%2052l7-13c3-6%200-12-6-14Z%22%2F%3E%3Cpath%20d%3D%22M34%2020c-1-6%202-9%206-9M39%2037l1%201M48%2061l1%201M67%2080l1%201M91%2087l1%201%22%2F%3E%3C%2Fg%3E%3C%2Fpattern%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%23p)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E"); background-size: 252px 216px; } }

@media (max-width: 899px) {
 .container[data-tab="room"][data-host-room="true"] .call-avatar { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20aria-hidden%3D%22true%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%228%22%20r%3D%224%22%3E%3C%2Fcircle%3E%3Cpath%20d%3D%22M4%2021a8%208%200%200%201%2016%200%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E"); }
}

/* Shared visual system for the application and exported design boards. */
:root { --sidebar-width: 340px; --radius-control: 12px; --radius-card: 16px; --surface: #fff; --page: var(--c-bg); --call-background: var(--c-call-bg); --call-control: 64px; }
.call-status { font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
 .container:has(#authSection:not([hidden])) > header { min-height: 0; padding: 48px 24px 40px; }
 .container[data-authenticated="true"] { display: block; }
 .container[data-authenticated="true"] > header { min-height: 0; }
 .container[data-authenticated="true"] > #status { flex: none; }
 .container[data-authenticated="true"] .account-tabs { top: auto; bottom: 0; left: 0; right: 0; width: auto; display: flex; flex-direction: row; height: calc(64px + env(safe-area-inset-bottom, 0px)); min-height: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--c-line); background: white; }
 .container[data-authenticated="true"] .account-tabs button { flex: 1; min-width: 0; margin: -1px 0 0; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 0; border-top: 3px solid transparent; font-size: 13px; font-weight: 500; color: #3e5247; }
 .container[data-authenticated="true"] .account-tabs button[aria-selected="true"] { border-top-color: var(--c-primary); background: var(--c-tint); color: var(--c-primary-dark); font-weight: 600; }
 .container[data-authenticated="true"][data-tab="contacts"][data-call="false"] { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
 .profile-logout-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 899px) and (max-height: 640px) {
 .container:has(#authSection:not([hidden])) > header { padding: 24px; }
}
@media (min-width: 900px) {
 .container[data-authenticated="true"] { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: 100dvh; }
 .container[data-authenticated="true"] > header { font-size: 18px; }
 .container[data-authenticated="true"] > header h1 { font-size: 18px; }
 #accountSection { display: contents; }
 .container[data-authenticated="true"] > .footer-note { position: fixed; left: var(--sidebar-width); right: 0; bottom: 18px; margin: 0; padding: 0; font-size: 11px; text-align: center; }
 .container[data-authenticated="true"] > #status:not(:empty), .container[data-authenticated="true"] > #notify:not(:empty) { position: fixed; z-index: 14; left: calc(var(--sidebar-width) + 24px); right: 24px; bottom: 48px; width: fit-content; max-width: calc(100% - var(--sidebar-width) - 48px); margin: 0; }
 .container[data-authenticated="true"] > #notify:not(:empty) { bottom: 100px; }
 #accountSection > .panel:not(#contactsSection) { grid-column: 2; grid-row: 1; }
 #contactsSection > .small { font-size: 12px; line-height: 17px; }
 .contacts-scroll > .contacts-list-title, .contacts-scroll > .call-history-title { font-size: 16px; font-weight: 700; }
 .contact-row { gap: 12px; padding: 10px 16px; }
 .contact-row > .contact-person { font-size: 14px; gap: 12px; }
 .contact-row > .contact-person::before { width: 40px; height: 40px; flex-basis: 40px; font-size: 16px; }
 .contact-row > button[data-call], .contact-row > .contact-delete { width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; }
 #openContact.new-contact-row { min-height: 60px; padding: 10px 16px; gap: 12px; font-size: 14px; }
 .new-contact-avatar { width: 40px; height: 40px; flex-basis: 40px; }
 .history-row { font-size: 13px; padding: 11px 0; }
 .history-state { font-size: 12px; }
 #desktopWelcome { grid-column: 2; grid-row: 1; margin: auto; max-width: 520px; padding: 32px; }
 .welcome-symbol { width: 92px; height: 92px; margin: 0 auto 22px; }
 #desktopWelcome h2 { margin: 0 0 10px; font-size: 22px; font-weight: 700; }
 #desktopWelcome p { margin: 0; font-size: 14px; line-height: 21px; }
 #accountSection > #roomSection { align-self: center; margin: auto; width: min(520px, calc(100% - 64px)); max-height: calc(100dvh - 64px); }
 .container[data-tab="room"] .room-symbol { width: 100px; height: 100px; margin: 0 auto 24px; }
 .container[data-tab="room"] #roomSection h2 { margin: 0 0 10px; font-size: 28px; font-weight: 700; }
 .container[data-tab="room"] #roomSection .small { margin: 0 auto 28px; max-width: 440px; font-size: 15px; line-height: 24px; }
 .container[data-tab="room"] #createRoom { width: 100%; max-width: 320px; height: 52px; margin: 0; border-radius: 14px; font-size: 16px; }
 dialog#incomingSection { min-height: 72px; padding: 12px 24px; border-color: var(--c-av-green); font-family: Inter, Arial, sans-serif; }
 dialog#incomingSection::backdrop { background: rgba(15, 30, 23, .6); }
 dialog#incomingSection h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
 dialog#incomingSection #incomingCaller { font-size: 18px; font-weight: 700; line-height: normal; }
 dialog#incomingSection .incoming-actions button { height: 48px; font-size: 15px; font-weight: 700; border-radius: 24px; }
 dialog#incomingSection #acceptCall { background: #4cc38a; color: #0b2e1f; }
 .container[data-authenticated="true"][data-direct-call="true"] .call-surface { inset: 0 0 0 var(--sidebar-width); padding: 40px 32px; background: var(--call-background); }
 .container[data-direct-call="true"] .call-avatar { width: 116px; height: 116px; flex-basis: 116px; margin: 0; font-size: 48px; }
 .container[data-direct-call="true"] #callName { margin: 22px 0 0; font-size: 26px; font-weight: 700; }
 .container[data-direct-call="true"] .call-status { margin: 8px 0 0; font-size: 14px; }
 .container[data-direct-call="true"] .call-controls { width: auto; margin: 40px 0 0; gap: 48px; }
 .container[data-direct-call="true"] .call-controls #mute,
 .container[data-direct-call="true"] .call-controls #hangup { width: var(--call-control); height: var(--call-control); margin-bottom: 27px; }
 .container[data-authenticated="true"][data-host-room="true"] .call-surface { inset: 0 0 0 var(--sidebar-width); padding: 24px 48px 0; overflow-y: auto; }
 .container[data-host-room="true"] .call-main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 24px 0 36px; }
 .container[data-authenticated="true"][data-host-room="true"] .call-avatar { position: relative; width: 128px; height: 128px; flex: 0 0 128px; margin: 0; font-size: 0; background: var(--c-av-green); }
 .container[data-host-room="true"] .call-avatar::before { content: ""; position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; background: white; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
 .container[data-host-room="true"] #callName { margin: 24px 0 0; font-size: 28px; font-weight: 700; }
 .container[data-host-room="true"] .call-status, .container[data-host-room="true"] .room-waiting-label { margin: 8px 0 0; font-size: 16px; color: #bfe6d1; }
 .container[data-host-room="true"] #callStatus[data-waiting-for-guest="true"] { display: none; }
 .container[data-host-room="true"] #callStatus[data-waiting-for-guest="true"] + .room-waiting-label { display: block; }
 .container[data-host-room="true"] .call-controls { width: auto; margin: 36px 0 0; gap: 56px; }
 .container[data-host-room="true"] .call-controls #mute, .container[data-host-room="true"] .call-controls #hangup { width: var(--call-control); height: var(--call-control); margin-bottom: 27px; }
 .container[data-host-room="true"] #hangup::after { content: "Закрыть комнату"; }
 .container[data-host-room="true"] #roomInfo { position: static; transform: none; flex: none; width: 100%; max-width: 640px; margin: 0 auto 28px; padding: 20px; border-radius: var(--radius-card); background: var(--c-primary-dark); }
 .container[data-host-room="true"] #roomInfo label { font-size: 13px; font-weight: 600; }
 .container[data-host-room="true"] #roomInfo .small { margin: 4px 0 0; font-size: 13px; line-height: 19px; }
 .container[data-host-room="true"] #roomLink { background: #0b3d2b; border-color: var(--c-av-green); color: var(--c-tint); font-size: 14px; }
 .container[data-host-room="true"] #copyLink, .container[data-host-room="true"] #shareRoom { display: grid; place-items: center; }
 .container[data-host-room="true"] #copyLink::before, .container[data-host-room="true"] #shareRoom::before { content: none; }
 .container[data-host-room="true"] .room-action-icon { display: block; }
 #accountSection > #diagnostics { align-self: start; width: calc(100% - 92px); max-width: none; max-height: calc(100dvh - 150px); margin: 110px 46px 0; padding: 0; }
 #diagnostics .settings-title { font-size: 26px; margin: 0 0 6px; }
 #diagnostics .settings-intro { margin: 0 0 24px; font-size: 14px; }
 #diagnostics .settings-microphone { display: grid; grid-template-columns: minmax(160px,220px) minmax(0,1fr) minmax(0,1fr) minmax(150px,230px); gap: 20px; align-items: center; padding: 24px 0; }
 #diagnostics .settings-microphone h2, #diagnostics .settings-logs h2 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
 #diagnostics .small { font-size: 13px; line-height: 20px; }
 #diagnostics .settings-microphone > .small { margin: 0; }
 #diagnostics #testMic, #diagnostics #enableIncomingSound { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 8px 12px; font-size: 14px; font-weight: 600; }
 #diagnostics .settings-logs { padding: 24px 0; }
 #diagnostics .settings-logs > .small { max-width: 560px; margin: 0 0 14px; }
 #diagnostics #logOutput { height: 234px; min-height: 160px; margin: 0 0 12px; border-radius: 8px; font-size: 11px; line-height: 16px; }
 #diagnostics .settings-actions { margin: 0; gap: 12px; }
 #diagnostics .settings-actions button { min-height: 40px; margin: 0; padding: 10px 22px; font-size: 14px; }
}
@media (min-width: 900px) and (max-width: 1199px) {
 #diagnostics .settings-microphone { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
 #diagnostics .settings-microphone > div, #diagnostics .settings-microphone > .small { grid-column: 1 / -1; }
}

.container[data-authenticated="true"]:not([data-tab="diagnostics"]) { background-color:#e6efe8; background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20aria-hidden%3D%22true%22%20width%3D%22252%22%20height%3D%22216%22%20viewBox%3D%220%200%20252%20216%22%3E%3Cdefs%3E%3Cpattern%20id%3D%22p%22%20width%3D%22252%22%20height%3D%22216%22%20patternUnits%3D%22userSpaceOnUse%22%3E%3Cg%20stroke%3D%22%23CFDDD3%22%20stroke-width%3D%221.6%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20transform%3D%22translate(20%2018)%22%20d%3D%22M12%2020s-7-4.5-7-10a4%204%200%200%201%207-2.5A4%204%200%200%201%2019%2010c0%205.5-7%2010-7%2010z%22%3E%3C%2Fpath%3E%3Cpath%20transform%3D%22translate(84%2062)%22%20d%3D%22M12%203l2.6%206%206.4.5-5%204.5%201.6%206.5-5.6-3.5-5.6%203.5%201.6-6.5-5-4.5%206.4-.5z%22%3E%3C%2Fpath%3E%3Cpath%20transform%3D%22translate(146%2014)%22%20d%3D%22M3%2011l18-8-6%2018-3-7-9-3z%22%3E%3C%2Fpath%3E%3Cg%20transform%3D%22translate(18%20112)%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2212%22%20rx%3D%225%22%3E%3C%2Frect%3E%3Cpath%20d%3D%22M8%2017v4l4-4%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(150%20118)%22%3E%3Cpath%20d%3D%22M9%2018V6l10-2v12%22%3E%3C%2Fpath%3E%3Ccircle%20cx%3D%226.5%22%20cy%3D%2218%22%20r%3D%222.5%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2216.5%22%20cy%3D%2216%22%20r%3D%222.5%22%3E%3C%2Fcircle%3E%3C%2Fg%3E%3Cpath%20transform%3D%22translate(204%20160)%22%20d%3D%22M12%2020s-7-4.5-7-10a4%204%200%200%201%207-2.5A4%204%200%200%201%2019%2010c0%205.5-7%2010-7%2010z%22%3E%3C%2Fpath%3E%3Ccircle%20cx%3D%22110%22%20cy%3D%2230%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3Cpath%20d%3D%22M60%20170l6%206m0-6l-6%206%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cg%20id%3D%22cucumber-pattern%22%20transform%3D%22translate(204%2062)%20scale(.19)%22%20fill%3D%22none%22%20stroke%3D%22%23CFDDD3%22%20stroke-width%3D%227%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M35%2020c-7-2-15%203-15%2012%200%2034%2042%2076%2076%2076%209%200%2014-8%2012-15l-5-17c-2-6-8-9-14-6l-13%207C65%2072%2056%2063%2051%2052l7-13c3-6%200-12-6-14Z%22%2F%3E%3Cpath%20d%3D%22M34%2020c-1-6%202-9%206-9M39%2037l1%201M48%2061l1%201M67%2080l1%201M91%2087l1%201%22%2F%3E%3C%2Fg%3E%3C%2Fpattern%3E%3C%2Fdefs%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20fill%3D%22url(%23p)%22%3E%3C%2Frect%3E%3C%2Fsvg%3E"); background-size:252px 216px; }

/* Embedded web-auth font assets. */
/*
Some of the files packed into this page (the "__bundler/manifest" data in this file, unpacked by the page’s script when it opens) are font files downloaded unchanged from Google Fonts (fonts.gstatic.com) when the page was saved. Google Fonts serves each family in pieces, one file per range of characters, so these may not be complete families. Each family’s license follows and still applies to its files. If you pass this file on, keep this comment in it.

Inter

Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

*/
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/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;
  font-display: swap;
  src: url("/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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/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: 500;
  font-display: swap;
  src: url("/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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/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: 600;
  font-display: swap;
  src: url("/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;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/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: 700;
  font-display: swap;
  src: url("/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;
}

@media (min-width: 900px) { #messagesTab { display: none; } }
@media (max-width: 899px) {
 .container[data-authenticated="true"][data-tab="messages"] { height:100dvh; min-height:0; display:flex; flex-direction:column; padding-bottom:calc(64px + env(safe-area-inset-bottom, 0px)); overflow:hidden; }
 .container[data-tab="messages"] > header { flex:none; height:56px; padding:16px; }
 .container[data-tab="messages"] > header h1 { display:none; }
 .container[data-tab="messages"] > header::before { content:"Сообщения"; display:block; font-size:20px; line-height:24px; font-weight:700; }
 .container[data-tab="messages"] #accountSection { flex:1; min-height:0; display:flex; flex-direction:column; }
 .container[data-tab="messages"] #messagesSection { flex:1; margin:0; padding:24px; background:transparent; text-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center; }
 #messagesSection[hidden] { display:none !important; }
 .messages-symbol { width:100px; height:100px; border-radius:50%; background:#d8eee3; color:var(--green); display:grid; place-items:center; margin-bottom:24px; }
 #messagesSection h2 { margin:0 0 10px; font-size:24px; }
 #messagesSection .small { margin:0; font-size:14px; color:#5b6f64; }
 .container[data-tab="messages"] > #status, .container[data-tab="messages"] > .footer-note { display:none; }
 .container .account-tabs { height:calc(64px + env(safe-area-inset-bottom, 0px)); min-height:0; padding:0 0 env(safe-area-inset-bottom, 0px); }
 .container .account-tabs button { font-size:11px; padding-left:1px; padding-right:1px; }
}

/* Mobile navigation: centered icons with accessible names. */
.account-tab-icon { display:none; }
@media (max-width:899px) {
 .container .account-tabs .account-tab-label { display:none; }
 .container .account-tabs .account-tab-icon { display:block; width:24px; height:24px; flex:none; pointer-events:none; }
 .container .account-tabs button { display:flex; align-items:center; justify-content:center; }
 .container .account-tabs button:focus-visible { outline:2px solid var(--green); outline-offset:-5px; }
}

/* Consistent mobile tab bar geometry on every screen. */
@media (max-width:899px) {
 .container[data-authenticated="true"] #accountNav.account-tabs {
  position:fixed; inset:auto 0 0; z-index:20; width:100%; max-width:none;
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); align-items:stretch; gap:0;
  height:calc(64px + env(safe-area-inset-bottom,0px)); min-height:0;
  margin:0; padding:0 8px env(safe-area-inset-bottom,0px); border:0; border-top:1px solid var(--c-line);
  border-radius:0; background:#fff; box-shadow:0 -2px 12px #173b2c06;
 }
 .container[data-authenticated="true"] #accountNav.account-tabs button {
  position:relative; display:flex; align-items:center; justify-content:center;
  width:100%; min-width:0; height:63px; min-height:0; margin:0; padding:0;
  border:0; border-radius:0; background:transparent; color:#708378; line-height:1;
 }
 .container[data-authenticated="true"] #accountNav.account-tabs button::before {
  content:""; position:absolute; width:48px; height:36px; top:13px; left:50%; transform:translateX(-50%);
  border-radius:14px; background:transparent; pointer-events:none;
 }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] { color:var(--c-primary); background:transparent; border:0; }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"]::before { background:#e0f0e7; }
 .container[data-authenticated="true"] #accountNav.account-tabs button:hover::before { background:#edf5f0; }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"]:hover::before { background:#e0f0e7; }
 .container[data-authenticated="true"] #accountNav.account-tabs .account-tab-icon { position:relative; z-index:1; display:block; flex:none; width:24px; height:24px; margin:0; overflow:visible; }
 .container[data-authenticated="true"] #accountNav.account-tabs .account-tab-label { display:none; }
 .container[data-authenticated="true"] #accountNav.account-tabs button:focus-visible { outline:2px solid var(--c-primary); outline-offset:-6px; border-radius:14px; }
 .msg-app:has(#chatView:not([hidden])) { padding-bottom:0; }
}

/* Direct calls occupy the full mobile screen, without account navigation. */
@media (max-width:899px) {
 .container[data-authenticated="true"][data-direct-call="true"] #accountNav.account-tabs { display:none; }
 .container[data-authenticated="true"][data-direct-call="true"] #callSurface {
  position:fixed; inset:0; z-index:21; width:100%; height:100dvh; min-height:0;
  margin:0; padding:max(32px,env(safe-area-inset-top,0px)) 24px calc(32px + env(safe-area-inset-bottom,0px));
  display:flex; flex-direction:column; align-items:center; border-radius:0; overflow-y:auto;
 }
 .container[data-direct-call="true"] #callSurface .call-controls { flex:none; width:100%; margin:auto 0 0; padding:40px 0 0; gap:48px; }
 .container[data-direct-call="true"] #callSurface .call-controls #mute,
 .container[data-direct-call="true"] #callSurface .call-controls #hangup { flex:none; width:68px; height:68px; margin:0 0 28px; padding:0; }
 .container[data-direct-call="true"] #callSurface .call-status { flex:none; max-width:100%; text-align:center; }
}

/* Keep the contacts heading visible inside its scrolling region. */
.contacts-scroll > .contacts-list-title {
 position:sticky; top:0; z-index:2; margin:0; padding:16px 0 12px;
 background:#e6efe8; box-shadow:0 1px 0 var(--c-line);
}
@media (max-width:899px) {
 .contacts-scroll > .contacts-list-title { margin:0; padding:16px; }
}

/* Information marker for user guidance. */
.user-info::before {
 content:""; display:inline-block; width:18px; height:18px; margin-right:8px; vertical-align:-4px;
 background:currentColor; opacity:.8;
 mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M10 11h2.5l-1.5 6h2' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='13' cy='7.5' r='1'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* The journal heading stays outside its independently scrolling rows. */
.call-history-panel { flex:none; min-width:0; margin-top:12px; }
.call-history-panel > .call-history-title { margin:0; padding:12px 0; font-size:16px; line-height:20px; font-weight:700; color:var(--c-text); background:#e6efe8; }
.call-history-panel #callHistory { max-height:110px; overflow-y:auto; overscroll-behavior-y:contain; scrollbar-width:thin; scrollbar-color:#a6c9b6 transparent; margin:0; padding:0; border-radius:0; white-space:normal; }
.call-history-panel .history-row { min-height:44px; padding:11px 12px; font-size:13px; line-height:21px; }
.call-history-panel #callHistoryEmpty { margin:0; padding:8px 0 16px; }
@media (max-width:899px) {
 .call-history-panel { margin-top:0; }
 .call-history-panel > .call-history-title { padding:12px 16px; }
 .call-history-panel .history-row { padding-left:16px; padding-right:16px; }
 .call-history-panel #callHistoryEmpty { padding:8px 16px 16px; }
}

/* Let short contact lists keep the journal directly below the new-contact row. */
.container[data-authenticated="true"] #contactsSection > .contacts-scroll {
 flex:0 1 auto; min-height:0; overflow-y:auto; padding-bottom:0;
}
.container[data-authenticated="true"] #contactsSection > .call-history-panel {
 flex:0 0 auto; margin-top:0;
}

/* Keep the inbox hint above navigation, leaving unused journal space open. */
.container[data-authenticated="true"] #contactsSection > #inboxStatus {
 flex:none; margin-top:auto;
}
.container[data-authenticated="true"] #contactsSection > .call-history-panel:has(#callHistory:empty) {
 flex:1 0 auto;
}

/* Use remaining screen space for history; retain a compact minimum beside long contact lists. */
.container[data-authenticated="true"] #contactsSection > .call-history-panel,
.container[data-authenticated="true"] #contactsSection > .call-history-panel:has(#callHistory:empty) {
 display:flex; flex-direction:column; flex:1 0 154px; min-height:154px; overflow:hidden;
}
.container[data-authenticated="true"] .call-history-panel > .call-history-title { flex:none; }
.container[data-authenticated="true"] .call-history-panel #callHistory {
 flex:1 1 auto; min-height:0; max-height:none; overflow-y:auto;
}

/* Short captions below mobile navigation icons. */
@media (max-width:899px) {
 .container[data-authenticated="true"] #accountNav.account-tabs button { flex-direction:column; gap:4px; }
 .container[data-authenticated="true"] #accountNav.account-tabs button::before { top:6px; height:32px; }
 .container[data-authenticated="true"] #accountNav.account-tabs .account-tab-label {
  display:block; position:relative; margin:0; font-size:10px; line-height:14px; font-weight:500; white-space:nowrap;
 }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] .account-tab-label { font-weight:600; }
}

/* Contact cards and desktop layout shared with the design. */

.contact-person { cursor:pointer; }
.contact-person:focus-visible { outline:2px solid var(--c-primary); outline-offset:2px; border-radius:8px; }
.contact-row > button.contact-message, .contact-row > button[data-call] { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; min-height:40px; padding:0; margin:0; background:#e0f0e7; color:var(--c-primary); border:0; border-radius:12px; font-size:0; }
.contact-row > button.contact-message::before, .contact-row > button[data-call]::before { content:none; }
.contact-row > button svg { display:block; }
.contact-card-dialog { padding:0; border:0; border-radius:20px; width:calc(100% - 32px); max-width:380px; color:#173b2c; background:#f7faf8; }
.contact-card-dialog::backdrop { background:#0c302970; }
.contact-card-close { display:grid; place-items:center; width:40px; height:40px; margin:8px 8px 0 auto; padding:0; background:transparent; color:#426354; font-size:26px; }
.contact-card-body { padding:4px 24px 28px; text-align:center; }
.contact-card-avatar { display:grid; place-items:center; width:88px; height:88px; margin:0 auto 16px; border-radius:50%; background:var(--c-av-green); color:white; font-size:34px; }
.contact-card-body h2 { margin:0 0 8px; font-size:24px; }
.contact-card-email { margin:0 0 24px; color:#6c8175; font-size:14px; overflow-wrap:anywhere; }
.contact-card-actions { display:flex; gap:12px; }
.contact-card-actions button { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; margin:0; padding:14px 8px; background:#e0f0e7; color:var(--c-primary); font-size:13px; }
.contact-card-body .card-delete { width:100%; margin:24px 0 0; padding:12px; color:#c63c32; background:#fbeae7; font-size:14px; }
.contact-chat-dialog { position:fixed; inset:0; width:100%; max-width:none; height:100dvh; max-height:none; margin:0; padding:0; border:0; border-radius:0; background:#e6efe8; color:#173b2c; }
.contact-chat-dialog[open] { display:flex; flex-direction:column; }
.contact-chat-header { display:flex; align-items:center; gap:12px; flex:none; height:64px; padding:0 12px; background:var(--c-primary); color:white; }
.contact-chat-header button { display:grid; place-items:center; width:40px; height:40px; margin:0; padding:0; background:transparent; color:white; }
.contact-chat-header h2 { margin:0; font-size:18px; }
.contact-chat-thread { flex:1; min-height:0; overflow-y:auto; padding:24px 16px; }
.contact-chat-hint { margin:20px auto; max-width:250px; text-align:center; color:#6c8175; font-size:13px; }
.contact-chat-compose { display:flex; gap:10px; padding:12px 12px max(12px,env(safe-area-inset-bottom)); background:#f4f8f5; }
.contact-chat-compose input { flex:1; min-width:0; height:44px; margin:0; padding:0 14px; border:1px solid var(--c-line); border-radius:24px; background:white; font:14px Inter,Arial,sans-serif; }
.contact-chat-compose button { display:grid; place-items:center; flex:0 0 44px; height:44px; margin:0; padding:0; border-radius:50%; background:var(--c-primary); }
.contact-chat-bubble { width:fit-content; max-width:85%; margin:0 0 12px auto; padding:12px 14px; background:#d1eddf; border-radius:14px 14px 3px 14px; font-size:14px; overflow-wrap:anywhere; }


@media (min-width:900px) {
 .container[data-authenticated="true"] #accountNav.account-tabs { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; left:0; top:56px; bottom:auto; width:340px; height:64px; padding:0 6px; gap:0; background:var(--c-primary); border:0; }
 .container[data-authenticated="true"] #accountNav.account-tabs button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; margin:0; padding:6px 0; min-width:0; background:transparent; border:0; border-bottom:3px solid transparent; color:#bfe6d1; border-radius:0; }
 .container[data-authenticated="true"] #accountNav.account-tabs #messagesTab { display:flex; }
 .container[data-authenticated="true"] #accountNav.account-tabs .account-tab-icon { display:block; width:22px; height:22px; margin:0; }
 .container[data-authenticated="true"] #accountNav.account-tabs .account-tab-label { display:block; font-size:10px; line-height:14px; white-space:nowrap; }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] { color:white; border-bottom-color:#bfe6d1; background:#ffffff0d; }
 .container[data-authenticated="true"] #accountNav.account-tabs button:hover { color:white; background:#ffffff12; }
 #accountSection > #contactsSection { top:120px; }
 .contact-card-dialog { width:380px; box-shadow:0 24px 80px #082e3526; }
 .contact-chat-dialog { inset:40px 40px 40px 380px; width:auto; height:auto; max-height:calc(100dvh - 80px); border:1px solid var(--c-line); border-radius:20px; box-shadow:0 24px 80px #082e3526; }
}


@media (min-width:900px) {
 .container[data-authenticated="true"]::after { content:""; position:fixed; top:0; bottom:0; left:339px; width:1px; background:var(--c-line); z-index:30; pointer-events:none; }
 .container[data-authenticated="true"] #accountSection > #contactsSection { padding:0; border-right:0; background:#e6efe8; }
 .container[data-authenticated="true"] #contactsSection > .small { flex:none; margin:0; padding:16px; }
 .container[data-authenticated="true"] #contactsSection > .contacts-scroll { margin:0; padding:0; }
 .container[data-authenticated="true"] #contactsSection .contacts-list-title,
 .container[data-authenticated="true"] #contactsSection .call-history-title {
  margin:0; padding:16px; background:#e6efe8; color:var(--c-text); font-family:Inter,Arial,sans-serif;
  font-size:16px; line-height:20px; font-weight:700; letter-spacing:normal; text-transform:none; border:0; box-shadow:none;
 }
 .container[data-authenticated="true"] #contactsSection .contact-row { padding:10px 16px; }
 .container[data-authenticated="true"] #contactsSection #openContact.new-contact-row { width:100%; margin:0; padding:10px 16px; }
 .container[data-authenticated="true"] #contactsSection > .call-history-panel { width:100%; margin:0; background:#e6efe8; }
 .container[data-authenticated="true"] #contactsSection .call-history-panel #callHistory { width:100%; background:white; }
 .container[data-authenticated="true"] #contactsSection .call-history-panel .history-row { padding-left:16px; padding-right:16px; }
 .container[data-authenticated="true"] #contactsSection #contactEmpty,
 .container[data-authenticated="true"] #contactsSection #callHistoryEmpty { margin:0; padding:12px 16px; }
 .container[data-authenticated="true"] #contactsSection > #inboxStatus { margin-left:0; margin-right:0; padding:12px 16px; background:#e6efe8; }
}


@media (min-width:900px) {
 .container[data-authenticated="true"] #contactsSection > .contacts-scroll { width:100%; min-width:0; margin:0; padding:0; overflow-x:hidden; }
 .container[data-authenticated="true"] #contactsSection #contactList { width:100%; min-width:0; margin:0; padding:0; }
 .container[data-authenticated="true"] #contactsSection .contact-row { box-sizing:border-box; width:100%; min-width:0; margin:0; padding:10px 16px; gap:12px; background:white; }
 .container[data-authenticated="true"] #contactsSection .contact-row > .contact-person { min-width:0; margin:0; }
 .container[data-authenticated="true"] #contactsSection #openContact.new-contact-row { box-sizing:border-box; width:100%; margin:0; padding:10px 16px; }
 .container[data-authenticated="true"] #contactsSection #callHistory { overflow-x:hidden; }
}
/* Messaging UI: drafts only until the messaging service is implemented. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.search-person { display:flex; align-items:center; gap:12px; padding:16px; background:white; border-bottom:1px solid #e6efea; }
.search-person > .avatar { flex:0 0 44px; width:44px; height:44px; }
.search-person-info { flex:1; min-width:0; }
.search-person-info strong { display:block; font-size:16px; font-weight:600; }
.search-person-info small { display:block; margin-top:4px; font-size:12px; color:#6c8175; overflow-wrap:anywhere; }
.search-person button { width:auto; flex:none; margin:0; padding:10px 12px; background:#e0f0e7; color:var(--c-primary); font-size:13px; }
.message-search { display:block; margin:0; padding:12px 16px; background:white; }
.message-search input { height:44px; margin:0; padding:0 14px; border:1px solid var(--c-line); border-radius:14px; background:var(--c-bg); }
.message-sidebar { min-height:0; overflow-y:auto; background:white; }
.message-empty { padding:24px 16px; margin:0; color:#6c8175; font-size:14px; text-align:center; }
.conversation { display:flex; flex-direction:column; min-width:0; min-height:0; background:#e6efe8; }
.conversation-header { display:flex; align-items:center; gap:12px; height:72px; flex:none; padding:12px 24px; background:#f7faf8; border-bottom:1px solid var(--c-line); }
.conversation-header h2 { margin:0; font-size:18px; overflow-wrap:anywhere; }
.conversation-header .avatar { width:40px; height:40px; flex:0 0 40px; }
.message-back { display:grid; place-items:center; width:40px; height:40px; flex:none; padding:0; margin:0; background:transparent; color:var(--c-primary); }
.conversation-thread { flex:1; min-height:0; overflow-y:auto; }
.message-unavailable { margin:0; padding:10px 16px 0; background:#f4f8f5; color:#6c8175; font-size:12px; }
.message-compose { display:flex; gap:10px; padding:12px 16px; background:#f4f8f5; }
.message-compose input { flex:1; min-width:0; height:44px; margin:0; border-radius:24px; padding:0 16px; background:white; }
.message-compose button { display:grid; place-items:center; width:44px; height:44px; flex:0 0 44px; margin:0; padding:0; border-radius:50%; }
.conversation-welcome { align-self:center; text-align:center; color:#6c8175; padding:32px; }
.conversation-welcome h2 { color:var(--c-primary); }
.contact-row > button.contact-message::before { content:''; display:block; width:22px; height:22px; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M21 11a8 8 0 0 1-8 8H7l-4 3V11a9 9 0 1 1 18 0Z'/%3E%3Cpath d='M8 10h8M8 14h5'/%3E%3C/svg%3E") center/contain no-repeat; }
.contact-row > button[data-call]::before { content:''; }
@media (min-width:900px) {
 .container[data-authenticated="true"][data-tab="messages"] #messagesSection.messaging { position:fixed; inset:0; z-index:1; display:grid; grid-template-columns:340px minmax(0,1fr); grid-template-rows:1fr; max-height:none; width:auto; margin:0; padding:0; border-radius:0; }
 .messaging .message-sidebar { padding-top:120px; border-right:1px solid var(--c-line); }
 .messaging .conversation, .messaging .conversation-welcome { grid-column:2; grid-row:1; }
 .messaging .message-back { display:none; }
 .container[data-tab="messages"] > #status, .container[data-tab="messages"] > .footer-note { display:none; }
 .messaging .message-sidebar { padding-bottom:0; }
}
@media (max-width:899px) {
 .container[data-authenticated="true"][data-tab="messages"] #messagesSection.messaging { flex:1; min-height:0; margin:0; padding:0; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; text-align:left; }
 .messaging .message-sidebar { flex:1; }
 .messaging .conversation-welcome { display:none; }
 .container[data-tab="messages"][data-conversation="true"] > header,
 .container[data-tab="messages"][data-conversation="true"] .message-sidebar,
 .container[data-authenticated="true"][data-tab="messages"][data-conversation="true"] #accountNav { display:none; }
 .container[data-authenticated="true"][data-tab="messages"][data-conversation="true"] { padding-bottom:0; }
 .messaging .conversation { flex:1; }
 .conversation-header { height:64px; padding:8px 12px; background:var(--c-primary); color:white; }
 .conversation-header .message-back { color:white; }
 .message-compose { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
}
/* The desktop messages panel fills the viewport independently of generic cards. */
@media (min-width:900px) {
 .container[data-authenticated="true"][data-tab="messages"] #accountSection > #messagesSection.messaging {
  position:fixed; inset:0; width:100vw; height:100dvh; min-height:0; max-height:none;
  margin:0; padding:0; align-self:stretch; justify-self:stretch;
  display:grid; grid-template-columns:340px minmax(0,1fr); grid-template-rows:minmax(0,1fr);
  align-items:stretch; overflow:hidden; background:transparent;
 }
 #messagesSection.messaging > .message-sidebar { grid-column:1; grid-row:1; align-self:stretch; height:100%; min-height:0; padding-top:120px; padding-bottom:0; }
 #messagesSection.messaging > .conversation { grid-column:2; grid-row:1; height:100%; align-self:stretch; }
 #messagesSection.messaging > .conversation-welcome { grid-column:2; grid-row:1; height:100%; margin:0; display:flex; flex-direction:column; align-items:center; justify-content:center; align-self:stretch; background:transparent; }
}

.search-person button.write-message { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; padding:0; border-radius:12px; }
.search-person button.write-message svg { display:block; }

/* Consistent section headings in contacts and call history. */
.container #contactsSection .contacts-list-title,
.container #contactsSection .call-history-title {
 font-family:Inter,Arial,sans-serif; font-size:16px; line-height:20px; font-weight:700;
 letter-spacing:normal; text-transform:none; color:var(--c-text);
}

.brand-mark:has(.cucumber-brand-icon), .welcome-symbol:has(.cucumber-brand-icon) { background:transparent; }
.cucumber-brand-icon { display:block; width:100%; height:100%; }

.contact-row > button[data-call]::before { content:none; }
.contact-row > button[data-call] .cucumber-call-icon { display:block; width:24px; height:24px; flex:none; }

/* Separate the desktop sidebar from the patterned conversation canvas. */
@media (min-width:900px) {
 .container[data-authenticated="true"] #accountSection > #contactsSection,
 .container[data-authenticated="true"] #contactsSection .contacts-list-title,
 .container[data-authenticated="true"] #contactsSection .call-history-title,
 .container[data-authenticated="true"] #contactsSection > .call-history-panel,
 .container[data-authenticated="true"] #contactsSection > #inboxStatus { background-color:#f3f7f4; }
 .container[data-authenticated="true"]::after { background:#c7d9ce; box-shadow:1px 0 4px #173b2c08; }
 .messaging .message-sidebar { border-right-color:#c7d9ce; }
}

/* Center message glyphs independently of the button's accessible text. */
.contact-row > button.contact-message { position:relative; }
.contact-row > button.contact-message::before,
.contact-row > button.contact-message > svg { position:absolute; inset:0; margin:auto; width:22px; height:22px; pointer-events:none; }

/* Center room actions independently of their hidden text labels. */
#roomInfo #copyLink, #roomInfo #shareRoom { position:relative; display:grid; place-items:center; }
#roomInfo #copyLink .room-action-icon, #roomInfo #shareRoom .room-action-icon { position:absolute; inset:0; margin:auto; display:block; width:20px; height:20px; pointer-events:none; }
#roomInfo #copyLink::before, #roomInfo #shareRoom::before { content:none; }

@media (min-width:900px) { #messagesSection.messaging .conversation-header .message-back { display:grid; place-items:center; } }
.message-bubble { max-width:80%; width:fit-content; margin:12px 16px; padding:10px 14px; border-radius:14px 14px 14px 3px; background:white; overflow-wrap:anywhere; }
.message-bubble.outgoing { margin-left:auto; background:#d1eddf; border-radius:14px 14px 3px 14px; }
.message-bubble p { white-space:pre-wrap; margin:0 0 4px; font-size:14px; line-height:1.5; }
.message-bubble small { display:block; text-align:right; font-size:10px; color:#597364; }
.message-bubble button { width:auto; padding:6px 10px; margin:6px 0 0; font-size:12px; }
.load-older { display:block; width:auto; margin:12px auto; padding:8px 16px; font-size:12px; background:#e0f0e7; color:var(--c-primary); }
.unread-count { flex:none; min-width:22px; height:22px; padding:2px 6px; border-radius:12px; background:var(--c-primary); color:white; text-align:center; font-size:12px; }
#accountNav #messagesTab.has-unread .account-tab-icon { filter:drop-shadow(0 0 3px #95d8a0); }
#accountNav #messagesTab.has-unread::after { content:''; position:absolute; top:8px; right:calc(50% - 20px); width:8px; height:8px; border-radius:50%; background:#d6ed62; border:1px solid var(--c-primary); }
#accountNav #messagesTab { position:relative; }
.conversation-header .message-security { width:auto; flex:none; margin:0 0 0 auto; padding:6px; background:transparent; color:var(--c-primary); font-size:11px; }
@media(max-width:899px){.conversation-header .message-security{color:white;max-width:90px;}}
/* Keep mobile conversation chrome in the visible area above the keyboard. */
@media (max-width:899px) {
 body:has(.container[data-tab="messages"][data-conversation="true"]) { overflow:hidden; }
 .container[data-authenticated="true"][data-tab="messages"][data-conversation="true"] {
  position:fixed; top:var(--conversation-viewport-top,0px); left:0; right:0;
  width:100%; height:var(--conversation-viewport-height,100dvh); min-height:0; max-height:none;
  margin:0; padding:0; overflow:hidden;
 }
 .container[data-tab="messages"][data-conversation="true"] #accountSection,
 .container[data-tab="messages"][data-conversation="true"] #messagesSection.messaging,
 .container[data-tab="messages"][data-conversation="true"] .conversation { min-height:0; overflow:hidden; border-radius:0; }
 .conversation-header, .message-unavailable, .message-compose { flex-shrink:0; }
 .conversation-thread { flex:1 1 0; min-height:0; overscroll-behavior-y:contain; overflow-anchor:auto; }
}
button.chat-contact-row { width:100%; margin:0; border:0; border-bottom:1px solid #e6efea; border-radius:0; text-align:left; color:#173b2c; background:white; font-family:inherit; }
button.chat-contact-row:hover { background:var(--c-bg); }
button.chat-contact-row:focus-visible { outline:2px solid var(--c-primary); outline-offset:-3px; }
button.chat-contact-row .search-person-info { text-align:left; }
/* Unread badge stays next to the chat icon on mobile and desktop. */
#accountNav.account-tabs #messagesTab.has-unread::after {
 content:attr(data-unread); display:grid; place-items:center; position:absolute;
 top:4px; right:calc(50% - 25px); width:auto; min-width:18px; height:18px;
 padding:0 4px; border:2px solid var(--c-primary); border-radius:10px;
 background:#d6ed62; color:#173b2c; font:700 10px/1 Inter,Arial,sans-serif; pointer-events:none;
}
@media(max-width:899px){#accountNav.account-tabs #messagesTab.has-unread::after{border-color:white;}}

/* Compact, vertically centered conversation titles, including long addresses. */
#messagesSection .conversation-header { align-items:center; }
#messagesSection .conversation-header #conversationName { flex:1; min-width:0; margin:0; font-size:16px; line-height:22px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; align-self:center; }
@media(max-width:899px){
 #messagesSection .conversation-header { gap:10px; }
 #messagesSection .conversation-header .message-security { max-width:76px; font-size:10px; line-height:13px; }
}

/* A fixed circular send action cannot shrink with its input. */
#messagesSection .message-compose { align-items:center; }
#messagesSection .message-compose > button { box-sizing:border-box; flex:0 0 44px; width:44px; min-width:44px; max-width:44px; height:44px; min-height:44px; max-height:44px; aspect-ratio:1; padding:0; border:0; border-radius:50%; display:flex; align-items:center; justify-content:center; }
#messagesSection .message-compose > button > svg { flex:none; display:block; width:22px; height:22px; min-width:22px; min-height:22px; margin:0; }
.conversation-header .conversation-add-contact { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; margin:0; padding:0; background:#e0f0e7; color:var(--c-primary); border-radius:10px; }
.conversation-header .conversation-add-contact svg { display:block; flex:none; }
@media(max-width:899px){.conversation-header .conversation-add-contact{background:#ffffff20;color:white;}}

/* The add-contact action must not be clipped by the shrinking contacts scroller. */
.container[data-authenticated="true"] #contactsSection > #openContact.new-contact-row {
 flex:0 0 auto; width:100%; min-height:60px; margin:0; padding:10px 16px;
}
@media(max-width:899px){
 .container[data-authenticated="true"] #contactsSection > .call-history-panel,
 .container[data-authenticated="true"] #contactsSection > .call-history-panel:has(#callHistory:empty) { flex-shrink:1; min-height:88px; }
 .container[data-authenticated="true"] #contactsSection > .contacts-scroll { overflow-x:hidden; -webkit-overflow-scrolling:touch; }
}

/* Compact empty address-book guidance. */
.container #contactsSection #contactEmpty { margin:0; padding:6px 16px 12px; }
.container #contactsSection:has(#contactEmpty:not([hidden])) .contacts-list-title { padding-bottom:8px; }

@media(max-width:899px){.container[data-tab="profile"] .profile-logout-bar { background:transparent; }}
.conversation-header .conversation-add-contact { margin-left:auto; }
.contact-card-body .person-verify { width:100%; margin:20px 0 0; padding:12px; background:#e0f0e7; color:var(--c-primary); font-size:14px; }
.encryption-dialog { width:calc(100% - 32px); max-width:480px; max-height:85dvh; padding:24px; overflow-y:auto; }
.encryption-dialog h2 { font-size:20px; margin:0 0 12px; }
.encryption-dialog p, .encryption-dialog li { font-size:14px; line-height:1.5; }
.encryption-dialog ol { padding-left:22px; }
.encryption-peer { overflow-wrap:anywhere; font-weight:600; }
.encryption-code { display:block; padding:16px; margin:16px 0; border-radius:12px; background:#e0f0e7; color:#173b2c; font:600 15px/1.8 ui-monospace,monospace; text-align:center; overflow-wrap:anywhere; user-select:all; }
#conversationName[role="button"] { cursor:pointer; }
#conversationName[role="button"]:focus-visible { outline:2px solid currentColor; outline-offset:4px; border-radius:4px; }
.profile-devices { margin:20px auto; padding:0 24px; max-width:400px; text-align:center; }
.profile-devices button { width:100%; }
.profile-devices > #messageDevices,.profile-devices > #messageDevicesHint { display:none; }
@media(max-width:899px){
 .container[data-tab="profile"] #profileSection .profile-devices { max-width:480px; margin:28px auto 0; padding:0; text-align:left; }
 .profile-device-panel > h2 { display:block; margin:0 0 12px; font:700 18px/24px Inter,Arial,sans-serif; }
 .profile-device-panel p { font-size:13px; line-height:20px; }
 .profile-device-panel .device-row { padding:16px; margin:0 0 12px; border:0; border-radius:12px; background:white; }
 .profile-device-panel .device-row strong { font-size:14px; overflow-wrap:anywhere; }
}
@media(min-width:900px){
 .profile-devices > #messageDevices,.profile-devices > #messageDevicesHint { display:none; }
 .profile-device-panel { text-align:left; }
 .profile-device-panel > h2 { margin:0 -16px 12px; padding:16px; background:#f3f7f4; color:var(--c-text); font:700 16px/20px Inter,Arial,sans-serif; }
 .profile-device-panel p { font-size:13px; line-height:20px; }
 .profile-device-panel .device-row { padding:16px 0; }
 .profile-device-panel .device-row strong { font-size:14px; overflow-wrap:anywhere; }
}
.room-history-panel { display:none; }
@media (max-width:899px) {
 .container[data-tab="room"][data-call="false"] #accountSection { overflow-y:auto; }
 .container[data-tab="room"][data-call="false"] #roomSection { flex:none; min-height:0; padding:36px 24px; overflow:visible; }
 .room-history-panel:not([hidden]) { display:block; flex:none; margin:0; padding:0 0 16px; background:#f3f7f4; }
 .room-history-panel > .room-history-info { display:none; }
 .container .room-history-panel h3 { margin:0; padding:16px; font:700 16px/20px Inter,Arial,sans-serif; letter-spacing:normal; text-transform:none; color:var(--c-text); }
 .room-history-panel > p { margin:0; padding:0 16px 12px; }
 .room-history-panel > p:empty { display:none; }
 .room-history-list { max-height:300px; overflow-y:auto; }
 .room-history-list .history-row { margin:0; padding:12px 16px; background:#fff; gap:12px; }
}
@media (min-width:900px) {
 .container[data-tab="room"] #accountSection > #contactsSection { display:none; }
 .room-history-panel:not([hidden]) {
  display:flex; flex-direction:column; position:fixed; left:0; top:112px; bottom:60px;
  width:var(--sidebar-width); background:#f3f7f4; border-right:1px solid var(--c-line); overflow:hidden;
 }
 .container .room-history-panel h3 { flex:none; margin:0; padding:16px; font-family:Inter,Arial,sans-serif; font-size:16px; line-height:20px; font-weight:700; color:var(--c-text); letter-spacing:normal; text-transform:none; }
 .room-history-panel > .room-history-info { flex:none; margin:0; padding:16px; font-size:12px; line-height:17px; }
 .room-history-panel > p { margin:0; padding:0 16px 12px; }
 .room-history-panel > p:empty { display:none; }
 .room-history-list { overflow-y:auto; min-height:0; }
 .room-history-list .history-row { margin:0; padding:12px 16px; background:white; gap:12px; }
}
@media (min-width:900px) {
 .container[data-tab="profile"] #accountSection > #contactsSection { display:none; }
 .container[data-tab="profile"] #accountSection > #profileSection:not([hidden]) {
  position:fixed; left:0; top:112px; bottom:60px; width:var(--sidebar-width);
  max-width:none; margin:0; padding:20px 16px; border-radius:0;
  border-right:1px solid var(--c-line); background:#f2f7f4; overflow-y:auto;
 }
 .container[data-tab="profile"] #profileSection > .profile-devices { margin:0; padding:0; max-width:none; }
}
.device-dialog { width:calc(100% - 32px); max-width:480px; max-height:85dvh; overflow-y:auto; padding:24px; }
.device-dialog h2 { margin-top:0; }
.device-dialog p { font-size:14px; line-height:1.5; }
.device-row { padding:16px 0; border-top:1px solid var(--c-line); }
.device-row > button { width:100%; }
.device-confirm { display:flex; align-items:flex-start; gap:10px; font-size:13px; }
.device-confirm input { width:18px; min-width:18px; max-width:18px; min-height:18px; height:18px; padding:0; margin:2px 0 0; flex:none; accent-color:var(--green); }
.device-request-banner {
 position:fixed; z-index:40; top:calc(12px + env(safe-area-inset-top,0px)); left:50%; transform:translateX(-50%);
 width:calc(100% - 24px); max-width:480px; max-height:calc(100dvh - 32px); overflow-y:auto;
 background:#fff; color:#142e23; border:1px solid #c6dfd1; border-radius:16px; box-shadow:0 8px 32px #123a292b;
}
.device-request-banner > summary { cursor:pointer; padding:16px 20px; font-size:14px; font-weight:700; color:var(--c-primary-dark); }
.device-request-body { padding:0 20px 16px; }
.device-request-body .device-row { border-top:1px solid var(--c-line); padding:14px 0 0; }
.device-request-body p { font-size:14px; line-height:1.5; }
.device-request-body .encryption-code { overflow-wrap:anywhere; font-size:13px; }
.device-request-banner > p { margin:0; padding:0 20px 16px; font-size:13px; }
.device-request-banner > p:empty { display:none; }
.device-request-announcement { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); }
.device-request-banner {
 top:0; left:0; transform:none; width:100%; max-width:none;
 padding:calc(14px + env(safe-area-inset-top,0px)) 16px 16px;
 border:0; border-bottom:1px solid var(--c-av-green); border-radius:0 0 20px 20px;
 background:var(--c-call-bg); color:#fff; animation:device-request-slide .2s ease-out;
}
.device-request-banner > h2 { margin:0 0 8px; font-size:16px; line-height:22px; color:#fff; }
.device-request-banner .device-request-body { padding:0; }
.device-request-banner .device-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:0; border:0; }
.device-request-banner .device-row p { grid-column:1/-1; margin:0; color:#d5f0e2; }
.device-request-banner .device-row button { grid-column:2; grid-row:3; margin:0; min-height:48px; border-radius:24px; background:#48c28d; color:#083b29; }
.device-request-banner .device-row button.secondary { grid-column:1; background:#d63c30; color:#fff; }
.device-request-banner .device-row .device-request-name { color:#fff; font-weight:600; overflow-wrap:anywhere; }
.device-request-banner .device-row button.secondary:hover { background:#bc3026; }
.device-request-banner .device-row button { display:flex; align-items:center; justify-content:center; gap:8px; }
.device-decision-icon,.device-decision-icon svg { display:block; width:20px; height:20px; flex:none; }
.device-request-banner > p { padding:8px 0 0; }
@keyframes device-request-slide { from { transform:translateY(-100%); } to { transform:translateY(0); } }
@media(prefers-reduced-motion:reduce){.device-request-banner { animation:none; }}
#diagnostics .settings-microphone .incoming-sound-heading { margin:20px 0 10px; }
@media (min-width:900px) {
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone h2 {
  margin:0 -16px 12px; padding:16px; background:#f3f7f4; color:var(--c-text);
  font-family:Inter,Arial,sans-serif; font-size:16px; line-height:20px; font-weight:700;
  letter-spacing:normal; text-transform:none;
 }
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone h2.incoming-sound-heading { margin-top:12px; }
}
@media (min-width:900px) {
 .container[data-tab="diagnostics"] #accountSection > #contactsSection { display:none; }
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone {
  position:fixed; left:0; top:112px; bottom:60px; width:var(--sidebar-width);
  display:block; margin:0; padding:0 16px 20px; overflow-y:auto;
  background:#fff; border:0; border-right:1px solid var(--c-line); border-radius:0;
 }
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone h2 { margin:0 -16px 12px; }
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone p { margin:0 0 16px; font-size:13px; line-height:20px; }
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone button { display:block; width:100%; min-height:44px; margin:0 0 12px; flex:none; }
 .container[data-tab="diagnostics"] #diagnostics .settings-microphone #incomingSoundStatus { margin:4px 0 0; }
 .container[data-tab="diagnostics"] #diagnostics .settings-logs { padding-top:0; }
}

#authForm #passwordConfirmField { margin-bottom: 20px; }
#authForm #passwordConfirmField > label { margin-top: 16px; }
.password-requirements { margin:8px 0; padding:0; list-style:none; color:var(--muted); font-size:12px; line-height:1.5; }
.password-requirements li { margin:4px 0; }
.password-requirements [data-valid="true"] { color:var(--green); }
#registrationPasswordHelp > .small { font-size:12px; margin:8px 0 16px; }
.registration-trap { position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden; }
.profile-security { margin:20px auto; padding:0 24px; max-width:400px; }
.profile-security > .small { margin:8px 0 0; font-size:12px; }
#recoveryCodesText { display:block; width:100%; min-width:0; padding:10px; border:1px solid var(--line); border-radius:12px; background:#f2f7f4; color:inherit; font:11px/1.8 ui-monospace,monospace; resize:none; }
.recovery-code-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#openPasswordRecovery { margin-top:0; font-size:13px; }
#authForm #recoveryCodeField > label { margin-top:16px; }
@media(max-width:899px){
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header { display:flex; align-items:center; gap:12px; min-height:0; padding:20px 24px; }
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header .brand-mark { width:40px; height:40px; margin:0; flex:none; }
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header h1 { margin:0; font-size:24px; }
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header .intro { display:none; }
}
@media(min-width:900px){.container[data-tab="profile"] #profileSection > .profile-security { margin:20px 0 0; padding:0; max-width:none; }}

/* Device management requires an explicit password and replacement selection. */
.device-dialog label:not(.device-confirm) { display:block; margin:16px 0; font-size:14px; line-height:1.5; }
.device-dialog label[hidden] { display:none; }
.device-dialog label input:not([type="checkbox"]):not([type="radio"]), .device-dialog label select { display:block; width:100%; box-sizing:border-box; margin-top:6px; min-height:44px; padding:10px 12px; border:1px solid #c9ddd3; border-radius:10px; background:white; color:#142b22; font:inherit; }

.device-dialog label .password-field { margin-top:6px; }
.device-dialog label .password-field input { margin-top:0; padding-right:48px; }

.device-action-result:empty, .profile-device-panel > .error:empty { display:none; }
.device-action-result { padding:12px; border-radius:10px; background:#def2e6; color:var(--c-primary-dark); font-size:14px; }

@media(max-width:899px){
 dialog.device-dialog.dialog-viewport-fit {
  position:fixed; inset:auto; left:50%;
  top:calc(var(--dialog-visible-top,0px) + var(--dialog-visible-height,100dvh) / 2);
  transform:translate(-50%,-50%); margin:0; box-sizing:border-box;
  max-height:calc(var(--dialog-visible-height,100dvh) - 24px);
  overflow-y:auto; scroll-behavior:auto;
 }
}

.password-changed-dialog { position:fixed; text-align:center; }
.password-changed-dialog h2 { margin:16px 24px 12px; }
.password-changed-symbol { display:grid; place-items:center; width:56px; height:56px; margin:0 auto; border-radius:50%; color:#177d53; background:#def2e6; }
.password-changed-close { position:absolute; top:8px; right:8px; width:40px; min-height:40px; margin:0; padding:0; background:transparent; color:#607568; font-size:28px; }
.password-changed-close:hover { background:var(--c-tint); }

/* Keep a full 39-character recovery code visible on narrow phones. */
#authSection:not([hidden]) #recoveryCode {
 font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
 font-size:clamp(10px,3.2vw,13px); letter-spacing:0; padding-inline:10px;
}

#authDeviceState.is-error { padding:12px 14px; border-left:3px solid #c5483d; border-radius:8px; background:#fff0ee; color:#96382f; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }

.device-replacement-summary { margin:16px 0; padding:12px 14px; border:1px solid var(--c-line); border-radius:10px; background:#f2f7f4; }
.device-replacement-summary[hidden] { display:none; }
.device-replacement-summary span, .device-replacement-summary strong { display:block; overflow-wrap:anywhere; }
.device-replacement-summary span { margin-bottom:4px; font-size:12px; color:#607568; }
.device-replacement-summary strong { font-size:14px; color:#173b2c; }

#recoveryCodesReplaceField { margin:16px 0; padding:12px; border:1px solid var(--c-line); border-radius:10px; background:#f2f7f4; cursor:pointer; }
#recoveryCodesReplaceField strong { display:block; color:#173b2c; font-size:14px; line-height:1.4; }
#recoveryCodesReplaceField .replacement-hint { display:block; margin-top:3px; color:#607568; font-size:13px; line-height:1.4; }

/* Stage 5 authentication: a quiet shared surface and readable form states. */
.container:has(#authSection:not([hidden])) {
 display:flex; flex-direction:column; gap:24px; min-height:100dvh; height:auto;
 padding:calc(32px + env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) calc(16px + env(safe-area-inset-bottom,0px)) max(24px,env(safe-area-inset-left,0px));
 background:var(--c-bg); color:var(--c-text); overflow:visible;
}
.container:has(#authSection:not([hidden])) > header {
 display:block; position:static; width:100%; max-width:var(--size-form); height:auto; min-height:0;
 margin:0 auto; padding:0; background:transparent; color:var(--c-text); border:0;
}
.container:has(#authSection:not([hidden])) > header::before { content:none; }
.container:has(#authSection:not([hidden])) > header .eyebrow { display:none; }
.container:has(#authSection:not([hidden])) > header .brand-mark { width:64px; height:64px; margin:0 0 12px; }
.container:has(#authSection:not([hidden])) > header h1 { display:block; margin:0 0 8px; color:var(--c-text); font-size:36px; line-height:44px; letter-spacing:normal; }
.container:has(#authSection:not([hidden])) > header .intro { display:block; max-width:440px; margin:0; color:var(--c-text-2); font-size:17px; line-height:25px; }
.container:has(#authSection:not([hidden])) > header .intro::after { content:none; }
.container #authSection:not([hidden]) { flex:1 0 auto; width:100%; max-width:var(--size-form); margin:0 auto; padding:0; border-radius:0; background:transparent; }
.container #authSection:not([hidden]) #authTitle { margin:0 0 24px; font-size:20px; line-height:28px; font-weight:700; }
.container #authSection:not([hidden]) label { margin:16px 0 6px; color:var(--c-text-2); font-size:13px; line-height:18px; }
.container #authSection:not([hidden]) #authForm > label:first-child { margin-top:0; }
.container #authSection:not([hidden]) input { height:48px; border:1.5px solid var(--c-line); border-radius:12px; padding:0 16px; background:var(--c-surface); color:var(--c-text); font-size:16px; }
.container #authSection:not([hidden]) .password-field input { padding-right:48px; }
.container #authSection:not([hidden]) .password-toggle { width:44px; margin:0; padding:8px; color:var(--c-text-2); }
.container #authSection:not([hidden]) #passwordHint { margin:8px 0 20px; font-size:13px; line-height:18px; color:var(--c-text-2); }
.container #authSection:not([hidden]) #authSubmit { margin-top:16px; min-height:48px; font-size:15px; }
.container #authSection:not([hidden]) #authToggle,
.container #authSection:not([hidden]) #openPasswordRecovery { margin:12px 0 0; padding:12px 8px; font-size:14px; line-height:20px; background:transparent; color:var(--c-primary); }
.container #authSection:not([hidden]) #authToggle:hover,
.container #authSection:not([hidden]) #openPasswordRecovery:hover { background:var(--c-tint); }
.container #authSection:not([hidden]) .small { font-size:13px; line-height:20px; }
.container #authSection:not([hidden]) .password-requirements { font-size:12px; line-height:18px; margin:12px 0; }
.container #authSection:not([hidden]) #authError:not(:empty) { margin:16px 0 0; padding:12px 16px; border-radius:12px; color:var(--c-danger); background:var(--c-danger-bg); font-size:14px; line-height:20px; overflow-wrap:anywhere; }
.container #authSection:not([hidden]) #authMessage:not(:empty) { display:block; margin:16px 0 0; padding:12px 16px; border-radius:12px; color:var(--c-primary-dark); background:var(--c-tint); overflow-wrap:anywhere; }
.container:has(#authSection:not([hidden])) > .footer-note { display:block; margin:auto 0 0; padding:16px 0 0; background:transparent; color:var(--c-text-2); font-size:12px; line-height:18px; }
.container:has(#authSection:not([hidden])) #recoveryCode { font-size:clamp(10px,3vw,13px); padding-inline:10px; }
.auth-device-dialog, .password-changed-dialog { width:min(440px,calc(100% - 32px)); padding:24px; border-radius:24px; }
.auth-device-dialog h2 { font-size:20px; line-height:28px; }
.auth-device-dialog p { color:var(--c-text-2); font-size:14px; line-height:21px; overflow-wrap:anywhere; }
.auth-device-dialog #authDeviceState { padding:12px 16px; background:var(--c-tint); color:var(--c-primary-dark); border-radius:12px; }
.auth-device-dialog #authDeviceState.is-error { background:var(--c-danger-bg); color:var(--c-danger); }
@media (min-width:900px) {
 .container:has(#authSection:not([hidden])) { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:minmax(min-content,1fr) auto; gap:32px 40px; padding:48px; }
 .container:has(#authSection:not([hidden])) > header { grid-column:1; grid-row:1; align-self:center; text-align:center; }
 .container:has(#authSection:not([hidden])) > header .brand-mark { width:96px; height:96px; margin:0 auto 24px; }
 .container:has(#authSection:not([hidden])) > header h1 { font-size:36px; line-height:44px; margin:0 0 12px; }
 .container:has(#authSection:not([hidden])) > header .intro { margin:0 auto; }
 .container #authSection:not([hidden]) { grid-column:2; grid-row:1; align-self:center; width:100%; margin:0 auto; padding:0; }
 .container:has(#authSection:not([hidden])) > .footer-note { grid-column:1 / -1; grid-row:2; }
}
@media (max-width:899px) {
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header { display:flex; align-items:center; gap:12px; }
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header .brand-mark { width:40px; height:40px; flex:none; margin:0; }
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header h1 { margin:0; font-size:24px; line-height:32px; }
 .container[data-auth-mode="recover"]:has(#authSection:not([hidden])) > header .intro { display:none; }
}
@media (max-width:359px), (max-height:520px) {
 .container:has(#authSection:not([hidden])) { padding:16px; gap:20px; }
}

/* Stage 3 shell: four destinations, with settings nested under profile. */
/* Stage 6 chats: clean list, readable thread and a stable composer. */
.container[data-authenticated="true"][data-tab="messages"] { background:var(--c-bg); background-image:none; }
.container[data-authenticated="true"] #messagesSection.messaging { background:var(--c-bg); }
.container[data-authenticated="true"] #messagesSection .message-sidebar { background:var(--c-surface); }
.message-search { padding:12px 16px; margin:0; }
.container #messagesSection .message-search input { height:44px; min-height:44px; background:var(--c-bg); border:1px solid var(--c-line); border-radius:12px; padding:0 16px; font-size:16px; }
.container #messagesSection .search-person { min-height:80px; gap:12px; margin:0; padding:12px 16px; border-bottom:1px solid var(--c-line); background:var(--c-surface); color:var(--c-text); }
.container #messagesSection .search-person:hover { background:var(--c-bg); }
.chat-entry { display:flex; align-items:center; min-width:0; border-bottom:1px solid var(--c-line); background:var(--c-surface); }
.container #messagesSection .chat-entry > .chat-contact-row { flex:1; min-width:0; width:auto; border-bottom:0; }
.container #messagesSection .chat-call { display:grid; place-items:center; flex:0 0 44px; width:44px; min-height:44px; height:44px; margin:0 16px 0 0; padding:0; border-radius:12px; background:var(--c-primary); color:white; }
.chat-call .cucumber-call-icon { width:24px; height:24px; flex:none; }
.chat-call .cucumber-call-icon > path:nth-child(2) { stroke:var(--c-primary); }
.chat-call .cucumber-call-icon > g { fill:var(--c-primary); }
.container #messagesSection .search-person .avatar { flex:0 0 48px; width:48px; height:48px; background:var(--c-av-green); font-size:20px; }
.container #messagesSection .search-person-info { flex:1; min-width:0; }
.container #messagesSection .search-person-info strong { font-size:15px; line-height:22px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.container #messagesSection .search-person-info small { font-size:13px; line-height:18px; color:var(--c-text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.container #messagesSection .unread-count { display:grid; place-items:center; min-width:22px; height:22px; padding:0 6px; color:white; background:var(--c-primary); font-size:12px; line-height:18px; }
.container #messagesSection .message-empty { padding:24px 16px; color:var(--c-text-2); font-size:14px; line-height:21px; text-align:center; }
.container #messagesSection .conversation { background:var(--c-bg); }
.container #messagesSection .conversation-header { display:flex; align-items:center; gap:12px; flex:none; min-height:64px; height:auto; padding:10px 16px; background:var(--c-surface); color:var(--c-text); border-bottom:1px solid var(--c-line); }
.container #messagesSection .conversation-header .avatar { flex:0 0 40px; width:40px; height:40px; background:var(--c-av-green); font-size:18px; }
.container #messagesSection .conversation-header .message-back { flex:0 0 36px; width:36px; height:40px; min-height:40px; color:var(--c-primary); }
.container #messagesSection .conversation-header .conversation-add-contact { flex:0 0 40px; width:40px; height:40px; min-height:40px; background:var(--c-tint); color:var(--c-primary); }
.container #messagesSection .conversation-header .conversation-call { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; min-height:44px; margin:0; padding:0; background:var(--c-primary); color:white; border-radius:12px; }
.conversation-call .cucumber-call-icon { width:24px; height:24px; flex:none; }
.conversation-call .cucumber-call-icon > path:nth-child(2) { stroke:var(--c-primary); }
.conversation-call .cucumber-call-icon > g { fill:var(--c-primary); }
.container #messagesSection .conversation-thread { padding:16px; background:var(--c-bg); }
.container #messagesSection .message-bubble { width:fit-content; max-width:min(85%,520px); margin:0 0 12px; padding:10px 12px; background:var(--c-surface); color:var(--c-text); border-radius:16px 16px 16px 4px; }
.container #messagesSection .message-bubble.outgoing { margin-left:auto; background:var(--c-tint-strong); border-radius:16px 16px 4px 16px; }
.container #messagesSection .message-bubble:has(button) { background:var(--c-danger-bg); }
.container #messagesSection .message-bubble p { font-size:15px; line-height:22px; overflow-wrap:anywhere; }
.container #messagesSection .message-bubble small { margin-top:4px; color:var(--c-text-2); font-size:11px; line-height:16px; font-variant-numeric:tabular-nums; }
.container #messagesSection .message-bubble button { min-height:36px; margin:8px 0 0; padding:8px 12px; color:var(--c-danger); background:var(--c-danger-bg); font-size:13px; }
.container #messagesSection .load-older { min-height:40px; margin:0 auto 16px; padding:8px 16px; background:var(--c-tint); color:var(--c-primary); font-size:13px; }
.container #messagesSection .message-unavailable { margin:0; padding:8px 16px; background:var(--c-bg); color:var(--c-text-2); font-size:12px; line-height:18px; overflow-wrap:anywhere; }
.container #messagesSection .message-compose { display:flex; align-items:center; flex:none; gap:8px; padding:8px 16px max(12px,env(safe-area-inset-bottom,0px)); background:var(--c-bg); }
.container #messagesSection .message-compose input { min-height:48px; height:48px; padding:0 16px; background:var(--c-surface); border:1px solid var(--c-line); border-radius:24px; font-size:16px; }
.container #messagesSection .message-compose > button { flex:0 0 48px; width:48px; min-width:48px; max-width:48px; height:48px; min-height:48px; max-height:48px; }
.container #messagesSection .conversation-welcome { background:var(--c-bg); color:var(--c-text-2); }
@media (min-width:900px) {
 .container[data-authenticated="true"][data-tab="messages"] #accountSection > #messagesSection.messaging { background:var(--c-bg); }
 .container #messagesSection .conversation-thread { padding:24px max(24px,calc((100% - 760px)/2)); }
 .container #messagesSection .message-compose, .container #messagesSection .message-unavailable { padding-left:max(24px,calc((100% - 760px)/2)); padding-right:max(24px,calc((100% - 760px)/2)); }
}
/* Stage 7 rooms and calls: invitations remain distinct from direct calls. */
.container[data-authenticated="true"][data-tab="room"] { background:var(--c-bg); background-image:none; }
.container[data-authenticated="true"] #accountSection > #roomSection { background:transparent; text-align:center; }
.container[data-authenticated="true"] #roomSection .room-symbol { display:grid; place-items:center; width:88px; height:88px; margin:0 auto 20px; border-radius:50%; background:var(--c-tint); color:var(--c-primary); }
.container[data-authenticated="true"] #roomSection h2 { margin:0 0 12px; color:var(--c-text); font-size:24px; line-height:30px; }
.container[data-authenticated="true"] #roomSection .small { max-width:440px; margin:0 auto 24px; color:var(--c-text-2); font-size:14px; line-height:21px; }
.container[data-authenticated="true"] #roomSection #createRoom { width:100%; max-width:360px; min-height:48px; height:auto; margin:0; border-radius:12px; font-size:15px; }
.container #roomHistoryPanel { background:var(--c-bg); }
.container #roomHistoryPanel .contacts-list-title { padding:16px; color:var(--c-primary); background:var(--c-bg); font-size:16px; line-height:22px; }
.container #roomHistoryPanel .room-history-info { color:var(--c-text-2); font-size:13px; line-height:20px; }
.container #roomHistoryPanel .room-history-list { min-height:0; overflow-y:auto; }
.container #roomHistoryPanel .history-row { min-height:48px; padding:12px 16px; gap:12px; background:var(--c-surface); color:var(--c-text-2); border-bottom:1px solid var(--c-line); }
.container #roomHistoryPanel .history-row span:first-child { min-width:0; overflow-wrap:anywhere; }
.container #roomHistoryError:not(:empty) { padding:12px 16px; color:var(--c-text-2); font-size:13px; line-height:20px; }
.container[data-direct-call="true"] #callSurface { background:var(--c-call-bg); color:var(--c-primary-ink); }
.container[data-direct-call="true"] #callSurface .call-avatar { width:128px; height:128px; flex:0 0 128px; margin:0; background:var(--c-call-accent); font-size:48px; }
.container[data-direct-call="true"] #callName { margin:24px 0 8px; font-size:28px; line-height:34px; }
.container[data-direct-call="true"] #callStatus { color:#ffffffd9; font-size:15px; line-height:22px; font-variant-numeric:tabular-nums; }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface { background:var(--c-bg); color:var(--c-text); }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface .call-main { width:100%; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px 16px; }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface #callName { max-width:100%; margin:20px 0 8px; color:var(--c-text); font-size:28px; line-height:34px; }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface #callStatus,
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface .room-waiting-label { max-width:480px; margin:0; color:var(--c-text-2); font-size:15px; line-height:22px; font-variant-numeric:tabular-nums; }
.container[data-call="true"] #callSurface .call-controls { gap:48px; }
.container[data-call="true"] #callSurface .call-controls #mute,
.container[data-call="true"] #callSurface .call-controls #hangup { display:grid; place-items:center; flex:0 0 64px; width:64px; height:64px; min-height:64px; padding:0; margin-bottom:30px; }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface #mute { background:var(--c-tint); color:var(--c-primary); }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface #mute[data-muted="true"] { background:var(--c-danger-bg); color:var(--c-danger); outline:2px solid var(--c-danger); }
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface #mute::after,
.container[data-call="true"]:not([data-direct-call="true"]) #callSurface #hangup::after { color:var(--c-text-2); }
.container #callSurface #playAudio { flex:1 0 100%; max-width:320px; min-height:48px; padding:12px 16px; background:var(--c-tint); color:var(--c-primary); font-size:14px; }
.container[data-host-room="true"] #callSurface #roomInfo { width:100%; max-width:640px; position:static; transform:none; margin:0 auto; padding:20px 16px; background:var(--c-surface); border:1px solid var(--c-line); border-radius:24px 24px 0 0; gap:12px; }
.container[data-host-room="true"] #callSurface #roomInfo label { color:var(--c-text-2); font-size:14px; line-height:20px; font-weight:600; }
.container[data-host-room="true"] #callSurface #roomLink { height:48px; min-height:48px; padding:0 12px; background:var(--c-bg); color:var(--c-text); border:1px solid var(--c-line); border-radius:12px; font-size:13px; }
.container[data-host-room="true"] #callSurface #copyLink,
.container[data-host-room="true"] #callSurface #shareRoom { width:48px; height:48px; min-height:48px; margin:0; padding:0; border-radius:12px; background:var(--c-primary); color:var(--c-primary-ink); }
.container[data-host-room="true"] #callSurface #roomInfo .small { color:var(--c-text-2); font-size:12px; line-height:18px; }
.container[data-host-room="true"] #callSurface .room-privacy-note { display:block; }
dialog#incomingSection { inset:8px 8px auto; width:calc(100% - 16px); max-width:440px; max-height:calc(100dvh - 16px); margin:env(safe-area-inset-top,0px) auto 0; padding:16px; border:0; border-radius:24px; background:var(--c-call-bg); box-shadow:var(--shadow-dialog); }
dialog#incomingSection .incoming-actions { gap:12px; }
dialog#incomingSection .incoming-actions button { min-width:0; min-height:48px; height:auto; padding:12px; font-size:14px; border-radius:12px; }
dialog#incomingSection #incomingEnableSound { margin-top:12px; background:var(--c-tint); color:var(--c-primary); font-size:14px; }
.container:has(#inviteSection:not([hidden])) #inviteSection { background:var(--c-surface); border:1px solid var(--c-line); border-radius:24px; }
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) { min-height:100dvh; padding:24px 16px; background:var(--c-bg); }
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) > header { min-height:0; padding:0; background:transparent; color:var(--c-text); }
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) > header .eyebrow,
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) > header .intro { display:none; }
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) > header .brand-mark { width:48px; height:48px; margin-bottom:12px; }
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) > header h1 { font-size:28px; }
.container[data-authenticated="false"]:has(#inviteSection:not([hidden])) #inviteSection { width:100%; max-width:440px; margin:24px auto; }
.container[data-authenticated="false"][data-call="true"] > header,
.container[data-authenticated="false"][data-call="true"] > .footer-note { display:none; }
.container[data-authenticated="false"][data-call="true"] #callSurface { position:fixed; inset:0; z-index:21; display:flex; flex-direction:column; width:100%; height:100dvh; min-height:0; margin:0; padding:24px 16px max(24px,env(safe-area-inset-bottom,0px)); border-radius:0; overflow-y:auto; }
.container[data-authenticated="false"][data-call="true"] #callSurface .call-main { flex:1; min-height:min-content; padding:24px 0; }
.container[data-authenticated="false"][data-call="true"] #callSurface .call-controls { flex:none; margin-top:40px; }
@media (min-width:900px) {
 dialog#incomingSection { left:calc(var(--size-rail) + 12px); right:auto; width:356px; margin:0; }
 .container[data-authenticated="true"][data-host-room="true"] #callSurface { padding:24px 24px 0; }
 .container[data-authenticated="true"] #roomHistoryPanel .room-history-list { max-height:none; flex:1; }
}
@media (max-width:899px) {
 .container[data-authenticated="true"][data-host-room="true"] #callSurface { padding:0; }
 .container[data-authenticated="true"][data-host-room="true"] #callSurface .call-main { flex:1 0 auto; }
}
@media (max-height:600px) {
 .container[data-call="true"] #callSurface .call-avatar { width:72px; height:72px; flex:0 0 72px; font-size:32px; }
 .container[data-call="true"] #callSurface .call-main { padding:16px; }
 .container[data-call="true"] #callSurface .call-controls { margin-top:20px; }
}
.nav-brand { display:none; }
.container[data-tab="contacts"] { --section-title:"Контакты"; }
.container[data-tab="messages"] { --section-title:"Чаты"; }
.container[data-tab="room"] { --section-title:"Комната"; }
.container[data-tab="profile"] { --section-title:"Профиль"; }
.container[data-tab="diagnostics"] { --section-title:"Настройки"; }
.container[data-authenticated="true"] > header h1 { display:none; }
.container[data-authenticated="true"] > header::before { content:var(--section-title); display:block; color:var(--c-text); font-size:20px; line-height:24px; font-weight:700; }
.profile-settings { margin:24px 0; }
.profile-settings h3 { text-transform:none; letter-spacing:normal; font-size:16px; }
.settings-back { width:auto; margin:0 0 16px; text-align:left; }

/* Stage 4 address book: shared rows, actions and contact dialogs. */
.container[data-authenticated="true"][data-tab="contacts"][data-call="false"] { background:var(--c-bg); background-image:none; }
.container[data-authenticated="true"] #accountSection > #contactsSection { background:var(--c-bg); }
.container[data-authenticated="true"] #contactsSection > .user-info { padding:16px; margin:0; font-size:13px; line-height:20px; color:var(--c-text-2); }
.container[data-authenticated="true"] #contactsSection .contacts-list-title,
.container[data-authenticated="true"] #contactsSection .call-history-title { padding:16px 16px 8px; margin:0; color:var(--c-primary); background:var(--c-bg); font-size:16px; line-height:22px; font-weight:600; }
.container[data-authenticated="true"] #contactsSection .contact-row { gap:8px; padding:8px 16px; min-height:68px; border-bottom:1px solid var(--c-line); background:var(--c-surface); }
.container[data-authenticated="true"] #contactsSection .contact-row > .contact-person {
 display:flex; align-items:center; gap:12px; flex:1; min-width:0; max-width:none; width:auto;
 min-height:48px; margin:0; padding:0; border:0; border-radius:0; background:transparent;
 color:var(--c-text); font-size:15px; line-height:22px; font-weight:600; text-align:left;
 overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
.container[data-authenticated="true"] #contactsSection .contact-row > .contact-person:hover { color:var(--c-primary); }
.contact-person-name { display:block; flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.container[data-authenticated="true"] #contactsSection .contact-row > .contact-person::before { width:48px; height:48px; flex:0 0 48px; font-size:20px; background:var(--c-av-green); }
.container[data-authenticated="true"] #contactsSection .contact-row:nth-child(3n + 2) > .contact-person::before { background:var(--c-av-amber); }
.container[data-authenticated="true"] #contactsSection .contact-row:nth-child(3n + 3) > .contact-person::before { background:var(--c-av-blue); }
.container[data-authenticated="true"] #contactsSection .contact-row > .contact-message { width:44px; height:44px; min-height:44px; flex:0 0 44px; border:1px solid var(--c-line); border-radius:50%; color:var(--c-primary); background:var(--c-surface); }
.container[data-authenticated="true"] #contactsSection .contact-row > button[data-call] { width:44px; height:44px; min-height:44px; flex:0 0 44px; border-radius:12px; color:var(--c-primary-ink); background:var(--c-primary); }
.container[data-authenticated="true"] #contactsSection .contact-row > .contact-message:hover { background:var(--c-tint); }
.container[data-authenticated="true"] #contactsSection .contact-row > button[data-call]:hover { background:var(--c-primary-dark); }
.contact-row button[data-call] .cucumber-call-icon > path:nth-child(2),
#personCall .cucumber-call-icon > path:nth-child(2) { stroke:var(--c-primary); }
.contact-row button[data-call] .cucumber-call-icon > g,
#personCall .cucumber-call-icon > g { fill:var(--c-primary); }
.container[data-authenticated="true"] #contactsSection > #openContact.new-contact-row { min-height:68px; gap:12px; padding:8px 16px; font-size:15px; background:var(--c-surface); border-bottom:1px solid var(--c-line); }
.container[data-authenticated="true"] #contactsSection > #openContact.new-contact-row:hover { background:var(--c-tint); }
.container[data-authenticated="true"] #contactsSection .new-contact-avatar { width:48px; height:48px; flex:0 0 48px; background:var(--c-tint); }
.container[data-authenticated="true"] #contactsSection .new-contact-plus { background:var(--c-tint); }
.container[data-authenticated="true"] #contactsSection #contactEmpty { padding:8px 16px 16px; background:var(--c-bg); font-size:13px; line-height:20px; }
.container[data-authenticated="true"] #contactsSection > .call-history-panel { background:var(--c-bg); }
.container[data-authenticated="true"] #contactsSection > .call-history-panel,
.container[data-authenticated="true"] #contactsSection > .call-history-panel:has(#callHistory:empty) { flex:1 0 164px; min-height:164px; }
.container[data-authenticated="true"] #contactsSection .call-history-panel .history-row { min-height:44px; padding:12px 16px; color:var(--c-text-2); border-bottom:1px solid var(--c-line); }
.container[data-authenticated="true"] #contactsSection #callHistoryEmpty { color:var(--c-text-2); background:var(--c-bg); }
.container[data-authenticated="true"] #contactsSection > #inboxStatus { background:var(--c-bg); color:var(--c-text-2); font-size:11px; line-height:16px; }
.contact-card-dialog { width:min(440px,calc(100% - 32px)); padding:24px; border-radius:24px; }
.contact-card-body { padding:16px 0 0; }
.contact-card-body .contact-card-avatar { width:128px; height:128px; margin:0 auto 16px; font-size:48px; background:var(--c-av-green); }
.contact-card-body h2 { font-size:24px; line-height:30px; overflow-wrap:anywhere; }
.contact-card-body .contact-card-email { margin:8px 0 24px; color:var(--c-text-2); font-size:14px; }
.contact-card-actions { gap:12px; }
.contact-card-actions button { min-width:0; min-height:80px; background:var(--c-tint); color:var(--c-primary); border-radius:12px; }
.contact-card-actions button:hover { background:var(--c-tint-strong); }
#personCall .cucumber-call-icon { width:22px; height:22px; flex:none; }
.contact-card-body .person-verify { margin:16px 0 0; background:var(--c-tint); color:var(--c-primary); }
.contact-card-body .card-delete { margin:12px 0 0; background:var(--c-danger-bg); color:var(--c-danger); }
#contactDialog, #deleteContactDialog { width:min(440px,calc(100% - 32px)); padding:24px; border-radius:24px; }
#contactDialog h2, #deleteContactDialog h2 { margin:0 0 16px; font-size:20px; line-height:28px; }
#contactDialog #closeContact { margin-top:12px; }
#contactError, #deleteContactError { overflow-wrap:anywhere; }
@media (max-width:639px) {
 #contactDialog, #deleteContactDialog { position:fixed; inset:auto 0 0; width:100%; max-width:none; max-height:calc(100dvh - env(safe-area-inset-top,0px) - 16px); margin:0; padding:24px 24px max(24px,env(safe-area-inset-bottom,0px)); border-radius:24px 24px 0 0; }
}
.container[data-authenticated="true"] > header { background:var(--c-surface); color:var(--c-text); border-bottom:1px solid var(--c-line); }
.container[data-authenticated="true"] #accountNav.account-tabs button { color:var(--c-text-2); }
.container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] { color:var(--c-primary); }
.container[data-authenticated="true"] #accountNav.account-tabs button:hover { background:var(--c-tint); }
.container[data-authenticated="true"] #accountNav.account-tabs button::before { display:none; }
.container[data-authenticated="true"] #accountNav.account-tabs .account-tab-label { display:block; font-size:11px; line-height:16px; }
.container[data-authenticated="true"] #accountNav.account-tabs .account-tab-icon { display:block; flex:none; width:24px; height:24px; }
@media (max-width:899px) {
 .container[data-authenticated="true"] #accountNav.account-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .container[data-authenticated="true"] #accountNav.account-tabs button { flex-direction:column; gap:4px; border-top:3px solid transparent; padding:4px 0; }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] { border-top-color:var(--c-primary); }
}
@media (min-width:900px) {
 .container[data-authenticated="true"] {
  --sidebar-width:380px;
  padding-left:var(--size-rail); width:100%; max-width:none;
  grid-template-columns:var(--sidebar-width) minmax(0,1fr);
  background:var(--c-bg); background-image:none;
 }
 .container[data-authenticated="true"]::after { left:calc(var(--size-rail) + var(--sidebar-width) - 1px); }
 .container[data-authenticated="true"][data-tab="diagnostics"]::after { display:none; }
 .container[data-authenticated="true"] > header {
  position:fixed; left:var(--size-rail); top:0; width:var(--sidebar-width); height:56px;
  min-height:0; margin:0; padding:16px; z-index:12;
 }
 .container[data-authenticated="true"] #accountNav.account-tabs {
  position:fixed; inset:0 auto 0 0; width:var(--size-rail); height:100dvh;
  display:flex; flex-direction:column; align-items:stretch; gap:8px;
  padding:16px 4px; background:var(--c-surface); border:0; border-right:1px solid var(--c-line); z-index:20;
 }
 .container[data-authenticated="true"] #accountNav .nav-brand { display:grid; place-items:center; height:64px; margin-bottom:16px; flex:none; }
 .nav-brand svg { display:block; width:48px; height:48px; }
 .container[data-authenticated="true"] #accountNav.account-tabs button {
  display:flex; flex:none; flex-direction:column; align-items:center; justify-content:center;
  width:100%; min-height:64px; height:auto; margin:0; padding:8px 0; gap:4px;
  border:0; border-radius:12px; background:transparent;
 }
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] { background:var(--c-tint); border:0; }
 .container[data-authenticated="true"] #accountNav.account-tabs .account-tab-label { font-size:10px; }
 .container[data-authenticated="true"] #accountSection > #contactsSection {
  left:var(--size-rail); top:56px; bottom:0; width:var(--sidebar-width);
 }
 .container[data-authenticated="true"] #roomHistoryPanel {
  left:var(--size-rail); top:56px; bottom:0; width:var(--sidebar-width);
 }
 .container[data-authenticated="true"][data-tab="profile"] #accountSection > #profileSection {
  position:fixed; inset:56px auto 60px var(--size-rail); width:var(--sidebar-width);
  max-width:none; height:calc(100dvh - 116px); min-height:0; max-height:calc(100dvh - 116px); margin:0; padding:24px 16px;
  align-self:auto; justify-self:auto;
  display:block; overflow-y:auto; background:var(--c-bg); border-radius:0;
 }
 .container[data-authenticated="true"][data-tab="profile"] #profileSection > .profile-card { display:block; padding:0; background:transparent; text-align:center; }
 .container[data-authenticated="true"][data-tab="profile"] #profileSection > .profile-settings { display:block; }
 .container[data-authenticated="true"] #profileSection .profile-devices { position:static; width:auto; height:auto; margin:24px 0; padding:0; }
 .container[data-authenticated="true"] #profileSection .profile-logout-bar { position:static; margin:24px 0 0; padding:0; background:transparent; }
 .container[data-authenticated="true"] #profileSection #accountTitle { display:none; }
 .container[data-authenticated="true"] #profileSection #accountEmail { font-size:16px; margin:12px 0 4px; }
 .container[data-authenticated="true"] #profileSection .profile-avatar { margin:0 auto; }
 .container[data-authenticated="true"][data-tab="diagnostics"] #accountSection > #diagnostics {
  position:fixed; inset:56px 0 0 var(--size-rail); width:auto; max-width:none; max-height:none;
  margin:0; padding:24px; overflow-y:auto; background:var(--c-bg);
 }
 .container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics .settings-microphone { position:static; width:auto; margin:0 0 24px; padding:0; border:0; background:transparent; }
 .container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics .settings-microphone h2 { margin:16px 0 8px; padding:0; background:transparent; }
 .container[data-authenticated="true"][data-tab="messages"] #accountSection > #messagesSection.messaging {
  inset:0 0 0 var(--size-rail); width:auto; grid-template-columns:var(--sidebar-width) minmax(0,1fr);
 }
 .container[data-authenticated="true"] #messagesSection.messaging > .message-sidebar { padding-top:56px; }
 .container[data-authenticated="true"] > .footer-note { left:calc(var(--size-rail) + var(--sidebar-width)); }
 .container[data-authenticated="true"] > #status:not(:empty), .container[data-authenticated="true"] > #notify:not(:empty) { left:calc(var(--size-rail) + var(--sidebar-width) + 24px); max-width:calc(100% - var(--size-rail) - var(--sidebar-width) - 48px); }
 .container[data-authenticated="true"][data-direct-call="true"] #callSurface,
 .container[data-authenticated="true"][data-host-room="true"] #callSurface { left:calc(var(--size-rail) + var(--sidebar-width)); }
}

/* Stage 8 profile and its sound/support destinations. */
.container[data-authenticated="true"][data-tab="profile"] { background:var(--c-bg); background-image:none; }
.container[data-authenticated="true"][data-tab="diagnostics"] { background:var(--c-bg); background-image:none; }
.container[data-authenticated="true"] #profileSection { padding:24px 16px; background:var(--c-bg); }
.container[data-authenticated="true"] #profileSection > .profile-card,
.container[data-authenticated="true"] #profileSection > .profile-devices,
.container[data-authenticated="true"] #profileSection > .profile-security,
.container[data-authenticated="true"] #profileSection > .profile-settings,
.container[data-authenticated="true"] #profileSection > .profile-logout-bar { width:100%; max-width:560px; margin-left:auto; margin-right:auto; }
.container[data-authenticated="true"] #profileSection > .profile-card { display:flex; align-items:center; gap:16px; text-align:left; margin-top:0; padding:0; background:transparent; }
.container[data-authenticated="true"] #profileSection .profile-avatar { flex:0 0 88px; width:88px; height:88px; margin:0; font-size:36px; background:var(--c-av-green); }
.container[data-authenticated="true"] #profileSection .account { min-width:0; text-align:left; }
.container[data-authenticated="true"] #profileSection #accountEmail { margin:0; font-size:17px; line-height:24px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.container[data-authenticated="true"] #profileSection .profile-presence { margin:4px 0 0; font-size:13px; line-height:18px; color:var(--c-text-2); }
.container[data-authenticated="true"] #profileSection > .profile-devices { margin-top:24px; padding:0; }
.container[data-authenticated="true"] #profileSection .profile-device-panel { text-align:left; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > h2,
.container[data-authenticated="true"] #profileSection h3 { margin:24px 0 8px; padding:0; background:transparent; color:var(--c-primary); font-size:16px; line-height:22px; font-weight:600; text-transform:none; letter-spacing:normal; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > p { margin:8px 0 16px; color:var(--c-text-2); font-size:13px; line-height:20px; }
.container[data-authenticated="true"] #profileSection .profile-device-panel .device-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; margin:0; padding:16px; background:var(--c-surface); border:0; border-bottom:1px solid var(--c-line); border-radius:0; }
.container[data-authenticated="true"] #profileSection .device-row:first-of-type { border-radius:16px 16px 0 0; }
.container[data-authenticated="true"] #profileSection .device-row:last-child { border-radius:0 0 16px 16px; }
.container[data-authenticated="true"] #profileSection .device-row:only-child { border-radius:16px; }
.container[data-authenticated="true"] #profileSection .device-row strong { grid-column:1; font-size:14px; line-height:21px; overflow-wrap:anywhere; }
.container[data-authenticated="true"] #profileSection .device-row p { grid-column:1; margin:0; color:var(--c-text-2); font-size:13px; line-height:18px; }
.container[data-authenticated="true"] #profileSection .device-row > button { grid-column:2; grid-row:1 / span 2; align-self:center; width:auto; min-width:64px; min-height:40px; margin:0; padding:8px; background:transparent; color:var(--c-danger); font-size:13px; }
.container[data-authenticated="true"] #profileSection .device-row > button:hover { background:var(--c-danger-bg); }
.container[data-authenticated="true"] #profileSection > .profile-settings { display:block; margin-top:24px; padding:0; }
.container[data-authenticated="true"] #profileSection .profile-link,
.container[data-authenticated="true"] #profileSection #openRecoveryCodes { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:64px; margin:0; padding:16px; background:var(--c-surface); color:var(--c-text); border-radius:16px; font-size:15px; line-height:22px; text-align:left; }
.profile-link .profile-link-body { display:flex; flex:1; min-width:0; flex-direction:column; gap:4px; color:var(--c-text); font-size:15px; }
.profile-link-body small { color:var(--c-text-2); font-size:13px; line-height:18px; font-weight:400; }
.profile-link .profile-link-chevron { flex:none; color:var(--c-text-2); font-size:24px; }
.container[data-authenticated="true"] #profileSection .profile-link:hover,
.container[data-authenticated="true"] #profileSection #openRecoveryCodes:hover { background:var(--c-tint); }
.container[data-authenticated="true"] #profileSection > .profile-security { margin-top:24px; padding:0; }
.container[data-authenticated="true"] #profileSection > .profile-logout-bar { position:static; margin-top:24px; padding:0 0 24px; background:transparent; }
.container[data-authenticated="true"] #profileSection #logout { width:100%; min-height:48px; background:transparent; color:var(--c-danger); border:1px solid var(--c-danger); }
.container[data-authenticated="true"] #profileSection #logout:hover { background:var(--c-danger-bg); }
.container[data-authenticated="true"] #profileSection #logoutAll { min-height:48px; margin:0 0 12px; border:1px solid var(--c-danger); background:var(--c-danger-bg); color:var(--c-danger); }
.container[data-settings-view="logs"] #diagnostics .settings-microphone,
.container[data-settings-view="sound"] #diagnostics .settings-logs { display:none; }
.container[data-tab="diagnostics"] #diagnostics .settings-intro { display:none; }
.container[data-tab="diagnostics"][data-settings-view="logs"] { --section-title:"Журнал подключения"; }
.container[data-tab="diagnostics"][data-settings-view="sound"] { --section-title:"Звук"; }
.container[data-tab="diagnostics"] #diagnostics .settings-logs,
.container[data-tab="diagnostics"] #diagnostics .settings-microphone { max-width:640px; margin:24px auto; padding:20px; background:var(--c-surface); border:1px solid var(--c-line); border-radius:16px; }
.container[data-tab="diagnostics"] #diagnostics .settings-logs h2 { border:0; padding:0; margin:0 0 8px; }
.container[data-tab="diagnostics"] #diagnostics #logOutput { min-height:240px; font-size:12px; line-height:18px; }
dialog.device-dialog { border-radius:24px; background:var(--c-surface); }
dialog.device-dialog h2 { font-size:20px; line-height:28px; }
dialog.device-dialog .error:not(:empty) { padding:12px; border-radius:12px; background:var(--c-danger-bg); color:var(--c-danger); font-size:14px; line-height:20px; }
#recoveryCodesText { padding:16px; color:var(--c-primary-dark); background:var(--c-tint); border-radius:12px; }
@media (min-width:900px) {
 .container[data-authenticated="true"][data-tab="profile"] #accountSection > #profileSection { position:fixed; inset:56px 0 0 var(--size-rail); width:auto; max-width:none; height:calc(100dvh - 56px); max-height:calc(100dvh - 56px); margin:0; padding:24px; overflow-y:auto; }
 .container[data-authenticated="true"][data-tab="profile"] > header,
 .container[data-authenticated="true"][data-tab="diagnostics"] > header { width:calc(100% - var(--size-rail)); }
 .container[data-authenticated="true"][data-tab="profile"]::after,
 .container[data-authenticated="true"][data-tab="profile"] #desktopWelcome,
 .container[data-authenticated="true"][data-tab="profile"] > .footer-note,
 .container[data-authenticated="true"][data-tab="diagnostics"] > .footer-note { display:none; }
 .container[data-authenticated="true"][data-tab="profile"] #profileSection > .profile-card { display:flex; }
 .container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics .settings-microphone { max-width:640px; margin:24px auto; padding:20px; border:1px solid var(--c-line); border-radius:16px; background:var(--c-surface); }
}

/* Profile and nested views follow the approved prototype. */
.container[data-authenticated="true"][data-tab="profile"],
.container[data-authenticated="true"][data-tab="diagnostics"],
.container[data-authenticated="true"][data-tab="profile"] #accountSection > #profileSection,
.container[data-authenticated="true"][data-tab="diagnostics"] #accountSection > #diagnostics { background:var(--c-surface); background-image:none; }
.container[data-authenticated="true"] #profileSection > .profile-card,
.container[data-authenticated="true"] #profileSection > .profile-devices,
.container[data-authenticated="true"] #profileSection > .profile-security,
.container[data-authenticated="true"] #profileSection > .profile-settings,
.container[data-authenticated="true"] #profileSection > .profile-logout-bar { max-width:528px; }
.container[data-authenticated="true"] #profileSection > .profile-card { padding:0 16px; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > h2,
.container[data-authenticated="true"] #profileSection h3 { padding:0 16px; font-size:13px; line-height:18px; margin:24px 0 8px; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > p { padding:0 16px; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > p:first-of-type { order:2; }
.container[data-authenticated="true"] #profileSection .profile-device-panel { display:flex; flex-direction:column; }
.container[data-authenticated="true"] #profileSection .profile-device-panel .device-row { min-height:64px; padding:12px 16px; border:0; }
.container[data-authenticated="true"] #profileSection .device-row strong { font-weight:600; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > .profile-device-intro,
.container[data-authenticated="true"] #profileSection .profile-device-panel > p[data-summary="true"],
.container[data-authenticated="true"] #profileSection #messageDevicesHint,
.container[data-authenticated="true"] #profileSection .profile-security > p,
.container[data-authenticated="true"] #profileSection #logout { display:none; }
.container[data-authenticated="true"] #profileSection #logoutAll { background:transparent; margin:0; }
.container[data-authenticated="true"] #profileSection .profile-logout-bar { padding:0 16px 24px; }
.container[data-authenticated="true"] #profileSection .profile-device-connect { width:100%; border-radius:0; background:var(--c-surface); }
.profile-sound-row { display:flex; align-items:center; gap:16px; padding:16px; min-height:64px; }
.profile-sound-row .profile-link-body { display:flex; flex:1; flex-direction:column; gap:4px; font-size:15px; }
.profile-switch { position:relative; flex:0 0 46px; width:46px; height:28px; min-height:28px; margin:0; padding:0; border-radius:20px; background:var(--c-tint-strong); }
.profile-switch::before { content:""; position:absolute; width:22px; height:22px; top:3px; left:3px; background:white; border-radius:50%; box-shadow:0 1px 3px #0002; transition:transform .15s; }
.profile-switch[aria-checked="true"] { background:var(--c-primary); }
.profile-switch[aria-checked="true"]::before { transform:translateX(18px); }
.container[data-tab="diagnostics"][data-settings-view="sound"] { --section-title:"Проверка микрофона"; }
.container[data-authenticated="true"][data-tab="diagnostics"] > header { padding-left:64px; }
.container[data-authenticated="true"][data-tab="diagnostics"] #backToProfile { position:fixed; z-index:11; top:6px; left:12px; width:44px; height:44px; margin:0; padding:0; font-size:30px; color:var(--c-text-2); text-align:center; }
.container[data-authenticated="true"][data-tab="diagnostics"] #settingsTitle,
.container[data-authenticated="true"][data-tab="diagnostics"] .settings-intro,
.container[data-authenticated="true"][data-tab="diagnostics"] .settings-logs > h2,
.container[data-authenticated="true"][data-tab="diagnostics"] .settings-logs > p,
.container[data-authenticated="true"][data-tab="diagnostics"] .settings-logs > label,
.container[data-authenticated="true"][data-tab="diagnostics"] .incoming-sound-heading,
.container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics #enableIncomingSound,
.container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics #incomingSoundStatus { display:none; }
.container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics .settings-microphone,
.container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics .settings-logs { width:100%; max-width:528px; margin:8px auto 0; padding:16px; border:0; border-radius:0; background:transparent; }
.container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics #logOutput { background:var(--c-tint); color:var(--c-text); border:0; border-radius:12px; font-size:12px; line-height:22px; min-height:168px; height:168px; padding:16px; resize:vertical; margin:0 0 12px; }
.container[data-tab="diagnostics"] #diagnostics .settings-actions { display:flex; flex-direction:row; gap:8px; }
.container[data-tab="diagnostics"] #diagnostics .settings-actions > button { flex:1; min-width:0; margin:0; min-height:48px; }
.container[data-tab="diagnostics"] #diagnostics #testMic { width:100%; height:48px; margin:12px 0 0; background:var(--c-primary); color:white; }
#microphoneTestStatus { margin:0 0 16px; font-size:15px; line-height:22px; }
.microphone-meter { display:flex; height:64px; gap:6px; align-items:flex-end; margin:16px 0 0; }
.microphone-meter i { flex:1; height:12px; border-radius:8px; background:var(--c-line); transition:height .08s; }
#recoveryCodesDialog { width:min(440px,calc(100vw - 24px)); padding:24px; }
#recoveryCodesDialog .small { font-size:14px; line-height:20px; }
#recoveryCodesDialog[data-phase="save"] #recoveryCodesStatus { font-size:12px; }
#recoveryCodesDialog[data-phase="save"] #recoveryCodesText { width:100%; height:auto; min-height:150px; font-size:clamp(9px,2.5vw,12px); line-height:26px; padding:12px; border:0; }
#recoveryCodesDialog[data-phase="save"] .recovery-code-actions button { background:var(--c-primary); color:white; }
#recoveryCodesDialog .device-confirm { display:flex; align-items:center; gap:12px; font-size:14px; }
#recoveryCodesDialog .device-confirm input { flex:0 0 20px; width:20px; height:20px; }
@media(min-width:900px) {
 .container[data-authenticated="true"][data-tab="diagnostics"] #backToProfile { left:calc(var(--size-rail) + 12px); }
 .container[data-authenticated="true"][data-tab="profile"] #accountSection > #profileSection { padding-top:16px; }
}
.recovery-dialog-actions { display:flex; gap:8px; }
.recovery-dialog-actions > button { flex:1; min-width:0; margin:0; }
#recoveryCodesDialog:has(#recoveryCodesForm[hidden]) #generateRecoveryCodes { display:none; }
#recoveryCodesDialog[data-phase="save"] #recoveryCodesResult > label:first-child { display:none; }
#recoveryCodesDialog[data-phase="save"] #closeRecoveryCodes { width:100%; }
.container[data-authenticated="true"][data-tab="diagnostics"] #accountSection > #diagnostics { display:block; }
.container[data-authenticated="true"][data-tab="diagnostics"][data-settings-view="sound"] #diagnostics .settings-microphone { display:block; }
.container[data-authenticated="true"][data-tab="diagnostics"] #diagnostics #clearLogs { color:var(--c-primary); }
.container[data-authenticated="true"][data-tab="diagnostics"] > #status { display:none; }
@media(min-width:900px) {
 .container[data-authenticated="true"][data-tab="diagnostics"] #accountSection > #diagnostics { height:calc(100dvh - 56px); }
}
.container[data-authenticated="true"] #profileSection > .profile-devices,
.container[data-authenticated="true"] #profileSection > .profile-settings,
.container[data-authenticated="true"] #profileSection > .profile-security { margin-top:8px; }
.container[data-authenticated="true"] #profileSection .profile-device-panel > h2,
.container[data-authenticated="true"] #profileSection h3 { margin-top:16px; }
.container[data-authenticated="true"][data-tab="diagnostics"] #backToProfile { z-index:25; }
#recoveryCodesDialog .recovery-code-actions { gap:8px; }
#recoveryCodesDialog .recovery-code-actions button { min-height:48px; margin:8px 0; padding:10px 8px; font-size:14px; white-space:nowrap; }
#connectionLogPreview { display:block; width:100%; height:168px; margin:0 0 12px; padding:16px; background:var(--c-tint); color:var(--c-text); border-radius:12px; font:12px/22px ui-monospace,monospace; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.container[data-tab="diagnostics"] #diagnostics #logOutput[hidden] { display:none; }
.container[data-authenticated="true"] #profileSection > .profile-devices,
.container[data-authenticated="true"] #profileSection > .profile-settings,
.container[data-authenticated="true"] #profileSection > .profile-security { margin-bottom:0; }
@media(min-width:900px) {
 .container[data-authenticated="true"][data-tab="diagnostics"] #accountSection > #diagnostics { width:calc(100vw - var(--size-rail)); justify-self:stretch; }
}
@media(max-width:639px) {
 dialog.profile-dialog, dialog.profile-dialog.dialog-viewport-fit, #recoveryCodesDialog.profile-dialog {
  position:fixed; top:auto; left:0; right:0;
  bottom:max(0px,calc(100dvh - var(--dialog-visible-top,0px) - var(--dialog-visible-height,100dvh)));
  transform:none; margin:0; width:100%; max-width:none;
  max-height:calc(var(--dialog-visible-height,100dvh) - 24px); overflow-y:auto;
  border-radius:24px 24px 0 0; padding:20px 24px calc(20px + env(safe-area-inset-bottom,0px));
 }
 dialog.profile-dialog::before { content:""; display:block; width:40px; height:4px; margin:0 auto 16px; border-radius:2px; background:var(--c-line); }
}

/* Design reconciliation: shared components (empty states, error banner, active tab line) */
.message-empty:not([hidden]), #contactEmpty:not([hidden]), #roomHistoryEmpty:not([hidden]) { display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; color:#4f6458; font-size:14px; line-height:1.5; }
.message-empty:not([hidden])::before, #contactEmpty:not([hidden])::before, #roomHistoryEmpty:not([hidden])::before { content:""; flex:none; width:56px; height:56px; border-radius:50%; background:#e0f0e7 var(--empty-icon, none) center / 28px 28px no-repeat; }
.message-empty:not([hidden]) { --empty-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7f54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11a8 8 0 0 1-8 8H7l-4 3V11a9 9 0 1 1 18 0Z'/%3E%3C/svg%3E"); }
#contactEmpty:not([hidden]) { --empty-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7f54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6M16 4.8a3.5 3.5 0 0 1 0 6.4M18 14.3c2 .7 3.5 2.4 3.5 5.7'/%3E%3C/svg%3E"); }
#roomHistoryEmpty:not([hidden]) { --empty-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a7f54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.container #roomHistoryError:not(:empty) { margin:8px 16px; padding:12px 14px; border-radius:12px; background:#fdeaea; color:#9b2c2c; }
@media (max-width:899px) {
 .container[data-authenticated="true"] #accountNav.account-tabs button[aria-selected="true"] { box-shadow:inset 0 3px 0 var(--c-primary); }
}

/* Empty-state title/action and skeleton rows */
.message-empty strong, #contactEmpty strong, #roomHistoryEmpty strong { color:var(--c-text, #12261b); font-size:16px; font-weight:600; }
.empty-action { margin-top:4px; padding:10px 20px; border:0; border-radius:12px; background:var(--c-primary); color:#fff; font:inherit; font-weight:600; cursor:pointer; }
.skeleton-row { display:flex; align-items:center; gap:12px; padding:12px 16px; }
.skeleton-row i { flex:none; width:40px; height:40px; border-radius:50%; background:#e3ece6; }
.skeleton-row span { flex:1; display:grid; gap:8px; }
.skeleton-row b { display:block; height:10px; border-radius:6px; background:#e3ece6; }
.skeleton-row b:last-child { width:60%; }
@media (prefers-reduced-motion:no-preference) { .skeleton-row i, .skeleton-row b { animation:skeleton-pulse 1.4s ease-in-out infinite; } }
@keyframes skeleton-pulse { 50% { opacity:.55; } }

/* Auth errors under the field */
.container #authSection:not([hidden]) #authError.auth-error--mirrored { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; background:none; }
.field-error { margin:6px 0 0; color:var(--c-danger, #b42318); font-size:13px; line-height:18px; }
#authSection input[aria-invalid="true"] { border-color:var(--c-danger, #b42318); }

/* Banner: peer is not in contacts */
.conversation-unknown { display:flex; align-items:center; gap:12px; margin:8px 12px 0; padding:10px 12px; border-radius:12px; background:#fff4d6; color:#6b4f00; font-size:13px; line-height:18px; }
.conversation-unknown[hidden] { display:none; }
.conversation-unknown span { flex:1; }
.conversation-unknown button { flex:none; padding:6px 14px; border:0; border-radius:10px; background:var(--c-primary); color:#fff; font:inherit; font-weight:600; cursor:pointer; }
.container .conversation-unknown button { width:auto; min-width:0; height:auto; min-height:0; margin:0; flex:none; white-space:nowrap; }

/* Message that could not be decrypted */
.message-bubble--error { background:#fbe6e3 !important; color:#7a1f17; }
.message-bubble--error small { color:#9b2c2c; }
.message-bubble .message-verify { width:auto; min-height:0; height:auto; margin:8px 0 0; padding:6px 12px; border:1px solid #a52a20; border-radius:10px; background:transparent; color:#a52a20; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }

/* Mobile profile: pin "end all sessions" above the tab bar, translucent so the scroll shows through */
@media (max-width:899px) {
 .container[data-authenticated="true"] #profileSection > .profile-logout-bar { position:fixed; left:0; right:0; bottom:calc(64px + env(safe-area-inset-bottom, 0px)); z-index:9; width:auto; max-width:none; margin:0; padding:12px 16px; background:transparent; pointer-events:none; }
 .container[data-authenticated="true"] #profileSection > .profile-logout-bar > button { pointer-events:auto; }
 .container[data-authenticated="true"] #profileSection #logoutAll { margin:0; background:rgba(255,255,255,.72); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
 .container[data-authenticated="true"] #profileSection { padding-bottom:calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* Mobile profile: pin the page title, translucent like the bottom action */
@media (max-width:899px) {
 .container[data-authenticated="true"][data-tab="profile"] > header { position:sticky; top:0; z-index:10; background:rgba(255,255,255,.72); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
}
