/* Full-screen picture viewer (modules/viewer.js): the original PNG with zoom and pan. */
html:not(#_) #modal.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  border-radius: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  box-shadow: none;
  transform: none;
  animation: none;
}
html:not(#_) #modal.photo-viewer[open] {
  display: flex;
  flex-direction: column;
}
html:not(#_) #modal.photo-viewer::backdrop {
  background: #000;
}
html:not(#_) #modal.photo-viewer .modal-header {
  flex: none;
  background: transparent;
  color: #fff;
  border: 0;
}
html:not(#_) #modal.photo-viewer .modal-header h2 {
  color: #fff;
}
html:not(#_) #modal.photo-viewer #close-modal {
  color: #fff;
}
html:not(#_) #modal.photo-viewer #modal-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  outline: none;
  opacity: var(--viewer-fade, 1);
  user-select: none;
  -webkit-user-select: none;
}
.viewer-stage.zoomed {
  cursor: grab;
}
.viewer-stage.zoomed:active {
  cursor: grabbing;
}
html:not(#_) .photo-viewer img.viewer-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  transform-origin: center;
  transform: translate(-50%, -50%);
  will-change: transform;
  -webkit-user-drag: none;
  pointer-events: none;
}
.viewer-image.animating {
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.viewer-status {
  position: absolute;
  inset: auto 0 16px;
  margin: 0;
  color: #ffffffb3;
  font-size: 14px;
  text-align: center;
}
.viewer-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
html:not(#_) .viewer-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 22px;
  background: #ffffff1f;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
html:not(#_) .viewer-tool:hover {
  background: #ffffff33;
}
html:not(#_) .viewer-tool:disabled {
  opacity: 0.4;
  cursor: default;
}
html:not(#_) .viewer-tool[hidden] {
  display: none;
}
.viewer-tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.viewer-zoom {
  min-width: 72px;
  font-variant-numeric: tabular-nums;
}
.image-message {
  padding: 5px 6px 7px;
  max-width: 420px;
}
.image-message .message-text,
.image-message .message-author {
  padding: 3px 6px;
}
.image-message .message-meta {
  padding: 0 4px;
}
.image-message .message-photo {
  margin-bottom: 0;
  border-radius: 9px;
}
.message-photo:focus-visible {
  outline: 3px solid #3390ec;
  outline-offset: 3px;
}
.reply-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 920px;
  margin: 0 auto 8px;
  padding: 9px 12px;
  background: #fff;
  border-radius: 10px;
}
.reply-preview > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
  border-left: 3px solid #3390ec;
  padding-left: 10px;
}
.reply-preview strong {
  font-size: 12px;
  color: #3390ec;
}
.reply-preview span span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  color: #8697a2;
}
.message-quote {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  background: #3390ec0c;
  border-left: 3px solid #70b3ed;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 5px;
  max-width: 100%;
  font-size: 11px;
}
.message-quote strong {
  color: #438fcf;
}
.message-quote span {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  white-space: nowrap;
  color: #82959e;
}
.message-emoji {
  font-size: 1.28em;
  vertical-align: -0.07em;
}
.message-emoji-only .message-emoji {
  font-size: 1.8em;
}
.message-reaction-footer {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 5px;
}
.message-reactions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  min-width: min-content;
  flex: 1 1 0;
}
.message-reaction-footer .message-meta {
  flex: 0 0 auto;
  margin-left: auto;
}
.context-menu .quick-reactions {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  width: min(287px, calc(100vw - 32px));
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--tg-search);
}
.context-menu .quick-reactions button {
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 4px 0;
  font-size: 20px;
}
.context-menu .quick-reactions button[aria-pressed='true'] {
  background: color-mix(in srgb, var(--tg-accent) 24%, transparent);
}
.reaction-users {
  max-height: 48dvh;
  overflow-y: auto;
}
.reaction-user-emoji {
  margin-left: auto;
  font-size: 1.25em;
}
.message-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: var(--tg-panel, var(--tg-search));
}
.message-selection button {
  min-height: 36px;
  padding: 4px 10px;
}
.selecting-messages #compose-area,
.selecting-messages .message-actions {
  display: none;
}
.message-select {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  align-self: center;
  border: 1px solid var(--tg-hint);
  border-radius: 50%;
  color: transparent;
}
.message-select svg {
  width: 15px;
  height: 15px;
}
.message-select[aria-checked='true'] {
  background: var(--tg-accent);
  border-color: var(--tg-accent);
  color: white;
}
.message-selected .message-bubble {
  outline: 2px solid var(--tg-accent);
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  min-height: max(27px, 1.7em);
  padding: 0.12em 0.3em;
  border-radius: 999px;
  font-size: var(--chat-font, 14px);
}
.reaction-emoji {
  font-size: 1.25em;
  line-height: 1;
}
.message-row .reaction .avatar {
  --reaction-avatar-size: calc(var(--chat-font, 14px) * 1.25);
  flex: 0 0 var(--reaction-avatar-size);
  width: var(--reaction-avatar-size);
  height: var(--reaction-avatar-size);
  font-size: 0.7em;
  line-height: 1;
}

