/* Borneo — дизайн-система.
   Минимализм: один акцентный цвет, крупная лёгкая типографика, много воздуха,
   почти нет границ. Тёмная тема — по системной настройке. */

:root {
  color-scheme: light dark;

  --brand:        #0e7c5a;
  --brand-strong: #0a6047;
  --brand-soft:   #e8f5f0;
  --brand-line:   #bfe3d6;

  --ink:      #0d1b16;
  --body:     #41524b;
  --muted:    #6f8078;
  --line:     #e4eae7;
  --line-soft:#eff3f1;
  --surface:  #ffffff;
  --canvas:   #f7faf9;
  --danger:   #c0392b;
  --warn:     #b7791f;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(13,27,22,.05);
  --shadow:    0 4px 24px -8px rgba(13,27,22,.14);

  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand:        #35c99a;
    --brand-strong: #57d9af;
    --brand-soft:   #10241d;
    --brand-line:   #1d4438;

    --ink:      #eaf2ee;
    --body:     #a8bbb3;
    --muted:    #7d918a;
    --line:     #212c28;
    --line-soft:#1a2320;
    --surface:  #111917;
    --canvas:   #0b100f;
    --danger:   #ff6b5e;
    --warn:     #e0a33a;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 4px 28px -10px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать раскладочные display у .blank, .mail и
   прочих блоков — иначе скрытые элементы остаются на экране. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.wrap--narrow { width: min(640px, 100% - 40px); }

/* ===== Логотип ============================================================ */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo__mark { display: block; flex: none; }
.logo__word {
  font-size: 19px; font-weight: 600; letter-spacing: -.02em;
}

/* ===== Шапка ============================================================== */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in { display: flex; align-items: center; gap: 12px; height: 68px; }
.nav__spacer { flex: 1; }
.nav__links { display: flex; align-items: center; gap: 6px; }

/* ===== Кнопки ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-pill);
  border: 1px solid transparent; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn--primary { color: #06211a; } }
.btn--primary:hover { background: var(--brand-strong); }
.btn--outline { border-color: var(--line); color: var(--ink); }
.btn--outline:hover { border-color: var(--brand); color: var(--brand); }
.btn--ghost { color: var(--body); }
.btn--ghost:hover { color: var(--ink); background: var(--line-soft); }
.btn--sm { padding: 6px 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Переключатель языка */
.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill);
  overflow: hidden;
}
.lang button {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 5px 11px; cursor: pointer;
}
.lang button.is-on { background: var(--brand-soft); color: var(--brand); }

/* ===== Типографика ======================================================== */
h1, h2, h3 { color: var(--ink); letter-spacing: -.025em; margin: 0; font-weight: 600; }
h1 { font-size: clamp(38px, 6vw, 62px); line-height: 1.06; letter-spacing: -.035em; }
h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.18; }
h3 { font-size: 18px; line-height: 1.35; }
p  { margin: 0; color: var(--body); }
.lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.55; max-width: var(--measure); }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand);
}

/* ===== Секции ============================================================= */
.hero { padding: clamp(64px, 11vw, 130px) 0 clamp(48px, 7vw, 84px); }
.hero__stack > * + * { margin-top: 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.hero__note { font-size: 14px; color: var(--muted); }

section { padding: clamp(48px, 7vw, 88px) 0; }
.section__head { max-width: var(--measure); }
.section__head > * + * { margin-top: 14px; }

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.feature > * + * { margin-top: 10px; }
.feature__icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 4px;
}
.feature p { font-size: 15px; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
}

.rule { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

/* ===== Формы ============================================================== */
.form { display: flex; flex-direction: column; gap: 16px; }
.field > * + * { margin-top: 6px; }
.field__label { display: block; font-size: 14px; font-weight: 500; color: var(--ink); }
.field__hint { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; padding: 11px 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.input--joined { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.joined { display: flex; align-items: stretch; }
.joined__suffix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  white-space: nowrap;
}

.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--body);
}
.alert--error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
}
.alert--ok {
  border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-strong);
}

/* Карточка авторизации */
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.auth__body { display: grid; place-items: center; padding: 40px 20px; }
.auth__card { width: min(420px, 100%); }
.auth__card > * + * { margin-top: 20px; }
.auth__title { text-align: center; }
.auth__title > * + * { margin-top: 8px; }
.auth__alt { text-align: center; font-size: 14px; color: var(--muted); }

