/* Почта ЭКСПРО: цвета и шрифты сайта too-expro.kz */
@font-face { font-family: "Onest"; src: url(fonts/onest-cyrillic.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; src: url(fonts/onest-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Unbounded"; src: url(fonts/unbounded-cyrillic.woff2) format("woff2"); font-weight: 200 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; src: url(fonts/unbounded-latin.woff2) format("woff2"); font-weight: 200 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --bg: #EEF1EC;
  --surface: #FFFFFF;
  --soft: #F6F8F4;
  --line: rgba(14, 26, 18, .12);
  --line-strong: rgba(14, 26, 18, .24);
  --ink: #0E1A12;
  --ink-2: #4C5C50;
  --ink-3: #6E7F72;
  --green: #1E7A3C;
  --green-ink: #0F3D22;
  --green-deep: #0A2A17;
  --tint: #E3EFE5;
  --yellow: #F2C10D;
  --yellow-hi: #FFD43B;
  --yellow-ink: #221A00;
  --danger: #B3261E;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --rail: 248px;
  --list: 392px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; white-space: nowrap; transition: background-color .15s; }
.btn--main { background: var(--yellow); color: var(--yellow-ink); }
.btn--main:hover { background: var(--yellow-hi); }
.btn--main:disabled { opacity: .6; cursor: default; }
.btn--line { border: 1px solid var(--line-strong); background: var(--surface); }
.btn--line:hover { background: var(--soft); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.is-on { color: #B98F00; }
.icon-btn.is-on svg { fill: var(--yellow); }

/* ---------- вход ---------- */
.login { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--green-deep); overflow: hidden; }
.login::after { content: "ЭКСПРО"; position: absolute; left: 50%; bottom: -2.4vw; transform: translateX(-50%); font: 800 19vw/1 var(--display); color: rgba(255, 255, 255, .045); white-space: nowrap; pointer-events: none; }
.login__card { position: relative; z-index: 1; width: 100%; max-width: 400px; padding: 36px 32px 32px; background: var(--surface); border-radius: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.login__logo { display: block; width: 76px; height: 76px; margin: 0 auto 14px; }
.login h1 { margin: 0 0 24px; text-align: center; font: 700 1.3rem/1.2 var(--display); color: var(--green-ink); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 500; color: var(--ink-2); }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 122, 60, .18); }
.login .btn { width: 100%; height: 50px; margin-top: 6px; }
.login__err { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #FBEAE8; color: var(--danger); font-size: .875rem; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--rail) var(--list) minmax(0, 1fr); height: 100vh; height: 100dvh; }

.rail { display: flex; flex-direction: column; min-height: 0; background: var(--green-deep); color: #C7D6CB; padding: 18px 12px 12px; }
.rail__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: #fff; font: 700 1rem/1 var(--display); }
.rail__brand img { width: 38px; height: 38px; }
.rail .btn--main { width: 100%; height: 46px; margin-bottom: 18px; }
.rail nav { flex: 1; min-height: 0; overflow-y: auto; }
.folders { list-style: none; margin: 0; padding: 0; }
.folder { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; text-align: left; color: inherit; }
.folder:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.folder.is-active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.folder.is-active svg { color: var(--yellow); }
.folder__name { flex: 1; }
.folder__count { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--yellow); color: var(--yellow-ink); font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; }
.folder__count--quiet { background: none; color: #8FA596; font-weight: 500; }
.rail__user { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 10px 0 0 8px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8125rem; }
.rail__user span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__user .icon-btn { color: #A9BCAF; }
.rail__user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- список ---------- */
.list { display: flex; flex-direction: column; min-height: 0; background: var(--soft); border-right: 1px solid var(--line); }
.list__head { padding: 18px 16px 12px; }
.list__title { display: flex; align-items: center; gap: 8px; min-height: 40px; margin-bottom: 10px; }
.list__title h2 { flex: 1; margin: 0; font: 700 1.15rem/1.2 var(--display); color: var(--green-ink); }
.menu-btn { display: none; }
.linkish { color: var(--green); font-size: .8125rem; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 122, 60, .15); }
.rows { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--line); }
.row { position: relative; border-bottom: 1px solid var(--line); }
.row:hover { background: var(--surface); }
.row.is-active { background: var(--tint); }
.row.is-picked { background: #FFF8DC; }
.row__open { display: block; width: 100%; padding: 12px 16px 13px 26px; text-align: left; }
.row__pick { position: absolute; left: 3px; top: 7px; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; opacity: 0; cursor: pointer; }
.row__pick input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); cursor: pointer; }
.row:hover .row__pick, .row__pick:focus-within, .rows.is-selecting .row__pick { opacity: 1; }
.row:hover.is-unread::before, .rows.is-selecting .row.is-unread::before { display: none; }
.rows.is-selecting .row__open { padding-left: 34px; }
@media (hover: none) { .row__pick { display: none; } .rows.is-selecting .row__pick { display: grid; } }
.bulk { display: flex; align-items: center; gap: 2px; margin-top: 10px; padding: 4px 4px 4px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.bulk__count { flex: 1; min-width: 0; font-size: .875rem; font-weight: 600; white-space: nowrap; }
.bulk .linkish { margin-right: 6px; }
.row__top { display: flex; align-items: baseline; gap: 10px; }
.row__who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.row__date { flex: none; font-size: .78rem; color: var(--ink-3); }
.row__subject { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__snip { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--ink-3); }
.row__marks { float: right; display: inline-flex; gap: 4px; margin-left: 8px; color: var(--ink-3); }
.row__marks svg { width: 15px; height: 15px; }
.row__marks .star { color: #B98F00; fill: var(--yellow); }
.row.is-unread .row__who { color: var(--ink); font-weight: 600; }
.row.is-unread .row__subject { font-weight: 700; color: var(--green-ink); }
.row.is-unread::before { content: ""; position: absolute; left: 11px; top: 19px; pointer-events: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.more { display: block; width: 100%; padding: 14px; color: var(--green); font-weight: 600; }
.more:hover { background: var(--surface); }
.blank { padding: 48px 24px; text-align: center; color: var(--ink-3); }
.blank b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--ink-2); }

/* ---------- письмо ---------- */
.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.reader__bar { display: flex; align-items: center; gap: 2px; min-height: 58px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.reader__bar .sp { flex: 1; }
.back-btn { display: none; }
.reader__bar .btn { height: 38px; padding: 0 14px; font-size: .875rem; margin-right: 6px; }
.reader__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px clamp(16px, 3vw, 36px) 40px; }
.reader__subject { margin: 0 0 18px; font-size: 1.45rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.people { display: flex; gap: 12px; margin-bottom: 18px; }
.avatar { position: relative; display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; background: var(--tint); color: var(--green-ink); font-weight: 700; flex: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.avatar--own img { object-fit: contain; }
.avatar--1 { background: #FFF0B8; color: #5A4500; }
.avatar--2 { background: #DCE9F5; color: #1C4A70; }
.avatar--3 { background: #F3E2D6; color: #6B3A1B; }
.avatar--4 { background: #E5E0F0; color: #40336B; }
.avatar--5 { background: #D9EEEA; color: #12524A; }
.avatar--s { width: 24px; height: 24px; font-size: .72rem; }
.avatar--m { width: 34px; height: 34px; font-size: .875rem; }
.people__main { flex: 1; min-width: 0; }
.people__from b { font-weight: 600; }
.people__addr { color: var(--ink-3); font-size: .875rem; overflow-wrap: anywhere; }
.people__to { color: var(--ink-3); font-size: .875rem; overflow-wrap: anywhere; }
.people__date { flex: none; color: var(--ink-3); font-size: .85rem; }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; background: var(--bg); font-size: .875rem; color: var(--ink-2); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .875rem; }
.att:hover { background: var(--soft); }
.att svg { width: 17px; height: 17px; color: var(--green); }
.att__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.att__size { flex: none; color: var(--ink-3); }
.mail-frame { display: block; width: 100%; min-height: 80px; border: 0; background: #fff; }
.mail-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font: inherit; }

/* ---------- написать ---------- */
.compose { position: fixed; right: 24px; bottom: 0; z-index: 30; display: flex; flex-direction: column; width: min(680px, calc(100vw - 48px)); height: min(680px, calc(100dvh - 40px)); background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 16px 60px rgba(10, 42, 23, .35); }
.compose__head { display: flex; align-items: center; padding: 8px 8px 8px 20px; border-radius: 18px 18px 0 0; background: var(--green-deep); color: #fff; font-weight: 600; }
.compose__head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose__head .icon-btn { color: #C7D6CB; }
.compose__head .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.compose__line { display: flex; align-items: flex-start; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.compose__line > label { flex: none; width: 52px; padding-top: 12px; font-size: .875rem; color: var(--ink-3); }
.compose__line > .linkish { flex: none; padding-top: 12px; }
.compose__line input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; }
.compose__line input:focus { outline: none; }
.compose__line:focus-within { border-bottom-color: var(--green); }
.compose textarea { flex: 1; min-height: 0; padding: 14px 20px; border: 0; resize: none; line-height: 1.55; }
.compose textarea:focus { outline: none; }
.compose__files { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; padding: 0 20px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--bg); font-size: .8125rem; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--ink-3); }
.chip button:hover { background: rgba(0, 0, 0, .08); color: var(--ink); }
.chip svg { width: 14px; height: 14px; }
.compose__foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.compose__status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; color: var(--ink-3); }
.compose__line { position: relative; }
.rcpt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 44px; padding: 6px 0; cursor: text; }
.rchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 2px 0 3px; border-radius: 999px; background: var(--bg); font-size: .875rem; cursor: pointer; }
.rchip:hover { background: var(--tint); }
.rchip.is-bad { background: #FBEAE8; color: var(--danger); }
.rchip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rchip button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); flex: none; }
.rchip button:hover { background: rgba(0, 0, 0, .08); color: var(--ink); }
.rchip svg { width: 13px; height: 13px; }
.rcpt__field { position: relative; flex: 1; min-width: 150px; display: block; height: 30px; }
.compose__line .rcpt__field input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: none; }
.rcpt__ghost { position: absolute; inset: 0; overflow: hidden; color: var(--ink-3); line-height: 30px; white-space: pre; pointer-events: none; }
.rcpt__ghost i { font-style: normal; visibility: hidden; }
.suggest { position: absolute; left: 12px; right: 12px; top: 100%; z-index: 5; margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto; border-radius: 12px; background: var(--surface); box-shadow: 0 10px 32px rgba(10, 42, 23, .25); }
.suggest li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.suggest li.is-on, .suggest li:hover { background: var(--tint); }
.suggest__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest b { font-weight: 600; }
.suggest__addr { color: var(--ink-3); font-size: .875rem; }
.settings textarea { display: block; width: 100%; height: 130px; margin-bottom: 8px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; resize: vertical; }
.settings textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30, 122, 60, .18); }
.settings h3 { margin: 0 0 6px; font: 700 1.05rem/1.25 var(--display); color: var(--green-ink); }
.settings .hint { margin: 0 0 12px; font-size: .875rem; color: var(--ink-3); }
.compose__err { padding: 8px 20px; background: #FBEAE8; color: var(--danger); font-size: .875rem; }

.fab { display: none; }
.toast { position: fixed; left: 50%; top: 18px; z-index: 50; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: .875rem; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); }
.scrim { display: none; }
.confirm { max-width: 400px; width: calc(100vw - 32px); padding: 24px; border: 0; border-radius: 18px; color: var(--ink); }
.confirm::backdrop { background: rgba(10, 42, 23, .5); }
.confirm p { margin: 0 0 18px; }
.confirm__btns { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- ноутбук ---------- */
@media (max-width: 1180px) {
  :root { --rail: 208px; --list: 320px; }
}

/* ---------- планшет и телефон: одна колонка, меню выезжает ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 272px; transform: translateX(-100%); transition: transform .2s; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .shell.is-menu .rail { transform: none; }
  .shell.is-menu .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(10, 42, 23, .5); }
  .menu-btn, .back-btn { display: inline-grid; }
  .list { border-right: 0; }
  .list__head { padding-top: 10px; }
  .list__title { margin-left: -8px; }
  .shell.has-message .list { display: none; }
  .shell:not(.has-message) .reader { display: none; }
  .reader__bar { position: sticky; top: 0; padding: 6px 8px; }
  .reader__bar .btn { display: none; }
  .fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 10; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 8px 22px rgba(10, 42, 23, .3); }
  .shell.has-message .fab { display: none; }
  .reply-row { display: flex !important; }
  .compose { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  .compose__head { border-radius: 0; }
  .field input, .compose__line input, .compose textarea, .search input { font-size: 16px; }
  .people { flex-wrap: wrap; }
  .people__date { width: 100%; padding-left: 54px; }
  .login__card { padding: 28px 20px 24px; border-radius: 18px; }
}
.reply-row { display: none; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.reply-row .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
