/* Uxella — оформление кабинета. Система ЮниксAI/Uvexa (ТЗ §15), токены — из прототипа
   prototype/uxella-master.html: бумага #FCFBF7, ink #141719, кислотный #C8FF00 только заливкой под
   тёмным текстом (текстовый вариант — #4A6300). Шрифты — со своего сервера (public/fonts). */

@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/onest-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/onest-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/static/fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/static/fonts/golos-text-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(/static/fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(/static/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fcfbf7; --bg-2: #f1efe6; --surface: #ffffff;
  --text: #141719; --text-2: #6e7168; --line: rgba(20, 23, 25, 0.12); --line-2: rgba(20, 23, 25, 0.22);
  --island: #141719; --on-island: #f5f3ec; --on-island-2: #9da298; --line-island: rgba(245, 243, 236, 0.14);
  --acid: #c8ff00; --acid-ink: #4a6300; --acid-soft: #f2fad0;
  --coral: #a83426; --coral-soft: #f8e6e3; --amber: #86620a; --amber-soft: #f7efd9; --sky: #3b6e86; --sky-soft: #e7eef2;
  --btn-bg: #141719; --btn-fg: #f5f3ec;
  --f-d: "Onest", -apple-system, "Segoe UI", Arial, sans-serif;
  --f-b: "Golos Text", -apple-system, "Segoe UI", Arial, sans-serif;
  --f-m: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 18px; --e: cubic-bezier(0.22, 0.61, 0.36, 1);
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101312; --bg-2: #0a0c0b; --surface: #191e1b;
    --text: #f1efe8; --text-2: #9da298; --line: rgba(245, 243, 236, 0.11); --line-2: rgba(245, 243, 236, 0.22);
    --island: #222924;
    --acid-ink: #c8ff00; --acid-soft: rgba(200, 255, 0, 0.12);
    --coral: #f0907f; --coral-soft: rgba(240, 144, 127, 0.14);
    --amber: #e3b75a; --amber-soft: rgba(227, 183, 90, 0.14); --sky: #8db9ce; --sky-soft: rgba(141, 185, 206, 0.14);
    --btn-bg: #c8ff00; --btn-fg: #141719;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101312; --bg-2: #0a0c0b; --surface: #191e1b;
  --text: #f1efe8; --text-2: #9da298; --line: rgba(245, 243, 236, 0.11); --line-2: rgba(245, 243, 236, 0.22);
  --island: #222924;
  --acid-ink: #c8ff00; --acid-soft: rgba(200, 255, 0, 0.12);
  --coral: #f0907f; --coral-soft: rgba(240, 144, 127, 0.14);
  --amber: #e3b75a; --amber-soft: rgba(227, 183, 90, 0.14); --sky: #8db9ce; --sky-soft: rgba(141, 185, 206, 0.14);
  --btn-bg: #c8ff00; --btn-fg: #141719;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { background: var(--bg-2); }
body {
  margin: 0; background: var(--bg-2); color: var(--text);
  font-family: var(--f-b); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--f-d); font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; border-radius: 8px; }
.num { font-family: var(--f-m); font-variant-numeric: tabular-nums; }

/* Мобильный каркас: колонка до 440px по центру, от 360px без горизонтальной прокрутки. */
.app {
  max-width: 440px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); overflow-x: hidden;
}
.screen { display: flex; flex-direction: column; gap: 22px; padding: 18px 16px 24px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { font-size: 26px; }
.top .sub { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.avatar {
  width: var(--tap); height: var(--tap); border-radius: 50%; flex: none;
  background: var(--island); color: var(--acid);
  display: grid; place-items: center; font-family: var(--f-d); font-weight: 700; font-size: 18px; text-decoration: none;
}
.brand { font-family: var(--f-m); font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1px var(--line-2); }

/* Тёмный остров — сводка дня (как в прототипе). */
.island {
  background: var(--island); color: var(--on-island); border-radius: var(--r); padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.island small { font-family: var(--f-m); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-island-2); }
.island .clock { font-family: var(--f-d); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.island .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pill-acid {
  background: var(--acid); color: #141719; border-radius: 99px; padding: 8px 14px;
  font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.note {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px; font-size: 14px;
}
.note .meta { color: var(--text-2); font-size: 13px; }
.note code { font-family: var(--f-m); font-size: 12.5px; }

/* Нижняя панель вкладок. Экраны — С7–С8, пока вкладки не нажимаются. */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(440px, 100%); z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tab {
  min-height: var(--tap); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 4px 0; font-size: 11px; color: var(--text-2); text-decoration: none; min-width: 0;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab .ic { padding: 3px 14px; border-radius: 99px; display: grid; place-items: center; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .ic { background: var(--acid); color: #141719; }
.tab[aria-disabled="true"] { cursor: default; }

/* Страница ошибки. */
.error { max-width: 440px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding: 48px 20px; display: flex; flex-direction: column; gap: 14px; }
.error .code { font-family: var(--f-m); font-size: 13px; letter-spacing: 0.12em; color: var(--text-2); }
.error .rid { font-family: var(--f-m); font-size: 12px; color: var(--text-2); }

/* ─── Кабинет (С7): компоненты из прототипа prototype/uxella-master.html ─────────────────────── */

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
.lbl { font-family: var(--f-m); font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lbl .cnt { background: var(--coral-soft); color: var(--coral); padding: 2px 8px; border-radius: 99px; letter-spacing: 0.04em; }
.block { display: flex; flex-direction: column; gap: 10px; }
.sub { color: var(--text-2); font-size: 14px; }

.island { position: relative; overflow: hidden; gap: 16px; }
.island::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, var(--line-island) 1px, transparent 1px); background-size: calc(100% / 6) 100%; opacity: 0.45; -webkit-mask-image: linear-gradient(#000, transparent 90%); mask-image: linear-gradient(#000, transparent 90%); }
.island > * { position: relative; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat b { display: block; font-family: var(--f-d); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.stat span { font-size: 12px; color: var(--on-island-2); }
.next { border-top: 1px solid var(--line-island); padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.next small { display: block; font-family: var(--f-m); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-island-2); }
.next strong { font-weight: 500; }
.pill-acid { min-height: var(--tap); text-decoration: none; }
.botline { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--on-island-2); }
.botline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); flex: none; animation: pulse 2.4s var(--e) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .botline .dot { animation: none; } }

.alert { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 10px; }
.alert.warn { border-left: 3px solid var(--amber); }
.alert.need { border-left: 3px solid var(--coral); }
.alert p { font-size: 14px; overflow-wrap: anywhere; }
.alert p b { font-weight: 600; }
.alert .meta { font-size: 12.5px; color: var(--text-2); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.acts form { display: contents; }

/* Кнопки: цель нажатия не меньше 44 px (ТЗ §15). */
.btn {
  min-height: var(--tap); padding: 0 16px; border-radius: 99px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none;
  background: var(--btn-bg); color: var(--btn-fg); transition: transform 0.15s var(--e);
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger { background: transparent; color: var(--coral); box-shadow: inset 0 0 0 1px var(--coral); }
.btn.sm { padding: 0 13px; font-size: 13.5px; }
.btn.wide { width: 100%; }

/* Расписание дня. */
.day { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.row .t { font-family: var(--f-m); font-size: 13px; color: var(--text-2); padding-top: 13px; font-variant-numeric: tabular-nums; }
.row .body { padding: 6px 0; min-width: 0; }
.appt { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; text-decoration: none; min-height: var(--tap); }
.appt .who { font-weight: 600; overflow-wrap: anywhere; }
.appt .what { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.appt.new { box-shadow: 0 0 0 2px var(--acid); }
.appt.done, .appt.bad { opacity: 0.75; }
.st { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; flex: none; }
.st.ok, .st.done { background: var(--acid-soft); color: var(--acid-ink); }
.st.wait { background: var(--amber-soft); color: var(--amber); }
.st.new { background: var(--sky-soft); color: var(--sky); }
.st.pending, .st.bad { background: var(--coral-soft); color: var(--coral); }
.gap { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 11px 13px; display: flex; flex-direction: column; gap: 9px; }
.gap .g1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gap .g1 b { font-weight: 600; color: var(--acid-ink); }
.gap .fits { font-size: 12.5px; color: var(--text-2); }
.gap.closed { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--line) 7px 8px); }
.gap.closed .g1 b { color: var(--text-2); }
.dayoff { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-align: center; color: var(--text-2); }

/* Календарь: лента дней. Прокручивается только лента — страница вбок не уезжает. */
.week { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.week::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 54px; min-height: 64px; border-radius: 14px; padding: 9px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.dchip .wd { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.dchip .dn { font-family: var(--f-d); font-weight: 600; font-size: 19px; }
.dchip .load { width: 26px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dchip .load i { display: block; height: 100%; background: var(--text); }
.dchip.off { opacity: 0.5; }
.dchip.today { box-shadow: inset 0 0 0 1.5px var(--acid-ink); }
.dchip.sel { background: var(--island); border-color: var(--island); color: var(--on-island); opacity: 1; }
.dchip.sel .wd { color: var(--on-island-2); }
.dchip.sel .load { background: var(--line-island); }
.dchip.sel .load i { background: var(--acid); }
.dayhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dayhead h2 { font-size: 20px; }
.dayhead .sub { font-size: 13px; }

/* Переключатель «Выходной» — настоящий чекбокс в форме. */
.sw { position: relative; width: 46px; height: 28px; flex: none; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background 0.2s; }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--e); }
.sw input:checked + span { background: var(--acid-ink); }
.sw input:checked + span::after { transform: translateX(18px); }
.sw input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 2px; }
.swrow { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); min-height: var(--tap); cursor: pointer; }

/* Формы: поля от 16 px — iOS не приближает страницу. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2 { font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); min-width: 0; }
.field input, .field select, .field textarea {
  font-size: 16px; min-height: var(--tap); border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); padding: 0 12px; width: 100%; min-width: 0;
}
.field textarea { padding: 10px 12px; min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--acid); outline-offset: 1px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--acid-ink); flex: none; }
details.more summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; font-size: 14px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--text-2); }
details.more[open] summary::after { content: "−"; }

.flash { border-radius: 14px; padding: 12px 14px; font-size: 14px; background: var(--acid-soft); color: var(--text); border: 1px solid var(--line); }
.flash.err { background: var(--coral-soft); color: var(--coral); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.li { width: 100%; text-align: left; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); text-decoration: none; min-height: var(--tap); }
.li:first-child { border-top: 0; }
.li .ava { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-weight: 600; font-family: var(--f-d); flex: none; }
.li .mid { flex: 1; min-width: 0; }
.li .n { font-weight: 600; overflow-wrap: anywhere; }
.li .s { font-size: 13px; color: var(--text-2); }
.li[aria-current="true"] { background: var(--acid-soft); }
.tag { display: inline-flex; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.tag.red { background: var(--coral-soft); color: var(--coral); }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); color: var(--text-2); text-decoration: none; font-size: 14px; align-self: flex-start; }
.hint { font-size: 13px; color: var(--text-2); }

/* Вход. */
.login { max-width: 440px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding: 40px 20px; display: flex; flex-direction: column; gap: 18px; }
.login h1 { font-size: 28px; }
.login ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.login code { font-family: var(--f-m); font-size: 14px; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.kv dd a { display: inline-block; padding: 13px 0; margin: -13px 0; }
.nw { white-space: nowrap; }
.dchip.sel { border-color: color-mix(in srgb, var(--acid-ink) 70%, var(--island)); }

/* ─── Кабинет С8: переписки, клиентки, настройки, публичная страница ─── */
/* Tabs: badge "need you" on Chats. */
.tab .ic { position: relative; }
.tab .badge { position: absolute; top: -3px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-2); border-radius: 99px; padding: 4px; gap: 4px; }
.seg a { min-height: 38px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--text-2); display: grid; place-items: center; text-decoration: none; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(20, 23, 25, 0.12); }
.ch { font-family: var(--f-m); font-size: 10px; font-weight: 500; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 5px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.li .r { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.li .time { font-size: 12px; color: var(--text-2); }
.li .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acid-ink); }
.li.unread .n, .li.unread .s { color: var(--text); font-weight: 600; }
.li .clip { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.li .p { font-family: var(--f-m); font-size: 14px; white-space: nowrap; }
.li.muted .mid { opacity: 0.6; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 0 16px; min-height: 46px; }
.search input { border: 0; background: none; outline: none; flex: 1; font-size: 16px; min-width: 0; min-height: var(--tap); }
.search svg { flex: none; color: var(--text-2); }
.search:focus-within { outline: 2px solid var(--acid); outline-offset: 1px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag.ok { background: var(--acid-soft); color: var(--acid-ink); }
.tag.am { background: var(--amber-soft); color: var(--amber); }
.red { color: var(--coral); }
.st.need { background: var(--coral-soft); color: var(--coral); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }

/* Chat. */
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.m { max-width: 86%; padding: 9px 12px 6px; border-radius: 16px; font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; }
.m.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.m.me { align-self: flex-end; background: var(--island); color: var(--on-island); border-bottom-right-radius: 5px; }
.m.master { align-self: flex-end; background: var(--acid-soft); color: var(--text); border-bottom-right-radius: 5px; }
.m .who { font-family: var(--f-m); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.m .btns { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; }
.m .btns span { font-size: 12px; border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 8px; color: var(--text-2); }
.m .tm { align-self: flex-end; font-size: 10.5px; opacity: 0.6; }
.daysep { align-self: center; font-size: 12px; color: var(--text-2); background: var(--bg-2); border-radius: 99px; padding: 3px 10px; margin: 6px 0 2px; }
.compose { display: flex; gap: 8px; align-items: flex-end; }
.compose .grow { flex: 1; }
.compose textarea { min-height: 48px; border-radius: 22px; padding: 12px 16px; resize: vertical; }
.send { width: var(--tap); height: var(--tap); border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); display: grid; place-items: center; flex: none; margin-bottom: 2px; }

/* Settings. */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); display: grid; place-items: center; text-decoration: none; font-size: 13.5px; }
.lnk { color: var(--acid-ink); text-decoration: none; font-weight: 600; letter-spacing: 0.04em; min-height: var(--tap); display: inline-flex; align-items: center; }
.li.svc { padding-right: 6px; }
.li.svc .mid { text-decoration: none; min-height: var(--tap); display: flex; flex-direction: column; justify-content: center; }
.updown { display: flex; flex-direction: column; flex: none; }
.updown form { display: contents; }
.updown button { width: 36px; height: 26px; border-radius: 8px; color: var(--text-2); font-size: 15px; }
.updown button:disabled { opacity: 0.25; cursor: default; }
.wrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.wrow .check { font-size: 14px; min-width: 0; }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: min(220px, 100%); align-self: center; }
.qr svg { display: block; width: 100%; height: auto; }
code.url { font-family: var(--f-m); font-size: 12.5px; overflow-wrap: anywhere; background: var(--bg-2); border-radius: 8px; padding: 8px 10px; }
details.more[open] { gap: 12px; }

/* Public page. */
.pub { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding: 32px 16px 40px; display: flex; flex-direction: column; gap: 22px; }
.pub h1 { font-size: 30px; }
.pub .lead { font-size: 16px; white-space: pre-line; }
.pub .card p { white-space: pre-line; }
.pubfoot { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.pubfoot a { color: var(--text-2); min-height: 32px; display: inline-flex; align-items: center; }
.li .mid > .n, .li .mid > .s { display: block; }
.li .mid > .s.clip { display: -webkit-box; }

/* Журнал действий (С10) */
.chips a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.li.jr { align-items: flex-start; }
.li.jr .mid { display: flex; flex-direction: column; gap: 2px; }
.li.jr .s a { color: inherit; }
.li.jr.erase { border-left: 3px solid var(--coral); }
.li.jr .d { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }

/* ─── Политика ПДн мастера /privacy (С10б) ─────────────────────────────────── */
.brand a { color: inherit; text-decoration: none; }
.policy h1 { font-size: 26px; }
.policy .draftnote { font-size: 13.5px; }
.policy-body { display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.policy-body h2 { font-size: 17px; margin-top: 10px; }
.policy-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ─── Акт об уничтожении ПДн (С10б): лист A4, печать из браузера ────────────── */
.act-bar { max-width: 794px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.act {
  max-width: 794px; margin: 0 auto 32px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r); padding: 28px 22px;
  display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.5;
}
.act-head { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.act-kicker { font-family: var(--f-m); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.act h1 { font-size: 22px; }
.act h2 { font-size: 15px; margin-top: 6px; }
.act-date { color: var(--text-2); font-size: 13px; }
.act-warn { border-left: 3px solid var(--amber); background: var(--amber-soft); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.act table { width: 100%; border-collapse: collapse; }
.act th, .act td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.act-kv th { width: 38%; font-weight: 500; color: var(--text-2); }
.act-list thead th { font-family: var(--f-m); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); font-weight: 400; }
.act-list td:last-child { width: 36%; }
.act-blank { display: inline-block; min-width: 60%; border-bottom: 1px solid var(--line-2); height: 1.2em; }
.act-log { font-size: 13px; color: var(--text-2); }
.act-sign { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 16px; margin-top: 24px; }
.act-sign div { display: flex; flex-direction: column; gap: 4px; }
.act-line { border-bottom: 1px solid var(--text); min-height: 1.6em; font-size: 13px; }
.act-sign small { font-size: 11px; color: var(--text-2); text-align: center; }
@media (max-width: 520px) {
  .act { padding: 20px 14px; border-radius: 0; border-left: 0; border-right: 0; }
  .act-kv th { width: auto; display: block; padding-bottom: 0; border-bottom: 0; }
  .act-kv td { display: block; padding-top: 2px; }
  .act-sign { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 12mm 14mm 12mm; }
  html, body { background: #fff !important; }
  .noprint { display: none !important; }
  .act {
    --text: #000; --text-2: #333; --line: #999; --line-2: #666; --surface: #fff;
    max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; font-size: 10pt; line-height: 1.35; gap: 8px; color: #000; background: #fff;
  }
  .act h1 { font-size: 15pt; }
  .act h2 { font-size: 11pt; margin-top: 2px; break-after: avoid; }
  .act th, .act td { padding: 4px 6px; }
  .act-log { font-size: 9pt; }
  .act-sign { margin-top: 18px; }
  .act tr, .act-sign { break-inside: avoid; }
  .act-kv th { width: 38%; display: table-cell; }
  .act-kv td { display: table-cell; }
  .act-sign { grid-template-columns: 1fr 1.6fr 1fr; }
}