.typing {
  color: #3390ec !important;
}

.search-results {
  max-height: 55dvh;
  overflow: auto;
  margin-top: 15px;
}
.search-result {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 7px;
  border-bottom: 1px solid #edf0f2;
  width: 100%;
  text-align: left;
}
.search-result:hover {
  background: #f4f8fc;
}
.search-result strong {
  font-size: 13px;
  color: #3390ec;
}
.search-result small {
  font-size: 11px;
  color: #91a1ae;
}
.search-result > span {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.search-more {
  margin-top: 16px;
}

/* Emoji panel above the message field */
.composer {
  position: relative;
}
.emoji-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(348px, 100%);
  padding: 8px;
  border-radius: 14px;
  background: var(--panel, #fff);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px #00000033;
  z-index: 5;
}
.emoji-tabs {
  display: flex;
  gap: 4px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.emoji-tabs button {
  flex: 1;
  font-size: 19px;
  padding: 6px 0;
  border-radius: 9px;
  opacity: 0.55;
}
.emoji-tabs button.active {
  opacity: 1;
  background: var(--hover, #eff6fc);
}
.emoji-popover .emoji-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  max-height: 212px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.emoji-popover .emoji-grid button {
  font-size: 22px;
  padding: 7px 0;
  border-radius: 8px;
}
.emoji-popover .emoji-grid button:hover {
  background: var(--hover, #eff6fc);
}
/* Reason for a wrong field, shown right under it */
.field-error {
  color: #d9545f;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
:root:not([data-theme='light']) .field-error {
  color: #ff7b84;
}
/* Saved session, server not answering yet: a status line instead of the sign-in form */
.boot-status:empty {
  display: none;
}
.boot-status {
  color: #aebcdb;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
.login-screen.booting #login-form,
.login-screen.booting #registration-form {
  display: none;
}
/* Picture placeholder keeps the proportions of the picture that is still loading */
.message-photo {
  height: auto;
}
#start-call {
  min-width: 44px;
  min-height: 44px;
}

#incoming-call.incoming-call {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 24%, color-mix(in srgb, var(--tg-accent) 22%, transparent), transparent 56%),
    var(--panel);
}

.incoming-call-layout {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 100%;
  max-width: 460px;
  margin-inline: auto;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(32px, calc(env(safe-area-inset-bottom) + 18px))
    max(20px, env(safe-area-inset-left));
  text-align: center;
}

.incoming-call-identity h2 {
  margin: 0;
  color: var(--tg-hint);
  font-size: 16px;
  font-weight: 600;
}

.incoming-call-identity h2:focus {
  outline: none;
}

.incoming-call-portrait {
  display: grid;
  place-items: center;
  width: clamp(102px, 27vh, 166px);
  aspect-ratio: 1;
  margin: 22px auto 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tg-accent) 11%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tg-accent) 23%, transparent);
}

#incoming-call-avatar {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  font-size: clamp(32px, 8vh, 50px);
}

#incoming-call-peer {
  margin: 0;
  font-size: clamp(26px, 6vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

#incoming-call-status {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: var(--tg-hint);
}

