/* Почта — оформление. Светлая/тёмная тема через data-theme, плотность через data-density. */
:root {
  --bg: #f4f5f7; --pane: #ffffff; --pane2: #f8f9fb; --line: #e2e5ea; --line2: #eef0f3;
  --text: #1b1f27; --text2: #3c4452; --muted: #4a5261; --faint: #5b6474;
  --accent: #2457c5; --accent-hover: #1d4aa8; --accent-soft: #e8eefa; --accent-text: #163c8c; --on-accent: #fff;
  --ok: #1e8a4c; --ok-soft: #e6f4ec; --ok-text: #145c33;
  --warn: #b7791f; --warn-soft: #fff6e5; --warn-text: #6b3d07;
  --bad: #a3261b; --bad-soft: #fdecea; --bad-text: #7a1d14;
  --shadow: 0 1px 2px rgba(20, 24, 33, .06), 0 4px 16px rgba(20, 24, 33, .06);
  --row-pad: 12px; --row-gap: 2px; --font: 14px;
  --radius: 8px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1115; --pane: #16191f; --pane2: #1c2028; --line: #2a2f39; --line2: #222731;
  --text: #e6e8ec; --text2: #c3c8d2; --muted: #a3aab6; --faint: #8f97a5;
  --accent: #6d97f2; --accent-hover: #86a9f5; --accent-soft: #1f2a44; --accent-text: #b9cdfa; --on-accent: #0c1220;
  --ok: #4cc27d; --ok-soft: #173023; --ok-text: #9be0b6;
  --warn: #e2a64a; --warn-soft: #34270f; --warn-text: #f3cf93;
  --bad: #f07a6e; --bad-soft: #3a1b18; --bad-text: #f6b2aa;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #0f1115; --pane: #16191f; --pane2: #1c2028; --line: #2a2f39; --line2: #222731;
    --text: #e6e8ec; --text2: #c3c8d2; --muted: #a3aab6; --faint: #8f97a5;
    --accent: #6d97f2; --accent-hover: #86a9f5; --accent-soft: #1f2a44; --accent-text: #b9cdfa; --on-accent: #0c1220;
    --ok: #4cc27d; --ok-soft: #173023; --ok-text: #9be0b6;
    --warn: #e2a64a; --warn-soft: #34270f; --warn-text: #f3cf93;
    --bad: #f07a6e; --bad-soft: #3a1b18; --bad-text: #f6b2aa;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
[data-density="compact"] { --row-pad: 6px; --row-gap: 0px; --font: 13px; }
[data-density="comfy"] { --row-pad: 16px; --row-gap: 4px; --font: 15px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: var(--font)/1.45 Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--pane); color: var(--text);
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--pane2); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.icon { width: 36px; padding: 0; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: .92em; }
.btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url],
input[type=file], select, textarea {
  min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pane);
  width: 100%; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* поля ввода при фокусе не обводим — хватает мигающего курсора (просьба пользователя, 0.8.3) */
input:focus, select:focus, textarea:focus, [contenteditable]:focus { outline: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 500; color: var(--text2); }
.field .help { font-weight: 400; color: var(--muted); font-size: .92em; }
.field .err { color: var(--bad); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); }
.check input { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 4px; font-size: 11.5px;
  font-weight: 600; background: var(--line2); color: var(--text2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); }
.chip.bad { background: var(--bad-soft); color: var(--bad-text); }
.chip.acc { background: var(--accent-soft); color: var(--accent-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.bad { background: var(--bad); }
.dot.idle { background: var(--faint); }
.dot.warn { background: var(--warn); }
.dot.work { background: var(--accent); animation: livepulse 1.2s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .3; } }
.live { display: inline; }
.live .dot { display: inline-block; margin-right: 4px; vertical-align: 1px; }
.live-bad { color: var(--bad); font-weight: 600; }
.live-warn { color: var(--warn-text); }
.live-alert { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: min(520px, 92vw);
  padding: 10px 36px 10px 16px; border-radius: var(--radius); background: #b3261e; color: #fff; font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.live-alert div { margin-top: 2px; }
.live-alert .x { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: #fff; font-size: 18px;
  line-height: 1; cursor: pointer; padding: 4px; opacity: .8; }
.live-alert .x:hover { opacity: 1; }

.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn-text); }
.notice.info { background: var(--accent-soft); color: var(--accent-text); }
.notice.bad { background: var(--bad-soft); color: var(--bad-text); }
.notice.ok { background: var(--ok-soft); color: var(--ok-text); }
.msgs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

/* Шапка */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 16px; background: var(--pane);
  border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.brand svg { color: var(--accent); }
.search { flex: 1 1 280px; max-width: 620px; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--pane2); color: var(--faint); }
.search input { border: 0; background: transparent; min-height: 0; padding: 0; outline: none; color: var(--text); }

