/* Colour swatches (theme, avatar, wallpaper, bubble) and the settings Close / Save footer. */
/* Same framed square language as .theme-swatch / .cal-color */
.wallpaper-grad-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #d8dbe3;
  padding: 2px;
  margin: 0;
  cursor: pointer;
  box-sizing: border-box;
  background:
    linear-gradient(var(--grad-swatch, #fff2ff), var(--grad-swatch, #fff2ff)) content-box,
    #fff;
  display: block;
}
.wallpaper-grad-swatch:hover { transform: scale(1.04); }
.wallpaper-grad-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.wallpaper-grad-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 2;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #2a3140;
  color: #fff;
  font-size: 10px;
  line-height: 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.wallpaper-grad-remove:hover { background: #111827; }
.wallpaper-grad-remove[hidden] { display: none !important; }
.wallpaper-grad-add {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px dashed rgba(0,0,0,.28);
  background: #fff;
  color: #5c6270;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  box-shadow: none;
  box-sizing: border-box;
}
.wallpaper-grad-add:hover {
  border-color: rgba(0,0,0,.38);
  color: #1a1d26;
  transform: scale(1.04);
}
.wallpaper-grad-item.is-editing .wallpaper-grad-swatch {
  border-color: var(--accent, #1c58d9);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #1c58d9) 28%, transparent);
}
.wallpaper-color-picker {
  position: fixed;
  z-index: 1200;
  width: 220px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform-origin: top left;
  animation: app-color-picker-in .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes app-color-picker-in { from { opacity: 0; transform: translateY(-6px) scale(.95); } }
.wallpaper-color-picker.hidden { display: none !important; }
.wallpaper-color-picker-sv {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 10px;
  cursor: crosshair;
  background: hsl(200, 100%, 50%);
  overflow: hidden;
  touch-action: none;
}
.wallpaper-color-picker-sv-white,
.wallpaper-color-picker-sv-black {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wallpaper-color-picker-sv-white {
  background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}
.wallpaper-color-picker-sv-black {
  background: linear-gradient(to top, #000, rgba(0,0,0,0));
}
.wallpaper-color-picker-thumb {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 1px 3px rgba(0,0,0,.25);
  pointer-events: none;
}
.wallpaper-color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wallpaper-color-picker-preview {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #d8dbe3;
  padding: 2px;
  box-sizing: border-box;
  flex: 0 0 auto;
  background:
    linear-gradient(var(--picker-swatch, #fff2ff), var(--picker-swatch, #fff2ff)) content-box,
    #fff;
}
.wallpaper-color-picker-hue {
  position: relative;
  flex: 1 1 auto;
  height: 14px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(to right,
    #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.wallpaper-color-picker-hue-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.2);
  background: #f00;
  pointer-events: none;
}
.wallpaper-color-picker-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wallpaper-color-picker-hex {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #d0d4dc;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff;
  color: #1a1d26;
  text-transform: uppercase;
}
.wallpaper-color-picker-hex:focus {
  outline: none;
  border-color: var(--accent, #1c58d9);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #1c58d9) 18%, transparent);
}
.wallpaper-color-picker-format {
  flex: 0 0 auto;
  min-width: 44px;
  text-align: center;
  border: 1px solid #d0d4dc;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1d26;
  background: #f4f5f7;
}
.wallpaper-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.wallpaper-preset-name {
  flex: 1 1 160px;
  min-width: 140px;
  border: 1px solid #d0d4dc;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #1a1d26;
}
.wallpaper-preset-name:focus {
  outline: none;
  border-color: var(--accent, #1c58d9);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #1c58d9) 18%, transparent);
}
.wallpaper-name-row .btn {
  padding: 6px 10px;
  font-size: 13px;
  flex: 0 0 auto;
}
.wallpaper-name-row .btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.wallpaper-presets-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallpaper-presets-title {
  font-size: 13px;
  font-weight: 600;
  color: #5c6270;
}
.wallpaper-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  min-height: 28px;
}
.wallpaper-preset-item {
  position: relative;
  width: 56px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wallpaper-preset-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #d8dbe3;
  padding: 2px;
  margin: 0;
  cursor: pointer;
  box-sizing: border-box;
  background: var(--preset-fill, #d0e7f5) content-box, #fff;
  display: block;
}
.wallpaper-preset-swatch:hover { transform: scale(1.04); }
.wallpaper-preset-remove {
  position: absolute;
  top: -5px;
  right: 8px;
  z-index: 2;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #2a3140;
  color: #fff;
  font-size: 11px;
  line-height: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.wallpaper-preset-remove:hover { background: #111827; }
.wallpaper-preset-caption {
  max-width: 56px;
  font-size: 11px;
  font-weight: 600;
  color: #5c6270;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallpaper-presets-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #8a91a0;
}
.wallpaper-grad-add[hidden] { display: none !important; }
.wallpaper-crop-editor {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.wallpaper-crop-editor.hidden { display: none !important; }
.wallpaper-crop-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wallpaper-crop-tab {
  appearance: none;
  border: 1px solid #e4e7ec;
  background: #fff;
  color: #5c6270;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.wallpaper-crop-tab:hover { background: #f3f5f8; color: #1f2430; }
.wallpaper-crop-tab.active {
  border-color: transparent;
  background: var(--action, #1c58d9);
  color: var(--action-text, #fff);
}
.wallpaper-crop-stage-wrap {
  display: flex;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.wallpaper-crop-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: none;
  background: transparent;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.wallpaper-crop-frame.is-dragging { cursor: grabbing; }
.wallpaper-crop-frame.is-static { cursor: default; touch-action: auto; }
.wallpaper-crop-frame.is-desktop {
  width: min(100%, 360px);
  aspect-ratio: 16 / 10;
}
.wallpaper-crop-frame.is-mobile {
  width: min(220px, 56%);
  aspect-ratio: 9 / 16;
}
.wallpaper-crop-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 50% 50%;
  pointer-events: none;
}
.wallpaper-crop-zoom-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #5c6270;
}
.wallpaper-crop-zoom-row input[type="range"] { width: 100%; }
.wallpaper-crop-zoom-row span { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: #1a1d26; }
.wallpaper-crop-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #8b8e98;
}
.avatar-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-swatch, .theme-swatch, .wallpaper-swatch, .bubble-swatch {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid #d8dbe3;
  padding: 3px; cursor: pointer; box-sizing: border-box;
  background: #fff;
}
.avatar-swatch[data-style="purple"], .theme-swatch[data-theme="purple"] {
  background: linear-gradient(#7939f2, #7939f2) content-box, #fff;
}
.avatar-swatch[data-style="blue"], .theme-swatch[data-theme="blue"] {
  background: linear-gradient(#1c58d9, #1c58d9) content-box, #fff;
}
.avatar-swatch[data-style="green"], .theme-swatch[data-theme="green"] {
  background: linear-gradient(#3db887, #3db887) content-box, #fff;
}
.avatar-swatch[data-style="red"], .theme-swatch[data-theme="red"] {
  background: linear-gradient(#d24b4e, #d24b4e) content-box, #fff;
}
.avatar-swatch[data-style="orange"], .theme-swatch[data-theme="orange"] {
  background: linear-gradient(#e0941a, #e0941a) content-box, #fff;
}
.avatar-swatch[data-style="navy"], .theme-swatch[data-theme="navy"] {
  background: linear-gradient(#1e325c, #1e325c) content-box, #fff;
}
/* Same hue order as theme/avatar: purple, blue, green, red, orange, navy */
.wallpaper-swatch[data-color="#ead9e8"] { background: linear-gradient(#ead9e8, #ead9e8) content-box, #fff; }
.wallpaper-swatch[data-color="#d0e7f5"] { background: linear-gradient(#d0e7f5, #d0e7f5) content-box, #fff; }
.wallpaper-swatch[data-color="#ddecd8"] { background: linear-gradient(#ddecd8, #ddecd8) content-box, #fff; }
.wallpaper-swatch[data-color="#edd9d9"] { background: linear-gradient(#edd9d9, #edd9d9) content-box, #fff; }
.wallpaper-swatch[data-color="#f3e8d4"] { background: linear-gradient(#f3e8d4, #f3e8d4) content-box, #fff; }
.wallpaper-swatch[data-color="#dde0e8"] { background: linear-gradient(#dde0e8, #dde0e8) content-box, #fff; }
.wallpaper-swatch[data-color="#ffffff"] { background: linear-gradient(#ffffff, #ffffff) content-box, #fff; }
.wallpaper-swatch[data-color="#16181d"] { background: linear-gradient(#16181d, #16181d) content-box, #fff; }
.bubble-swatch[data-color="#f0e0fc"] { background: linear-gradient(#f0e0fc, #f0e0fc) content-box, #fff; }
.bubble-swatch[data-color="#eef8fc"] { background: linear-gradient(#eef8fc, #eef8fc) content-box, #fff; }
.bubble-swatch[data-color="#e5faf6"] { background: linear-gradient(#e5faf6, #e5faf6) content-box, #fff; }
.bubble-swatch[data-color="#fde8e8"] { background: linear-gradient(#fde8e8, #fde8e8) content-box, #fff; }
.bubble-swatch[data-color="#fff3d6"] { background: linear-gradient(#fff3d6, #fff3d6) content-box, #fff; }
.bubble-swatch[data-color="#e8ecf4"] { background: linear-gradient(#e8ecf4, #e8ecf4) content-box, #fff; }
.bubble-swatch[data-color="#fdfdfd"] { background: linear-gradient(#fdfdfd, #fdfdfd) content-box, #fff; }
.bubble-swatch[data-color="#16181d"] { background: linear-gradient(#16181d, #16181d) content-box, #fff; }
.avatar-swatch:hover, .theme-swatch:hover, .wallpaper-swatch:hover, .bubble-swatch:hover { transform: scale(1.04); }
.appearance-block { margin-top: 18px; }
.avatar-swatch[aria-checked="true"], .theme-swatch[aria-checked="true"], .wallpaper-swatch[aria-checked="true"], .bubble-swatch[aria-checked="true"] {
  border-color: var(--accent, #1c58d9);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #1c58d9) 28%, transparent);
}
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.admin-row strong { display: block; }
.admin-row span { color: #6b7080; font-size: 13px; }
.admin-row select { border: 1px solid #d0d4dc; border-radius: 4px; padding: 6px 8px; background: #fff; color: var(--text-strong); }
.user-head, .admin-row.user-line {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
  align-items: center; gap: 16px;
}
.user-head.with-email, .admin-row.user-line.with-email {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.3fr) 76px; /* 76px: the row's ✎ ⋯ */
}
.admin-row .user-email.is-empty { color: #b0b4bd; }
@media (max-width: 800px) {
  /* Phones: name · login · actions on one line (the heading over the same
     columns), the address under them — only when there is one. */
  .user-head.with-email, .admin-row.user-line.with-email {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 76px;
    row-gap: 2px;
  }
  .user-head.with-email span:nth-child(3) { display: none; }
  .admin-row.user-line.with-email > .user-email-cell { grid-column: 1 / -1; grid-row: 2; }
  .admin-row.user-line.with-email > .user-email-cell.is-empty { display: none; }
  .admin-row.user-line.with-email .user-email { font-size: 13px; color: #6b7080; }
}
.user-head.with-role, .admin-row.user-line.with-role {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
}
.user-head {
  padding: 8px 0; border-bottom: 1px solid #eceef2;
  color: var(--text-strong); font-size: 14px; font-weight: 700;
}
.user-person { display: flex; align-items: center; min-width: 0; }
.user-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-login-cell {
  display: flex; align-items: center; gap: 4px; min-width: 0;
}
.admin-row .user-login {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-strong); font-size: 15px; min-width: 0; flex: 1;
}
.admin-row.is-disabled .user-person strong,
.admin-row.is-disabled .user-login { color: #8b8e98; }
.row-actions { position: relative; display: flex; align-items: center; gap: 2px; flex: none; }
.admin-row.user-line.with-email > .row-actions { justify-content: flex-end; }
.row-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; min-width: 230px;
  background: #fff; color: var(--text-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px 0;
}
.row-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 14px; color: var(--text-strong);
}
.row-menu button:hover { background: var(--accent-soft); }
.row-menu button.danger { color: #d24b4e; }
.settings-card h2 { margin: 22px 0 0; font-size: calc(15px * var(--text-scale, 1)); }
.settings-card input:disabled { background: #f4f5f7; color: #6b7080; }
.settings-card label { display: block; margin: 14px 0 4px; font-size: calc(13px * var(--text-scale, 1)); font-weight: 700; }
.settings-card input, .settings-card select { width: 100%; }
.settings-card input[type="text"],
.settings-card input[type="email"],
.settings-card input[type="password"],
.settings-card input:not([type]) {
  font-size: calc(15px * var(--text-scale, 1));
}
.settings-card select {
  border: 1px solid #d0d4dc; border-radius: 4px; padding: 8px 12px;
  background: #fff; color: var(--text-strong);
  font-size: calc(15px * var(--text-scale, 1)); font-weight: 700; line-height: 1.35;
  min-height: 0; box-sizing: border-box;
}
#setting-language {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: calc(15px * var(--text-scale, 1));
  font-weight: 400;
  padding: 8px 12px;
  min-height: 0;
}
.settings-card label.settings-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  cursor: pointer;
  font-size: calc(14px * var(--text-scale, 1));
  font-weight: 400;
  box-sizing: border-box;
}
.settings-card label.settings-toggle input[type="checkbox"] {
  /* Full-label hit target — Android WebView often ignores zero-size inputs. */
  position: absolute;
  inset: 0;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  pointer-events: auto;
  z-index: 2;
}
.settings-card .settings-toggle-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-card .settings-toggle-text strong {
  display: block;
  font-size: calc(14px * var(--text-scale, 1));
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.3;
}
.settings-card .settings-toggle-text > span {
  display: block;
  font-size: calc(13px * var(--text-scale, 1));
  color: #6b7080;
  font-weight: 400;
  line-height: 1.35;
}
.settings-card .settings-toggle-ui {
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cfd3db;
  position: relative;
  z-index: 1;
  transition: background .15s ease;
}
.settings-card .settings-toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .15s ease;
}
.settings-card label.settings-toggle input:checked + .settings-toggle-ui {
  background: var(--accent);
}
.settings-card label.settings-toggle input:checked + .settings-toggle-ui::after {
  transform: translateX(18px);
}
.settings-card label.settings-toggle:has(input:disabled) {
  opacity: .55;
  cursor: default;
}
.settings-card label.settings-toggle input:disabled {
  pointer-events: none;
  cursor: default;
}
.setting-line { display: flex; align-items: center; gap: 4px; }
.setting-line input { width: auto; flex: 1; min-width: 0; }
.role-name-row { margin-top: 10px; }
.role-name-row input { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.profile-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-bottom: 32px;
}
/* Settings Close/Save: «Сохранить» stays pale until something changed. */
.profile-actions .btn {
  flex: 1;
  width: auto;
  margin-top: 0;
  text-align: center;
}
.workspace-settings-block { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e6e8ee; }
.workspace-settings-block h1 { margin-top: 0; }
.workspace-settings-block.hidden { display: none !important; }
#admin-actions.hidden { display: none !important; }
#profile-actions.hidden { display: none !important; }
.composer-shell {
  border: var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  padding: 8px 8px 8px 10px;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  position: relative;
  z-index: 3;
  /* Allow the textarea to grow past one line without clipping. */
  max-height: none;
}
.composer-wrap {
  padding: 8px 16px calc(12px + var(--kb-inset, 0px));
  flex: none; background: transparent; border-top: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 3;
  overflow: visible;
}
.composer-shell.hidden { display: none !important; }
.composer-shell.has-draft { padding-top: 8px; }
.composer-draft {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 8px; min-height: 36px;
}
.composer-draft[hidden] { display: none !important; }
.composer-draft-accent {
  width: 3px; align-self: stretch; min-height: 32px; border-radius: 2px;
  background: var(--accent); flex: none;
}
.composer-draft-text { flex: 1; min-width: 0; padding-top: 1px; }
.composer-draft-title {
  color: var(--accent); font-size: 13px; font-weight: 600; line-height: 1.25;
}
.composer-draft-preview {
  color: #1f2430; font-size: 13px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.composer-shell.editing .composer-draft-preview { color: #8b8e98; }
.composer-draft-close {
  appearance: none; border: 0; background: transparent; color: #6b7080;
  width: 28px; height: 28px; font-size: 22px; line-height: 1;
  padding: 0; cursor: pointer; flex: none; border-radius: 4px;
  display: grid; place-items: center;
}
.composer-draft-close:hover { color: #1f2430; background: #f0f2f5; }
.select-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px 2px;
}
.select-bar.hidden { display: none !important; }
.select-bar .btn {
  border: 0;
  border-radius: 999px;
  background: #e6e7ea;
  color: #2c3038;
  box-shadow: none;
  padding: 10px 18px;
  min-width: 108px;
  font-size: 15px;
  font-weight: 600;
}
.select-bar .btn.danger {
  color: #d24b4e;
  background: #fff;
  border: 0;
  border-radius: 999px;
}
.select-bar .btn:hover:not(:disabled) { background: #dcdee2; }
.select-bar .btn.danger:hover:not(:disabled) { background: #f4f5f7; color: #d24b4e; }
.select-count {
  margin-right: auto; color: var(--text-strong); font-size: 14px; font-weight: 600;
}
.msg-menu {
  position: fixed; z-index: 80; min-width: 220px; max-width: min(92vw, 320px);
  background: #fff; border-radius: 12px; padding: 6px 0;
  box-shadow: 0 8px 28px rgba(20, 28, 45, .18), 0 0 0 1px rgba(20, 28, 45, .06);
  overflow: hidden;
}
.msg-menu.hidden { display: none !important; }
.msg-menu-reactions {
  display: flex; align-items: center; justify-content: space-between; gap: 0;
  padding: 8px 10px; border-bottom: 1px solid #eef0f4; box-sizing: border-box;
  width: 100%;
}
.msg-menu-react {
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; padding: 0; flex: 0 0 auto;
}
.msg-menu-react:hover, .msg-menu-react:focus-visible {
  background: #f3f5f8; outline: none;
}
.msg-menu-react.is-more {
  width: 26px; height: 26px; margin-left: 2px;
  background: #c8ccd4; color: #fff;
}
.msg-menu-react.is-more:hover,
.msg-menu-react.is-more:focus-visible {
  background: #b4b9c3;
}
.msg-menu-react.is-more svg {
  width: 15px; height: 15px; display: block;
}
.msg-menu-item {
  width: 100%; appearance: none; border: 0; background: transparent;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; color: #1f2430; font-size: 15px; text-align: left; cursor: pointer;
}
.msg-menu-item:hover, .msg-menu-item:focus-visible { background: #f3f5f8; outline: none; }
.msg-menu-item svg { width: 20px; height: 20px; flex: none; color: #5c6270; }
.msg-menu-ico-spacer {
  width: 20px; height: 20px; flex: none; display: block;
}
.msg-menu-item.has-trail > span:nth-child(2) { flex: 1; min-width: 0; }
.msg-menu-item.is-checkable > span:nth-child(2) { flex: 1; min-width: 0; }
.msg-menu-check {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0 0 0 auto;
  accent-color: var(--accent, #1c58d9);
  pointer-events: none;
}
.msg-menu-item.is-views {
  color: #1f2430;
}
.msg-menu-item.is-views:hover,
.msg-menu-item.is-views:focus-visible {
  background: #f3f5f8;
  color: #1f2430;
  outline: none;
}
.msg-menu-people {
  display: inline-flex; align-items: center; flex: none; margin-left: auto;
  height: 18px; max-height: 18px; overflow: visible;
}
.msg-menu-item .msg-menu-people .avatar.msg-menu-person,
.msg-menu-person {
  width: 18px !important; height: 18px !important;
  min-width: 18px !important; min-height: 18px !important;
  max-width: 18px !important; max-height: 18px !important;
  flex: 0 0 18px !important; align-self: center !important;
  font-size: 8px !important; line-height: 18px !important;
  margin-left: -5px; margin-top: 0 !important; margin-bottom: 0 !important;
  box-shadow: 0 0 0 1.5px #fff; pointer-events: none;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
.msg-menu-person:first-child { margin-left: 0; }
.msg-menu-item .msg-menu-people .avatar.msg-menu-person img,
.msg-menu-person img {
  position: absolute; inset: 0;
  width: 100% !important; height: 100% !important;
  object-fit: cover;
}
.msg-menu-item .msg-menu-people .avatar.msg-menu-person .presence,
.msg-menu-person .presence,
.msg-menu-views-flyout-av .presence {
  display: none !important;
}
.msg-menu-trailing {
  flex: none; margin-left: 6px; color: #8b8e98;
  font-size: 15px; font-weight: 700; letter-spacing: -0.5px; line-height: 1;
}
.msg-menu-views-flyout {
  position: fixed; z-index: 90; min-width: 176px; max-width: min(72vw, 240px);
  max-height: min(50vh, 280px); overflow: auto;
  background: #fff; border-radius: 12px; padding: 6px 0;
  box-shadow: 0 8px 28px rgba(20, 28, 45, .18), 0 0 0 1px rgba(20, 28, 45, .06);
}
.msg-menu-views-flyout-empty {
  padding: 12px 14px; color: #8b8e98; font-size: 13px; line-height: 1.3;
}
.msg-menu-views-flyout-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; min-width: 0;
}
.msg-menu-views-flyout-av {
  width: 28px !important; height: 28px !important;
  min-width: 28px !important; min-height: 28px !important;
  max-width: 28px !important; max-height: 28px !important;
  flex: 0 0 28px !important; align-self: center !important;
  font-size: 11px !important; overflow: hidden;
}
.msg-menu-views-flyout-av .presence {
  width: 8px; height: 8px;
}
.msg-menu-views-flyout-name {
  min-width: 0; flex: 1;
  color: #1f2430; font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-menu-item.danger { color: #d24b4e; }
.msg-menu-item.danger svg { color: #d24b4e; }
.msg-menu-item.is-disabled,
.msg-menu-item:disabled {
  opacity: .45; cursor: default; pointer-events: none;
}
.msg-menu-sep {
  height: 1px; margin: 6px 0; background: #eef0f4;
}
.nav-mute {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; opacity: .55; color: #c5ccd8;
}
.nav-mute svg { width: 14px; height: 14px; display: block; }
.nav-item .nav-mute:last-child { margin-left: auto; }

/* Разрешения → «Отправка писем» */
.mail-test-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.mail-test-card.hidden, #perm-mail-title.hidden { display: none !important; }
.mail-test-status { margin: 0; font-size: 14px; line-height: 1.45; color: #4b5161; }
.mail-test-status.is-off { color: #8a5a00; }
.mail-test-label { font-size: 13px; font-weight: 700; color: var(--text-strong, #1a1d26); margin-bottom: -4px; }
.mail-test-form { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-test-form input {
  flex: 1 1 220px; min-width: 0; height: 42px; padding: 0 12px; box-sizing: border-box;
  border: 1px solid #d8dce4; border-radius: 10px; font: inherit; font-size: 15px;
}
.mail-test-form .btn { flex: none; height: 42px; }
.mail-test-result { margin: 0; font-size: 14px; }
.mail-test-result:empty { display: none; }
.mail-test-result.is-ok { color: #0f7a4d; }
.mail-test-result.is-error { color: #d24b4e; }

/* Учётные записи → Корзина: who, since when and how long left; restore / delete for good. */
.admin-row.trash-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trash-row > div:first-child { flex: 1 1 220px; min-width: 0; }
.trash-actions { display: flex; gap: 8px; flex: none; }
.trash-actions .btn { padding: 8px 14px; font-size: 14px; }

/* Хранилище → Корзина: categories as chips, one row per deleted thing. */
.trash-view { display: flex; flex-direction: column; gap: 14px; }
.trash-lead { color: var(--muted, #6b7080); font-size: 14px; line-height: 1.45; }
.trash-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
.trash-kind { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(16, 24, 40, .1); background: rgba(255, 255, 255, .7); color: var(--text-strong, #1e325c); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.trash-kind b { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(16, 24, 40, .07); font-size: 12px; text-align: center; }
.trash-kind.is-active { background: var(--accent, #1c58d9); border-color: var(--accent, #1c58d9); color: #fff; }
.trash-kind.is-active b { background: rgba(255, 255, 255, .25); }
.trash-list { display: flex; flex-direction: column; }
.trash-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid rgba(16, 24, 40, .07); flex-wrap: wrap; }
.trash-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft, #eaf0fb); color: var(--accent, #1c58d9); }
.trash-info { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trash-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-info span { color: var(--muted, #6b7080); font-size: 13px; }
.trash-row-actions { display: flex; gap: 8px; flex: none; }
.trash-row-actions .btn { padding: 8px 14px; font-size: 14px; }
.trash-empty-all { align-self: flex-start; }
@media (max-width: 640px) {
  .trash-row-actions { width: 100%; padding-left: 52px; box-sizing: border-box; }
  .trash-row-actions .btn { flex: 1 1 0; }
}

/* Хранилище → «Состояние»: the chip at the right end of the tabs, and its window. */
.feature-tab.storage-state-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.storage-state-dialog { width: min(460px, calc(100vw - 24px)); }
.storage-state { display: flex; flex-direction: column; gap: 14px; }
.storage-state-top { position: relative; width: 168px; height: 168px; margin: 4px auto 6px; }
.storage-state-donut { width: 168px; height: 168px; display: block; }
.storage-state-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.storage-state-center b { font-size: 22px; color: var(--text-strong, #1e325c); }
.storage-state-center span { font-size: 13px; color: var(--muted, #6b7080); margin-top: 2px; }
.storage-state-card { display: block; width: 100%; box-sizing: border-box; padding: 4px 16px; border-radius: 16px; background: rgba(255, 255, 255, .85); border: 1px solid rgba(16, 24, 40, .07); font: inherit; text-align: left; color: inherit; }
.storage-state-head { padding: 10px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b7080); }
.storage-state-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(16, 24, 40, .07); }
.storage-state-head + .storage-state-row { border-top: 0; }
.storage-state-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.storage-state-name { flex: 1; min-width: 0; font-size: 15px; color: var(--text-strong, #1e325c); }
.storage-state-name small { margin-left: 8px; font-size: 14px; color: var(--muted, #8b8e98); }
.storage-state-val { font-size: 14px; color: var(--muted, #6b7080); white-space: nowrap; }
.storage-state-trash { cursor: pointer; }
.storage-state-trash .storage-state-row { border-top: 0; }
.storage-state-trash .storage-state-val::after { content: "›"; margin-left: 10px; font-size: 18px; vertical-align: -1px; }
.storage-state-trash:hover { background: #fff; }
.storage-state-note { font-size: 12.5px; color: var(--muted, #8b8e98); line-height: 1.45; padding: 0 4px; }
/* Phones: the tabs scroll sideways; «Состояние» stays pinned at the right edge. */
@media (max-width: 640px) {
  .feature-tab.storage-state-chip {
    position: sticky; right: 0; z-index: 1; flex: none;
    background: #fff;
    box-shadow: -14px 0 10px -4px #fff;
  }
  .feature-tab.storage-state-chip span { display: none; }
}