#call-duration,
#minibar-duration {
  color: var(--tg-hint);
  font-variant-numeric: tabular-nums;
}

#call-duration {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

#incoming-call[data-ringing] .incoming-call-portrait {
  animation: call-pulse 2.4s ease-out infinite;
}

@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--tg-accent) 23%, transparent); }
  56% { box-shadow: 0 0 0 12px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  #incoming-call[data-ringing] .incoming-call-portrait { animation: none; }
}

.incoming-call-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.incoming-call-action {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
}

.incoming-call-action:focus-visible {
  outline: 2px solid var(--tg-accent);
  outline-offset: 2px;
}

.incoming-call-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #b8243b;
  color: #fff;
}

.incoming-call-action.accept .incoming-call-icon {
  background: #087a4b;
}

.incoming-call-icon.neutral {
  background: var(--panel-2);
  color: var(--text);
}

.incoming-call-icon svg {
  width: 28px;
  height: 28px;
}

.incoming-call-action.decline svg {
  transform: rotate(135deg);
}

.voice-call-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.voice-call-options:has(> button:not([hidden])) > button {
  min-height: 44px;
}

#call-minibar {
  position: fixed;
  z-index: 40;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 62px));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: min(365px, calc(100% - 24px));
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 32px #0004;
}

#restore-call {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 4px 8px;
  text-align: start;
}

#restore-call-icon {
  display: inline-flex;
  color: var(--tg-accent);
}

.call-minibar-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.call-minibar-text > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#minibar-status {
  color: var(--tg-hint);
  font-size: 12px;
}

#minibar-end-call {
  min-width: 44px;
  min-height: 44px;
  color: #d93652;
}

#minibar-end-call svg {
  transform: rotate(135deg);
}

#call-output-device {
  width: 100%;
  min-height: 44px;
  margin-bottom: 14px;
}

.call-history-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.call-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.call-history-item small {
  display: block;
  margin-top: 4px;
}

.call-history-item small,
.call-history-item time {
  color: var(--tg-hint);
  font-size: 13px;
}

/* ---------- Conversations of three or more (conference.js, docs/GROUP_CALLS.md) ---------- */

.conference-dialog.incoming-call {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 24%, color-mix(in srgb, var(--tg-accent) 22%, transparent), transparent 56%),
    var(--panel);
}

.conference-layout {
  grid-template-rows: auto 1fr auto;
  align-items: start;
  max-width: 560px;
}

.conference-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.conference-head h2:focus {
  outline: none;
}

.conference-status {
  min-height: 1.4em;
  margin: 6px 0 0;
  color: var(--tg-hint);
}

/* Buttons with an icon in the call and conversation controls ("Добавить"). */
.voice-call-options > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.voice-call-options > button svg {
  width: 18px;
  height: 18px;
}

.conference-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 140px));
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.conference-tile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.15s ease;
}

.conference-tile.speaking {
  box-shadow: 0 0 0 3px #2fbf71;
}

.conference-tile.invited {
  opacity: 0.65;
}

.conference-tile strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conference-tile small {
  min-height: 1.2em;
  color: var(--tg-hint);
  font-size: 12px;
}

.conference-tile-avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.conference-invite-avatar {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  font-size: clamp(32px, 8vh, 50px);
}

.conference-invite-name {
  margin: 0;
  font-size: clamp(24px, 5.5vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.conference-invite-people {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--tg-hint);
}

.conference-ringing {
  animation: call-pulse 2.4s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .conference-ringing { animation: none; }
  .conference-tile { transition: none; }
}

.conference-minibar {
  position: fixed;
  z-index: 40;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 62px));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: min(365px, calc(100% - 24px));
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 32px #0004;
}

.conference-minibar[hidden] {
  display: none;
}

.conference-restore {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 4px 8px;
  text-align: start;
  color: inherit;
}

.conference-restore > svg {
  color: var(--tg-accent);
}

.conference-minibar-status {
  color: var(--tg-hint);
  font-size: 12px;
}