/* Строка с адресом и копированием */
.addr {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.addr__value {
  font-family: var(--mono); font-size: 15px; color: var(--brand-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 5px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--brand-line); background: var(--surface); color: var(--brand);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .16s ease;
}
.copy:hover { background: var(--brand-soft); }
.copy.is-done { color: var(--brand-strong); }

/* ===== Подвал ============================================================= */
.footer { border-top: 1px solid var(--line-soft); padding: 32px 0 48px; }
.footer__in { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--ink); }
.footer__note { font-size: 13px; color: var(--muted); margin-left: auto; }

@media (max-width: 560px) {
  .wrap, .wrap--narrow { width: calc(100% - 32px); }
  .nav__in { height: 60px; }
  .footer__note { margin-left: 0; width: 100%; }
}

/* ==========================================================================
   Живость: фон, макет продукта, появление при скролле.
   Всё декоративное отключается при prefers-reduced-motion.
   ========================================================================== */

/* --- Градиентные пятна за героем ------------------------------------------ */
.hero { position: relative; overflow: hidden; }
.aurora {
  position: absolute; inset: -30% -10% auto -10%; height: 780px;
  pointer-events: none; z-index: 0; filter: blur(70px); opacity: .5;
}
@media (prefers-color-scheme: dark) { .aurora { opacity: .34; } }
.aurora span {
  position: absolute; display: block; border-radius: 50%;
  will-change: transform;
}
.aurora span:nth-child(1) {
  width: 46vw; height: 46vw; left: -6vw; top: 4vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 55%, transparent), transparent 68%);
  animation: drift1 26s ease-in-out infinite;
}
.aurora span:nth-child(2) {
  width: 38vw; height: 38vw; right: -4vw; top: -6vw;
  background: radial-gradient(circle, color-mix(in srgb, #3ba0ff 40%, transparent), transparent 68%);
  animation: drift2 32s ease-in-out infinite;
}
.aurora span:nth-child(3) {
  width: 30vw; height: 30vw; left: 42%; top: 16vw;
  background: radial-gradient(circle, color-mix(in srgb, #ffd36e 34%, transparent), transparent 70%);
  animation: drift3 38s ease-in-out infinite;
}
@keyframes drift1 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(6vw,3vw,0) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-5vw,4vw,0) scale(1.08); } }
@keyframes drift3 { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-4vw,-3vw,0) scale(1.15); } }

/* Едва заметное зерно — убирает «пластиковость» больших заливок */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { .grain { opacity: .04; } }

.hero > .wrap { position: relative; z-index: 2; }

/* --- Двухколоночный герой -------------------------------------------------- */
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 64px); align-items: center;
}
.hero__grid .hero__stack > * + * { margin-top: 22px; }
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { display: none; }
}

/* --- Макет ящика ----------------------------------------------------------- */
.mockup {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.mockup:hover { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg) translateY(-4px); }
.mockup__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); background: var(--canvas);
}
.mockup__bar i {
  width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: block;
}
.mockup__bar i:first-child { background: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.mockup__body { padding: 16px; }
.mockup__body > * + * { margin-top: 12px; }

.msg {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; align-items: start;
  padding: 11px; border-radius: 10px; border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease;
}
.msg:hover { background: var(--canvas); border-color: var(--line-soft); }
.msg--unread { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.msg__av {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: 13px; font-weight: 600;
}
.msg__from { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.msg__sub  { font-size: 13px; color: var(--body); margin-top: 1px; }
.msg__time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  margin-top: 6px;
}

/* Пульсация «пришло письмо» */
.pulse { position: relative; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent);
  animation: pulse 3.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 40%, transparent); }
  55%  { box-shadow: 0 0 0 12px color-mix(in srgb, var(--brand) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 0%, transparent); }
}

/* --- Появление при скролле -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
.reveal--d1.is-in { transition-delay: .09s; }
.reveal--d2.is-in { transition-delay: .18s; }
.reveal--d3.is-in { transition-delay: .27s; }

/* --- Карточки: подъём при наведении ------------------------------------------ */
.panel {
  transition: transform .22s cubic-bezier(.2,.7,.3,1), border-color .22s ease, box-shadow .22s ease;
}
.panel:hover {
  transform: translateY(-3px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow);
}
.feature__icon { transition: transform .22s cubic-bezier(.2,.7,.3,1); }
.feature:hover .feature__icon { transform: translateY(-2px) scale(1.06); }