/* Поиск: подсказки и детальный поиск */
.sbox { position: relative; flex: 1 1 280px; max-width: 620px; display: flex; min-width: 0; }
.sbox .search { flex: 1; max-width: none; margin: 0; min-width: 0; }
.sopt { flex: none; width: 30px; height: 30px; margin-right: -6px; border: 0; border-radius: 6px; background: transparent; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sopt:hover, .sopt[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--pane); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; max-height: 60vh; overflow: auto; }
.sugg .sh { padding: 6px 10px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sugg .si { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 10px; border: 0; border-radius: 6px;
  background: none; text-align: left; cursor: pointer; color: var(--text); }
.sugg .si:hover, .sugg .si[aria-selected="true"] { background: var(--accent-soft); }
.sugg .si svg { color: var(--faint); }
.sugg .si .ad { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg .si .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg .si .k { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.qpanel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 31; width: min(760px, 96vw); background: var(--pane); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 18px 16px; }
.qp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 15px; }
.qp-h .x { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qp-h .x:hover { background: var(--pane2); color: var(--text); }
.qp-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.qpanel .field { margin-bottom: 10px; font-size: 13px; }
.qp-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
.qp-st { grid-column: 1 / -1; border: 0; padding: 0; margin: 2px 0 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.qp-st legend { font-size: 13px; font-weight: 500; color: var(--text2); padding: 0; margin-bottom: 6px; }
.qp-f { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; border-top: 1px solid var(--line2); padding-top: 12px; }
.qp-f .sp { flex: 1; }
.qp-help { flex: 1 1 300px; font-size: 12.5px; color: var(--muted); }
.qp-help summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--accent); }
.qp-help ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.qp-help p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--line2); color: var(--text); padding: 0 4px; border-radius: 4px; }
mark { background: #fff1a6; color: inherit; border-radius: 2px; padding: 0 1px; }
[data-theme="dark"] mark { background: #5a4700; color: #fff; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] mark { background: #5a4700; color: #fff; } }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: inherit; }
.menu .pop button.link { text-decoration: none; }

/* Разделители панелей: тянуть мышью или стрелками, двойной щелчок — ширина по умолчанию */
.split { flex: none; width: 9px; margin: 0 -4px; position: relative; z-index: 3; cursor: col-resize; touch-action: none; outline: none; }
.split::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 3px; border-radius: 2px; background: transparent;
  transition: background .12s; }
.split:hover::after, .split:focus-visible::after, .split.on::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.moving { cursor: move; }

/* Меню правой клавиши */
.cmenu { position: fixed; z-index: 60; min-width: 240px; max-width: min(360px, 94vw); padding: 4px; background: var(--pane); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, .14), 0 12px 32px rgba(0, 0, 0, .18); }
.cmenu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: inherit; text-align: left; cursor: pointer; font-size: 13.5px; }
.cmenu button:hover:not([disabled]), .cmenu button:focus-visible { background: var(--accent-soft); color: var(--accent-text); outline: none; }
.cmenu button[disabled] { opacity: .45; cursor: default; }
.cmenu button svg, .cmenu .ic { width: 16px; height: 16px; flex: none; color: var(--muted); }
.cmenu button:hover:not([disabled]) svg { color: inherit; }
.cmenu button.danger, .cmenu button.danger svg { color: var(--bad); }
.cmenu .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmenu .k { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cmenu .sep { height: 1px; margin: 4px 6px; background: var(--line); }
.cmenu .mh { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* Выделенные письма */
.row.sel, .row.sel:hover { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row.ctx { outline: 2px solid var(--accent); outline-offset: -2px; }
.fl.ctx { outline: 2px solid var(--accent); outline-offset: -2px; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 6px 4px 14px; background: var(--accent-soft); color: var(--accent-text);
  border-bottom: 1px solid var(--line); }
.selbar b { font-size: 13px; margin-right: 4px; white-space: nowrap; }
.selbar .ib { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; }
.selbar .ib:hover { background: var(--pane); }
.selbar .ib.danger { color: var(--bad); }
.selbar .sp { flex: 1; }
.selbar .x { width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; }
.selbar .x:hover { background: var(--pane); }

/* Окно письма по двойному щелчку: «плавающее» или «поверх всего» (настройка в меню имени) */
.mwin { position: fixed; z-index: 40; display: flex; flex-direction: column; overflow: hidden; resize: both;
  min-width: 420px; min-height: 280px; max-width: 100vw; max-height: 100vh;
  background: var(--pane); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 18px 56px rgba(0, 0, 0, .26); }
.mwin.max { left: 8px !important; top: 8px !important; width: calc(100vw - 16px) !important; height: calc(100vh - 16px) !important;
  resize: none; border-radius: 10px; }
.mwin.anim { transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.mwin-h { flex: none; display: flex; align-items: center; gap: 2px; min-height: 44px; padding: 4px 6px 4px 16px;
  background: var(--pane2); border-bottom: 1px solid var(--line); cursor: move; user-select: none; touch-action: none; }
.mwin.max .mwin-h { cursor: default; }
.mwin-h .t { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mwin-h .pos { font-size: 12px; color: var(--muted); margin: 0 6px; white-space: nowrap; }
.mwin-h button { flex: none; width: 34px; height: 34px; border: 0; border-radius: 6px; background: none; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.mwin-h button:hover:not([disabled]) { background: var(--line2); color: var(--text); }
.mwin-h button[disabled] { opacity: .35; cursor: default; }
.mwin-h button[data-mwin-close]:hover { background: #c42b1c; color: #fff; }
.mwin .mwin-read { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: block; border: 0; border-radius: 0; box-shadow: none;
  background: var(--pane); }
.mwin .mwin-read [data-back] { display: none !important; }
.mwin .mwin-read .inner { max-width: none; }
.mwin-back { position: fixed; inset: 0; z-index: 39; background: rgba(12, 15, 22, .48); }
@media (prefers-reduced-motion: reduce) { .mwin.anim { transition: none; } }
body.resizing iframe { pointer-events: none; }

/* Заголовок результатов поиска */
.shead { padding: 8px 14px 10px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.shead .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scope { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-right: 2px; }
.scope svg { width: 14px; height: 14px; }
.qchip { display: inline-flex; align-items: center; gap: 0; border-radius: 4px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-text); max-width: 100%; overflow: hidden; transition: background .12s, box-shadow .12s; }
.qchip .qc-t { border: 0; background: none; color: inherit; font: inherit; padding: 2px 4px 2px 8px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qchip .qc-t span { font-weight: 400; }
.qc-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 2px;
  border-radius: 50%; color: currentColor; opacity: .45; text-decoration: none; transition: background .12s, color .12s, opacity .12s; }
.qc-x svg { width: 12px; height: 12px; stroke-width: 2.6; }
.qchip:hover { box-shadow: inset 0 0 0 1px currentColor; }
.qchip:hover .qc-x, .qc-x:focus-visible, .scope:hover .qc-x { opacity: 1; color: #c42b1c; }
.qc-x:hover, .qc-x:focus-visible { background: #c42b1c; color: #fff !important; opacity: 1; outline: none; }
.scope .qc-x { margin-left: 2px; }
.sreset { font-size: 12.5px; color: var(--muted); }
.sreset:hover { color: var(--bad); }
.qchip.bad { background: var(--bad-soft); color: var(--bad-text); }
.srow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.srow .sp { flex: 1; }
.found { font-size: 13px; color: var(--muted); }
.found b { color: var(--text); }
.seg.sm { margin: 0; padding: 2px; }
.seg a { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; color: var(--text2); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--pane); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.savebox > summary { list-style: none; width: max-content; }
.srow .savebox[open] { flex-basis: 100%; }
.savebox > summary::-webkit-details-marker { display: none; }
.savef { margin-top: 8px; padding: 12px; border-radius: 8px; background: var(--pane2); display: flex; flex-direction: column; gap: 8px; }
.savef .field { margin: 0; font-size: 13px; }
.savef .check { font-size: 13px; }
.savef .btn { align-self: flex-start; }
.saved-note { font-size: 12.5px; color: var(--muted); }
.side .smart-h { padding-top: 10px; }
.fl.smart .n { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.state { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text2); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu .pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 8px; background: var(--pane);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; z-index: 10; }
.menu .pop a, .menu .pop button.link { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 6px;
  color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.menu .pop a:hover, .menu .pop button.link:hover { background: var(--pane2); }
.menu .pop .sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu .pop .lbl { font-size: 12px; color: var(--muted); padding: 4px 10px 2px; }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--line2); border-radius: 8px; margin: 2px 6px 6px; }
.seg button { flex: 1; min-height: 30px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12.5px; color: var(--text2); }
.seg button[aria-pressed="true"] { background: var(--pane); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; }

/* Три панели */
.app { display: flex; height: calc(100vh - 55px); min-height: 0; }
.side { flex: 0 1 var(--side-w, 248px); min-width: 150px; overflow-y: auto; background: var(--pane); border-right: 1px solid var(--line); padding: 10px 8px 16px; }
.side .box { display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px; font-size: 12.5px; font-weight: 600; color: var(--text2); }
.side .box .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .box form { margin: 0; }
.side .box button { width: 26px; height: 26px; border: 0; background: none; color: var(--faint); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.side .box button:hover { background: var(--pane2); color: var(--text); }
.fl { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border-radius: 6px; color: var(--text);
  text-decoration: none; }
.fl:hover { background: var(--pane2); color: var(--text); }
.fl[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.fl .n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text2); }
.fl[aria-current="page"] .n { color: var(--accent-text); }
.fl .lab { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .all { margin-bottom: 4px; }
.side .err { margin: 2px 10px 6px; font-size: 12px; color: var(--bad); }

.list { flex: 0 1 var(--list-w, 420px); min-width: 260px; display: flex; flex-direction: column; background: var(--pane); border-right: 1px solid var(--line); }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.list-head h1 { margin: 0 auto 0 0; font-size: 16px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.list-body { flex: 1; overflow-y: auto; }
.day { position: sticky; top: 0; z-index: 1; padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--pane2); border-bottom: 1px solid var(--line2); }
.row { display: flex; gap: 10px; padding: var(--row-pad) 14px; border-bottom: 1px solid var(--line2); color: var(--text); text-decoration: none; position: relative; }
.row:hover { background: var(--pane2); color: var(--text); }
.row[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row .u { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; }
.row.unread .u { background: var(--accent); }
.row .c { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--row-gap); }
.row .l1 { display: flex; gap: 8px; align-items: baseline; }
.row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.row .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row .subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.row .snip { font-size: .92em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.unread .who, .row.unread .subj { color: var(--text); font-weight: 700; }
.row .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.row .flag { color: var(--bad); }
[data-density="compact"] .row .snip { display: none; }
[data-density="compact"] .row .tags:empty { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; color: var(--muted); font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.read { flex: 1 1 480px; min-width: 340px; overflow-y: auto; background: var(--pane); }
.read .bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--pane); z-index: 1; }
.read .bar .sp { flex: 1; }
.read .inner { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.read h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.hdr { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.hdr .who { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.hdr .who b { font-weight: 600; overflow-wrap: anywhere; }
.hdr .who span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.hdr .when { font-size: 13px; color: var(--muted); }
.frame { width: 100%; border: 0; min-height: 60px; display: block; background: transparent; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line2); }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); min-width: 220px; max-width: 100%; }
.att:hover { background: var(--pane2); color: var(--text); }
.att .ico { width: 36px; height: 36px; border-radius: 6px; background: var(--line2); color: var(--text2); font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none; text-transform: uppercase; }
.att .meta { display: flex; flex-direction: column; min-width: 0; }
.att .meta b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .meta span { font-size: 12px; color: var(--muted); }
.att.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); }
.att.warn .ico { background: var(--warn); color: #fff; }
.att.block { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: var(--bad-soft); }
.att.block .ico { background: var(--bad); color: #fff; }
.att.block .meta b, .att.block .meta span { color: var(--bad-text); }
.placeholder { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 30px; text-align: center; }
.back { display: none; }

/* Страницы (вход, админка) */
.page { max-width: 1200px; margin: 0 auto; padding: 24px; }
.card { background: var(--pane); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 4px; }
.auth h1 { margin: 0 0 12px; font-size: 22px; }
.adm { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.adm nav { flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.adm nav a { display: flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.adm nav a:hover { background: var(--pane); }
.adm nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.adm main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.adm h1 { margin: 0; font-size: 22px; }
.adm h2 { margin: 0 0 12px; font-size: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar h1 { margin-right: auto; }
.tbl-wrap { overflow-x: auto; background: var(--pane); border: 1px solid var(--line); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .muted, .muted { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.steps { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.steps .y { color: var(--ok); font-weight: 700; } .steps .n { color: var(--bad); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters > * { width: auto; flex: 1 1 150px; }
form.inline { display: inline; margin: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 1100px) { .list { flex-basis: var(--list-w, 360px); } .side { flex-basis: var(--side-w, 220px); } }
@media (max-width: 860px) {
  .app { height: auto; min-height: calc(100vh - 55px); flex-direction: column; }
  .side { flex: none; border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .list { flex: none; border-right: 0; }
  .list-body { overflow: visible; }
  .read { flex: none; }
  body.reading .side, body.reading .list { display: none; }
  body:not(.reading) .read { display: none; }
  .back { display: inline-flex; }
  .split { display: none; }
  .side, .list, .read { min-width: 0; }
  .mwin { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border-radius: 0; resize: none; min-width: 0; }
  body:not(.reading) .mwin .read, .mwin .read { display: block; }
  .grid2 { grid-template-columns: 1fr; }
  .top .state { display: none; }
  .sbox { flex-basis: 100%; max-width: none; order: 3; }
  .qpanel { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; max-height: calc(100vh - 72px); overflow: auto; }
  .qp-g { grid-template-columns: 1fr; }
}

/* Элементы оформления «Офис» — в классическом виде скрыты */
.fl .fi, .row .av { display: none; }
.fl .fi.fi-smart { display: inline-flex; color: var(--accent); }
/* Элементы «Офис 2026» — в остальных оформлениях скрыты */
.rail, .qa { display: none; }
.rw { position: relative; }

/* ---------- Метки: категории, флажок со сроком, «выполнено», закреплено ---------- */
.cat { display: inline-flex; align-items: center; max-width: 160px; padding: 0 6px; border-radius: 3px; font-size: 11.5px;
  line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--cc) 22%, #fff); color: color-mix(in srgb, var(--cc) 45%, #000);
  border: 1px solid color-mix(in srgb, var(--cc) 70%, #fff); }
[data-theme="dark"] .cat { background: color-mix(in srgb, var(--cc) 30%, #1b1b1b); color: color-mix(in srgb, var(--cc) 35%, #fff);
  border-color: color-mix(in srgb, var(--cc) 75%, #1b1b1b); }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .cat { background: color-mix(in srgb, var(--cc) 30%, #1b1b1b);
  color: color-mix(in srgb, var(--cc) 35%, #fff); border-color: color-mix(in srgb, var(--cc) 75%, #1b1b1b); } }
/* значок-ярлык категории, как в Outlook */
.ctag { width: 16px; height: 16px; flex: none; }
.ctag path { fill: color-mix(in srgb, var(--cc) 35%, #fff); stroke: color-mix(in srgb, var(--cc) 85%, #000); stroke-width: 1.1; }
.ctag circle { fill: color-mix(in srgb, var(--cc) 85%, #000); }
.row .flag { display: inline-flex; align-items: center; gap: 3px; }
.row .flag svg { width: 14px; height: 14px; }
.row .flag small { font-size: 11px; font-weight: 600; white-space: nowrap; }
.row .flag:not(.over) small { color: var(--muted); }
.row .done, .row .pin { display: inline-flex; color: var(--ok, #13a10e); }
.row .pin { color: var(--muted); }
.row .done svg, .row .pin svg { width: 14px; height: 14px; }
.row[data-done] .subj { text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.mlabels { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.mlabels .cat { font-size: 12.5px; line-height: 22px; padding: 0 9px; max-width: 260px; }
.mlabels .chip svg { width: 13px; height: 13px; }
.chip.flagc { background: var(--bad-soft); color: var(--bad-text); }
.chip.flagc:not(.bad) { background: var(--warn-soft); color: var(--warn-text); }

/* Подменю, цветные точки категорий, поле-фильтр */
.cmenu.sub { z-index: 61; max-height: min(70vh, 520px); overflow-y: auto; }
.cmenu .more { display: inline-flex; margin-right: -4px; }
.cmenu .more svg { width: 14px; height: 14px; }
.cmenu button[aria-expanded="true"] { background: var(--pane2); }
.cmenu .ck { display: inline-flex; width: 14px; flex: none; margin-right: -4px; }
.cmenu .ck svg { width: 14px; height: 14px; color: var(--text) !important; stroke-width: 2.2; }
.cmenu button svg.ctag { width: 16px; height: 16px; }
.cmenu .mfilter { display: block; width: calc(100% - 8px); margin: 4px; padding: 6px 9px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg, var(--pane)); color: var(--text); font: inherit; font-size: 13px; }
.cmenu .mfilter:focus { outline: none; }
.cmenu button[hidden], .cmenu .sep[hidden], .cmenu .mh[hidden] { display: none; }

/* Перетаскивание на папку, всплывающее сообщение */
.fl.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-text); }
.dragghost { position: fixed; top: -100px; left: 0; padding: 6px 12px; border-radius: 6px; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, 92vw);
  padding: 10px 16px; border-radius: 8px; background: #1f2430; color: #fff; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast[hidden] { display: none; }

/* Админка: категории */
.cats-admin { display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cat-row .cat { min-width: 90px; }
.cat-row input[type="text"] { width: 200px; }
.cat-row .sp { flex: 1; }
.cat-row select, .cat-row input[type="text"] { width: auto; flex: none; }
.cat-row input[type="text"] { width: 200px; }

/* ---------- Правила ---------- */
.rules { display: flex; flex-direction: column; gap: 10px; }
.rule { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; }
.rule.off { opacity: .6; }
.rule-main { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rule-if code { overflow-wrap: anywhere; }
.rule-meta { font-size: 12px; }
.rule-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rule-btns .ib { min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--text); }
.rule-btns .ib[disabled] { opacity: .35; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; }
.rgrid .field { margin: 0; }
.rgrid .link { align-self: flex-start; margin-top: 4px; font-size: 12.5px; }
.rraw { margin-top: 12px; }
.rraw summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.rraw input { width: 100%; margin-top: 8px; font-family: ui-monospace, Consolas, monospace; }
.rprev { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--pane2); font-size: 13.5px; }
.rprev:empty { display: none; }
.rprev.ok { background: var(--accent-soft); }
.rprev.bad { background: var(--bad-soft); color: var(--bad-text); }
.rprev .muted { margin-top: 4px; font-size: 12px; }
.rcats { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 14px 0 0; padding: 0; border: 0; }
.rcats legend { margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.rchecks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }

/* Фильтр над списком */
.fltmenu { position: relative; }
.fltmenu > summary { display: inline-flex; align-items: center; gap: 5px; max-width: 220px; }
.fltmenu > summary svg { width: 14px; height: 14px; }
.fltmenu .pop { left: 0; right: auto; max-height: 70vh; overflow-y: auto; z-index: 30; }
.fltmenu .pop a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); }
.fltmenu .pop .cat { max-width: 200px; }

/* ---------- Окно «Создание категории» ---------- */
.cmodal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .35); }
.cmodal { width: min(600px, 100%); padding: 24px 24px 20px; border-radius: 10px; background: var(--pane); color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.cmodal h2 { margin: 0 0 18px; font-size: 20px; font-weight: 600; }
.cm-lbl { display: block; margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.cm-row { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.cm-row input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-bottom: 2px solid var(--accent);
  border-radius: 4px; background: var(--pane); color: var(--text); font: inherit; }
.cm-row input:focus { outline: none; }
.cm-star { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; }
.cm-star svg, .catpage .star svg { width: 20px; height: 20px; }
.cm-star.on svg, .catpage .star.on svg { fill: #f2b01e; color: #c78b00; }
.cm-colhead { display: flex; justify-content: space-between; gap: 10px; }
.cm-used { font-weight: 400; font-size: 12.5px; }
.cm-pal { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin: 4px 0 16px; }
.cm-pal button { aspect-ratio: 1; width: 100%; max-width: 36px; border-radius: 50%; cursor: pointer; font-size: 13px; padding: 0;
  background: color-mix(in srgb, var(--cc) 30%, #fff); color: color-mix(in srgb, var(--cc) 45%, #000);
  border: 1px solid color-mix(in srgb, var(--cc) 75%, #fff); }
.cm-pal button[aria-checked="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-pal button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.cm-done { margin-bottom: 12px; font-size: 13px; }
.cm-err { margin-bottom: 10px; color: var(--bad); font-size: 13px; }
.cm-btns { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 520px) { .cm-pal { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Страница «Категории» ---------- */
.catpage { max-width: 820px; }
.cat-intro { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; padding-bottom: 18px;
  margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.cat-intro p { margin: 0; max-width: 520px; }
.cat-intro .btn { flex: none; gap: 6px; }
.cat-intro .btn svg { width: 16px; height: 16px; }
.cat-list { display: flex; flex-direction: column; }
.cat-lh { display: flex; justify-content: space-between; padding: 6px 140px 8px 36px; font-weight: 600; font-size: 13.5px; }
.cat-li { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 0 12px; border: 1px solid var(--line);
  border-top-width: 0; background: var(--pane); }
.cat-li:first-of-type, .cat-lh + .cat-li { border-top-width: 1px; border-radius: 4px 4px 0 0; }
.cat-li:last-child { border-radius: 0 0 4px 4px; }
.cat-li:hover { background: var(--pane2); }
.cat-li .ctag { width: 18px; height: 18px; }
.cat-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cat-n { min-width: 40px; text-align: right; font-size: 13px; text-decoration: none; }
.cat-li .ib { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none;
  color: var(--text2); cursor: pointer; }
.cat-li .ib:hover { background: var(--accent-soft); color: var(--accent-text); }
.cat-li .ib svg { width: 18px; height: 18px; }
.cat-li .chip svg { width: 12px; height: 12px; }

/* ---------- Окно «Параметры» (как в Outlook) ---------- */
.gearbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: var(--text2); }
.gearbtn:hover { background: var(--pane2); color: var(--accent-text); }
.gearbtn svg { width: 20px; height: 20px; }
.smodal-back { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 3vh 2vw;
  background: rgba(0, 0, 0, .4); }
.smodal { display: grid; grid-template-columns: 220px 200px minmax(0, 1fr); width: min(1280px, 100%); height: min(850px, 94vh);
  overflow: hidden; border-radius: 8px; background: var(--pane); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .35); }
.smodal .s1, .smodal .s2 { display: flex; flex-direction: column; gap: 2px; padding: 22px 12px; overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--pane); }
.smodal .s1 { background: color-mix(in srgb, var(--pane2) 55%, var(--pane)); }
.smodal .s2 { padding-top: 28px; }
.smodal .s1 h2 { margin: 0 8px 14px; font-size: 20px; font-weight: 600; }
.s-find { display: flex; align-items: center; gap: 6px; margin: 0 4px 16px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--pane); }
.s-find svg { width: 14px; height: 14px; color: var(--muted); }
.s-find input { flex: 1; min-width: 0; border: 0; padding: 6px 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; }
.s-find input:focus { outline: none; }

.smodal .s1 a, .smodal .s2 a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 4px; color: var(--text); text-decoration: none; font-size: 14px; }
.smodal .s2 a { flex-direction: column; align-items: flex-start; gap: 0; font-size: 13.5px; line-height: 1.35; }
.smodal .s2 a small { color: var(--muted); font-size: 11.5px; }
.smodal .s1 a svg { width: 18px; height: 18px; color: var(--text2); }
.smodal .s1 a:hover, .smodal .s2 a:hover { background: var(--pane2); }
.smodal .s1 a[aria-current], .smodal .s2 a[aria-current] { font-weight: 600; }
.smodal .s1 a[aria-current]::before, .smodal .s2 a[aria-current]::before { content: ""; position: absolute; left: 0; top: 7px;
  bottom: 7px; width: 3px; border-radius: 2px; background: var(--accent); }
.smodal .s1 a[aria-current] svg { color: var(--accent); }
.smodal .s2 a[hidden] { display: none; }
.smodal .s3 { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.smodal .s3 > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line); }
.smodal .s3 > header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.s-x { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 6px; background: none;
  color: var(--text2); cursor: pointer; }
.s-x:hover { background: var(--pane2); }
.s-x svg { width: 20px; height: 20px; }
.s3b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 28px; }
.s3b > * { max-width: 840px; }
.s3b h3 { margin: 4px 0 10px; font-size: 16px; font-weight: 600; }
.s3b hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }
.s3b p { margin: 0 0 12px; }
.s3b .notice { margin-bottom: 14px; }
.s-form { display: flex; flex-direction: column; gap: 10px; }
.s-form .radio, .s-form .check { display: flex; align-items: center; gap: 8px; }
.s-save { margin-top: 10px; }
.s-note { margin-top: 12px; }
.s-headrow { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.s-headrow .btn { flex: none; gap: 6px; }
.s-headrow .btn svg { width: 16px; height: 16px; }
.s-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 4px; }
.s-li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--line); }
.s-li:first-child { border-top: 0; }
.s-li.off { opacity: .6; }
.s-li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.s-li-main .muted { font-size: 12.5px; overflow-wrap: anywhere; }
.s-li-main input[type="text"] { max-width: 360px; }
.s-li .ib { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none;
  color: var(--text2); cursor: pointer; }
.s-li .ib:hover { background: var(--accent-soft); color: var(--accent-text); }
.s-li .ib svg { width: 18px; height: 18px; }
.s-boxic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft);
  color: var(--accent); flex: none; }
.s-boxic svg { width: 20px; height: 20px; }
.s-li .live { font-size: 12.5px; }
.s-toggle { display: contents; }
.sw { position: relative; width: 40px; height: 20px; flex: none; padding: 0; border: 1px solid var(--muted); border-radius: 10px;
  background: var(--pane); cursor: pointer; }
.sw i { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--text2); transition: left .15s; }
.sw.on { background: var(--accent); border-color: var(--accent); }
.sw.on i { left: 23px; background: #fff; }
.s-soon { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 16px; padding: 14px 16px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-text); }
.s-soon svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.s-fake { display: flex; flex-direction: column; gap: 8px; opacity: .55; }
/* хранилище */
.s-card { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.s-card > .kv { margin: 0; padding: 16px; }
.s-card-h { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.s-card-h .muted { font-size: 12.5px; }
.s-usage { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 24px; padding: 18px; }
.s-big { font-size: 30px; font-weight: 600; line-height: 1.2; margin: 2px 0 6px; }
.s-big small { font-size: 14px; font-weight: 400; color: var(--muted); }
.s-bar { display: flex; height: 14px; margin: 8px 0 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px;
  background: var(--pane2); }
.s-bar span { height: 100%; }
.seg-mail { background: #c4317f; } .seg-db { background: #4f6bed; } .seg-bak { background: #13a10e; } .seg-imp { background: #e8a33d; }
.s-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.s-legend i { display: inline-block; width: 4px; height: 14px; margin-right: 6px; border-radius: 2px; vertical-align: -2px; }
.s-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.s-table th, .s-table td { padding: 8px 18px; text-align: left; border-top: 1px solid var(--line); }
.s-table th { border-top: 0; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.s-card .s-table + p { padding: 0 18px 14px; }
/* внешний вид: плитки-превью и цвета */
.s-tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.s-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 112px; padding: 0; border: 0; background: none;
  color: var(--text); font: inherit; font-size: 13px; text-align: center; cursor: pointer; }
.s-tile .pv { position: relative; display: block; width: 96px; height: 66px; overflow: hidden; border: 2px solid var(--line);
  border-radius: 6px; background: #fff; }
.s-tile.on .pv { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.s-tile:hover .pv { border-color: var(--accent); }
.pv i { position: absolute; top: 0; bottom: 0; display: block; }
.pv i:nth-child(1) { left: 0; width: 22%; background: #eef0f3; }
.pv i:nth-child(2) { left: 22%; width: 34%; background: #fff; border-left: 1px solid #e2e5ea; border-right: 1px solid #e2e5ea; }
.pv i:nth-child(3) { left: 56%; right: 0; background: #fbfbfc; }
.pv-dark i:nth-child(1) { background: #1b1b1b; } .pv-dark i:nth-child(2) { background: #262626; border-color: #333; }
.pv-dark i:nth-child(3) { background: #202020; }
.pv-auto i:nth-child(3) { background: #202020; }
.sk-classic i:nth-child(1) { background: #e8eefa; } .sk-classic i:nth-child(2) { border-top: 10px solid #2457c5; }
.sk-office i:nth-child(1) { background: #0f6cbd; } .sk-office i:nth-child(2) { border-top: 10px solid #f3f2f1; }
.sk-office26 i:nth-child(1) { background: linear-gradient(#cfe0f5, #eaf1fa); }
.sk-office26 i:nth-child(2) { margin: 8px 0; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.sk-office26 i:nth-child(3) { margin: 8px 6px; border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.sk-all i:nth-child(1) { background: repeating-linear-gradient(45deg, #e8eefa 0 6px, #dfe6f3 6px 12px); }
.s-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.s-sw { width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: var(--sw);
  cursor: pointer; outline-offset: 2px; }
.s-sw.on { outline: 2px solid var(--text); }
.s-sw:hover { filter: brightness(1.08); }
html[data-nosnip] .row .snip { display: none; }
html[data-noav] .row .av { display: none; }
@media (max-width: 900px) {
  .smodal { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; height: 96vh; }
  .smodal .s1, .smodal .s2 { flex-direction: row; flex-wrap: wrap; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .smodal .s1 h2, .s-find { display: none; }
  .s-usage { grid-template-columns: 1fr; }
}

/* Заявки, группы, таблица доступов */
.pend { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.pend-who { flex: 1 1 260px; }
.pend-groups { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.grp-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.acc-matrix td { min-width: 170px; vertical-align: top; }
.acc-matrix select, .acc-matrix input[type="date"] { width: 100%; margin-bottom: 4px; font-size: 13px; }
.acc-via { font-size: 11.5px; }
.pending-banner { margin: 10px; }
.mlabels-by { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: -6px 0 12px; font-size: 12px; color: var(--muted); }
.mlabels-by:empty { display: none; }
.mlabels-by b { font-weight: 600; color: var(--text2); }
.mhist { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.mhist summary { cursor: pointer; color: var(--muted); }
.mhist ol { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.mhist p { margin: 8px 0 0; }
.fl-trash { opacity: .8; }

/* ---------- Новое письмо / ответ ---------- */
.newmail { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 8px 10px; min-height: 36px; }
.newmail svg { width: 16px; height: 16px; }
.compose { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.compose .cbar .btn.primary { gap: 6px; }
.csaved { font-size: 12.5px; margin-right: 8px; }
.cinner { position: relative; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.ctitle { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.cfields { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.cf { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid var(--line); }
.cf:first-child { border-top: 0; }
.cf > span { flex: none; width: 70px; color: var(--muted); font-size: 13.5px; }
.cf input, .cf select { flex: 1; min-width: 0; border: 0; padding: 8px 0; background: none; color: var(--text); font: inherit; }
.cf input:focus, .cf select:focus { outline: none; }

.ccshow { align-self: flex-end; margin: -32px 0 6px; font-size: 12.5px; position: relative; z-index: 1; }
.csugg { position: absolute; z-index: 40; top: 100%; left: 80px; right: 0; display: flex; flex-direction: column; padding: 4px;
  background: var(--pane); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.csugg button { padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: left; font: inherit;
  font-size: 13.5px; cursor: pointer; }
.csugg button:hover { background: var(--accent-soft); }
.catts { display: flex; flex-wrap: wrap; gap: 6px; }
.catts:empty { display: none; }
.catt { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; background: var(--pane2); }
.catt svg { width: 14px; height: 14px; }
.catt small { color: var(--muted); }
.catt .x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 4px; }
.catt .x:hover { color: var(--bad); }
.csrcatt { font-size: 13px; }
.ctools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ctools button { min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 4px; background: none; color: var(--text);
  font: inherit; font-size: 13.5px; cursor: pointer; }
.ctools button:hover { background: var(--pane2); }
.ctools .sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.cbody { flex: 1; min-height: 260px; padding: 12px 2px; outline: none; font: 14px/1.5 Calibri, "Segoe UI", Arial, sans-serif;
  color: var(--text); overflow-wrap: anywhere; }
.cbody blockquote { margin: 0 0 0 4px; padding-left: 10px; border-left: 3px solid var(--line); }
.cbody .pq { color: var(--text2); }
.cbody img { max-width: 100%; height: auto; }
.cdrop { position: absolute; inset: 8px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 85%, transparent); color: var(--accent-text); font-weight: 600; z-index: 5; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-act { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 6px; background: none; color: #fff; font: inherit;
  font-weight: 600; cursor: pointer; }
.toast-act:hover { background: rgba(255, 255, 255, .15); }
.bad-text { color: var(--bad); font-size: 12.5px; }
.sign-edit { min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane);
  font: 14px/1.5 Calibri, "Segoe UI", Arial, sans-serif; outline: none; }

.sign-tools { border: 0; padding: 0; }

/* 0.5: ответственный, заметки, беседа */
.massign { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; font-size: 13px; color: var(--text2); }
.massign svg { width: 15px; height: 15px; color: var(--muted); }
.massign select { font: inherit; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--text); max-width: 260px; }
.mnotes { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--pane2); font-size: 13px; }
.mnotes-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mnotes-h svg { width: 15px; height: 15px; color: var(--muted); }
.mnote { padding: 6px 0; border-top: 1px solid var(--line2); }
.mnote-h { display: flex; align-items: center; gap: 8px; }
.mnote-h .ib { margin-left: auto; }
.mnote-t { margin-top: 2px; white-space: normal; overflow-wrap: anywhere; color: var(--text); }
.mnote-f { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.mnote-f textarea { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--text); resize: vertical; min-height: 38px; }
.mthread { margin-top: 16px; font-size: 13px; }
.mthread summary { cursor: pointer; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.mthread summary svg { width: 15px; height: 15px; }
.mthread ol { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mthread li + li { border-top: 1px solid var(--line2); }
.mthread a { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; padding: 7px 10px; color: var(--text); text-decoration: none; }
.mthread a:hover { background: var(--accent-soft); }
.mthread a.unread b { color: var(--accent-text); }
.mthread a .snip { grid-column: 1 / -1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .thr, .row .nts { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); margin-left: 4px; }
.row .thr svg, .row .nts svg { width: 12px; height: 12px; }
.row .thr.unread { color: var(--accent-text); font-weight: 600; }
.chip.asg { background: var(--accent-soft); color: var(--accent-text); }
.chip.asg svg { width: 12px; height: 12px; }
.cat-user select { font: inherit; font-size: 12px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--text); max-width: 170px; }
.mnote-h .ib { width: 26px; height: 26px; padding: 4px; border: 0; background: transparent; color: var(--muted); }
.mnote-h .ib:hover { color: var(--text); background: var(--line2); }
/* 0.6: условное форматирование, палитра */
.row[data-rc] .who, .row[data-rc] .subj { color: var(--rc); }
.row.rbold .who, .row.rbold .subj { font-weight: 700; }
.rs-sample { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 28px; border: 1px solid var(--line); border-radius: 6px; color: var(--rc, var(--text)); }
.rs-pal { border: 0; padding: 0; margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.rs-pal legend { margin-bottom: 4px; }
.rs-c input { position: absolute; opacity: 0; }
.rs-c span { display: inline-block; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; outline-offset: 2px; }
.rs-c input:checked + span { outline: 2px solid var(--text); }
.rs-c input:focus-visible + span { outline: 2px dashed var(--accent); }

/* ---------- 0.7: календарь (в духе Outlook) ---------- */
.calp { display: flex; height: calc(100vh - 55px); min-height: 0; background: var(--bg); }
[data-skin="office"] .calp { height: calc(100vh - 48px); }
.cal-side { width: 260px; flex: 0 0 260px; padding: 12px; overflow: auto; border-right: 1px solid var(--line); background: var(--pane); display: flex; flex-direction: column; gap: 14px; }
.cal-new { justify-content: center; }
.mini-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: 13px; }
.mini table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: center; }
.mini th { color: var(--muted); font-weight: 500; padding: 2px 0; }
.mini td a { display: block; width: 28px; height: 28px; line-height: 28px; margin: 0 auto; border-radius: 50%; color: var(--text); text-decoration: none; }
.mini td a:hover { background: var(--line2); }
.mini td a.out { color: var(--faint); }
.mini td a.sel { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.mini td a.today { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-people { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cal-ph { margin-bottom: 4px; }
.cal-mine { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; color: var(--text2); text-decoration: none; margin-bottom: 4px; }
.cal-mine:hover, .cal-mine.on { background: var(--accent-soft); color: var(--accent-text); }
.cal-mine svg { width: 15px; height: 15px; }
.cal-pp { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.cal-pp:hover { background: var(--line2); }
.cal-pp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cal-pp .box { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 4px; border: 2px solid var(--pc); background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.cal-pp input:checked + .box { background: var(--pc); }
.cal-pp input:checked + .box::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cal-pp input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-pp .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-pa { font-size: 12px; color: var(--muted); padding: 2px 6px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.cal-subbtn { margin-top: auto; justify-content: center; font-size: 13px; }
.cal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--pane); }
.cal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-bar h1 { font-size: 18px; margin: 0 0 0 8px; font-weight: 600; }
.cal-bar .ib, .mini-h .ib { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 6px; color: var(--text2); }
.cal-bar .ib:hover, .mini-h .ib:hover { background: var(--line2); }
.cal-bar .ib svg, .mini-h .ib svg { width: 18px; height: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 12px; font-size: 13px; color: var(--text2); text-decoration: none; border-left: 1px solid var(--line); }
.seg a:first-child { border-left: 0; }
.seg a[aria-current] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
/* неделя / день: сетка по часам */
.cal-week { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cw-head, .cw-all { display: grid; grid-template-columns: 56px repeat(var(--ndays), 1fr); border-bottom: 1px solid var(--line); }
.cw-gut { font-size: 11px; padding: 4px; text-align: right; }
.cw-dh { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; color: var(--text2); text-decoration: none; border-left: 1px solid var(--line2); }
.cw-dh .n { font-size: 22px; font-weight: 300; }
.cw-dh .w { font-size: 12px; }
.cw-dh.today .n { color: var(--accent); font-weight: 600; }
.cw-dh.today { box-shadow: inset 0 3px 0 var(--accent); }
.cw-ac { min-height: 26px; padding: 2px; border-left: 1px solid var(--line2); display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.cw-body { flex: 1; min-height: 0; overflow-y: auto; }
.cw-grid { display: grid; grid-template-columns: 56px repeat(var(--ndays), 1fr); position: relative; }
.cw-h { height: 48px; position: relative; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; }
.cw-h span { position: relative; top: -7px; }
.cw-col { position: relative; border-left: 1px solid var(--line2); }
.cw-col.we { background: color-mix(in srgb, var(--pane2) 70%, transparent); }
.cw-slot { height: 24px; border-top: 1px solid var(--line2); cursor: pointer; }
.cw-slot.half { border-top: 1px dotted color-mix(in srgb, var(--line2) 60%, transparent); }
.cw-slot:hover { background: var(--accent-soft); }
.cw-now { position: absolute; left: 0; right: 0; height: 2px; background: #d13438; z-index: 3; pointer-events: none; }
.cw-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #d13438; }
.ev { position: absolute; z-index: 2; margin: 0 1px; padding: 3px 6px; overflow: hidden; text-align: left; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.3;
  border: 0; border-left: 4px solid var(--ec); border-radius: 4px; color: var(--text);
  background: color-mix(in srgb, var(--ec) 22%, var(--pane)); display: flex; flex-direction: column; gap: 1px; }
.ev:hover { background: color-mix(in srgb, var(--ec) 34%, var(--pane)); }
.ev b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .who { font-size: 11px; color: var(--muted); }
.ev-chip { display: block; width: 100%; text-align: left; font: inherit; font-size: 12px; padding: 2px 6px; border: 0; border-left: 3px solid var(--ec); border-radius: 3px;
  background: color-mix(in srgb, var(--ec) 18%, var(--pane)); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-chip.allday { background: var(--ec); color: #fff; border-left-color: color-mix(in srgb, var(--ec) 70%, #000); }
.ev-chip .t { color: var(--muted); }
/* месяц */
.cal-month { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mo-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.mo-head div { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.mo-row { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line2); min-height: 92px; }
.mo-cell { border-left: 1px solid var(--line2); padding: 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; cursor: pointer; }
.mo-cell:hover { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.mo-cell.out { background: var(--pane2); }
.mo-cell.out .mo-day { color: var(--faint); }
.mo-cell.we:not(.out) { background: color-mix(in srgb, var(--pane2) 60%, transparent); }
.mo-day { font-size: 12px; color: var(--text2); text-decoration: none; align-self: flex-start; padding: 1px 6px; border-radius: 10px; }
.mo-cell.today .mo-day { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.mo-more { font-size: 11px; color: var(--accent); text-decoration: none; padding-left: 6px; }
/* повестка */
.cal-agenda { flex: 1; overflow: auto; padding: 8px 18px 20px; }
.cal-agenda h2 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: var(--text2); }
.cal-agenda h2.today { color: var(--accent); }
.ag-ev { display: flex; gap: 14px; width: 100%; text-align: left; font: inherit; padding: 8px 10px; margin: 0 0 4px; border: 0; border-left: 4px solid var(--ec);
  border-radius: 6px; background: var(--pane2); color: var(--text); cursor: pointer; }
.ag-ev:hover { background: color-mix(in srgb, var(--ec) 12%, var(--pane2)); }
.ag-t { width: 110px; flex: 0 0 110px; color: var(--text2); font-size: 13px; }
.ag-b { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.kind { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; color: var(--kc); border: 1px solid color-mix(in srgb, var(--kc) 50%, transparent); margin-left: 4px; }
/* окно события */
.cal-modal { position: fixed; inset: 0; background: rgba(15, 17, 21, .38); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow: auto; }
.cal-modal[hidden] { display: none; }
.cal-dlg { width: min(640px, 100%); background: var(--pane); border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,.25); }
.cev-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cev-top .btn svg { width: 15px; height: 15px; }
.cev-top .ib { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text2); }
.cev-top .ib:hover { background: var(--line2); }
.cev-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.cev-title { font-size: 20px; font-weight: 600; border: 0; border-bottom: 2px solid var(--line); padding: 6px 2px; background: transparent; color: var(--text); }
.cev-title:focus { outline: none; }
.cev-by { margin: -6px 0 0; font-size: 12px; }
.cev-row { display: flex; align-items: flex-start; gap: 10px; }
.cev-row > svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 8px; color: var(--muted); }
.cev-row input[type="text"], .cev-row select, .cev-when input, .cev-body textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--text); }
.cev-row input[type="text"] { flex: 1; }
.cev-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cev-body textarea { resize: vertical; }
.cev-ppl { flex: 1; }
.cev-ppl summary { cursor: pointer; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.cev-pl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px; padding: 6px 0; max-height: 220px; overflow: auto; }
.cev-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.cev-kinds label { cursor: pointer; }
.cev-kinds input { position: absolute; opacity: 0; }
.cev-kinds span { display: inline-block; padding: 4px 10px; border-radius: 14px; font-size: 13px; border: 1px solid color-mix(in srgb, var(--kc) 55%, transparent); color: var(--text2); }
.cev-kinds input:checked + span { background: var(--kc); color: #fff; border-color: var(--kc); }
.cev-kinds input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-subb h3 { font-size: 14px; margin: 6px 0 0; }
.cal-subb ul { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.cal-link { display: flex; gap: 6px; }
.cal-link input { flex: 1; font: inherit; font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane2); color: var(--text); }
@media (max-width: 900px) {
  .calp { flex-direction: column; height: auto; }
  .cal-side { width: auto; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .cal-week { min-height: 70vh; }
}
.cal-month .mo-row { align-items: stretch; }
.cal-month .mo-cell { height: 100%; justify-content: flex-start; align-items: stretch; min-height: 0; }
.ev.short { flex-direction: row; align-items: center; gap: 6px; padding-top: 1px; padding-bottom: 1px; }
.ev.short .who { display: none; }
.ev.short span { flex: 0 1 auto; }
.ag-b > .kind { align-self: flex-start; margin-left: 0; }

/* 0.7.2: свернуть ящик и вложенные папки */
.side .box .bx-tg { width: 20px; height: 20px; margin-left: -4px; color: var(--muted); }
.side .box .bx-tg svg { width: 14px; height: 14px; transition: transform .15s; transform: rotate(90deg); }
.bxg.closed .box .bx-tg svg { transform: rotate(0deg); }
.side .box .name { cursor: pointer; }
.bxg.closed .bx-list, .bxg.closed .err { display: none; }
.bx-n { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.bxg:not(.closed) .bx-n { display: none; }
.bx-all { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 0; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.bx-all .linkbtn { font-size: 12px; text-transform: none; letter-spacing: 0; }
.side .fl { position: relative; }
.fl-tg { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.fl-tg:hover { color: var(--text); background: var(--line2); }
.fl-tg svg { width: 12px; height: 12px; transition: transform .15s; transform: rotate(90deg); }
.fl.sub-closed > .fl-tg svg { transform: rotate(0deg); }
.side .fl[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .bx-tg svg, .fl-tg svg { transition: none; } }

/* 0.7.3: админка внутри окна «Параметры» */
.smodal .s3.s3-frame .s3b { padding: 0; overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.s-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--bg); }
body.embed { background: var(--bg); }
body.embed .page { max-width: none; padding: 16px 20px 24px; }
body.embed .adm { display: block; }
body.embed .adm main { gap: 14px; }
body.embed .adm h1 { font-size: 18px; }
.smodal .s3.s3-frame .s3b > * { max-width: none; }
.smodal .s2 a .chip { margin-left: 6px; }
.s-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8a33d; margin-left: 6px; flex: 0 0 8px; }

/* ---------- 0.8: календарь в духе Outlook — лента, мягкие карточки, окошки ---------- */
.calp { background: var(--bg); }
.cal-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.cal-in { flex: 1; min-height: 0; display: flex; gap: 8px; }
.ribbon { display: flex; align-items: stretch; gap: 4px; padding: 6px 10px 2px; background: var(--pane); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow-x: auto; }
.rb-g { display: flex; flex-direction: column; align-items: center; padding: 0 8px; border-right: 1px solid var(--line2); }
.rb-g:last-child { border-right: 0; }
.rb-g small { font-size: 10px; color: var(--muted); padding: 2px 0 4px; }
.rb-row { display: flex; gap: 2px; }
.rb { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-width: 54px; padding: 6px 6px 4px; border: 1px solid transparent; border-radius: 6px;
  background: none; color: var(--text); font: inherit; font-size: 11.5px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.rb svg { width: 26px; height: 26px; stroke-width: 1.4; color: var(--text2); }
.rb:hover { background: var(--line2); }
.rb[aria-current] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.rb[aria-current] svg { color: var(--accent); }
.cal-side { border-radius: 10px; border-right: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cal-main { border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cal-bar { padding: 10px 14px; gap: 8px; }
.cal-bar h1 { font-size: 20px; font-weight: 600; }
.cal-today { gap: 6px; }
.cal-today svg { width: 16px; height: 16px; }
.mini-h { padding: 0 2px 4px; }
.mini-h span { display: inline-flex; }
.mini td.inr a:not(.today) { background: var(--accent-soft); border-radius: 0; width: 100%; }
.mini td.inr:first-child a:not(.today) { border-radius: 14px 0 0 14px; }
.mini td.inr:last-child a:not(.today) { border-radius: 0 14px 14px 0; }
.cal-ph { display: flex; align-items: center; gap: 6px; }
.cal-ph svg { width: 16px; height: 16px; color: var(--muted); }
/* неделя */
.cw-dh { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 10px 8px; border: 0; border-left: 1px solid var(--line2); background: none; font: inherit; cursor: pointer; text-align: left; }
.cw-dh .n { font-size: 22px; font-weight: 400; color: var(--text); }
.cw-dh .w { font-size: 11.5px; color: var(--muted); }
.cw-dh.today { box-shadow: none; }
.cw-dh.today .n, .cw-dh.today .w { color: var(--accent); font-weight: 600; }
.cw-dh:hover { background: var(--pane2); }
.cw-h { height: 80px; }
.cw-slot { height: 40px; border-top: 1px solid var(--line2); }
.cw-slot.half { border-top: 1px dashed color-mix(in srgb, var(--line2) 80%, transparent); }
.cw-slot.slot-sel, .mo-cell.slot-sel, .cw-ac.slot-sel { background: var(--accent); opacity: .85; }
.cw-now { height: 0; background: none; border-top: 2px solid var(--accent); }
.cw-now::before { background: var(--accent); top: -6px; }
.cw-now.dashed { border-top: 2px dashed var(--accent); }
.ev { border-radius: 6px; border-left-width: 4px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ec) 30%, transparent); padding: 3px 7px; transition: box-shadow .12s, transform .12s; cursor: pointer; user-select: none; touch-action: none; }
.ev:hover, .ev:focus-visible { box-shadow: 0 2px 8px rgba(0,0,0,.18), 0 0 0 1px color-mix(in srgb, var(--ec) 50%, transparent); z-index: 4; outline: none; }
.ev b { display: flex; align-items: center; gap: 4px; }
.ev b svg, .ev-chip svg, .dl-b b svg { width: 12px; height: 12px; flex: 0 0 12px; }
.ev .hd { position: absolute; left: 50%; width: 9px; height: 9px; margin-left: -4px; border: 1.5px solid var(--text); border-radius: 50%; background: var(--pane); opacity: 0; cursor: ns-resize; }
.ev .hd.hs { top: 0; } .ev .hd.he { bottom: 0; }
.ev:hover .hd, .ev.dragging .hd { opacity: 1; }
.ev.dragging { opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 6; cursor: grabbing; transition: none; }
/* месяц */
.mo-head div { font-size: 12px; padding: 6px 10px; }
.mo-cell { gap: 3px; padding: 4px 6px 6px; transition: background .12s; }
.mo-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.mo-day { align-self: flex-start; border: 0; background: none; font: inherit; font-size: 13px; color: var(--text2); padding: 1px 6px; border-radius: 12px; cursor: pointer; }
.mo-day:hover { background: var(--line2); }
.mo-cell.today .mo-day { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.mo-cell.out .mo-day { color: var(--faint); }
.mo-cell.drop, .cw-ac.drop { background: var(--accent-soft); }
.ev-chip { display: flex; align-items: center; gap: 5px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--ec) 40%, transparent); border-left: 4px solid var(--ec); padding: 2px 6px;
  background: color-mix(in srgb, var(--ec) 16%, var(--pane)); transition: box-shadow .12s; }
.ev-chip:hover, .ev-chip:focus-visible { box-shadow: 0 2px 6px rgba(0,0,0,.15); outline: none; }
.ev-chip .t { flex: 0 0 auto; }
.ev-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-chip.allday { border-color: var(--ec); }
.mo-more { align-self: stretch; border: 0; border-radius: 4px; padding: 2px 6px; background: var(--line2); color: var(--text2); font: inherit; font-size: 12px; cursor: pointer; text-align: center; }
.mo-more:hover { background: var(--line); }
.mo-quick { width: 100%; font: inherit; font-size: 12.5px; padding: 3px 6px; border: 2px solid var(--text); border-radius: 4px; background: var(--pane); color: var(--text); }
.mo-quick:focus { outline: none; }
.ag-ev { border-radius: 8px; }
/* окошко: карточка события, день */
.cal-pop { position: fixed; z-index: 70; width: 360px; max-height: 80vh; overflow: auto; background: var(--pane); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,.24), 0 0 0 1px var(--line); animation: calpop .14s ease-out; }
.cal-pop.wide { width: 420px; }
@keyframes calpop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cal-pop, .cal-dlg { animation: none !important; } .ev, .ev-chip { transition: none; } }
.cal-pop .ib, .ce-title .ib, .ce-dnav .ib { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text2); }
.cal-pop .ib:hover, .ce-title .ib:hover, .ce-dnav .ib:hover { background: var(--line2); }
.cal-pop .ib svg, .ce-title .ib svg, .ce-dnav .ib svg { width: 16px; height: 16px; }
.cal-pop.pkw { width: 400px; }
.cal-pop.dlw { width: 460px; display: flex; flex-direction: column; overflow: hidden; }
.pk { padding: 10px 16px 14px; border-top: 4px solid var(--ec); border-radius: 10px 10px 0 0; }
.pk-top { display: flex; align-items: center; }
.pk-top .kind { font-size: 11px; line-height: 16px; }
.pk h3 { margin: 4px 0 8px; font-size: 15px; line-height: 20px; font-weight: 600; }
.pk-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 18px; margin-bottom: 4px; color: var(--text2); }
.pk-row svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; color: var(--muted); }
.pk-p { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.pk-p::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }
.pk-body { font-size: 13px; line-height: 19px; padding: 9px 12px; background: var(--pane2); border-radius: 8px; margin: 8px 0; overflow-wrap: anywhere; }
.pk-by { font-size: 11px; line-height: 16px; margin-bottom: 10px; }
.pk-act { display: flex; gap: 6px; flex-wrap: wrap; }
.pk-act .btn { height: 30px; font-size: 13px; }
.pk-act .btn svg { width: 13px; height: 13px; }
/* ссылка в описании: одной строкой, при наведении — «Открыть» и «Скопировать» */
.pk-ln { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 2px 0; }
.pk-ln > span:first-child:not(.pk-link) { flex: none; color: var(--muted); }
.pk-ln .pk-link { flex: 1 1 auto; min-width: 0; }
.pk-link { position: relative; display: inline-flex; max-width: 100%; vertical-align: bottom; }
.pk-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--pane); color: var(--accent); text-decoration: none; white-space: nowrap; overflow: hidden; }
.pk-chip span { overflow: hidden; text-overflow: ellipsis; }
.pk-chip svg { width: 12px; height: 12px; flex: 0 0 12px; }
.pk-link:hover .pk-chip, .pk-link:focus-within .pk-chip { border-color: var(--accent); background: var(--accent-soft); }
.pk-tip { display: none; position: absolute; right: 0; bottom: 100%; z-index: 3; padding-bottom: 4px; }
.pk-link:hover .pk-tip, .pk-link:focus-within .pk-tip { display: flex; }
.pk-tip button { height: 26px; padding: 0 10px; border: 1px solid var(--line); background: var(--pane); color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 24, 33, .16); }
.pk-tip button:first-child { border-radius: 7px 0 0 7px; }
.pk-tip button:last-child { border-radius: 0 7px 7px 0; border-left: 0; }
.pk-tip button:hover { background: var(--accent-soft); }
/* список дня («ещё N») */
.dl { display: flex; flex-direction: column; min-height: 0; max-height: 80vh; }
.dl-h { display: flex; align-items: baseline; gap: 8px; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--line2); background: var(--pane); }
.dl-h h3 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; }
.dl-h .muted { font-size: 12px; }
.dl-h .ib { align-self: center; }
.dl-h .btn svg { width: 14px; height: 14px; }
.dl-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; overflow: auto; min-height: 0; }
.dl-soon { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 2px 4px; padding: 1px 10px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 11px; }
.dl-soon svg { width: 12px; height: 12px; }
.dl-ev { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; border-left: 4px solid var(--ec); background: var(--pane); cursor: pointer; }
.dl-ev.next { background: var(--pane2); }
.dl-ev:hover, .dl-ev:focus-visible { background: color-mix(in srgb, var(--accent) 8%, var(--pane)); outline: none; }
.dl-t { width: 50px; flex: 0 0 50px; font-size: 13px; line-height: 18px; color: var(--text2); display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.dl-t small { color: var(--muted); font-size: 11px; line-height: 15px; }
.dl-b { display: flex; flex-direction: column; gap: 0; font-size: 12px; line-height: 16px; min-width: 0; color: var(--muted); }
.dl-b b { display: flex; align-items: center; gap: 5px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text); min-width: 0; }
.dl-b b > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-loc { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dl-loc svg { width: 11px; height: 11px; flex: 0 0 11px; }
.dl-loc span, .dl-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-f { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 12px; border-top: 1px solid var(--line2); }
.dl-f .btn { height: 30px; font-size: 13px; }
.dl-f .btn svg { width: 13px; height: 13px; }
.dp-all { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--line2); }
.dp-body { max-height: 60vh; overflow-y: auto; }
.dp-grid { display: grid; grid-template-columns: 44px 1fr; position: relative; }
.dp-grid .cw-col { border-left: 1px solid var(--line2); }
/* окно события */
.cal-modal { padding: 3vh 12px; }
.cal-dlg { width: min(1120px, 100%); background: var(--bg); border-radius: 10px; animation: calpop .16s ease-out; overflow: hidden; }
.ce-title { display: flex; align-items: center; padding: 8px 10px 4px 16px; font-size: 13.5px; color: var(--text2); }
.ce-bar { display: flex; align-items: center; gap: 6px; margin: 4px 12px 10px; padding: 6px 8px; background: var(--pane); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); flex-wrap: wrap; }
.ce-bar .btn svg { width: 15px; height: 15px; }
.ce-sep { width: 1px; height: 22px; background: var(--line); }
.ce-tool { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ce-tool:hover { background: var(--line2); }
.ce-tool svg { width: 16px; height: 16px; color: var(--text2); }
.ce-tool select { border: 0; background: transparent; font: inherit; color: inherit; padding: 2px; cursor: pointer; }
.ce-until { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.ce-until input { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--pane); color: var(--text); }
.ce-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; padding: 0 12px 12px; height: min(74vh, 720px); }
.ce-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.ce-card { background: var(--pane); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.ce-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ce-ico { width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); }
.ce-ico svg { width: 18px; height: 18px; }
.ce-row:first-child .ce-ico { border: 1px solid var(--line); border-radius: 6px; color: var(--kc, var(--accent)); }
.ce-row > input[type="text"], .ce-ppl, .ce-when { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 8px 2px; }
.ce-row > input[type="text"]:focus, .ce-ppl:focus-within { outline: none; }
.ce-name { font-size: 16px !important; }
.ce-ppl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; position: relative; padding: 5px 2px; }
.ce-chips { display: contents; }
.ce-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; border-radius: 12px; background: color-mix(in srgb, var(--pc) 16%, var(--pane)); border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); font-size: 13px; }
.ce-chip button { border: 0; background: none; cursor: pointer; color: var(--text2); width: 18px; height: 18px; border-radius: 50%; line-height: 1; font-size: 15px; }
.ce-chip button:hover { background: var(--line2); }
.ce-pin { flex: 1; min-width: 160px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 3px 2px; }
.ce-pin:focus { outline: none; }
.ce-sugg { position: absolute; left: 0; top: 100%; z-index: 5; min-width: 260px; max-height: 260px; overflow: auto; background: var(--pane); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2), 0 0 0 1px var(--line); padding: 4px; }
.ce-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 13.5px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); }
.ce-opt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.ce-opt.on, .ce-opt:hover { background: var(--accent-soft); }
.ce-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 2px; }
.ce-when input { font: inherit; font-size: 14px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); padding: 3px 4px; }
.ce-when input:hover, .ce-when input:focus { border-color: var(--line); background: var(--pane2); outline: none; }
.ce-when .dash { color: var(--muted); }
.ce-switch { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13.5px; cursor: pointer; }
.ce-switch input { position: absolute; opacity: 0; }
.ce-switch .sw { width: 36px; height: 20px; border-radius: 10px; border: 1.5px solid var(--text2); position: relative; transition: background .15s; }
.ce-switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--text2); transition: transform .15s; }
.ce-switch input:checked + .sw { background: var(--accent); border-color: var(--accent); }
.ce-switch input:checked + .sw::after { transform: translateX(16px); background: #fff; }
.ce-switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.ce-bodycard { flex: 1; flex-direction: row; gap: 12px; min-height: 160px; }
.ce-bodycard textarea { flex: 1; resize: none; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--pane); color: var(--text); }
.ce-bodycard textarea:focus { outline: none; }
.ce-meta { font-size: 12.5px; padding: 0 4px; }
.ce-right { background: var(--pane); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; min-height: 0; }
.ce-dnav { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.ce-dnav b { margin-left: 6px; font-size: 14px; }
.ce-tl { flex: 1; overflow-y: auto; }
.ce-grid { position: relative; margin-left: 44px; border-left: 1px solid var(--line2); }
.ce-h { height: 40px; border-top: 1px solid var(--line2); position: relative; }
.ce-h::after { content: ""; position: absolute; left: 0; right: 0; top: 20px; border-top: 1px dashed color-mix(in srgb, var(--line2) 80%, transparent); }
.ce-h span { position: absolute; left: -38px; top: 2px; font-size: 11px; color: var(--muted); width: 30px; text-align: right; }
.ce-ev { position: absolute; left: 4px; right: 4px; padding: 2px 8px; font-size: 12px; border-radius: 4px; background: color-mix(in srgb, var(--ec) 18%, var(--pane)); border-left: 3px solid var(--ec);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text2); pointer-events: none; }
.ce-ev.all { opacity: .7; }
.ce-new { position: absolute; left: 0; right: 0; z-index: 3; background: var(--kc, #13a10e); color: #fff; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 3px; cursor: grab; touch-action: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.2); opacity: .92; }
.ce-new.allday { opacity: .25; cursor: default; }
.ce-new:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.ce-new .hd { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid var(--kc, #13a10e); cursor: ns-resize; }
.ce-new .hd.hs { top: -5px; right: 24px; } .ce-new .hd.he { bottom: -5px; left: 24px; }
.ce-new.allday .hd { display: none; }
@media (max-width: 900px) { .ce-main { grid-template-columns: 1fr; height: auto; } .ce-right { height: 360px; } .cal-in { flex-direction: column; } }
@media print {
  .rail, .ribbon, .cal-side, .top, .cal-bar .ib, .cal-today, .live-alert, .toast { display: none !important; }
  .calp, .cal-wrap, .cal-in, .cal-main { display: block !important; height: auto !important; box-shadow: none !important; padding: 0 !important; }
  .cw-body { overflow: visible !important; }
}

.ce-when input { width: auto !important; flex: 0 0 auto; min-width: 0; }
.ce-pin { border: 0 !important; box-shadow: none !important; background: transparent !important; width: auto !important; }
.ce-row > input[type="text"] { width: auto; }
.ce-tool select { width: auto !important; min-width: 0; box-shadow: none !important; }

/* ---------- 0.8.1: производственный календарь, рабочие часы, номера недель ---------- */
.mo-cell { position: relative; }
.mo-mark { position: absolute; top: 5px; right: 6px; max-width: calc(100% - 44px); font-size: 10.5px; line-height: 14px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.mo-mark.hol, .mo-mark.moved { color: var(--bad-text); }
.mo-mark.short { color: var(--warn-text); }
.mo-mark.work { color: var(--accent-text); }
.mo-cell.mk-hol .mo-day, .mo-cell.mk-moved .mo-day { color: var(--bad); font-weight: 600; }
.mo-cell.today.mk-hol .mo-day, .mo-cell.today.mk-moved .mo-day { color: var(--on-accent); }
.mo-cell.mk-hol:not(.out), .mo-cell.mk-moved:not(.out) { background: color-mix(in srgb, var(--bad-soft) 55%, var(--pane)); }
.mo-cell.mk-work:not(.out) { background: var(--pane); }
.cal-month.wn .mo-head, .cal-month.wn .mo-row { grid-template-columns: 30px repeat(7, 1fr); }
.mo-wn { font-size: 10.5px; color: var(--faint); text-align: center; padding-top: 7px; border-right: 1px solid var(--line2); }
.cw-dh .mk { font-size: 10.5px; line-height: 14px; margin-top: 1px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.cw-dh .mk.hol, .cw-dh .mk.moved { color: var(--bad-text); }
.cw-dh .mk.short { color: var(--warn-text); }
.cw-dh .mk.work { color: var(--accent-text); }
.cw-slot.nw { background: color-mix(in srgb, var(--pane2) 75%, transparent); }
.cw-col.we .cw-slot { background: color-mix(in srgb, var(--pane2) 75%, transparent); }
.cw-slot.nw:hover, .cw-col.we .cw-slot:hover { background: var(--accent-soft); }
.cal-agenda h2 .mk { font-size: 12px; font-weight: 400; color: var(--bad-text); margin-left: 6px; }
.cal-agenda h2 .mk.short { color: var(--warn-text); }
.cal-agenda h2 .mk.work { color: var(--accent-text); }
.mini td a.off:not(.today):not(.out) { color: var(--bad); }
.mini .wn { font-size: 10px; color: var(--faint); width: 18px; }
.mini td.wn + td.inr a:not(.today) { border-radius: 14px 0 0 14px; }
/* Параметры → Календарь */
.pc-years td, .pc-years th { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line2); font-size: 13px; }
.pc-years { border-collapse: collapse; width: 100%; margin: 6px 0 12px; }
.pc-err { color: var(--bad-text); font-size: 12px; }
.pc-days { columns: 2; column-gap: 28px; font-size: 13px; margin: 8px 0; padding: 0; list-style: none; }
.pc-days li { break-inside: avoid; padding: 2px 0; }
.pc-days .d { display: inline-block; min-width: 92px; color: var(--muted); }
.pc-days .hol { color: var(--bad-text); }
.pc-days .short { color: var(--warn-text); }
.pc-days .work { color: var(--accent-text); }
.cr-table { border-collapse: collapse; width: 100%; margin: 8px 0 14px; }
.cr-table th, .cr-table td { padding: 8px 10px; border-bottom: 1px solid var(--line2); text-align: left; font-size: 13px; }
.cr-table td.c, .cr-table th.c { text-align: center; width: 150px; }
.cal-sub-off { padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn-text); font-size: 13px; }
a.rb { text-decoration: none; color: inherit; }
/* 0.8.2: шрифт, размер, цвет в окне письма */
.ctools select { height: 28px; padding: 0 22px 0 8px; border: 1px solid var(--line); border-radius: 4px; background-color: var(--pane); color: var(--text); font: inherit; font-size: 13px; width: auto; }
.ctools select[data-cfont] { min-width: 130px; }
.ctools select[data-csize] { min-width: 72px; }
.cclr { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.cclr:hover { background: var(--pane2); }
.cclr input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.s-fontrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.s-fontrow select { width: auto; }
.s-fontrow .tg { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 4px; background: var(--pane); color: var(--text); cursor: pointer; font: inherit; }
.s-fontrow .tg[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.s-fontrow input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--pane); }
.s-preview { margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; color: #000; }
.box-sign .sign-edit { min-height: 90px; }
/* 0.8.3: в окне «Параметры» выбранный пункт не обводим рамкой (полоска слева и так показывает, где вы) */
.smodal .s1 a:focus-visible, .smodal .s2 a:focus-visible { outline: none; background: var(--line2); }
.im-new code { font-size: 15px; letter-spacing: .5px; padding: 3px 8px; border-radius: 4px; background: var(--pane); margin: 0 6px; }
.im-newform { display: flex; flex-direction: row; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 6px; }
.im-newform .field { flex: 1 1 280px; margin: 0; }
.s3b form + h3, .s3b table + h3 { margin-top: 22px; }
/* 0.8.4: «Черновики Почты» — списком посередине */
.drafts { display: flex; flex-direction: column; }
.drow { display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line2); background: none; color: var(--text); font: inherit; cursor: pointer; }
.drow:hover { background: var(--pane2); }
.drow.on { background: var(--accent-soft); }
.drow[disabled] { cursor: default; opacity: .75; }
.dr-top { display: flex; gap: 8px; align-items: baseline; }
.dr-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dr-when { font-size: 12px; color: var(--muted); }
.dr-subj { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-meta { display: flex; gap: 6px; flex-wrap: wrap; }
/* 0.8.5: «Удалённые» — списком посередине */
.del-row { display: flex; align-items: flex-start; gap: 4px; border-bottom: 1px solid var(--line2); padding-left: 12px; }
.del-row > input { width: 16px; height: 16px; margin-top: 12px; flex: none; min-height: 0; }
.del-row .drow { border-bottom: 0; text-decoration: none; padding-left: 8px; }
.del-row .drow[aria-current] { background: var(--accent-soft); }
.del-all { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.del-all input { width: 15px; height: 15px; min-height: 0; }
.del-hint { padding: 8px 14px 0; margin: 0 0 6px; font-size: 12.5px; }
.del-note form { display: inline; margin-left: 8px; }
/* 0.8.6: импорт календаря */
.imp-how summary { cursor: pointer; }
.imp-how ol { margin: 10px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.imp-acts { white-space: nowrap; text-align: right; }
.imp-acts form { display: inline; }
/* 0.8.9: вход через Microsoft на странице ящика */
.ms-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.ms-steps li { line-height: 1.5; }
.ms-steps code { font-size: 12.5px; padding: 1px 5px; border-radius: 3px; background: var(--pane2); }
.ms-finish { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.ms-finish input[type=text] { flex: 1 1 360px; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.ms-login form.inline { display: inline; }
/* 0.8.11: окно «Объединить папку» */
.mrg-dlg { border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; width: min(520px, 92vw); background: var(--pane); color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.mrg-dlg::backdrop { background: rgba(0,0,0,.3); }
.mrg-dlg h2 { margin: 0 0 10px; font-size: 18px; }
.mrg-dlg p { margin: 0 0 14px; line-height: 1.5; font-size: 14px; }
.mrg-l { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.mrg-l select { font-size: 14px; color: var(--text); }
.mrg-btns { display: flex; gap: 8px; margin-top: 18px; }
/* 0.8.12: «Адресаты из отправленных» */
.rcp-form { display: grid; gap: 12px; }
.rcp-grid { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.rcp-grid label, .rcp-ex { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.rcp-grid select, .rcp-grid input[type=date] { min-width: 170px; }
.rcp-cc { padding-bottom: 8px; }
.rcp-ex textarea { width: 100%; }
.rcp-bar { flex-wrap: wrap; gap: 10px; align-items: center; }
.rcp-bar input[type=search] { flex: 1 1 260px; min-width: 0; }
.rcp-tbl td:first-child, .rcp-tbl th:first-child { width: 28px; }
/* 0.8.13: «Папки ящиков» — две панели */
.fm-intro { margin: 0 0 12px; max-width: 980px; font-size: 13px; }
.fm-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fm-pane { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--pane); min-width: 0; }
.fm-pane.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fm-top, .fm-filters { display: flex; gap: 6px; padding: 8px 8px 0; align-items: center; }
.fm-top select { flex: 1; min-width: 0; }
.fm-filters input { flex: 1; min-width: 0; }
.fm-filters select { width: auto; }
.fm-head, .fm-row { display: grid; grid-template-columns: minmax(0, 1fr) 58px 52px 64px 78px; gap: 6px; align-items: center; }
.fm-head { padding: 8px 10px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; border-bottom: 1px solid var(--line2); }
.fm-head span:not(:first-child), .fm-row span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.fm-list { height: 52vh; min-height: 260px; overflow: auto; outline: none; }
.fm-row { padding: 4px 10px; font-size: 13px; cursor: default; user-select: none; border-bottom: 1px solid transparent; }
.fm-row:hover { background: var(--pane2); }
.fm-row.sel { background: var(--accent-soft); }
.fm-row.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.fm-row.nosel { color: var(--muted); }
.fm-name { padding-left: calc(var(--d) * 16px); overflow: hidden; white-space: nowrap; min-width: 0; }
.fm-lock { font-size: 11px; margin-right: 4px; }
.fm-tag { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--pane2); color: var(--muted); border: 1px solid var(--line2); }
.fm-empty { padding: 20px 12px; font-size: 13px; }
.fm-empty.bad, .fm-log .bad, .fm-op.bad { color: var(--bad); }
.fm-foot { border-top: 1px solid var(--line2); padding: 6px 10px; font-size: 12px; color: var(--muted); display: grid; gap: 3px; min-height: 26px; }
.fm-actions { margin-top: 12px; display: grid; gap: 8px; }
.fm-dir { font-size: 13px; }
.fm-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fm-btns .btn[disabled] { opacity: .45; cursor: default; }
.fm-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.fm-log { margin-top: 10px; font-size: 12px; color: var(--muted); max-height: 140px; overflow: auto; display: grid; gap: 2px; }
.fm-cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 10px 0 4px; }
.fm-cgrid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.fm-cgrid label.check { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; }
.fm-conn { width: min(620px, 94vw); }
@media (max-width: 1050px) {   /* узко (окно «Параметры»): панели рядом, без «Непроч.» и «Последнее» */
  .fm-head, .fm-row { grid-template-columns: minmax(0, 1fr) 50px 60px; }
  .fm-head span:nth-child(3), .fm-row span:nth-child(3), .fm-head span:nth-child(5), .fm-row span:nth-child(5) { display: none; }
  .fm-list { height: 46vh; }
}
@media (max-width: 640px) { .fm-panes { grid-template-columns: 1fr; } }
/* 0.8.15: письма в «Папках ящиков», свернуть ветку */
.fm [data-mact], .fm.msgmode [data-act], .fm.msgmode .fm-sep { display: none; }
.fm.msgmode [data-mact] { display: inline-flex; }
.fm-tg, .fm-tg0 { display: inline-flex; width: 16px; justify-content: center; margin-right: 2px; flex: none; }
.fm-tg { border: 0; background: none; padding: 0; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; border-radius: 3px; }
.fm-tg:hover { background: var(--line2); color: var(--text); }
.fm-name { display: flex; align-items: center; }
.fm-head.msg, .fm-msg { display: grid; grid-template-columns: 116px minmax(0, .8fr) minmax(0, 1.4fr) 58px; gap: 8px; align-items: center; }
.fm-head.msg span:nth-child(2), .fm-head.msg span:nth-child(3) { text-align: left; }
.fm-msg { padding: 3px 10px; font-size: 12.5px; cursor: default; user-select: none; }
.fm-msg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-msg span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.fm-msg span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fm-msg.unread span:nth-child(3) { font-weight: 600; }
.fm-msg:hover { background: var(--pane2); }
.fm-msg.sel { background: var(--accent-soft); }
.fm-crumb { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--pane); border-bottom: 1px solid var(--line2); font-size: 13px; }
.fm-crumb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fm-crumb .muted { margin-left: auto; white-space: nowrap; font-size: 12px; }
.fm-selbar { position: sticky; top: 37px; z-index: 1; padding: 5px 10px; background: var(--accent-soft); font-size: 12.5px; }
@media (max-width: 1050px) {
  .fm-head.msg, .fm-msg { grid-template-columns: 70px minmax(0, 1fr) 52px; }
  .fm-head.msg span:nth-child(2), .fm-msg span:nth-child(2) { display: none; }
  .fm-head.msg span:nth-child(3), .fm-msg span:nth-child(3) { display: block; }
  .fm-msg span:first-child { font-size: 11.5px; }
}
.fm-name .fm-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: left; }
.fm-name .fm-tag { flex: none; margin-left: 4px; text-align: left; }

/* 0.8.17: Параметры → Календарь → «Сотрудники в календаре» */
.cpl td { vertical-align: middle; }
.cpl .cpl-h { width: 34px; padding-right: 0; }
.cpl .cpl-c { width: 70px; }
.cpl-r.off td:nth-child(2) { color: var(--text2); }
.cpl-r.dragging { opacity: .45; }
.cpl-r.drop-a td { box-shadow: inset 0 2px 0 var(--accent); }
.cpl-r.drop-b td { box-shadow: inset 0 -2px 0 var(--accent); }
.cpl-grip { border: 0; background: none; color: var(--text2); cursor: grab; font-size: 14px; letter-spacing: -3px; padding: 2px 6px; border-radius: 4px; }
.cpl-grip:hover, .cpl-grip:focus-visible { background: var(--line2); color: var(--text); }
.cpl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sw); margin-right: 8px; vertical-align: 0; }
.cpl-pal { position: relative; }
.cpl-cur { list-style: none; width: 26px; height: 26px; border-radius: 6px; background: var(--sw); cursor: pointer; border: 2px solid var(--pane); box-shadow: 0 0 0 1px var(--line); }
.cpl-cur::-webkit-details-marker { display: none; }
.cpl-grid { position: absolute; z-index: 20; top: 32px; left: -8px; display: grid; grid-template-columns: repeat(6, 24px); gap: 6px;
  padding: 10px; background: var(--pane); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.cpl-sw { width: 24px; height: 24px; border-radius: 5px; background: var(--sw); cursor: pointer; position: relative; }
.cpl-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cpl-sw:has(input:checked) { outline: 2px solid var(--text); outline-offset: 1px; }
.cpl-sw:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.cpl .cpl-on { margin: 0; }