.conference-minibar-leave {
  min-width: 44px;
  min-height: 44px;
  color: #d93652;
}

.conference-minibar-leave svg {
  transform: rotate(135deg);
}

/* "Добавить в разговор" uses the shared user picker; the button stays in reach. */
.conference-picker-footer {
  position: sticky;
  bottom: 0;
  padding: 12px 0 max(4px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--tg-page, var(--panel)) 30%);
}

.conference-picker-footer .conference-invite-send {
  width: 100%;
}

/* Android app: «Источник звука» menu in calls and conversations (calls.js audioSwitch). */
.audio-source {
  position: relative;
  display: inline-flex;
}

.audio-source[hidden] {
  display: none;
}

.audio-source-menu {
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 6px);
  left: 50%;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tg-card) 92%, transparent);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 10px 40px #0000004d;
  transform: translateX(-50%);
}

.audio-source-menu[hidden] {
  display: none;
}

.audio-source-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tg-text);
  font: inherit;
  font-size: 16px;
  text-align: left;
}

.audio-source-option::before {
  content: '';
  width: 18px;
  flex: none;
  color: var(--tg-accent);
  font-weight: 700;
}

.audio-source-option[aria-checked='true']::before {
  content: '✓';
}

.audio-source-option:hover,
.audio-source-option:focus-visible {
  background: color-mix(in srgb, var(--tg-text) 8%, transparent);
  outline: none;
}

/* Start-up splash (0.1.12): the page opens on the app's own background with the Void mark
   until it knows whether a session exists. A quick start shows only the background; the
   mark fades in when start-up takes longer, so nothing flashes. */
.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--tg-bg, #10172d);
  color: var(--soft, #b0bcdb);
  text-align: center;
}
.boot-splash[hidden] {
  display: none;
}
.boot-splash-mark {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--tg-link, #a6b5ff);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  animation: boot-splash-in 0.4s ease 0.6s forwards, boot-splash-pulse 2.4s ease-in-out 1s infinite;
}
.boot-splash-status {
  min-height: 1.6em;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
@keyframes boot-splash-in {
  to { opacity: 0.9; }
}
@keyframes boot-splash-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  /* styles.css switches every animation off here, so the mark is simply shown. */
  .boot-splash-mark {
    opacity: 0.9;
  }
}

/* Connection state (0.1.12): a pill at the top of every screen when there is no network or
   the server does not answer, so a lost connection never looks like a frozen app. */
.net-status {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 50%;
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 7px 14px;
  white-space: nowrap;
  border-radius: 999px;
  background: #1b2440eb;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 18px #0000003d;
  pointer-events: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.net-status[hidden] {
  display: none;
}
.net-status::before {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: net-status-spin 0.9s linear infinite;
}
.net-status.no-network::before {
  border-color: #e3b25c;
  animation: none;
  width: 8px;
  height: 8px;
  border-width: 0;
  background: #e3b25c;
}
/* After 20 s of «Подключение к серверу…» the pill can be clicked for the reason (netstatus.js). */
.net-status.explain {
  pointer-events: auto;
  cursor: pointer;
  flex-wrap: wrap;
}
.net-status-more {
  color: #aebcff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.net-status.open {
  width: min(460px, calc(100vw - 32px));
  border-radius: 16px;
  white-space: normal;
}
.net-status-details {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: min(460px, calc(100vw - 60px));
  white-space: normal;
  font-size: 12px;
  color: #ffffffc7;
}
@keyframes net-status-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .net-status::before {
    animation: none;
  }
}
.boot-splash.leaving {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* «Доступна новая версия Void» (0.1.12, modules/updates.js): offered, never forced —
   a reload would cut a call or a message being written. */
.update-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  z-index: 55;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: #1b2440f2;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 4px 18px #0000003d;
}
.update-bar[hidden] {
  display: none;
}
.update-bar-action,
.update-bar-close {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.update-bar-action {
  padding: 0 14px;
  background: #3390ec;
  font-weight: 600;
}
.update-bar-close {
  width: 32px;
  background: transparent;
  font-size: 18px;
  opacity: 0.75;
}
.update-bar-action:focus-visible,
.update-bar-close:focus-visible {
  outline: 2px solid #a6b5ff;
  outline-offset: 2px;
}

/* «Уведомления о сообщениях выключены» in an installed web app (notifications.js), above the
   update offer when both are on screen. */
.notify-bar {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 130px);
}