/* --- Шаги, связанные линией --------------------------------------------------- */
.steps-grid { position: relative; }
.steps-grid::before {
  content: ""; position: absolute; left: 0; right: 0; top: 46px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent);
}
@media (max-width: 780px) { .steps-grid::before { display: none; } }
.step__num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  position: relative; z-index: 1;
}
@media (prefers-color-scheme: dark) { .step__num { color: #06211a; } }

/* --- Ссылка со стрелкой -------------------------------------------------------- */
.arrow-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.arrow-link svg { transition: transform .2s ease; }
.arrow-link:hover { text-decoration: none; }
.arrow-link:hover svg { transform: translateX(3px); }

/* --- Полоса статистики ---------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px; padding: 26px 0;
}
.stat__n {
  font-size: clamp(26px, 3.4vw, 34px); font-weight: 600;
  letter-spacing: -.03em; color: var(--ink);
}
.stat__l { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* ==========================================================================
   Регистрация и вход: форма слева, карточка выгод справа.
   ========================================================================== */

.auth-page {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(36px, 6vw, 76px); align-items: start;
  padding: clamp(36px, 6vw, 68px) 0 80px;
}
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; gap: 36px; }
  .benefits { order: 2; }
}

.auth-form { max-width: 440px; }
.auth-form > * + * { margin-top: 22px; }
.auth-form__head > * + * { margin-top: 10px; }
.auth-form__head h1 { font-size: clamp(30px, 4vw, 40px); }
.auth-form__head p { font-size: 15px; }

/* Поле логина с доменом внутри */
.combo {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.combo:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.combo.is-bad { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.combo__input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; padding: 11px 0 11px 14px;
}
.combo__input:focus { outline: none; }
.combo__domain {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
  padding-left: 8px; white-space: nowrap;
}
.combo__state {
  width: 34px; display: grid; place-items: center; flex: none; color: var(--muted);
}
.combo__state.is-ok { color: var(--brand); }
.combo__state.is-bad { color: var(--danger); }

/* Пароль с показом */
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw__eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: var(--radius-sm);
}
.pw__eye:hover { color: var(--ink); background: var(--line-soft); }

/* Индикатор стойкости */
.meter-bar { display: flex; gap: 5px; margin-top: 8px; }
.meter-bar i {
  height: 3px; flex: 1; border-radius: 2px; background: var(--line);
  transition: background .2s ease;
}
.meter-bar.s1 i:nth-child(-n+1) { background: var(--danger); }
.meter-bar.s2 i:nth-child(-n+2) { background: var(--warn); }
.meter-bar.s3 i:nth-child(-n+3) { background: color-mix(in srgb, var(--brand) 70%, var(--warn)); }
.meter-bar.s4 i { background: var(--brand); }

.assure {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13.5px; color: var(--brand); font-weight: 500;
}
.legal { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.55; }
.legal a { color: var(--muted); text-decoration: underline; }

/* Карточка выгод */
.benefits {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 26px; box-shadow: var(--shadow);
}
.benefits h2 { font-size: 17px; }
.benefits__list { list-style: none; margin: 18px 0 0; padding: 0; }
.benefits__list li {
  display: grid; grid-template-columns: 20px 1fr; gap: 11px;
  align-items: start; padding: 9px 0; font-size: 14.5px; color: var(--body);
}
.benefits__list li + li { border-top: 1px solid var(--line-soft); }
.benefits__check { color: var(--brand); margin-top: 2px; }
.benefits__sep { height: 1px; background: var(--line-soft); margin: 18px 0; border: 0; }
.benefits__row {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 12px;
  background: var(--canvas); border: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--body);
}
.chip svg { color: var(--brand); flex: none; }

.auth-top {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 0; font-size: 14px; color: var(--muted);
}
.auth-top__spacer { flex: 1; }

/* ==========================================================================
   Веб-ящик: шапка с адресом, папки, список писем, чтение.
   ========================================================================== */

.mail { min-height: 100dvh; display: flex; flex-direction: column; }

.mail__top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.mail__spacer { flex: 1 1 auto; }

