/* Copyright (c) 2026 ООО «ГерсаСофт». Все права защищены. */
:root {
  --blue: #1f3864;
  --blue-dark: #15274a;
  --red: #dc2626;
  --ink: #242424;
  --muted: #5b6470;
  --line: #e6e4e1;
  --paper: #f5f5f5;
  --select: #e8eef8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }

/* Пока идёт проверка сессии — не показывать почту (без перекраски экрана входа). */
html.gm-auth-pending #app {
  display: none !important;
}
#login-form.is-busy {
  pointer-events: none;
  opacity: 0.94;
}
#login-form.is-busy .submit {
  opacity: 0.72;
}
.login {
  min-height: 100%;
  display: flex;
  background: #fff;
}
.legal-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  margin: 0;
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 13px;
  color: #5c6b80;
}
.legal-foot a { color: var(--blue, #1d4e89); text-decoration: none; }
.legal-foot a:hover { text-decoration: underline; }
.app-version-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(4px, env(safe-area-inset-bottom));
  z-index: 3;
  margin: 0;
  padding: 0 12px 2px;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(92, 107, 128, 0.72);
  pointer-events: none;
}
.app[hidden] .app-version-foot { display: none; }
html.gm-my-dock-on .app-version-foot { bottom: calc(58px + env(safe-area-inset-bottom)); }
body.neo .app-version-foot { color: rgba(197, 215, 245, 0.55); }
.login-brand, .login-form {
  flex: 1 1 50%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.login-brand { background: #fff; padding: 32px 24px; text-align: center; }
.login-brand img, .login-brand video {
  width: min(280px, 72vw);
  height: auto;
  max-height: 46vh;
  display: block;
  object-fit: contain;
  background: #fff;
}
.login-name {
  margin-top: 18px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue);
}
.login-hint { margin-top: 8px; font-size: 14px; color: var(--muted); }
.login-form { background: var(--blue); color: #fff; padding: 32px 24px; }
.guest-meet { margin: 0 0 16px; padding: 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; text-align: center; }
.guest-meet p { margin: 0 0 8px; }
.guest-meet button { border: 0; background: #fff; color: var(--blue); border-radius: 8px; padding: 8px 14px; }
.guest-meet .soon { color: #fecaca; min-height: 1.2em; }
.login-card { width: min(440px, 100%); }
.field { display: block; margin: 0 0 18px; }
.field > span:not(.control) { display: block; font-size: 12px; margin-bottom: 4px; }
.star { margin-left: 2px; }
.control {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding: 4px 0 6px;
}
.control svg { width: 18px; height: 18px; fill: #fff; stroke: none; flex: 0 0 auto; }
.control input, .control select {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 4px 0;
  min-width: 0;
}
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  transition: background-color 600000s 0s;
}
.control select { appearance: none; }
.control select option { color: var(--blue); }
.eye {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  width: 28px;
  height: 28px;
}
.eye svg { width: 20px; height: 20px; fill: none; stroke: #fff; }
.login-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 12px;
  margin-top: 8px;
  min-height: 92px;
}
.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}
.remember input { position: absolute; opacity: 0; }
.switch {
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.35);
  position: relative;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.remember input:checked + .switch { background: rgba(220, 38, 38, 0.7); }
.remember input:checked + .switch::after { left: 18px; background: var(--red); }
.about {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-style: italic;
  line-height: 1;
}
.submit {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  grid-row: 1 / span 2;
  grid-column: 2;
}
.submit svg { width: 26px; height: 26px; }
.submit:hover { background: #b91c1c; }
.submit:disabled { opacity: 0.7; }
.login-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #fecaca;
  font-size: 14px;
}
.login-totp { margin: 0 0 8px; }
.login-totp[hidden] { display: none; }
.login-qr { display: inline-block; background: #fff; padding: 8px; border-radius: 8px; }
.login-qr:empty { display: none; }
.login-qr img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; background: #fff; }
.login-secret { word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.web-totp-open {
  margin: 0 4px 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  text-align: left;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.web-totp { margin: 0 4px 12px; font-size: 13px; }
.web-totp input { width: 100%; margin: 6px 0; }
.web-totp button {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.web-totp .login-error { color: #b91c1c; }
.theme-login {
  grid-column: 1 / -1;
  justify-self: center;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  padding: 0;
  text-decoration: underline;
}
.theme-pick { position: relative; }
.theme-menu {
  position: absolute;
  z-index: 40;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  color: #1c2838;
  box-shadow: 0 16px 40px rgba(20, 24, 40, 0.2);
}
.theme-menu[hidden] { display: none !important; }
.theme-menu button,
.my-theme-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 10px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.theme-menu button::before,
.my-theme-list button::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.theme-menu button[data-theme="gersasoft"]::before,
.my-theme-list button[data-theme="gersasoft"]::before { background: #1f3864; box-shadow: inset 0 0 0 3px #dc2626; }
.theme-menu button[data-theme="sport"]::before,
.my-theme-list button[data-theme="sport"]::before { background: #1d4e89; }
.theme-menu button[data-theme="marble"]::before,
.my-theme-list button[data-theme="marble"]::before { background: #f4efe6; box-shadow: inset 0 0 0 3px #c6a15b; }
.theme-menu button[data-theme="pink"]::before,
.my-theme-list button[data-theme="pink"]::before { background: #ff8fb8; }
.theme-menu button[data-theme="tiffany"]::before,
.my-theme-list button[data-theme="tiffany"]::before { background: #8ee0d8; }
.theme-menu button[data-theme="tango"]::before,
.my-theme-list button[data-theme="tango"]::before { background: #c41e3a; }
.theme-menu button[data-theme="jade"]::before,
.my-theme-list button[data-theme="jade"]::before { background: #0f3d32; box-shadow: inset 0 0 0 3px #d4af37; }
.theme-menu button.is-on, .theme-menu button:hover,
.my-theme-list button.is-on, .my-theme-list button:hover { background: rgba(31, 56, 100, 0.08); }
.my-theme-list {
  display: grid;
  gap: 2px;
  max-width: 300px;
  margin-top: 14px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  color: #1c2838;
  box-shadow: 0 8px 24px rgba(20, 24, 40, 0.1);
  border: 1px solid rgba(31, 56, 100, 0.12);
}
.my-theme-current { margin-top: 8px; color: #475569; font-size: 14px; }
.my-theme-current .theme-current { color: #1c2838; }
.login .theme-menu { top: auto; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.rail .theme-menu { left: 8px; bottom: 52px; }
.filebox {
  grid-column: 1 / -1;
  justify-self: center;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.filebox:hover { text-decoration: underline; }

.app {
  height: 100%;
  display: flex;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(31, 56, 100, 0.08), transparent 60%),
    radial-gradient(700px 380px at 100% 100%, rgba(220, 38, 38, 0.07), transparent 55%),
    var(--paper);
  color: var(--ink);
}
body.guest-only .rail { display: none; }
.rail {
  width: 120px;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  flex: 0 0 auto;
  transition: width 0.2s ease, padding 0.2s ease;
}
.rail-fold {
  width: 28px;
  height: 22px;
  margin: 0 0 6px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.rail-fold svg { width: 16px; height: 16px; }
.rail-fold:hover { background: rgba(255, 255, 255, 0.28); }
.rail-edge {
  display: none;
  position: fixed;
  z-index: 40;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.rail-edge::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
  opacity: 0.7;
}
.rail-edge-tab {
  position: absolute;
  left: 0;
  top: 12px;
  width: 22px;
  height: 36px;
  border-radius: 0 8px 8px 0;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 10px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.rail-edge-tab svg { width: 16px; height: 16px; }
.rail-edge:hover .rail-edge-tab,
.rail-edge:focus-visible .rail-edge-tab {
  opacity: 1;
  transform: none;
}
@media (min-width: 961px) {
  body.rail-shut .rail {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right-width: 0;
  }
  body.rail-shut .rail-edge { display: block; }
}
body.day .rail-fold,
body.theme-marble .rail-fold,
body.theme-pink .rail-fold,
body.theme-tiffany .rail-fold {
  background: rgba(21, 39, 74, 0.08);
}
body.day .rail-fold:hover,
body.theme-marble .rail-fold:hover,
body.theme-pink .rail-fold:hover,
body.theme-tiffany .rail-fold:hover {
  background: rgba(21, 39, 74, 0.16);
}
body.day .rail-edge::before,
body.theme-marble .rail-edge::before,
body.theme-pink .rail-edge::before,
body.theme-tiffany .rail-edge::before { background: #1d4e89; }
body.neo .rail-edge-tab,
body.theme-jade .rail-edge-tab,
body.theme-tango .rail-edge-tab {
  background: #12203a;
  color: #e8f1ff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.rail-btn {
  width: 112px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn span { font-size: 10px; line-height: 1.15; text-align: center; max-width: 104px; overflow-wrap: anywhere; }
.rail-btn.is-on, .rail-btn:hover { background: rgba(255, 255, 255, 0.14); }
.theme-current { max-width: 100px; }
.shared-box { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 13px; }
.shared-box select { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 4px 8px; max-width: 220px; }
.rail-lang { cursor: pointer; margin-bottom: 4px; }
.rail-lang select {
  width: 100px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.16); color: #fff;
  font: inherit; font-size: 10px; padding: 2px 0; text-align: center; cursor: pointer;
}
.rail-lang select option { color: #15274a; }
.rail-lang .gm-lang-btn {
  width: 100px; justify-content: center; gap: 4px; border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 10px; padding: 3px 4px;
}
.rail-lang .gm-lang-btn svg.gm-flag { width: 16px; height: 11px; }
.control .gm-lang-btn { flex: 1; border: 0; background: transparent; color: #fff; padding: 4px 0; }
.rail-gap { flex: 1; }
.who {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 14px;
}
.workspace { flex: 1; min-width: 0; display: flex; gap: 8px; padding: 8px; }
.view-wide { display: block; }
.folders, .list-pane, .reader, .panel-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
}
.folders { width: 240px; flex: 0 0 auto; padding: 12px; overflow: auto; position: relative; }
.new-mail {
  width: 100%;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.new-mail svg { width: 18px; height: 18px; }
.new-mail:hover { background: var(--blue-dark); }
.new-folder {
  width: 100%;
  margin-top: 2px;
  border: 0;
  background: transparent;
  color: #8b93a0;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.new-folder svg { width: 16px; height: 16px; color: var(--blue); stroke-width: 1.6; }
.new-folder:hover { background: var(--select); color: var(--blue); }
.folder-form {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.folder-form input, .folder-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink);
  background: #fff;
}
.folder-where { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.folder-where select { margin-top: 4px; }
.folder-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.folder-actions { display: flex; gap: 8px; margin-top: 8px; }
.folder-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
}
.folder-actions button[type="submit"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.folder-error { margin: 8px 0 0; color: var(--red); font-size: 12px; }
.account {
  margin: 16px 4px 8px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}
.folders ul, .list-pane ul { list-style: none; margin: 0; padding: 0; }
.folders li {
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.folders li.is-on, .folders li:hover { background: var(--select); }
.badge {
  min-width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}
.list-pane { width: 360px; flex: 0 0 auto; display: flex; flex-direction: column; }
.list-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.list-head h1 { margin: 0 0 8px; font-size: 20px; }
.search-wrap { position: relative; display: block; }
.search-wrap .glass {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: var(--muted);
  pointer-events: none;
}
.list-head input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px 8px 34px;
  background: var(--paper);
}
#message-list { overflow: auto; flex: 1; }
#message-list li {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
#message-list li[draggable="true"] { cursor: grab; user-select: none; -webkit-user-drag: element; }
#message-list li.is-dragging { opacity: 0.4; cursor: grabbing; }
.folders li.drop-on {
  background: #d5e2f6;
  box-shadow: inset 0 0 0 2px var(--blue);
}
.folders li[draggable="true"] { cursor: grab; user-select: none; -webkit-user-drag: element; }
.folders li.is-child { box-shadow: inset 3px 0 0 #c5d4ee; }
.folder-note { margin: 6px 2px 0; font-size: 12px; color: var(--blue); }
.folder-move {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  padding: 0;
  display: grid;
  place-items: center;
}
.folder-move svg { width: 14px; height: 14px; }
.folder-move:hover, .folder-move[aria-expanded="true"] { background: #d5e2f6; }
.folder-move-menu {
  position: absolute;
  left: 12px;
  right: 12px;
  z-index: 4;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(21, 39, 74, 0.16);
  padding: 4px;
  max-height: 220px;
  overflow: auto;
}
.folder-move-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink);
}
.folder-move-menu button:hover { background: var(--select); }
.folder-move-menu button.folder-delete {
  color: var(--red);
  font-weight: 600;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
}
.folders li.is-dragging { opacity: 0.4; }
.folder-root-drop {
  margin: 2px 0 6px;
  padding: 8px 10px;
  border: 1px dashed #b9cceb;
  border-radius: 6px;
  color: var(--blue);
  font-size: 13px;
  text-align: center;
}
.folder-root-drop.drop-on {
  background: #d5e2f6;
  border-style: solid;
}
#message-list li.is-on { background: var(--select); }
#message-list li.unseen .subject { font-weight: 700; }
.subject { display: block; }
.from { color: var(--ink); }
.meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}
.reader-wrap { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.reader { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 18px 22px; }
.list-title-row { display: contents; }
.phone-folders-btn, .phone-compose, .phone-rail-btn, .phone-back, .folders-scrim { display: none; }
.empty-read, .people-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.people-empty { align-content: center; }
.people-empty h1 { margin-bottom: 8px; color: var(--ink); }
.read-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.read-tools button, .compose footer button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tool-ico, #compose-send .plane { width: 16px; height: 16px; flex: 0 0 auto; }
.compose footer button:hover { background: var(--paper); }
#compose-send { background: var(--blue); color: #fff; border-color: var(--blue); }
.read-tools button.act { font-weight: 600; padding: 6px 12px 6px 8px; }
.read-tools .tool-ico {
  width: 18px;
  height: 18px;
  padding: 4px;
  border-radius: 6px;
  box-sizing: content-box;
  stroke-width: 2.2;
  background: #fff;
}
.read-tools button.act-reply { color: #1f3864; background: #e7eef9; border-color: #b9cceb; }
.read-tools button.act-reply .tool-ico { color: #1f3864; }
.read-tools button.act-reply:hover { background: #d5e2f6; }
.read-tools button.act-forward { color: #0f6b4c; background: #e5f6ee; border-color: #b7e4cf; }
.read-tools button.act-forward .tool-ico { color: #0f6b4c; }
.read-tools button.act-forward:hover { background: #d3f0e3; }
.read-tools button.act-spam { color: #9a3412; background: #fff1e6; border-color: #f3c7a6; }
.read-tools button.act-spam .tool-ico { color: #c2410c; }
.read-tools button.act-spam:hover { background: #ffe4d1; }
.read-tools button.act-ham { color: #0f6b4c; background: #e5f6ee; border-color: #b7e4cf; }
.read-tools button.act-ham .tool-ico { color: #0f6b4c; }
.read-tools button.act-ham:hover { background: #d3f0e3; }
.read-tools button.act-delete { color: #fff; background: #dc2626; border-color: #dc2626; }
.read-tools button.act-delete .tool-ico { color: #fff; background: rgba(255, 255, 255, 0.16); }
.read-tools button.act-delete:hover { background: #b91c1c; border-color: #b91c1c; }
.read-tools button.act-rule { color: #5b3cc4; background: #f3eefe; border-color: #d9ccf5; }
.read-tools button.act-rule .tool-ico { color: #5b3cc4; }
.read-tools button.act-rule:hover { background: #e6dbfb; }
.filter-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 180px; overflow: auto; }
.filter-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.filter-list button {
  border: 0;
  background: transparent;
  color: var(--red);
  padding: 0;
  flex: 0 0 auto;
}
.folder-ico.inbox { color: #1f3864; }
.folder-ico.sent { color: #0f6b4c; }
.folder-ico.draft { color: #6d28d9; }
.folder-ico.spam { color: #c2410c; }
.folder-ico.trash { color: #dc2626; }
.folder-ico.archive { color: #0e7490; }
.read-subject { margin: 0 0 8px; font-size: 22px; }
.read-from { margin: 0; }
.read-to, .read-date { margin: 2px 0; color: var(--muted); font-size: 13px; }
.attach { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attach a {
  color: var(--blue);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.body-text { white-space: pre-wrap; line-height: 1.45; }
.body-frame { width: 100%; min-height: 360px; border: 0; background: #fff; }
.calendar-card { height: calc(100% - 0px); padding: 16px 18px; overflow: auto; }
.cal-head { display: flex; align-items: center; gap: 12px; }
.cal-head h1 { flex: 1; margin: 0; font-size: 22px; }
.cal-head button {
  width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 22px;
}
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays { margin-top: 12px; color: var(--muted); font-size: 12px; }
.cal-weekdays span, .cal-grid > div { padding: 8px; }
.cal-grid > div { min-height: 72px; border-top: 1px solid var(--line); }
.cal-grid .out { color: #b0b6bd; }
.cal-grid .today { background: var(--select); border-radius: 6px; font-weight: 700; }
.cal-grid > div { cursor: pointer; min-width: 0; }
.cal-num { display: block; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.cal-num:hover { color: var(--blue); text-decoration: underline; }
.cal-events { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cal-event {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 4px; padding: 1px 4px;
  background: #e7eef9; font: inherit; font-size: 11px; line-height: 1.35; color: var(--blue);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cal-event:hover { background: #d5e2f6; }
.cal-event.all-day { background: var(--blue); color: #fff; }
.cal-more { border: 0; background: transparent; padding: 0 4px; font-size: 11px; color: var(--muted); text-align: left; cursor: pointer; }
.cal-head .cal-today { width: auto; font-size: 14px; padding: 0 12px; }
.cal-views { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.cal-head .cal-views button {
  width: auto; height: auto; border: 0; border-radius: 0; background: #fff; padding: 8px 12px; font-size: 13px;
  color: var(--ink); cursor: pointer;
}
.cal-head .cal-views button + button { border-left: 1px solid var(--line); }
.cal-head .cal-views button.is-on { background: var(--blue); color: #fff; }
.cal-time { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tg-row { display: grid; border-bottom: 1px solid var(--line); }
.tg-day {
  border: 0; border-left: 1px solid var(--line); background: #fff; padding: 8px 4px; font: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer;
}
.tg-day.today { color: var(--blue); font-weight: 700; }
.tg-label { font-size: 11px; color: var(--muted); padding: 6px 4px; text-align: right; }
.tg-cell { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 26px; }
.tg-scroll { height: min(560px, calc(100vh - 330px)); min-height: 280px; overflow: auto; }
.tg-body { display: grid; position: relative; }
.tg-hours { position: relative; }
.tg-hours span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.tg-hours span:first-child { transform: none; }
.tg-col {
  position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 44px);
}
.tg-event {
  position: absolute; overflow: hidden; border: 0; border-left: 3px solid var(--blue); border-radius: 4px;
  background: #e7eef9; color: var(--blue); padding: 2px 4px; font: inherit; font-size: 12px; line-height: 1.3;
  text-align: left; cursor: pointer; z-index: 1;
}
.tg-event:hover { background: #d5e2f6; z-index: 2; }
.tg-where { display: block; color: var(--muted); font-size: 11px; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.cal-detail {
  margin-top: 12px; padding: 12px 14px; border: 1px solid #b9cceb; border-radius: 8px; background: #f6f9fe;
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
.cal-detail h2 { margin: 0 0 4px; font-size: 17px; }
.cal-detail p { margin: 2px 0; font-size: 13px; }
.cal-detail-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cal-detail-actions button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.cal-detail-actions .danger { background: var(--red); border-color: var(--red); color: #fff; }
.people-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.people-tools h1 { margin: 0; }
.people-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.people-all { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.people-all:hover { background: var(--select); }
.people-delete { border: 1px solid var(--red); background: var(--red); color: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.people-delete:hover { background: #b91c1c; }
.people-list { overflow: auto; flex: 1; }
.people-list li {
  display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.people-list li.is-on, .people-list li.is-picked, .people-list li:hover { background: var(--select); }
.people-list .people-check { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.people-menu {
  position: fixed; z-index: 50; min-width: 196px; padding: 4px;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.people-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: inherit; border-radius: 6px; padding: 8px 12px; cursor: pointer;
}
.people-menu button:hover { background: var(--select); }
.people-menu button.danger { color: var(--red); }
.people-list .people-empty-row { color: var(--muted); cursor: default; }
.people-list .people-empty-row:hover { background: transparent; }
.people-list .who {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  flex: 1; min-width: 0; width: auto; height: auto; margin: 0;
  border-radius: 0; background: none; box-shadow: none;
  font-weight: 400; font-size: 14px; line-height: 1.3; color: inherit;
}
.people-list .name { color: var(--ink); font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people-list .sub { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: #e7eef9; color: var(--blue);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.avatar.big { width: 52px; height: 52px; font-size: 22px; }
.person-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.person-head h2 { margin: 0; font-size: 22px; }
.person-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-kind { margin: 0; color: var(--muted); font-size: 13px; }
.person-lines { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.person-lines dt { color: var(--muted); font-size: 13px; }
.person-lines dd { margin: 0; }
.person-lines a { color: var(--blue); text-decoration: none; }
.person-note { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.person-form h2 { margin: 0 0 12px; font-size: 20px; }
.person-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.person-form label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.person-form input, .person-form textarea {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; color: var(--ink); background: #fff; font: inherit;
}
.person-form textarea { resize: vertical; }
#pf-save { background: var(--blue); color: #fff; border-color: var(--blue); }
.compose-later {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line);
  background: #f6f9fe; color: var(--muted); font-size: 13px;
}
.compose-later button { border: 1px solid #b9cceb; background: #fff; color: var(--blue); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.compose-later input { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; color: var(--ink); }
.compose-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.compose-clip {
  width: 36px; height: 36px; flex: 0 0 auto; padding: 0;
  display: grid; place-items: center; color: var(--blue);
}
.compose-clip svg { width: 20px; height: 20px; }
.compose-files {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line);
}
.compose-file {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px 4px 8px;
  font-size: 13px; color: var(--ink); background: var(--paper);
}
.compose-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.compose-file em { color: var(--muted); font-style: normal; font-size: 12px; flex: 0 0 auto; }
.compose-file button {
  border: 0; background: transparent; color: var(--muted); padding: 0 2px; font-size: 16px; line-height: 1;
}
.compose.is-drop { outline: 2px dashed var(--blue); outline-offset: -4px; }
#compose-disk { width: auto; padding: 0 10px; font-size: 12px; }
.disk-list, #disk-picker-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.disk-list li, #disk-picker-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.disk-list li:last-child, #disk-picker-list li:last-child { border-bottom: 0; }
.disk-list button, #disk-picker-list button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font: inherit; text-align: left; }
.disk-picker { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(8, 18, 35, 0.45); }
.disk-picker-card { width: min(520px, 92vw); max-height: 70vh; overflow: auto; background: var(--panel, #fff); border-radius: 10px; padding: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.disk-picker-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#compose-later-toggle.is-on { background: #e7eef9; border-color: #b9cceb; color: var(--blue); }
.scheduled-list { max-height: 320px; }
.scheduled-list li { align-items: flex-start; }
.scheduled-list button { color: var(--red); }
.sched-sent { color: var(--muted); }
.sched-error { color: var(--red); }
.cal-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.cal-form input, .cal-form > button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.cal-form > button:not(.cal-time-field) { background: var(--blue); color: #fff; border-color: var(--blue); cursor: pointer; }
.cal-form > button.cal-cancel, .cal-form > button.cal-online { background: #fff; color: var(--ink); border-color: var(--line); }
.cal-form > button.cal-online.is-on { background: var(--blue); color: #fff; border-color: var(--blue); }
#cal-location, #cal-guests { flex: 1 1 180px; min-width: 160px; }
.cal-allday { flex: 1 0 100%; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; cursor: pointer; }
.cal-allday input { width: 16px; height: 16px; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; }
.cal-form.is-allday .cal-time-field { display: none; }
.cal-time-field {
  display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 28px 0 8px; background: #fff; color: var(--ink); min-width: 108px; min-height: 38px;
  text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; position: relative;
}
.cal-time-field::after {
  content: ""; position: absolute; right: 10px; top: 50%; margin-top: -2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .7;
}
.cal-time-field.is-open { border-color: #2f6fed; box-shadow: 0 0 0 1px #2f6fed; }
.cal-part { border: 0; background: transparent; color: inherit; padding: 8px 2px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.cal-part.is-on { background: #dbe7ff; }
.cal-colon { padding: 0 1px; }
.cal-when-label { margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
.cal-when-label b { color: var(--ink); }
.cal-dur-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-dur-btns button { border: 1px solid var(--line); border-radius: 8px; min-width: 32px; padding: 7px 0; background: #fff; color: var(--ink); cursor: pointer; }
.cal-dur-btns button.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.cal-clock {
  position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 4px; width: max-content; min-width: 276px;
  max-width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; padding: 12px 14px 14px;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}
.cal-clock[hidden] { display: none; }
.cal-face-read { display: flex; justify-content: center; align-items: center; gap: 2px; font-size: 28px; font-variant-numeric: tabular-nums; }
.cal-face-read button { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 2px 8px; font: inherit; font-variant-numeric: tabular-nums; }
.cal-face-read button.is-on { background: #dbe7ff; color: var(--blue); }
.cal-face-title { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }
.cal-face { position: relative; width: 252px; height: 252px; margin: 6px auto 0; border-radius: 50%; background: #eef3f8; touch-action: none; }
.cal-hand {
  position: absolute; left: 50%; bottom: 50%; width: 2px; height: var(--hand, 38%); margin-left: -1px;
  background: var(--blue); transform-origin: center bottom; transform: rotate(var(--angle, 0deg));
  border-radius: 1px; pointer-events: none;
}
.cal-hub {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: var(--blue); pointer-events: none;
}
.cal-face button {
  position: absolute; transform: translate(-50%, -50%); border: 0; background: transparent; color: inherit;
  padding: 0; border-radius: 50%; display: grid; place-items: center; font: inherit;
}
.cal-face button.cal-num { width: 32px; height: 32px; font-size: 13px; }
.cal-face button.cal-dot { width: 4px; height: 4px; background: #93a0b3; }
.cal-face button.is-on, .cal-face button.cal-num:hover { background: var(--blue); color: #fff; width: 32px; height: 32px; font-size: 13px; }
.cal-menu {
  position: fixed; z-index: 60; min-width: 160px; padding: 4px;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.cal-menu[hidden] { display: none; }
.cal-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: inherit; border-radius: 6px; padding: 8px 12px; cursor: pointer; font: inherit;
}
.cal-menu button:hover { background: var(--select); }
.cal-menu button.danger { color: var(--red); }
.thread-count { margin-left: 6px; font-size: 11px; color: var(--blue); }
.thread-more { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.thread-more button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.thread-more button.is-on { border-color: var(--blue); color: var(--blue); }
.soon { color: var(--muted); }

.compose {
  position: fixed;
  right: 24px;
  bottom: 0;
  width: min(560px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 28px rgba(21, 39, 74, 0.2);
  z-index: 5;
}
.compose form { display: flex; flex-direction: column; }
.compose header, .compose footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--blue);
  color: #fff;
}
.compose footer { background: #fff; color: inherit; }
.compose header button {
  border: 0; background: transparent; color: #fff; font-size: 22px; line-height: 1;
}
.compose label { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pick-contact {
  width: 28px; height: 28px; flex: 0 0 auto; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--blue);
  display: grid; place-items: center;
}
.pick-contact:hover, .pick-contact[aria-expanded="true"] { background: var(--select); }
.compose-to span { flex: 0 0 auto; }
.contact-picker { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); }
.contact-picker input {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px;
}
.contact-picker ul { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; }
.contact-picker li button {
  width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 4px; border-radius: 6px;
}
.contact-picker li button:hover { background: var(--select); }
.contact-picker .who {
  display: block; width: auto; height: auto; margin: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.3;
}
.contact-picker .mail { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; }
.contact-empty { margin: 0; color: var(--muted); font-size: 13px; }
.compose input, .compose textarea {
  flex: 1; border: 0; outline: 0; color: var(--ink); resize: vertical;
}
#compose-error { color: var(--red); margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 39, 74, 0.45);
  display: grid;
  place-items: center;
  z-index: 6;
  padding: 16px;
}
.modal-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 18px 18px 14px;
  box-shadow: 0 16px 40px rgba(21, 39, 74, 0.25);
}
.modal-card h2 { margin: 0 0 12px; font-size: 20px; }
.modal-card label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.modal-card textarea { box-sizing: border-box; font: inherit; resize: vertical; }
.modal-card input, .modal-card select, .modal-card textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}
.modal-card .check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.modal-card .check input { width: auto; margin: 0; }
.mig-hint, .mig-status { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.mig-status.error { color: var(--red); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
}
#mig-start { background: var(--blue); color: #fff; border-color: var(--blue); }

.folder-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.folder-ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--blue); }
.pick-contact svg { width: 18px; height: 18px; }

svg.motion { overflow: visible; }
svg.motion * { transform-box: fill-box; transform-origin: center; }

@keyframes flap {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1.6px); }
}
@keyframes pin {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(2px); }
}
@keyframes pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
@keyframes mate {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1.6px); }
}
@keyframes lift {
  0% { transform: translateY(2px); opacity: 0.35; }
  100% { transform: translateY(-2px); opacity: 1; }
}
@keyframes slide-up {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -1px); }
}
@keyframes slide-down {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 1px); }
}
@keyframes slip {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}
@keyframes tilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-10deg); }
}
@keyframes fly {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4px, -4px); }
}
@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
@keyframes lid {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-12deg); }
}
@keyframes look {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(16deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.55; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.rail-btn.is-on .mail .flap,
.rail-btn:hover .mail .flap,
.folders li.is-on .inbox .flap,
.folders li:hover .inbox .flap { animation: flap 1.4s ease-in-out infinite; }
.rail-btn.is-on .cal .pin,
.rail-btn:hover .cal .pin { animation: pin 1.15s ease-in-out infinite; }
.rail-btn .cal .pin.late { animation-delay: 0.12s; }
.rail-btn.is-on .cal .dot,
.rail-btn:hover .cal .dot { animation: pop 1.15s ease-in-out infinite; }
.rail-btn.is-on .people .mate,
.rail-btn:hover .people .mate { animation: mate 1.5s ease-in-out infinite; }
.rail-btn:hover .cloud .lift,
.rail-btn.is-on .cloud .lift { animation: lift 1s ease-in-out infinite alternate; }
.rail-btn:hover .migrate .up,
.rail-btn.is-on .migrate .up { animation: slide-up 1.1s ease-in-out infinite; }
.rail-btn:hover .migrate .down,
.rail-btn.is-on .migrate .down { animation: slide-down 1.1s ease-in-out infinite; }
.rail-btn:hover .leave .out { animation: slip 0.7s ease-in-out infinite; }
.submit .go { animation: slip 1.6s ease-in-out infinite; }
.submit:hover .go { animation-duration: 0.55s; }
.eye:hover .pupil { animation: pop 0.7s ease-in-out infinite; }
.field:focus-within .control > svg { animation: bob 1.1s ease-in-out infinite; }
.new-mail .pen { transform-origin: 70% 30%; animation: tilt 2.4s ease-in-out infinite; }
.new-folder:hover .plus { animation: pop 0.7s ease-in-out infinite; }
.new-mail:hover .pen { animation-duration: 0.7s; }
.search-wrap:focus-within .glass { transform-origin: 11px 11px; animation: look 1.1s ease-in-out infinite; }
.pick-contact:hover .head,
.pick-contact[aria-expanded="true"] .head { animation: pop 0.8s ease-in-out infinite; }
#compose-send .plane { animation: fly 1.8s ease-in-out infinite; }
#compose-send:hover .plane { animation-duration: 0.55s; }
.folders li.is-on .sent .plane,
.folders li:hover .sent .plane { animation: fly 1.1s ease-in-out infinite; }
.folders li.is-on .draft .nib,
.folders li:hover .draft .nib,
.read-tools button:hover .reply,
.read-tools button:hover .forward { animation: slip 0.7s ease-in-out infinite; }
.folders li.is-on .spam .shield,
.folders li:hover .spam .shield,
.read-tools button:hover .spam .shield { animation: shake 0.7s ease-in-out infinite; }
.folders li.is-on .trash .lid,
.folders li:hover .trash .lid,
.read-tools button:hover .trash .lid { animation: lid 0.8s ease-in-out infinite; transform-origin: left center; }
.folders li.is-on .archive .box,
.folders li:hover .archive .box { animation: bob 1.2s ease-in-out infinite; }
.badge { animation: pulse 2s ease-in-out infinite; }

.chat-thread {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.chat-log {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bubble {
  max-width: min(560px, 82%);
  padding: 8px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-bubble.mine { align-self: flex-end; background: var(--blue); color: #fff; }
.chat-bubble.theirs { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); }
.chat-bubble.call {
  align-self: center;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 13px;
  padding: 2px 8px;
}
.chat-bubble.voice {
  background: var(--paper);
  color: inherit;
  border: 1px solid var(--line);
}
.chat-bubble.voice.mine { border-color: var(--blue); }
.chat-bubble.voice audio { display: block; width: min(260px, 70vw); height: 36px; margin-top: 6px; }
.chat-time { display: block; margin-top: 4px; font-size: 11px; opacity: 0.75; }
.chat-head { display: flex; align-items: center; gap: 12px; }
.chat-head h1 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-calls { display: flex; gap: 8px; flex: 0 0 auto; }
.chat-calls button {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.chat-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.chat-form textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: inherit;
}
.chat-form button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
.chat-form button.chat-tool {
  background: transparent;
  color: inherit;
  border: 1px solid var(--line);
}
.chat-form button.chat-tool.is-on { background: var(--red); color: #fff; border-color: transparent; }
.chat-emoji-box[hidden],
.chat-voice-note[hidden],
.chat-calls[hidden] { display: none !important; }
.chat-emoji-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 2px;
}
.chat-form .chat-emoji-box button {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 4px;
  font-size: 22px;
  line-height: 1;
}
.chat-voice-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--red); font-size: 13px; }
.chat-incoming {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, 0.55);
}
.chat-incoming-card, .chat-call {
  background: #101820;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.chat-incoming-card { width: min(420px, calc(100% - 32px)); padding: 20px; }
.chat-incoming-card p { margin: 0 0 14px; }
.chat-incoming-actions, .chat-call-tools, .chat-call-bar { display: flex; align-items: center; gap: 8px; }
.chat-call {
  position: fixed;
  inset: 16px;
  z-index: 81;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-call-bar, .chat-call-tools { padding: 10px 14px; background: #182230; }
.chat-call-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-call-stage video.remote,
.chat-call-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 1;
}
.chat-call-stage video.remote { opacity: 0; }
.chat-call-stage video.remote.is-live { opacity: 1; z-index: 2; }
.chat-call-stage video.local {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: min(220px, 32%);
  max-height: 28%;
  border-radius: 8px;
  background: #111;
  object-fit: cover;
  z-index: 3;
}
.chat-call-stage.is-audio video { display: none; }
.chat-call-stage:not(.is-audio) .chat-call-name { display: none; }
.chat-call-name { font-size: 28px; font-weight: 600; }
.chat-call button, .chat-incoming-card button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: #2a3a4e;
  color: #fff;
  cursor: pointer;
}
.chat-call button.danger, .chat-incoming-card button.danger { background: var(--red); }
.chat-call button.ok, .chat-incoming-card button.ok { background: #1f7a4d; }
.chat-call-sound { position: absolute; width: 0; height: 0; opacity: 0; }
.chat-empty { color: var(--muted); cursor: default; }
.chat-unread {
  min-width: 18px;
  text-align: center;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}
.chat-status { margin: 0 12px 8px; color: var(--red); font-size: 13px; }
.rail-btn .chat-badge {
  display: none;
  min-width: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}
.rail-btn .chat-badge.on { display: inline-block; }
body.neo .chat-thread { background: transparent; }
.mail-chats {
  width: 280px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
body.neo .mail-chats { background: transparent; }
.chat-find { display: block; margin: 8px 0; }
.chat-find input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: inherit;
}
#chat-people, #chat-list, #mail-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  min-height: 0;
}
#mail-chat-list, #chat-list { flex: 1; }
#chat-people li, #chat-list li, #mail-chat-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
#chat-people li:hover, #chat-list li:hover, #mail-chat-list li:hover, #chat-list li.is-on {
  background: rgba(127, 127, 127, 0.16);
}
.chat-person { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-person span, .chat-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-person small { color: var(--muted); font-size: 12px; }
.chat-place { margin-left: 6px; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 500; }
.chat-place.is-on { color: #1f7a4d; }
#chat-people li.chat-empty, #chat-list li.chat-empty, #mail-chat-list li.chat-empty { cursor: default; }
#chat-people li.chat-empty:hover, #chat-list li.chat-empty:hover, #mail-chat-list li.chat-empty:hover { background: transparent; }
@media (max-width: 1100px) {
  .mail-chats { width: 220px; }
}
@media (max-width: 960px) {
  .mail-chats { width: auto; max-height: 28vh; }
}
#message-list li.unseen .from::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: 1px;
  animation: pulse 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .motion, .motion *, .badge, .submit .go, .new-mail .pen, #compose-send .plane,
  .field:focus-within .control > svg, #message-list li.unseen .from::before,
  body.neo .submit {
    animation: none !important;
  }
}

@media (max-width: 960px) {
  .login { flex-direction: column; }
  .login-brand, .login-form { min-height: 0; flex-basis: auto; }
  .login-brand { padding-top: 40px; }
  .login-form {
    min-height: 0;
    padding-bottom: max(52px, calc(36px + env(safe-area-inset-bottom)));
  }
  body.neo .submit,
  body.neo .submit .go {
    animation: none !important;
  }
  body.neo .submit {
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.42) !important;
  }
  .workspace { flex-direction: column; }
  .folders, .list-pane { width: auto; }
  .list-pane { max-height: 40vh; }
}
.meet-stage { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.meet-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  align-content: start;
}
.meet-tile {
  position: relative;
  background: #101820;
  border-radius: 12px;
  overflow: hidden;
  min-height: 180px;
}
.meet-tile video { width: 100%; height: 220px; object-fit: cover; background: #000; display: block; }
.meet-tile span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
}
.meet-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meet-actions { margin-left: auto; display: flex; gap: 8px; }
#view-meet > .folders { width: 300px; }
#meet-form, .meet-plan { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
#meet-form input, #meet-add input, .meet-plan input, #meet-form button, #meet-add button, .meet-plan button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
#meet-go, #meet-person-add, #meet-add button, #meet-plan-add button, #meet-plan-start {
  background: var(--blue);
  color: #fff;
  border: 0;
}
.meet-row { display: flex; gap: 6px; }
.meet-row input { flex: 1; min-width: 0; }
.meet-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.meet-chips li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
#meet-form .meet-chips button, .meet-plan .meet-chips button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
}
.meet-hint { color: var(--muted); font-size: 12px; margin: 0; }
.meet-plan h2 { margin: 0; font-size: 22px; }
#meet-list li, #meet-plans li { cursor: pointer; }
#meet-list li small, #meet-plans li small { display: block; color: var(--muted); }
@media (max-width: 960px) {
  #view-meet > .folders { width: auto; }
}

/* Телефон: боковой rail слева (drawer), один экран — список или письмо, без split-view. */
@media (max-width: 960px) {
  html { -webkit-text-size-adjust: 100%; }
  html.gm-logged-in body {
    height: 100dvh;
    overflow: hidden;
  }
  .login {
    min-height: 100%;
  }
  .app {
    flex-direction: row;
    height: 100dvh;
    min-height: 0;
    position: relative;
  }
  .workspace {
    flex: 1;
    min-height: 0;
    min-width: 0;
    flex-direction: column;
    padding: 6px;
    gap: 6px;
  }
  .phone-rail-global {
    display: none;
    position: fixed;
    z-index: 22;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
  }
  .app:not([hidden]) .phone-rail-global { display: grid; }
  .app:has(#view-mail:not([hidden]):not(.is-reading)) .phone-rail-global { display: none; }
  .list-title-row .phone-rail-btn { display: none; }
  .app:has(#view-mail:not([hidden]):not(.is-reading)) #phone-rail-inline { display: grid; }
  .rail {
    position: fixed;
    z-index: 35;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(112px, 32vw);
    height: 100dvh;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: calc(10px + env(safe-area-inset-top)) 6px calc(10px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.35);
    border-radius: 0 16px 16px 0;
  }
  body.mobile-rail-open .rail { transform: none; }
  .rail-edge { display: none; }
  .rail-fold {
    display: grid;
    align-self: center;
    margin-bottom: 4px;
  }
  .rail::after { display: none; }
  .rail-gap {
    display: block;
    flex: 1 1 auto;
    min-height: 6px;
    width: 100%;
  }
  .rail-btn {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    padding: 8px 4px 6px;
    position: relative;
  }
  .rail-btn[data-view] {
    min-height: 52px;
  }
  .rail-btn[data-view] > span:not(.chat-badge) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
    line-height: 1.15;
    white-space: normal;
  }
  .rail-btn .chat-badge.on {
    position: absolute;
    top: 4px;
    right: 8px;
  }
  #open-filebox span, #logout span,
  .rail-lang > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    display: block;
    font-size: 9px;
    margin-top: 2px;
  }
  #open-filebox, #logout, .rail-lang, .who {
    width: 100%;
    min-height: 44px;
    margin: 0;
  }
  .who { width: 36px; height: 36px; align-self: center; font-size: 13px; }
  .rail-lang { margin: 0; }
  .rail-lang select, .rail-lang .gm-lang-btn { width: 100%; max-width: 100px; }

  .login { flex-direction: column; }
  .login-brand, .login-form { min-height: 0; flex-basis: auto; }
  .login-brand { padding: 12px 16px 0; }
  .login-form { min-height: 0; padding: 12px 16px 28px; justify-content: flex-start; }
  .login-name { margin-top: 6px; font-size: 22px; }
  .login-card { width: min(440px, 100%); }
  .control input, .control select, .list-head input, .compose input, .compose textarea,
  .chat-form textarea, .person-form input, .person-form textarea, .cal-form input {
    font-size: 16px;
  }

  .phone-back {
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    border: 0;
    background: transparent;
    color: var(--blue);
    font-weight: 600;
    padding: 6px 2px;
  }
  .phone-folders-btn, .phone-compose, .phone-rail-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    display: grid;
    place-items: center;
    padding: 0;
  }
  .phone-folders-btn, .phone-rail-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--blue);
  }
  .phone-compose { border: 0; background: var(--blue); color: #fff; }
  .phone-folders-btn svg, .phone-compose svg, .phone-rail-btn svg { width: 20px; height: 20px; }
  .list-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  .list-title-row h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.folders-open .folders-scrim,
  body.mobile-rail-open .folders-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    padding: 0;
    background: rgba(8, 14, 28, 0.48);
  }

  #view-mail > .folders {
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    max-height: none;
    border-radius: 0 16px 16px 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.28);
  }
  body.folders-open #view-mail > .folders { transform: none; }
  #view-mail .list-pane { width: auto; max-height: none; flex: 1; min-height: 0; }
  #view-mail .mail-chats,
  #view-mail .reader-wrap { display: none; }
  #view-mail:not(.is-reading) .reader { display: none; }
  #view-mail.is-reading > .folders,
  #view-mail.is-reading > .list-pane,
  #view-mail.is-reading .mail-chats { display: none; }
  #view-mail.is-reading .reader-wrap { display: flex; flex: 1; min-height: 0; }
  #view-mail.is-reading .phone-back { display: inline-flex; }
  .reader { padding: 8px 14px 18px; }
  .read-subject { font-size: 18px; overflow-wrap: anywhere; }
  .read-from, .read-to { overflow-wrap: anywhere; }
  .meta { min-width: 0; }
  .from { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .body-frame { min-height: 240px; }

  #view-people > .folders { width: auto; max-height: none; flex: 0 0 auto; }
  #view-people .folder-hint { display: none; }
  #view-people .account { margin: 8px 4px; }
  #view-people #book-list { display: flex; gap: 6px; }
  #view-people #book-list li { flex: 1; justify-content: center; }
  #view-people .list-pane { width: auto; max-height: none; flex: 1; min-height: 0; }
  #view-people .reader-wrap { display: none; }
  #view-people.is-person > .folders,
  #view-people.is-person > .list-pane { display: none; }
  #view-people.is-person .reader-wrap { display: flex; flex: 1; min-height: 0; }
  #view-people.is-person .phone-back { display: inline-flex; }
  .person-grid { grid-template-columns: 1fr; }
  .person-lines { grid-template-columns: 1fr; gap: 2px 0; }
  .person-lines dt { margin-top: 8px; }
  .people-tools { flex-wrap: wrap; }
  .people-tools h1 { font-size: 18px; }

  #view-chat > .folders { width: auto; max-height: none; flex: 1; min-height: 0; }
  #view-chat .chat-thread { display: none; }
  #view-chat.is-chat > .folders { display: none; }
  #view-chat.is-chat .chat-thread { display: flex; flex: 1; min-height: 0; width: auto; }
  #view-chat.is-chat .phone-back { display: inline-flex; }
  #chat-body { order: -1; flex: 1 1 100%; }
  .chat-form button { padding: 8px 10px; }
  .chat-head { flex-wrap: nowrap; }
  .chat-head h1 { font-size: 16px; }
  .chat-call { inset: 0; border-radius: 0; }

  #view-meet { min-height: 0; }
  #view-meet > .folders { width: auto; max-height: none; flex: 1; min-height: 0; }
  #view-meet .meet-stage { display: none; }
  #view-meet.is-meet > .folders { display: none; }
  #view-meet.is-meet .meet-stage { display: flex; flex: 1; min-height: 0; }
  #view-meet.is-meet #meet-back { display: inline-flex; }
  #view-meet.is-meet:has(#meet-bar:not([hidden])) #meet-back { display: none; }
  .meet-grid { grid-template-columns: 1fr; }
  .meet-tile { min-height: 140px; }
  .meet-tile video { height: min(220px, 42vh); }
  .meet-actions { margin-left: 0; }

  #view-calendar { min-height: 0; overflow: auto; }
  .calendar-card { height: auto; min-height: 100%; padding: 10px 12px 16px; }
  .cal-head { flex-wrap: wrap; gap: 6px; }
  .cal-head h1 { order: -1; flex: 1 1 100%; font-size: 18px; }
  .cal-head .cal-views button { padding: 6px 8px; }
  .cal-weekdays { font-size: 10px; }
  .cal-weekdays span, .cal-grid > div { padding: 3px 2px; }
  .cal-grid > div { min-height: 48px; }
  .cal-event { font-size: 10px; }
  .cal-form input, .cal-time-field { min-width: 0; flex: 1 1 calc(50% - 8px); }
  #cal-summary, #cal-location, #cal-guests { flex: 1 1 100%; }
  .cal-detail { flex-direction: column; }
  .cal-time { overflow-x: auto; }
  .cal-face { width: min(252px, calc(100vw - 48px)); height: min(252px, calc(100vw - 48px)); }

  .compose {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: auto;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
  }
  .compose form { flex: 1; min-height: 0; overflow: auto; }
  .compose textarea { min-height: 140px; }
  .modal { padding: 0; align-items: end; }
  .modal-card {
    width: 100%;
    max-height: min(92dvh, 100%);
    overflow: auto;
    border-radius: 16px 16px 0 0;
  }
  .modal-actions { flex-wrap: wrap; }
}

#view-my.view-wide { display: block; }
.my-card { flex: 1; min-width: 0; overflow: auto; padding: 22px 24px 32px; }
#my-cabinet-dock { display: none; }
#my-cabinet-dock[hidden] { display: none !important; }
@media (min-width: 961px) {
  body:has(#view-my:not([hidden]) #my-home:not([hidden])) #my-cabinet-dock:not([hidden]) {
    display: grid;
    gap: 10px;
    position: fixed;
    z-index: 36;
    top: 16px;
    right: 16px;
    bottom: auto;
    left: auto;
    width: min(300px, calc(100vw - 32px));
    max-width: 300px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    background: #fff;
  }
}
.my-head h1, .my-card > section > h1 { margin: 0 0 6px; font-size: 28px; font-weight: 650; }
.my-head p, .my-hint { margin: 0; max-width: 560px; color: var(--muted); }
.my-menu { display: grid; gap: 10px; max-width: 420px; margin-top: 18px; }
.my-cabinet { display: block; }
.my-cabinet-main { min-width: 0; }
.my-line { display: flex; flex-direction: column; gap: 6px; }
.my-line-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-menu button, .my-back {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px;
  padding: 12px 14px; text-align: left; font-size: 16px;
}
.my-menu button { display: flex; align-items: center; gap: 12px; }
.my-back { margin-bottom: 14px; padding: 8px 12px; font-size: 14px; }
.my-form { display: flex; flex-direction: column; align-items: stretch; gap: 14px; max-width: 720px; margin-top: 16px; }
.my-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.my-label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.my-ico {
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: 0 0 auto;
  color: #1d4e89; background: #e7f0fa; box-shadow: inset 0 0 0 1px #d3e0f0;
}
.my-ico svg { width: 16px; height: 16px; }
.my-ico.wa { color: #128C7E; background: #e7f8ef; box-shadow: inset 0 0 0 1px #b7e7cb; }
.my-ico.max { color: #4f46e5; background: #eef0ff; box-shadow: inset 0 0 0 1px #d4d7fb; }
.my-ico.tg { color: #168acd; background: #e7f5fd; box-shadow: inset 0 0 0 1px #b9dff3; }
.my-ico.wx { color: #07904a; background: #e8f8ee; box-shadow: inset 0 0 0 1px #b7e7c8; }
.my-ico.migrate { color: #2563eb; background: #eff6ff; box-shadow: inset 0 0 0 1px #bfdbfe; }
.my-ico.palette { color: #7c3aed; background: #f5f3ff; box-shadow: inset 0 0 0 1px #ddd6fe; }
.my-ico.palette svg { fill: currentColor; stroke: none; }
.my-block {
  display: flex; flex-direction: column; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.55);
}
.my-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-block-head h2, .my-form h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.my-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.my-sign-main { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.my-sign-main textarea { width: 100%; }
.my-quiet {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 6px 10px;
}
.my-dates { display: flex; gap: 12px; }
.my-dates label { flex: 1; }
.my-form input[type="text"], .my-form input[type="password"], .my-form input[type="tel"], .my-form input[type="date"], .my-form input[type="email"], .my-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink);
}
.my-form textarea { min-height: 140px; resize: vertical; }
.my-check { flex-direction: row !important; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; cursor: pointer; }
.my-check input { width: 16px; height: 16px; margin: 0; }
.my-photo, .my-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.my-photo button, .my-logo button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 6px 10px; }
.my-photo-frame, .my-logo-frame {
  position: relative; overflow: hidden; border-radius: 16px; border: 1px solid #c5d4e8; background: #f4f7fb; color: #1d4e89;
  box-shadow: inset 0 0 0 1px #fff, 0 0 0 4px rgba(29, 78, 137, 0.06);
}
.my-photo-frame { width: 132px; height: 164px; }
.my-logo-frame { width: 220px; height: 96px; }
.my-photo-frame img, .my-logo-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; background: transparent;
}
.my-logo-frame img { object-fit: contain; background: #fff; }
.my-photo-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.my-photo-empty svg { width: 36px; height: 36px; }
.my-photo-frame.has-photo .my-photo-empty, .my-logo-frame.has-photo .my-photo-empty { display: none; }
.my-file input { display: block; margin-top: 6px; }
.my-sign { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.my-form h2 { margin: 8px 0 0; font-size: 18px; color: var(--ink); }
.my-form > button {
  align-self: flex-start; border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: 8px; padding: 8px 14px;
}
.my-form p, .my-list { margin: 0; }
.my-list p, .my-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.my-list { list-style: none; padding: 0; max-width: 560px; }
.my-actions { display: flex; gap: 8px; margin-left: auto; }
.my-list button {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 6px 10px;
}
.rdp-workspace { background: #0b1120; color: #e2e8f0; }
.rdp-home { flex: 1; min-width: 0; overflow: auto; padding: 22px 24px 32px; }
.rdp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.rdp-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 650; }
.rdp-head p { margin: 0; max-width: 520px; color: #94a3b8; }
.rdp-head-actions, .rdp-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rdp-head-actions button, .rdp-form-actions button, .rdp-bar button, .rdp-card-del {
  border: 1px solid #334155; background: #1e293b; color: #e2e8f0; border-radius: 8px; padding: 8px 12px;
}
.rdp-primary { background: #1d4e89; border-color: #1d4e89; }
.rdp-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.rdp-status, .rdp-form-error { min-height: 1.2em; color: #fecaca; }
.rdp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.rdp-empty { color: #94a3b8; }
.rdp-card { position: relative; background: #1e293b; border: 1px solid #334155; border-radius: 14px; }
.rdp-card:hover { border-color: #38bdf8; }
.rdp-card-open {
  width: 100%; min-height: 148px; border: 0; background: transparent; color: inherit; text-align: left;
  padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.rdp-card-open strong { font-size: 16px; padding-right: 72px; }
.rdp-card-open span { color: #94a3b8; font-size: 13px; }
.rdp-badge { align-self: flex-start; color: #e0f2fe !important; background: #1d4e89; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.rdp-card-del { position: absolute; top: 10px; right: 10px; padding: 4px 8px; font-size: 12px; color: #fecaca; }
.rdp-modal { position: fixed; inset: 0; z-index: 80; background: rgba(2, 6, 23, 0.72); display: grid; place-items: center; padding: 16px; }
.rdp-modal[hidden] { display: none !important; }
.rdp-modal-card { width: min(440px, 100%); background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b; border-radius: 16px; padding: 18px; }
.rdp-modal-card h2 { margin: 0 0 14px; }
.rdp-modal-card label { display: none; margin: 0 0 10px; font-size: 13px; }
.rdp-modal-card[data-mode="add"] label[data-rdp~="add"],
.rdp-modal-card[data-mode="quick"] label[data-rdp~="quick"],
.rdp-modal-card[data-mode="open"] label[data-rdp~="open"] { display: block; }
.rdp-modal-card[data-mode="add"] label.rdp-check[data-rdp~="add"],
.rdp-modal-card[data-mode="quick"] label.rdp-check[data-rdp~="quick"] { display: flex; align-items: center; gap: 8px; }
.rdp-modal-card input[type="text"], .rdp-modal-card input[type="password"], .rdp-modal-card input[type="number"] {
  width: 100%; margin-top: 4px; background: #0b1120; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 8px 10px;
}
.rdp-check input { width: auto; margin: 0; }
.rdp-session { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; flex-direction: column; }
.rdp-session[hidden] { display: none !important; }
.rdp-bar {
  height: 38px; flex: 0 0 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: #0f172a; border-bottom: 1px solid #1e293b; color: #e2e8f0;
}
.rdp-bar strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdp-bar button { padding: 4px 8px; font-size: 12px; line-height: 1.2; }
.rdp-bar-gap { flex: 1; }
.rdp-indicator { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; flex: 0 0 auto; }
.rdp-indicator.is-on { background: #22c55e; }
.rdp-indicator.is-off { background: #ef4444; }
.rdp-clip { position: absolute; top: 42px; right: 12px; z-index: 2; width: min(420px, calc(100% - 24px)); background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 10px; }
.rdp-clip[hidden] { display: none !important; }
.rdp-clip textarea { width: 100%; min-height: 120px; resize: vertical; background: #0b1120; color: #e2e8f0; border: 1px solid #334155; border-radius: 8px; padding: 8px; }
.rdp-screen { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #000; outline: none; }
.rdp-card-open:focus-visible, .rdp-bar button:focus-visible, .rdp-head-actions button:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
#view-gersadoc {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: var(--panel, #f4f7fb);
  color: var(--ink, inherit);
}
#view-gersadoc[hidden] { display: none !important; }
#view-gersadoc .doc-shell { flex: 1 1 0; min-height: 0; height: auto; }
.doc-commands { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 8px 10px; overflow-x: auto; background: var(--panel, #fff); border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.doc-commands button { flex: 1 1 auto; min-width: max-content; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 14%, var(--panel, #fff)); color: inherit; border-radius: 8px; padding: 6px 8px; font-size: 12px; line-height: 1.2; cursor: pointer; }
.doc-cmd-ico { width: 18px; height: 18px; flex: 0 0 auto; }
.doc-cmd-ico path, .doc-cmd-ico circle { stroke-width: 1.8; }
.doc-commands [data-screen="home"] .board { stroke: #38bdf8; fill: rgba(56, 189, 248, 0.16); }
.doc-commands [data-screen="home"] .band { stroke: #f59e0b; fill: rgba(245, 158, 11, 0.45); }
.doc-commands [data-screen="home"] .row { stroke: #34d399; }
.doc-commands [data-screen="docs"] .sheet { stroke: #818cf8; fill: rgba(129, 140, 248, 0.22); }
.doc-commands [data-screen="docs"] .fold { stroke: #a5b4fc; }
.doc-commands [data-screen="docs"] .lines { stroke: #67e8f9; }
.doc-commands [data-screen="search"] .glass,
.doc-home-tools [data-screen="search"] .glass { stroke: #22d3ee; fill: rgba(34, 211, 238, 0.16); }
.doc-commands [data-screen="search"] .handle,
.doc-home-tools [data-screen="search"] .handle { stroke: #f472b6; }
.doc-commands [data-screen="reports"] .low,
.doc-home-tools [data-screen="reports"] .low { stroke: #a78bfa; }
.doc-commands [data-screen="reports"] .mid,
.doc-home-tools [data-screen="reports"] .mid { stroke: #34d399; }
.doc-commands [data-screen="reports"] .high,
.doc-home-tools [data-screen="reports"] .high { stroke: #fbbf24; }
.doc-commands [data-screen="calendar"] .body { stroke: #fb7185; fill: rgba(251, 113, 133, 0.2); }
.doc-commands [data-screen="calendar"] .head,
.doc-commands [data-screen="calendar"] .pin { stroke: #fda4af; }
.doc-commands [data-screen="by_dept"] .house { stroke: #2dd4bf; fill: rgba(45, 212, 191, 0.18); }
.doc-commands [data-screen="by_dept"] .door { stroke: #fde68a; }
.doc-commands [data-screen="structure"] .link { stroke: #fb923c; }
.doc-commands [data-screen="structure"] .node { stroke: #f472b6; fill: #f472b6; }
.doc-commands button.is-on { background: color-mix(in srgb, var(--accent, #3b82f6) 46%, var(--panel, #fff)); border-color: color-mix(in srgb, var(--accent, #3b82f6) 60%, transparent); }
.doc-home, .doc-extra { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: var(--panel, #fff); }
.doc-create-window {
  position: absolute; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: flex-start;
  overflow: auto; padding: 28px 16px; background: color-mix(in srgb, #0f172a 42%, transparent);
}
.doc-create-window[hidden] { display: none !important; }
.doc-create-sheet {
  position: relative; width: min(980px, 100%); margin: auto 0; padding: 16px 16px 8px;
  border-radius: 12px; border: 2px solid #e0f2fe; background: var(--panel, #fff); color: inherit;
  box-shadow: 0 0 0 1px #7dd3fc, 0 0 16px rgba(224, 242, 254, 0.95), 0 0 42px rgba(125, 211, 252, 0.7), 0 18px 50px rgba(15, 23, 42, 0.28);
}
.doc-create-close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.doc-create-close:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.doc-create { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.doc-create-main, .doc-create-files { border: 1px solid rgba(224, 242, 254, 0.34); box-shadow: 0 0 3px rgba(186, 230, 253, 0.2); border-radius: 8px; padding: 14px 16px; background: var(--panel, #fff); }
.doc-create-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.doc-create h2 { margin: 0; font-size: 16px; }
.doc-create-number { font-variant-numeric: tabular-nums; }
.doc-create label { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; align-items: center; margin: 0 0 8px; }
.doc-create label.doc-create-wide, .doc-create label.doc-create-pick { align-items: start; }
.doc-applicant { display: grid; gap: 6px; }
.doc-applicant-role { font-size: 12px; opacity: 0.75; text-align: left; }
.doc-addressee { display: flex; gap: 6px; align-items: center; }
#doc-addressee-label, #doc-notice-label { cursor: pointer; }
.doc-addressee input, .doc-addressee-wrap > input[readonly] { flex: 1; min-width: 0; width: 100%; box-sizing: border-box; }
#doc-addressee-picker, #doc-notice-picker { margin-top: 8px; border: 1px solid rgba(224, 242, 254, 0.34); box-shadow: 0 0 3px rgba(186, 230, 253, 0.2); border-radius: 8px; padding: 8px; }
#doc-addressee-picker input, #doc-notice-picker input { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
#doc-addressee-tree, #doc-notice-tree { max-height: 320px; overflow: auto; }
.doc-notice-bar { margin: 0 0 8px 178px; }
#doc-notice-open,
.doc-create .doc-actions button {
  border: 1px solid rgba(224, 242, 254, 0.38);
  box-shadow: 0 0 3px rgba(186, 230, 253, 0.22);
}
.doc-person { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.doc-person small { font-size: 11px; opacity: 0.72; }
.doc-person:hover, .doc-person.is-on { background: color-mix(in srgb, var(--accent, #1f3864) 16%, transparent); }
.doc-tree-row { display: flex; align-items: center; gap: 2px; min-height: 26px; cursor: pointer; }
.doc-tree-fold { width: 22px; height: 22px; flex: 0 0 auto; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.doc-tree-dept { font-weight: 650; }
.doc-tree-kids { margin: 0 0 4px 10px; padding-left: 8px; border-left: 1px solid color-mix(in srgb, currentColor 28%, transparent); }
.doc-org-mini { margin-left: 10px; }
.doc-watch { margin-top: 6px; font-size: 13px; }
.doc-create label span { text-align: right; }
.doc-create input, .doc-create select, .doc-create textarea { width: 100%; box-sizing: border-box; border: 1px solid rgba(224, 242, 254, 0.34); box-shadow: 0 0 3px rgba(186, 230, 253, 0.2); border-radius: 6px; padding: 6px 8px; background: var(--panel, #fff); color: inherit; font: inherit; }
.doc-create input:focus, .doc-create select:focus, .doc-create textarea:focus { outline: none; border-color: rgba(224, 242, 254, 0.55); box-shadow: 0 0 4px rgba(186, 230, 253, 0.32); }
.doc-create textarea { min-height: 110px; resize: vertical; }
.doc-create label:has(:required) span::after, .doc-create-cash label span::after { content: " *"; color: #dc2626; }
.doc-create .doc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.doc-create-files ul { list-style: none; min-height: 180px; margin: 8px 0; padding: 8px; border: 1px solid rgba(224, 242, 254, 0.34); box-shadow: 0 0 3px rgba(186, 230, 253, 0.2); border-radius: 6px; }
.doc-create-files li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; }
.doc-file-drop { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 4px; font-size: 16px; line-height: 1; }
.doc-create-list { margin-top: 18px; }
.doc-create-list tr { cursor: pointer; }
.doc-late { color: #dc2626; font-weight: 600; }
.doc-file-add { display: inline-flex; align-items: center; border: 1px solid rgba(224, 242, 254, 0.34); box-shadow: 0 0 3px rgba(186, 230, 253, 0.2); border-radius: 8px; padding: 6px 10px; background: color-mix(in srgb, currentColor 14%, var(--panel, #fff)); color: inherit; cursor: pointer; }
@media (max-width: 860px) {
  .doc-create { grid-template-columns: 1fr; }
  .doc-create label, .doc-create label span { grid-template-columns: 1fr; text-align: left; }
}
.doc-home[hidden], .doc-extra[hidden], #doc-journal[hidden] { display: none !important; }
.doc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.doc-year-head { text-align: right; margin-bottom: 8px; }
.doc-year-board { display: grid; grid-template-columns: auto minmax(0, 920px) auto; gap: 18px; align-items: center; justify-content: center; }
.doc-home-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.doc-home-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-home-tools button { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 14%, var(--panel, #fff)); color: inherit; border-radius: 8px; padding: 6px 10px; font-size: 12px; line-height: 1.2; cursor: pointer; }
.doc-year-side { border: 1px solid var(--line, rgba(0,0,0,.18)); background: var(--panel, #fff); color: inherit; border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.doc-bestdoc { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: 100%; }
.doc-bestdoc section { border: 1px solid var(--line, rgba(0,0,0,.16)); background: var(--panel, #fff); border-radius: 4px; overflow: hidden; }
.doc-bestdoc h2 { margin: 0; padding: 7px 12px; background: color-mix(in srgb, var(--accent, #1f3864) 78%, #0b1e3a); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.doc-fresh { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; display: inline-block; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.28); }
.doc-node .doc-fresh, .doc-row .doc-fresh { align-self: center; margin-right: 4px; }
.doc-node { display: flex; align-items: baseline; gap: 8px; width: 100%; border: 0; background: transparent; color: inherit; padding: 4px 10px; text-align: left; font: inherit; }
button.doc-node { cursor: pointer; }
button.doc-node:hover .doc-node-label { color: var(--accent, #1f3864); }
.doc-node.is-child { padding-left: 32px; }
.doc-branch-row { display: flex; align-items: center; }
.doc-branch-row .doc-node { flex: 1 1 auto; width: auto; min-width: 0; }
.doc-branch-toggle { flex: 0 0 18px; width: 18px; height: 22px; margin-left: 4px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.doc-branch-toggle::before { content: ""; display: block; width: 0; height: 0; margin: 0 auto; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 6px solid currentColor; }
.doc-branch.is-open .doc-branch-toggle::before { border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; border-bottom: 0; }
.doc-branch.is-shut .doc-branch-kids { display: none; }
.doc-ico { width: 18px; height: 18px; flex: 0 0 auto; display: inline-flex; align-self: center; }
.doc-ico svg { width: 18px; height: 18px; overflow: visible; stroke-width: 1.8; filter: drop-shadow(0 0 3px color-mix(in srgb, currentColor 70%, transparent)); }
.doc-ico .doc-blob { fill: currentColor; opacity: 0.18; stroke: none; }
.doc-folder-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.doc-ico.is-total { color: #7c3aed; }
.doc-ico.is-received { color: #0284c7; }
.doc-ico.is-reported { color: #d97706; }
.doc-ico.is-addressed { color: #db2777; }
.doc-ico.is-pending { color: #ea580c; }
.doc-ico.is-answered { color: #0d9488; }
.doc-ico.is-task-in { color: #0891b2; }
.doc-ico.is-task-out { color: #7c3aed; }
.doc-ico.is-sent { color: #059669; }
.doc-ico.is-done { color: #16a34a; }
.doc-ico.is-rejected { color: #dc2626; }
.doc-ico.is-overdue { color: #e11d48; }
.doc-ico.is-off { color: #9333ea; }
.doc-ico.is-drafts { color: #7c3aed; }
.doc-ico.is-archive { color: #0284c7; }
.doc-ico.is-queue { color: #d97706; }
.doc-ico.is-watch { color: #059669; }
.doc-ico.is-structure { color: #c026d3; }
.rail-btn[data-view="gersadoc"] svg { color: #c4b5fd; }
.rail-btn[data-view="gersadoc"] svg .fold { stroke: #f9a8d4; }
.rail-btn[data-view="gersadoc"] svg .lines { stroke: #67e8f9; }
.rail-btn[data-view="gersadoc"].is-on svg,
.rail-btn[data-view="gersadoc"]:hover svg { filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.9)); }
.doc-node-label { text-decoration: underline; text-underline-offset: 2px; }
.doc-node-dots { flex: 1 1 auto; border-bottom: 1px dotted color-mix(in srgb, currentColor 55%, transparent); transform: translateY(-4px); min-width: 16px; }
.doc-node-count { min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .doc-year-board { grid-template-columns: 1fr; }
  .doc-bestdoc { grid-template-columns: 1fr; }
}
.doc-summary button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--line, rgba(0,0,0,.12)); background: var(--panel, #fff); color: inherit; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.doc-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.doc-month { border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 8px; padding: 8px; background: var(--panel, #fff); }
.doc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.doc-day { text-align: center; font-size: 12px; padding: 4px 0; border-radius: 4px; }
.doc-day.is-off { background: color-mix(in srgb, #eab308 35%, var(--panel, #fff)); }
.doc-day.is-holiday { background: color-mix(in srgb, #ef4444 28%, var(--panel, #fff)); }
.doc-day.is-work { background: color-mix(in srgb, #22c55e 28%, var(--panel, #fff)); }
.doc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.doc-dot.is-gray { background: #94a3b8; }
.doc-dot.is-green { background: #16a34a; }
.doc-dot.is-red { background: #dc2626; }
.doc-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0; width: 100%; min-height: 0; height: 100%; overflow: hidden; }
.doc-shell.is-united { grid-template-columns: minmax(0, 1fr); }
.doc-shell.is-united .doc-tree { display: none; }
.doc-filters { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); background: var(--panel, #fff); }
.doc-filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.doc-filter-row > span { font-size: 12px; opacity: .7; }
.doc-chip { border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 14%, var(--panel, #fff)); color: inherit; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.doc-chip.is-on { background: color-mix(in srgb, var(--accent, #3b82f6) 46%, var(--panel, #fff)); border-color: color-mix(in srgb, var(--accent, #3b82f6) 60%, transparent); }
.doc-kind-menu { position: relative; }
.doc-kind-panel { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 320px; overflow: auto; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line, rgba(0,0,0,.16)); border-radius: 10px; background: var(--panel, #fff); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.doc-kind-check { display: flex; align-items: center; gap: 8px; padding: 4px 6px; cursor: pointer; }
.doc-kind-check input { width: auto; }
.doc-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-verdict-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 0; border-radius: 10px; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.doc-verdict-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.doc-verdict-btn.is-accept { background: #16a34a; }
.doc-verdict-btn.is-reject { background: #dc2626; }
.doc-verdict-wrap select, .doc-modal-card textarea { width: 100%; box-sizing: border-box; margin-top: 8px; }
.doc-modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.doc-modal-card { width: min(560px, 100%); background: var(--panel, #fff); color: inherit; border-radius: 12px; padding: 16px; display: grid; gap: 10px; }
.doc-modal-card h3 { margin: 0; }
.doc-modal-card textarea { min-height: 120px; }
.doc-modal-card .is-reject { background: #dc2626; color: #fff; border-color: #dc2626; }
.doc-modal-card .is-rework { background: #b45309; color: #fff; border-color: #b45309; }
.doc-tree { background: var(--panel, #fff); border-radius: 0; padding: 10px; overflow: auto; border-right: 1px solid var(--line, rgba(0,0,0,.08)); }
.doc-group { margin: 12px 0 4px; font-size: 11px; letter-spacing: .04em; opacity: .7; }
.doc-folder, .doc-row { width: 100%; text-align: left; }
.doc-folder { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: inherit; }
.doc-folder.is-on, .doc-row.is-on { background: color-mix(in srgb, var(--accent, #1f3864) 18%, transparent); }
.doc-count { min-width: 1.2em; text-align: center; font-size: 11px; border-radius: 999px; padding: 0 6px; background: color-mix(in srgb, var(--accent, #1f3864) 16%, transparent); }
.doc-company { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.doc-main { display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr) auto; min-width: 0; min-height: 0; height: 100%; gap: 0; overflow: hidden; background: var(--panel, #fff); }
.doc-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); background: var(--panel, #fff); }
.doc-bar button, .doc-actions button, .doc-actions label { border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 14%, var(--panel, #fff)); border-radius: 8px; padding: 6px 10px; color: inherit; cursor: pointer; }
#doc-new-document { background: #16a34a; border-color: #15803d; color: #fff; font-weight: 700; box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.45), 0 6px 16px rgba(22, 163, 74, 0.32); }
#doc-new-document:hover { background: #15803d; }
.doc-search { margin-left: auto; flex: 1; min-width: 180px; }
.doc-search input { width: 100%; }
.doc-table-wrap { min-height: 0; overflow: auto; background: var(--panel, #fff); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th, .doc-table td { padding: 8px 10px; border-bottom: 1px solid var(--line, rgba(0,0,0,.06)); text-align: left; vertical-align: top; }
.doc-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel, #fff); }
.doc-sort { border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; padding: 0; color: inherit; }
.doc-sort.is-sort::after { content: " ↓"; }
.doc-sort.is-sort.is-asc::after { content: " ↑"; }
.doc-row { cursor: pointer; }
.doc-card { background: var(--panel, #fff); border-radius: 0; padding: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.doc-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--panel, #fff); border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); overflow-x: auto; }
.doc-tab { border: 0; background: transparent; border-radius: 8px 8px 0 0; padding: 6px 10px; color: inherit; }
.doc-tab.is-on { background: var(--bg, var(--paper, #fff)); font-weight: 600; }
.doc-tab-body { padding: 12px 14px; overflow: auto; min-height: 0; flex: 1; background: var(--panel, #fff); }
.doc-status { display: flex; gap: 14px; align-items: center; padding: 4px 12px; font-size: 11px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); background: var(--panel, #fff); }
.doc-card h2 { margin: 0 0 6px; font-size: 15px; }
.doc-form { display: grid; gap: 8px; margin-top: 8px; }
.doc-form input, .doc-form textarea, .doc-form select { width: 100%; }
.doc-form textarea { min-height: 72px; resize: vertical; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-country { display: inline-flex; align-items: center; gap: 6px; }
.doc-country select { background: transparent; color: inherit; border: 0; font: inherit; }
.doc-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.doc-kicker { font-size: 11px; letter-spacing: .04em; opacity: .7; margin-bottom: 4px; }
.doc-body { white-space: pre-wrap; max-height: 140px; overflow: auto; }
.doc-step { margin: 4px 0; }
.doc-note { opacity: .85; }
.doc-schema { padding: 8px 12px; }
.doc-schema[hidden], .doc-table[hidden] { display: none !important; }
.doc-shell.is-structure .doc-main { grid-template-rows: auto minmax(0, 1fr) minmax(72px, 16%) auto; }
.doc-shell.is-structure .doc-table-wrap { display: flex; flex-direction: column; }
.doc-shell.is-structure .doc-schema { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.doc-org-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-bottom: 8px; }
.doc-org-tools button { width: 32px; height: 32px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 14%, var(--panel, #fff)); color: inherit; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; }
.doc-org-view { flex: 1 1 auto; min-height: 0; overflow: auto; }
.doc-org-map { --org: 0.8; --org-line: #8eafcc; width: max-content; min-width: 100%; }
.doc-org-level { display: flex; flex-wrap: nowrap; justify-content: center; align-items: flex-start; }
.doc-org-node { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.doc-org-level > .doc-org-node { padding: 0 calc(10px * var(--org)); }
.doc-org-branch { position: relative; display: flex; flex-direction: column; align-items: center; }
.doc-org-branch::before { content: ""; position: absolute; top: 0; left: calc(50% - 0.75px); height: 42px; border-left: 1.5px solid var(--org-line); z-index: 0; }
.doc-org-branch.is-shut::before { height: 19px; }
.doc-org-fold { position: relative; z-index: 1; margin-top: 8px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--org-line); background: #fff; color: #1c2838; font-size: 16px; line-height: 1; padding: 0; cursor: pointer; }
.doc-org-kids { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; padding-top: 12px; z-index: 2; }
.doc-org-kids > .doc-org-level > .doc-org-node { position: relative; padding-top: 16px; }
.doc-org-kids > .doc-org-level > .doc-org-node::before { content: ""; position: absolute; top: 0; left: calc(50% - 0.75px); height: 16px; border-left: 1.5px solid var(--org-line); }
.doc-org-kids > .doc-org-level > .doc-org-node::after { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1.5px solid var(--org-line); }
.doc-org-kids > .doc-org-level > .doc-org-node:first-child::after { left: 50%; }
.doc-org-kids > .doc-org-level > .doc-org-node:last-child::after { right: 50%; }
.doc-org-kids > .doc-org-level > .doc-org-node:only-child::after { display: none; }
.doc-org-card { min-width: calc(168px * var(--org)); max-width: calc(220px * var(--org)); padding: calc(8px * var(--org)) calc(10px * var(--org)); border-radius: calc(12px * var(--org)); border: 1px solid #1f3864; background: #1f3864; color: #f4f7fb; cursor: pointer; text-align: center; font-size: calc(13px * var(--org)); line-height: 1.3; }
body.neo .doc-org-card, body.theme-jade .doc-org-card, body.theme-tango .doc-org-card { background: #f4f7fb; color: #1c2838; border-color: #d5deea; }
.doc-org-card.is-on { outline: 2px solid #f59e0b; }
.doc-org-card.is-yours { border-color: #38bdf8; }
.doc-people { margin: 8px 0 0; padding-left: 18px; }
.doc-toast { position: fixed; right: 16px; bottom: 16px; z-index: 40; padding: 10px 14px; border-radius: 12px; background: var(--panel, #fff); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.doc-toast[hidden] { display: none !important; }
@media (min-width: 961px) {
  #doc-new-request.mobile-action-fab {
    display: none !important;
  }
  #view-chat #chat-new.mobile-action-fab,
  #view-meet #meet-new.mobile-action-fab,
  #view-people #new-contact.mobile-action-fab {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    border-radius: inherit;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #view-chat #chat-new .mobile-action-fab-label,
  #view-meet #meet-new .mobile-action-fab-label,
  #view-people #new-contact .mobile-action-fab-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
}
@media (max-width: 720px) {
  .doc-shell { grid-template-columns: 1fr; }
  .doc-search { margin-left: 0; }
  .doc-split { grid-template-columns: 1fr; }
  .rdp-bar { height: auto; min-height: 38px; flex-wrap: wrap; padding: 4px 8px; }
  .rdp-home { padding: 16px 12px 24px; }
  .my-sign, .my-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  #view-gersadoc:not([hidden]) .doc-commands {
    justify-content: center;
    flex-wrap: nowrap;
    overflow: visible;
  }
  #view-gersadoc .doc-commands button[data-screen]:not([data-screen="docs"]) {
    display: none !important;
  }
  #view-gersadoc .doc-commands button[data-screen="docs"] {
    flex: 1 1 auto;
    max-width: 100%;
    pointer-events: none;
    cursor: default;
  }
  #view-gersadoc #doc-home,
  #view-gersadoc #doc-extra {
    display: none !important;
  }
  #view-gersadoc #doc-journal[hidden] {
    display: grid !important;
  }
  #view-gersadoc .doc-tree,
  #view-gersadoc .doc-shell.is-structure .doc-schema {
    display: none !important;
  }
  #view-gersadoc .doc-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  #view-gersadoc .doc-shell.is-united .doc-tree,
  #view-gersadoc .doc-tree {
    display: none !important;
  }
  #view-gersadoc .doc-bar {
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    gap: 0;
  }
  #view-gersadoc #doc-new-document,
  #view-gersadoc #doc-refresh,
  #view-gersadoc .doc-search,
  #view-gersadoc .doc-filters {
    display: none !important;
  }
  .mobile-action-fab svg,
  .phone-compose svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }
  .mobile-action-fab svg path,
  .phone-compose svg path {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
  }
  #view-chat:not([hidden]):not(.is-chat) #chat-new,
  #view-meet:not([hidden]):not(.is-meet) #meet-new,
  #view-people:not([hidden]):not(.is-person) #new-contact,
  #view-gersadoc:not([hidden]) #doc-new-request {
    position: fixed;
    z-index: 28;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    gap: 0;
    color: #fff;
    background: var(--blue, #3b82f6);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--blue, #3b82f6) 50%, transparent);
    cursor: pointer;
  }
  #view-chat:not([hidden]):not(.is-chat) #chat-new .mobile-action-fab-label,
  #view-meet:not([hidden]):not(.is-meet) #meet-new .mobile-action-fab-label,
  #view-people:not([hidden]):not(.is-person) #new-contact .mobile-action-fab-label,
  #view-gersadoc:not([hidden]) #doc-new-request .mobile-action-fab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  #view-chat:not([hidden]):not(.is-chat) > .folders,
  #view-meet:not([hidden]):not(.is-meet) > .folders,
  #view-people:not([hidden]):not(.is-person) > .folders,
  #view-gersadoc .doc-table-wrap {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  #view-my:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
  }
  #view-my:not([hidden]) .my-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    width: 100%;
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }
  body:has(#view-my:not([hidden]) #my-home:not([hidden])) #my-cabinet-dock:not([hidden]) {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    position: fixed !important;
  }
  #my-cabinet-dock:not([hidden]) {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    bottom: 0;
    top: auto !important;
    width: auto;
    max-width: none;
    padding: 4px 4px max(4px, env(safe-area-inset-bottom));
    gap: 4px;
    background: #fff;
    border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.14);
  }
  #my-cabinet-dock button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    border-radius: 8px;
  }
  #my-cabinet-dock .my-ico {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }
  #my-cabinet-dock .my-ico svg { width: 13px; height: 13px; }
  #my-cabinet-dock .my-dock-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