/* A call the other person did not pick up, as an entry in the chat (0.1.12). */
.call-entry-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.call-entry-line svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.call-entry.missed .call-entry-line {
  color: #e5484d;
}
:root:not([data-theme='light']) .call-entry.missed .call-entry-line {
  color: #ff7b84;
}
.call-entry-back {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tg-link, #3390ec);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.call-entry-back:hover {
  text-decoration: underline;
}
.chat-preview.missed-call {
  color: #e5484d;
}
:root:not([data-theme='light']) .chat-preview.missed-call {
  color: #ff7b84;
}

/* Notification settings (0.1.12): compact rows with a switch or a short state. */
html:not(#_) .notify-card {
  margin-bottom: 10px;
}
html:not(#_) .notify-row .tg-row-text small {
  white-space: normal;
}
html:not(#_) .notify-row[hidden] {
  display: none;
}
html:not(#_) .notify-row {
  flex-direction: row;
  gap: 12px;
  color: inherit;
  font-size: calc(15px * var(--ui-scale, 1));
  font-weight: 400;
  cursor: pointer;
}
/* The chevron belongs only to rows that open something. */
html:not(#_) label.notify-row::after,
html:not(#_) .notify-row:has(.notify-toggle)::after {
  content: none;
}
.notify-value {
  flex: none;
  color: var(--tg-hint, #8a9ca5);
  font-size: 15px;
}
/* 0.1.14: the window looked crooked. The value («Включены», «Вкл») took half the row
   (a general `.menu-action > span { flex: 1 }`), stood in the middle and squeezed the title
   and hint; the separators began at 60 px, made for rows with an icon, while these rows
   have none and their text begins at 16 px. */
html:not(#_) .notify-row > .tg-row-text {
  flex: 1 1 auto;
}
html:not(#_) .notify-row > .notify-value {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}
html:not(#_) .notify-row .tg-row-title {
  white-space: normal;
}
html:not(#_) .notify-card > .tg-row + .tg-row::before {
  left: 16px;
}
.notify-warn .notify-value,
.notify-warn .tg-row-text small {
  color: #e5484d;
}
:root:not([data-theme='light']) .notify-warn .notify-value,
:root:not([data-theme='light']) .notify-warn .tg-row-text small {
  color: #ff7b84;
}
.notify-toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 42px;
  height: 26px;
  margin: 0;
  border-radius: 13px;
  background: #8a94a666;
  cursor: pointer;
  transition: background 0.15s ease;
}
.notify-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0000004d;
  transition: transform 0.15s ease;
}
.notify-toggle:checked {
  background: var(--tg-accent, #3390ec);
}
.notify-toggle:checked::after {
  transform: translateX(16px);
}
.notify-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}
.notify-toggle:focus-visible {
  outline: 2px solid var(--tg-link, #3390ec);
  outline-offset: 2px;
}
.notify-note {
  margin: 4px 4px 0;
  font-size: 12px;
  line-height: 1.5;
}
.notify-help summary {
  cursor: pointer;
  font-size: 12px;
}
.notify-help p {
  margin: 6px 0 0;
}

/* Android 0.1.14: «Вибрация без звука» — three levels under the row's title. */
html:not(#_) .notify-vibration {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  cursor: default;
}
html:not(#_) .tg-row.notify-row.notify-vibration::after {
  content: none;
  display: none;
}
html:not(#_) .notify-segments {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: #8a94a62e;
}
.notify-segment {
  min-height: 34px;
  padding: 6px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.notify-segment[aria-checked='true'] {
  background: var(--tg-accent, #3390ec);
  color: #fff;
  font-weight: 600;
}
.notify-segment:focus-visible {
  outline: 2px solid var(--tg-accent, #3390ec);
  outline-offset: 2px;
}