/* Адрес с копированием — главный элемент шапки */
.addr-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 14px; border-radius: var(--radius-pill);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  max-width: 100%; min-width: 0;
}
.addr-chip__label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.addr-chip__value {
  font-family: var(--mono); font-size: 14px; color: var(--brand-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

.mail__body {
  flex: 1; display: grid; grid-template-columns: 210px 340px minmax(0, 1fr);
  min-height: 0;
}
@media (max-width: 1080px) { .mail__body { grid-template-columns: 190px minmax(0, 1fr); } }

/* --- папки ---------------------------------------------------------------- */
.folders { border-right: 1px solid var(--line-soft); padding: 16px 12px; }
.folders__title {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 8px;
}
.folder {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--body); cursor: pointer;
  font: inherit; font-size: 14px; text-align: left;
}
.folder:hover { background: var(--canvas); color: var(--ink); }
.folder.is-on { background: var(--brand-soft); color: var(--brand-strong); font-weight: 500; }
.folder__count {
  margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.folder.is-on .folder__count { color: var(--brand); }
.folder__badge {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; text-align: center;
}
@media (prefers-color-scheme: dark) { .folder__badge { color: #06211a; } }

/* --- список писем ---------------------------------------------------------- */
.list { border-right: 1px solid var(--line-soft); overflow-y: auto; }
@media (max-width: 1080px) { .list { border-right: 0; } }

.item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; font: inherit;
}
.item:hover { background: var(--canvas); }
.item.is-on { background: var(--brand-soft); }
.item__row { display: flex; align-items: baseline; gap: 10px; }
.item__from {
  font-size: 14px; color: var(--ink); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.item__time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item__subject {
  font-size: 13.5px; color: var(--body); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item__preview {
  font-size: 12.5px; color: var(--muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item.is-unread .item__from { font-weight: 650; }
.item.is-unread .item__subject { color: var(--ink); font-weight: 500; }
.item__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none;
}

/* --- чтение ---------------------------------------------------------------- */
.reader { overflow-y: auto; padding: 26px 30px 60px; min-width: 0; }
@media (max-width: 1080px) {
  /* Колонок всего две: читалка не может встать третьей, поэтому на узком
     экране она заменяет список, а не добавляется под ним. */
  .reader { display: none; }
  .mail.is-reading .reader { display: block; }
  .mail.is-reading .list { display: none; }
}
.reader__head { border-bottom: 1px solid var(--line-soft); padding-bottom: 18px; }
.reader__subject { font-size: 21px; letter-spacing: -.02em; margin: 0 0 10px; }
.reader__meta { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 13.5px; color: var(--muted); }
.reader__meta b { color: var(--ink); font-weight: 500; }
.reader__text {
  margin-top: 22px; font-size: 15px; line-height: 1.65; color: var(--body);
  white-space: pre-wrap; word-break: break-word;
}
.reader__note {
  margin-top: 20px; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--canvas); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.att {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--canvas);
  font-size: 13px; color: var(--body); margin: 6px 6px 0 0;
}

.blank {
  height: 100%; display: grid; place-items: center; text-align: center;
  padding: 60px 24px; color: var(--muted);
}
.blank__in > * + * { margin-top: 8px; }
.blank__icon { color: var(--line); }

.back-btn { display: none; }
@media (max-width: 1080px) {
  .back-btn { display: inline-flex; margin-bottom: 14px; }
}

/* --- параметры подключения --------------------------------------------------- */
/* Свёрнутый по умолчанию блок: настройки IMAP нужны один раз, при подключении
   клиента, а место в боковой колонке занимали постоянно — на узком экране
   развёрнутыми они выдавливали список писем за пределы экрана. */
.conn { border-top: 1px solid var(--line-soft); padding: 10px 2px 12px; }
.conn > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.conn > summary::-webkit-details-marker { display: none; }
.conn > summary:hover { background: var(--canvas); color: var(--body); }
.conn > summary::before {
  content: ""; flex: none; width: 5px; height: 5px;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease;
}
.conn[open] > summary::before { transform: rotate(45deg); }

/* Ключ над значением, а не рядом: колонка узкая, и в две колонки подписи
   вроде «Incoming server» ломались посреди слова. */
.conn__row { padding: 5px 10px; font-size: 12.5px; }
.conn__k { display: block; color: var(--muted); font-size: 11px; }
.conn__v {
  display: block; font-family: var(--mono); color: var(--body);
  overflow-wrap: anywhere;
}
.conn__note { margin: 0; padding: 8px 10px 0; font-size: 11.5px; color: var(--muted); }

/* --- узкий экран: почта в одну колонку --------------------------------------- */
/* До 720px две колонки не помещаются: на 360px под список писем оставалось
   меньше 170px. Папок мало, поэтому они становятся лентой над списком. */
@media (max-width: 720px) {
  .mail__body { grid-template-columns: minmax(0, 1fr); }

  .folders {
    border-right: 0; border-bottom: 1px solid var(--line-soft);
    padding: 8px 10px;
  }
  .folders > .folders__title { display: none; }
  .folders__list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .folders__list::-webkit-scrollbar { display: none; }
  .folder {
    width: auto; flex: none; gap: 7px; font-size: 13.5px;
    padding: 7px 13px; border-radius: var(--radius-pill); background: var(--canvas);
  }
  .folder.is-on { background: var(--brand-soft); }
  .folder__count, .folder__badge { margin-left: 0; }

  .conn { border-top: 0; padding: 6px 0 0; }

  /* Открытое письмо занимает весь экран — лента папок на нём лишняя. */
  .mail.is-reading .folders { display: none; }

  .addr-chip__label { display: none; }
  .reader { padding: 20px 16px 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora span { animation: none; }
  .pulse::after { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .mockup { transform: none; }
  .mockup:hover { transform: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Админка: вкладки, таблица учёток, плитки хранилища, задачи обслуживания.
   ========================================================================== */

.adm__tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft);
  margin-bottom: 26px; overflow-x: auto;
}
.adm__tab {
  padding: 10px 16px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.adm__tab:hover { color: var(--ink); }
.adm__tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }

.view { display: none; }
.view.is-on { display: block; }

.adm__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.adm__head .search {
  flex: 1; min-width: 200px; padding: 9px 13px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.adm__head .search:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.tbl-wrap {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 16px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--canvas); border-bottom: 1px solid var(--line);
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--canvas); }
.tbl .ta-r { text-align: right; }
.tbl .mono { font-size: 13px; }

.pill-role {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-line);
}

.bar { width: 90px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar__fill { height: 100%; background: var(--brand); }
.bar__fill.is-warn { background: var(--warn); }
.bar__fill.is-crit { background: var(--danger); }

.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.tile__label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.tile__value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.tile__note { font-size: 12.5px; color: var(--muted); margin-top: 4px; word-break: break-all; }

.gauge { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.gauge__fill { height: 100%; width: 0; background: var(--brand); transition: width .4s ease; }
.gauge__fill.is-warn { background: var(--warn); }
.gauge__fill.is-crit { background: var(--danger); }

.task-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.task-card h3 { font-size: 15.5px; }
.task-card p { font-size: 13.5px; }
.task-card .btn { align-self: flex-start; margin-top: auto; }

.console {
  margin: 0; padding: 14px 16px; border-radius: var(--radius-sm);
  background: #0d1512; color: #cfe0d8; border: 1px solid #060b09;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

/* Модальное окно подтверждения */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 22px; }
.modal__bg { position: absolute; inset: 0; background: rgba(8, 20, 16, .55); backdrop-filter: blur(3px); }
.modal__card {
  position: relative; width: min(440px, 100%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }

/* Тосты */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 95;
  display: flex; flex-direction: column; gap: 9px; max-width: 360px;
}
.toast {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--brand); border-radius: var(--radius-sm);
  padding: 11px 15px; font-size: 13.5px; color: var(--body); box-shadow: var(--shadow);
}
.toast--err { border-left-color: var(--danger); color: var(--danger); }

@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px; padding: 12px 0; }
  .tbl td { border: 0; padding: 2px 16px; }
  .tbl td.ta-r { text-align: left; }
}

/* ==========================================================================
   Переключатель ящиков: в корпоративной почте один человек держит несколько
   адресов сразу, и переключение должно быть в один клик, без ввода пароля.
   ========================================================================== */

.acc { position: relative; min-width: 0; }
.acc__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; margin-left: 2px;
  border: 0; border-radius: 50%; background: transparent; color: var(--brand);
  cursor: pointer; transition: background .15s ease;
}
.acc__toggle:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.acc__toggle svg { transition: transform .18s ease; }
.acc.is-open .acc__toggle svg { transform: rotate(180deg); }

.acc__menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 260px; max-width: 340px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.acc__label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px 6px;
}
.acc__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  font: inherit; font-size: 14px; text-align: left;
}
.acc__item:hover { background: var(--canvas); }
.acc__item.is-on { background: var(--brand-soft); }
.acc__addr {
  font-family: var(--mono); font-size: 13px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc__mark { color: var(--brand); flex: none; }
.acc__sep { height: 1px; background: var(--line-soft); margin: 6px 4px; border: 0; }
.acc__action {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--brand); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500; text-align: left;
  text-decoration: none;
}
.acc__action:hover { background: var(--canvas); text-decoration: none; }
.acc__action--muted { color: var(--muted); }

@media (max-width: 620px) {
  .acc__menu { left: auto; right: 0; min-width: 220px; }
}
