/* Дизайн-система сайта и кабинета: нейтральная палитра и компоненты в духе shadcn/ui (стиль new-york, тема zinc).
   Токены — HSL-каналы, как в shadcn. Шрифт Inter (SIL OFL 1.1) лежит у нас: public/fonts, внешних запросов нет. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  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 {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 42%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --accent: 240 4.8% 95.9%;
  --destructive: 0 72% 51%;
  --success: 142 64% 30%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  color-scheme: light;
}
/* Тема задаётся атрибутом data-theme на <html> (public/theme.js); без скрипта действует светлая. */
:root[data-theme='dark'] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --accent: 240 3.7% 15.9%;
  --destructive: 0 72% 60%;
  --success: 142 60% 55%;
  --ring: 240 4.9% 83.9%;
  --shadow-sm: none;
  color-scheme: dark;
}

/* Запасной шрифт с подогнанными метриками: пока грузится Inter, строки не «прыгают» (CLS) */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Liberation Sans');
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
  size-adjust: 107.4%;
}

* { box-sizing: border-box; border-color: hsl(var(--border)); }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 15px/1.65 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-color: hsl(var(--muted-foreground) / 0.5); text-underline-offset: 4px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: 4px; }
::selection { background: hsl(var(--foreground) / 0.15); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: hsl(var(--background)); border: 1px solid hsl(var(--border)); padding: 8px 12px; border-radius: var(--radius); z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 30rem; }

/* Шапка и подвал */
header.site { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--background) / 0.85); backdrop-filter: saturate(1.5) blur(8px); }
header.site .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; }
.brand::before { content: ''; width: 22px; height: 22px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%2309090b'/%3E%3Cpath d='M17 33l10 10 20-23' fill='none' stroke='%23fafafa' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
:root[data-theme='dark'] .brand::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%23fafafa'/%3E%3Cpath d='M17 33l10 10 20-23' fill='none' stroke='%2309090b' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.brand span { color: inherit; }
nav.main { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { font-size: 14px; color: hsl(var(--muted-foreground)); text-decoration: none; padding: 6px 10px; border-radius: calc(var(--radius) - 2px); white-space: nowrap; transition: color 0.15s, background 0.15s; }
nav.main a:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
nav.main a[aria-current='page'] { color: hsl(var(--foreground)); font-weight: 500; }
footer.site { border-top: 1px solid hsl(var(--border)); padding: 48px 0 28px; margin-top: 24px; background: hsl(var(--muted) / 0.35); color: hsl(var(--muted-foreground)); font-size: 14px; }
footer.site .foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
footer.site .foot-about p { max-width: 24rem; margin: 12px 0 0; line-height: 1.6; }
footer.site .foot-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--foreground)); }
footer.site ul.plain li { padding: 4px 0; }
footer.site a { color: inherit; text-decoration: none; }
footer.site a:hover { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 3px; }
footer.site .brand { color: hsl(var(--foreground)); }
footer.site .foot-bottom { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid hsl(var(--border)); font-size: 13px; }

main { padding: 40px 0 72px; min-height: 60vh; }

/* Типографика */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.12; margin: 0 0 16px; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 48px 0 12px; }
h3 { font-size: 1.05rem; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 1.3em; }
li { margin: 4px 0; }
main .wrap > p, main .wrap > ul, main .wrap > ol, main .wrap > details { max-width: 44rem; }
.lead { font-size: 1.1rem; line-height: 1.6; color: hsl(var(--muted-foreground)); max-width: 40rem; }
.muted, .editor-note { color: hsl(var(--muted-foreground)); }
.editor-note { font-size: 13px; margin-top: 10px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin: 0; padding: 2px 0; }
.nb { white-space: nowrap; }
pre, code { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }
pre { background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 16px; overflow-x: auto; line-height: 1.6; }
:not(pre) > code { background: hsl(var(--muted)); padding: 2px 6px; border-radius: 4px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px;
  border-radius: calc(var(--radius) - 2px); border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 500; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-sm); transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: hsl(var(--primary) / 0.9); }
.btn.outline, .btn.ghost { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--input)); }
.btn.outline:hover, .btn.ghost:hover { background: hsl(var(--accent)); }
.btn.secondary { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); box-shadow: none; }
.btn.secondary:hover { background: hsl(var(--secondary) / 0.8); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 24px; }
.btn.danger { background: hsl(var(--destructive)); color: #fff; }
.btn.danger:hover { background: hsl(var(--destructive) / 0.9); }
.wide { max-width: 36rem; }
.mt { margin-top: 16px; }
.btn.block { width: 100%; }
.btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 0; }
.link-btn, .example-btn { background: none; border: 0; padding: 0; font: inherit; color: hsl(var(--foreground)); cursor: pointer; text-decoration: underline; text-decoration-color: hsl(var(--muted-foreground) / 0.5); text-underline-offset: 4px; }
.link-btn:hover, .example-btn:hover { text-decoration-color: currentColor; }

/* Карточки */
.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px); padding: 24px; box-shadow: var(--shadow-sm); }
.card > :last-child { margin-bottom: 0; }
.card-header { margin-bottom: 16px; }
.card-title { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.3; }
.card-desc { color: hsl(var(--muted-foreground)); font-size: 14px; margin: 4px 0 0; }
.card-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid > .card h2, .grid > .card h3 { font-size: 1.05rem; margin: 0 0 12px; }
.grid > .card ul { padding-left: 1.1em; color: hsl(var(--muted-foreground)); }

/* Список возможностей: общая сетка с разделителями, без отдельных карточек */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px); overflow: hidden; gap: 1px; background: hsl(var(--border)); margin-top: 16px; }
.features > div { background: hsl(var(--background)); padding: 20px 22px; }
.features h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.features p { margin: 0; font-size: 14px; color: hsl(var(--muted-foreground)); }

/* Формы */
label, .label { font-size: 14px; font-weight: 500; line-height: 1; }
.input, textarea.input, #try-text {
  width: 100%; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); background: transparent; color: inherit;
  font: inherit; padding: 8px 12px; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, border-color 0.15s;
}
#try-text { min-height: 200px; resize: vertical; padding: 14px 16px; line-height: 1.7; font-size: 15px; }
.input:focus-visible, #try-text:focus-visible { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.5; margin: 12px 0; }
label.check input { appearance: none; flex: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1px solid hsl(var(--primary)); border-radius: 4px; background: transparent; display: grid; place-content: center; cursor: pointer; box-shadow: var(--shadow-sm); }
label.check input:checked { background: hsl(var(--primary)); }
label.check input:checked::after { content: ''; width: 8px; height: 4px; border-left: 2px solid hsl(var(--primary-foreground)); border-bottom: 2px solid hsl(var(--primary-foreground)); transform: translateY(-1px) rotate(-45deg); }
label.check input:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

/* Редактор на главной */
.editor-box { margin-top: 32px; }
.editor-box .card { padding: 0; overflow: hidden; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid hsl(var(--border)); }
.editor-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.editor-body { padding: 16px 20px; }
.editor-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: hsl(var(--muted-foreground)); font-size: 13px; margin-top: 10px; min-height: 22px; }
.editor-foot { padding: 12px 20px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); font-size: 13px; color: hsl(var(--muted-foreground)); }
.editor-foot p { margin: 0; }
.status { min-height: 1.4em; }
.status.err { color: hsl(var(--destructive)); }

/* Бейджи и сообщения */
.badge, .tag, .badge-soon { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1; background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border: 1px solid transparent; vertical-align: middle; }
.badge.outline { background: transparent; border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.badge-soon { margin-left: 8px; background: transparent; border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.btn .badge-soon { margin-left: 0; }
.alert, .notice { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 12px 16px; font-size: 14px; background: hsl(var(--muted) / 0.4); }
.alert.destructive, .status.err.alert { border-color: hsl(var(--destructive) / 0.5); color: hsl(var(--destructive)); background: transparent; }
.alert strong { font-weight: 600; }

/* Примеры «как неправильно / как правильно» */
.pair { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin: 10px 0; }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; } }
.pair > div { border-radius: var(--radius); padding: 10px 14px; border: 1px solid hsl(var(--border)); }
.pair .bad { border-left: 3px solid hsl(var(--destructive)); }
.pair .good { border-left: 3px solid hsl(var(--success)); }
.pair small { display: block; color: hsl(var(--muted-foreground)); font-size: 12px; margin-bottom: 2px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; padding: 0; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); color: hsl(var(--foreground)); cursor: pointer; box-shadow: var(--shadow-sm); transition: background 0.15s; }
.icon-btn:hover { background: hsl(var(--accent)); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-sun { display: none; }
:root[data-theme='dark'] .icon-btn .i-sun { display: block; }
:root[data-theme='dark'] .icon-btn .i-moon { display: none; }
header.site .tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.breadcrumbs { font-size: 13px; color: hsl(var(--muted-foreground)); margin-bottom: 20px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: hsl(var(--foreground)); text-decoration: underline; }
.breadcrumbs span { color: hsl(var(--foreground)); }

/* Таблицы */
table { border-collapse: collapse; width: 100%; margin: 12px 0 24px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
th { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 13px; }

/* Раскрывающиеся блоки (вопросы) */
details { border-bottom: 1px solid hsl(var(--border)); }
summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; font-weight: 500; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; flex: none; width: 8px; height: 8px; border-right: 1.5px solid hsl(var(--muted-foreground)); border-bottom: 1.5px solid hsl(var(--muted-foreground)); transform: rotate(45deg); transition: transform 0.2s; }
details[open] > summary::after { transform: rotate(-135deg); }
details > :not(summary) { color: hsl(var(--muted-foreground)); }
details > p:last-child { padding-bottom: 8px; }

/* Страницы кабинета: вход, согласия */
.auth { display: grid; place-items: start center; padding-top: 40px; }
.auth .card { width: 100%; max-width: 26rem; padding: 32px; }
.auth h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.02em; }
.stack { display: grid; gap: 10px; margin: 20px 0 0; }
.sep { display: flex; align-items: center; gap: 12px; color: hsl(var(--muted-foreground)); font-size: 12px; margin: 16px 0; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: hsl(var(--border)); }
.actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
td .actions-row { margin: 0; }
dl.fields { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
dl.fields dt { color: hsl(var(--muted-foreground)); }
dl.fields dd { margin: 0; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  header.site .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 6px; gap: 6px 12px; }
  .brand { order: 1; }
  header.site .tools { order: 2; }
  nav.main { order: 3; flex: 0 0 100%; margin: 0 -10px; }
  .cta .btn { flex: 1 1 100%; }
  main { padding-top: 28px; }
}
@media (pointer: coarse) {
  nav.main a { padding: 12px 12px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  footer.site a { display: inline-block; padding: 6px 0; }
  summary { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

/* Юридические документы и их редактор в кабинете (ADR-0035) */
.doc { max-width: 72ch; }
.doc h2 { margin-top: 32px; }
.doc blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.doc-list li { margin: 8px 0; }
mark.ph { background: hsl(48 96% 53% / 0.35); color: inherit; border-radius: 4px; padding: 0 3px; }
.editor-form textarea.input { width: 100%; min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
.editor-form .input { width: 100%; }

/* Админ-панель кабинета (стиль shadcn dashboard): меню у левого края на всю высоту, справа верхняя полоса и контент во всю ширину */
.shell-body { background: hsl(var(--background)); }
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.app-body { min-width: 0; display: flex; flex-direction: column; }
.app-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 32px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--background) / 0.85); backdrop-filter: saturate(1.5) blur(8px); }
.app-crumb { font-size: 14px; color: hsl(var(--muted-foreground)); }
.shell-main { min-width: 0; flex: 1; padding: 32px; min-height: 0; }
.shell-main > h1 { margin: 0 0 24px; font-size: 1.75rem; letter-spacing: -0.025em; }
.shell-main h2 { font-size: 1.15rem; letter-spacing: -0.015em; margin: 32px 0 12px; }
.shell-main > h2:first-of-type { margin-top: 0; }
.shell-main .wide, .shell-main .card { max-width: none; }
.shell-main > p, .shell-main > ul, .shell-main > ol { max-width: 60rem; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); }
.sidebar-brand { margin: 0 8px 20px; height: 24px; }
.sidebar-title { margin: 0 12px 6px; font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot { margin-top: 16px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.sidebar-version { margin: auto 0 12px; display: grid; gap: 2px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.sidebar-version strong { color: hsl(var(--foreground)); font-weight: 600; }
.sidebar-version code { font-size: 11px; }
.sidebar-version + .sidebar-user { margin-top: 0; }
.sidebar-user { margin-top: auto; display: grid; gap: 10px; padding: 12px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); background: hsl(var(--background)); font-size: 13px; }
.sidebar-user p, .sidebar-user form { margin: 0; }
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 13px; font-weight: 600; }
.user-meta { display: grid; min-width: 0; line-height: 1.3; }
.user-meta strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 12px; color: hsl(var(--muted-foreground)); }
.user-status { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.4; color: hsl(var(--muted-foreground)); }
.user-status i { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: hsl(var(--muted-foreground) / 0.5); }
.user-status.ok i { background: hsl(var(--success)); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: hsl(var(--muted-foreground)); }
.btn.ghost:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: calc(var(--radius) - 2px); font-size: 14px; line-height: 1.3; color: hsl(var(--muted-foreground)); text-decoration: none; transition: color 0.15s, background 0.15s; }
.sidebar nav a:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.sidebar nav a[aria-current='page'] { color: hsl(var(--foreground)); background: hsl(var(--accent)); font-weight: 500; }
.sidebar a:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25); }
.sidebar svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid hsl(var(--border)); }
  .sidebar-brand { margin: 0 8px 0 0; }
  .sidebar-title { display: none; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot, .sidebar-user { margin: 0; padding: 0; border: 0; }
  .sidebar nav a { padding: 8px 10px; min-height: 40px; }
  .app-top { padding: 0 16px; }
  .shell-main { padding: 20px 16px; }
  .shell-main table { display: block; overflow-x: auto; }
  .shell-main dl.fields { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .shell-main dl.fields dd { margin-bottom: 10px; }
}

/* Баннер расширения под редактором на главной (components/ExtensionBanner.astro): тёмная карточка с фиолетовым свечением одинакова в обеих темах,
   чтобы быть заметной; цвета заданы явно, а не токенами темы. Рисунок справа — «окно письма» с подчёркиванием и плашкой расширения. */
.ext-banner { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 36px; align-items: center; margin: 28px 0 8px; padding: 40px 44px;
  color: #fafafa; border: 1px solid #3f3f46; border-radius: calc(var(--radius) + 10px); background: linear-gradient(135deg, #18181b 0%, #231044 55%, #3b0764 100%); box-shadow: 0 18px 40px -20px rgb(59 7 100 / 0.6); }
.ext-banner::before { content: ''; position: absolute; top: -30%; right: -8%; width: 55%; height: 160%; background: radial-gradient(closest-side, rgb(167 139 250 / 0.38), transparent); pointer-events: none; }
.ext-banner > * { position: relative; z-index: 1; }
.ext-banner > .ext-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ext-ic { position: absolute; display: block; }
.ext-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; background: rgb(250 250 250 / 0.12); }
.ext-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #a78bfa; box-shadow: 0 0 0 4px rgb(167 139 250 / 0.25); }
.ext-banner h2 { margin: 16px 0 12px; font-size: clamp(1.6rem, 2.8vw, 2.15rem); line-height: 1.12; letter-spacing: -0.025em; color: #fff; }
.ext-banner p { max-width: 34rem; margin: 0 0 20px; color: rgb(250 250 250 / 0.8); font-size: 1.02rem; line-height: 1.55; }
.ext-browsers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.ext-browsers li { padding: 5px 12px; border: 1px solid rgb(250 250 250 / 0.28); border-radius: 8px; font-size: 13px; font-weight: 500; color: #fafafa; background: rgb(250 250 250 / 0.06); }
.ext-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.ext-banner .btn { box-sizing: border-box; height: 48px; padding: 0 30px; font-size: 16px; font-weight: 600; background: #fff; color: #18181b; box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.5); }
.ext-banner .btn:hover { background: #ede9fe; }
.ext-banner .btn:focus-visible, .ext-more:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; }
.ext-more { color: #ddd6fe; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.ext-more:hover { color: #fff; }
.ext-banner .ext-note { margin: 16px 0 0; font-size: 13px; color: rgb(250 250 250 / 0.62); }
.ext-visual { display: flex; justify-content: center; }
.mock { width: 100%; max-width: 380px; border-radius: 12px; background: #fff; color: #18181b; box-shadow: 0 24px 50px -18px rgb(0 0 0 / 0.65), 0 0 0 1px rgb(255 255 255 / 0.08); overflow: hidden; transform: rotate(1.5deg); }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #f4f4f5; border-bottom: 1px solid #e4e4e7; font-size: 12px; color: #71717a; }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #d4d4d8; }
.mock-bar span { margin-left: 10px; }
.mock-body { position: relative; padding: 18px 16px 58px; }
.mock-body p { margin: 0; max-width: none; color: #18181b; font-size: 15px; line-height: 1.7; }
.mock-body u { text-decoration: underline wavy #dc2626; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.mock-card { position: absolute; left: 16px; bottom: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #fff; box-shadow: 0 6px 18px -4px rgb(0 0 0 / 0.28), 0 0 0 1px #e4e4e7; font-size: 13px; }
.mock-card small { color: #7c3aed; font-weight: 600; }
.mock-card b { font-weight: 600; }
.mock-card span { padding: 3px 9px; border-radius: 6px; background: #18181b; color: #fff; font-size: 12px; font-weight: 500; }
.mock-dock { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 6px; padding: 3px 5px 3px 3px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px #e4e4e7, 0 2px 8px rgb(0 0 0 / 0.16); }
.mock-dock em { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 11px; background: #dc2626; color: #fff; font: 600 12px/1 inherit; font-style: normal; }
.mock-dock svg { width: 22px; height: 22px; padding: 4px; box-sizing: border-box; border-radius: 11px; background: #f4f4f5; fill: none; stroke: #52525b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mock-dock b { position: relative; width: 30px; height: 18px; border-radius: 9px; background: #09090b; }
.mock-dock b::after { content: ''; position: absolute; top: 2px; left: 14px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
@media (max-width: 860px) {
  .ext-ic.only-wide { display: none; }
  .ext-banner { grid-template-columns: 1fr; gap: 28px; padding: 28px 22px; }
  .ext-visual { order: -1; }
  .mock { max-width: 340px; transform: none; }
}
@media (max-width: 480px) {
  .ext-visual { display: none; }
  .ext-banner .btn { width: 100%; padding: 0 16px; justify-content: center; }
}

/* Полоса прокрутки не меняет ширину страницы: без этого при переходе с короткой страницы на длинную содержимое «дёргается» */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }

/* Широкие страницы (установка, документация): основной текст и боковая колонка; правила — карточки в несколько колонок */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: start; margin-top: 8px; }
.page-main > :first-child { margin-top: 0; }
.page-aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }
.aside-card { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px); padding: 20px; background: hsl(var(--card)); box-shadow: var(--shadow-sm); }
.aside-title { margin: 0 0 8px; font-weight: 600; font-size: 1rem; }
.aside-card p { margin: 0 0 14px; font-size: 14px; }
.aside-list { margin: 16px 0 0; padding: 0; list-style: none; font-size: 14px; color: hsl(var(--muted-foreground)); }
.aside-list li { margin: 0; padding: 6px 0 6px 22px; position: relative; border-top: 1px solid hsl(var(--border)); }
.aside-list li::before { content: '✓'; position: absolute; left: 2px; color: hsl(var(--success)); font-weight: 700; }
.toc { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 10px; border-left: 2px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); text-decoration: none; }
.toc a:hover { color: hsl(var(--foreground)); border-left-color: hsl(var(--foreground)); }
.rule-grid { columns: 3 340px; column-gap: 24px; margin-top: 28px; }
.rule-card { break-inside: avoid; margin: 0 0 24px; padding: 20px 22px; }
.rule-card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.rule-card p { margin: 0 0 10px; max-width: none; font-size: 14px; color: hsl(var(--muted-foreground)); }
.rule-card ul { margin: 0; padding-left: 1.1em; font-size: 14px; max-width: none; }
.lead.wide { max-width: 56rem; }
@media (max-width: 1000px) {
  .page-grid { grid-template-columns: 1fr; gap: 32px; }
  .page-aside { position: static; order: -1; }
  footer.site .foot-grid { grid-template-columns: 1fr 1fr; gap: 36px 32px; }
  footer.site .foot-about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  footer.site .foot-grid { grid-template-columns: 1fr; }
}

/* Вход, согласия и кабинет (cabinet/templates): сдержанные страницы без декора — типографика, рамки и одно основное действие */
.auth > .card, .auth > p.auth-back { width: 100%; max-width: 26rem; }
.auth-lead { margin: 8px 0 0; color: hsl(var(--muted-foreground)); font-size: 15px; line-height: 1.55; }
.provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border: 1px solid hsl(var(--input)); border-radius: var(--radius);
  background: hsl(var(--background)); color: inherit; font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; box-shadow: var(--shadow-sm); transition: background 0.15s, border-color 0.15s; }
.provider:hover { background: hsl(var(--accent)); border-color: hsl(var(--foreground) / 0.35); }
.provider:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.provider-icon { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; box-sizing: border-box; border-radius: 6px; background: hsl(var(--foreground)); color: hsl(var(--background)); font-size: 12px; font-weight: 700; line-height: 1; }
.dev-box { display: grid; gap: 8px; margin-top: 16px; padding: 12px; border: 1px dashed hsl(var(--border)); border-radius: var(--radius); font-size: 12px; color: hsl(var(--muted-foreground)); }
.auth-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid hsl(var(--border)); font-size: 13px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.auth-note + .auth-note { margin-top: 12px; padding-top: 0; border-top: 0; }
.auth-note a, .auth-legal a, .auth-back a { color: inherit; text-underline-offset: 3px; }
.auth-legal { margin: 16px 0 0; font-size: 12px; line-height: 1.55; color: hsl(var(--muted-foreground)); }
.auth-back { margin: 20px 0 0; text-align: center; font-size: 14px; color: hsl(var(--muted-foreground)); }
.who { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 14px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--muted) / 0.4); }
.who > span:last-child { display: grid; min-width: 0; }
.who-name { font-weight: 600; }
.who-sub { font-size: 13px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: hsl(var(--foreground)); color: hsl(var(--background)); font-size: 15px; font-weight: 600; line-height: 1; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.consent { display: grid; gap: 10px; margin-top: 20px; }
label.check.consent-item { margin: 0; padding: 14px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
label.check.consent-item:hover { background: hsl(var(--accent)); }
label.check.consent-item:has(input:checked) { border-color: hsl(var(--foreground) / 0.5); }
.consent-item strong { display: block; margin-bottom: 2px; font-weight: 600; }
.profile { display: flex; align-items: center; gap: 16px; padding: 20px; }
.profile-main { flex: 1; min-width: 0; }
.profile-name { margin: 0; font-weight: 600; font-size: 1.1rem; }
.profile-main .badge { height: auto; padding: 3px 8px; line-height: 1.35; white-space: normal; }
.profile-mail { margin: 2px 0 8px; font-size: 14px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.row-title { margin: 0; font-weight: 600; }
.row-text { margin: 2px 0 0; font-size: 14px; color: hsl(var(--muted-foreground)); line-height: 1.55; }
.muted-card { background: hsl(var(--muted) / 0.4); box-shadow: none; }
.danger-card { padding: 18px 20px; border-color: hsl(var(--destructive) / 0.35); }
.danger-card details { margin-top: 12px; }
@media (max-width: 560px) {
  .auth .card { padding: 24px 20px; }
  .profile { flex-wrap: wrap; }
  .row-card { flex-direction: column; align-items: flex-start; }
}

/* Вход в админ-панель: шаги, подключение аутентификатора (ADR-0042) */
.login-steps { list-style: none; display: flex; gap: 8px; margin: 20px 0 0; padding: 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.login-steps li { display: flex; align-items: center; gap: 8px; flex: 1; padding: 8px 10px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); }
.login-steps li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: hsl(var(--secondary)); font-size: 11px; font-weight: 600; flex: none; }
.login-steps li.current { color: hsl(var(--foreground)); border-color: hsl(var(--foreground) / 0.5); }
.login-steps li.current span { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.login-steps li.done { color: hsl(var(--foreground)); }
.howto { margin: 16px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.qr { display: grid; place-items: center; margin: 20px 0 0; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.qr-manual { margin: 12px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.qr-manual summary { cursor: pointer; }
.qr-manual code { font-size: 15px; letter-spacing: 0.05em; word-break: break-all; color: hsl(var(--foreground)); }
.auth.auth-wide > .card { max-width: 36rem; }

/* Сводка админ-панели: плитки, «требует внимания», блоки в колонках */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.card.stat { padding: 20px; }
.stat p { margin: 0; }
.stat-label { font-size: 13px; color: hsl(var(--muted-foreground)); }
.stat-value { margin-top: 8px !important; font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.stat-value span { font-size: 14px; font-weight: 400; letter-spacing: 0; color: hsl(var(--muted-foreground)); }
.stat-note { margin-top: 6px !important; font-size: 12px; color: hsl(var(--muted-foreground)); }
.block { margin-top: 32px; }
.block > h2, .shell-main .block > h2 { margin: 0 0 12px; font-size: 1.05rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 24px; margin-top: 32px; }
.cols .block { margin-top: 0; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush table { margin: 0; }
table.compact th, table.compact td { padding: 10px 16px; }
table.compact tbody tr:last-child td { border-bottom: 0; }
.card-link { margin: 0; padding: 10px 16px; border-top: 1px solid hsl(var(--border)); font-size: 13px; }
.attention { padding: 0; overflow: hidden; }
.attention a { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid hsl(var(--border)); text-decoration: none; color: inherit; font-size: 14px; }
.attention a:last-child { border-bottom: 0; }
.attention a:hover { background: hsl(var(--accent)); }
.attention .go { margin-left: auto; font-size: 13px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.attention-empty { margin: 0; padding: 16px 20px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--muted-foreground) / 0.5); }
.dot.warn { background: hsl(38 92% 50%); }
.note { margin: 8px 0 12px; font-size: 13px; }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* Защита сайта: формы действий рядом с полем */
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 140px; min-width: 0; }
.inline-form select.input { flex: 0 0 auto; }
.cols.tight { margin-top: 0; }
.note-box { margin-top: 16px; font-size: 13px; }
.lead-note { max-width: 60rem; margin: -12px 0 20px; }
td form { margin: 0; }

/* Защита сайта: вкладки, фильтр, листание и график (ADR-0043) */
:root { --sec-blocked: 24 90% 48%; --sec-recorded: 217 80% 52%; --sec-none: 142 55% 36%; }
:root[data-theme='dark'] { --sec-blocked: 27 95% 62%; --sec-recorded: 213 90% 66%; --sec-none: 142 55% 55%; }
.filter { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; padding: 16px; margin: 0 0 16px; }
.filter label { display: grid; gap: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.filter select, .filter .input, .pager select { height: 36px; min-width: 150px; padding: 0 10px; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); color: hsl(var(--foreground)); font: inherit; font-size: 14px; }
.filter .input { min-width: 170px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 20px; padding: 4px; border-radius: calc(var(--radius) + 2px); background: hsl(var(--muted)); width: fit-content; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: calc(var(--radius) - 2px); font-size: 14px; color: hsl(var(--muted-foreground)); text-decoration: none; }
.tabs a:hover { color: hsl(var(--foreground)); }
.tabs a[aria-current='page'] { background: hsl(var(--background)); color: hsl(var(--foreground)); font-weight: 500; box-shadow: var(--shadow-sm); }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: hsl(var(--secondary)); font-size: 12px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 16px; border-top: 1px solid hsl(var(--border)); font-size: 13px; color: hsl(var(--muted-foreground)); }
.pager form { margin: 0; }
.pager-size label { display: inline-flex; align-items: center; gap: 8px; }
.pager select { min-width: 0; height: 32px; }
.pager-nav { display: inline-flex; align-items: center; gap: 6px; }
.btn.disabled { opacity: 0.4; pointer-events: none; }
.sec-blocked { background: hsl(var(--sec-blocked) / 0.15); color: hsl(var(--sec-blocked)); border-color: hsl(var(--sec-blocked) / 0.3); }
.block.first { margin-top: 0; }
.chart-card { padding: 16px 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.legend b { color: hsl(var(--foreground)); margin-left: 4px; }
.sw { display: inline-block; width: 18px; height: 3px; margin-right: 8px; vertical-align: middle; border-radius: 2px; }
.sw-blocked { background: hsl(var(--sec-blocked)); } .sw-recorded { background: hsl(var(--sec-recorded)); } .sw-none { background: repeating-linear-gradient(90deg, hsl(var(--sec-none)) 0 5px, transparent 5px 8px); }
.chart-scroll { overflow-x: auto; }
.chart-frame { position: relative; min-width: 560px; }
.chart { display: block; width: 100%; height: auto; outline: none; }
.chart:focus-visible { box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25); border-radius: 6px; }
.chart .grid { stroke: hsl(var(--border)); stroke-width: 1; }
.chart .axis { fill: hsl(var(--muted-foreground)); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-blocked { stroke: hsl(var(--sec-blocked)); } .line-recorded { stroke: hsl(var(--sec-recorded)); } .line-none { stroke: hsl(var(--sec-none)); stroke-dasharray: 5 4; }
.chart .cross { stroke: hsl(var(--muted-foreground)); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 8px; z-index: 2; min-width: 150px; padding: 8px 10px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); box-shadow: 0 4px 12px rgb(0 0 0 / 0.12); font-size: 12px; line-height: 1.5; pointer-events: none; }
.tip[hidden], .chart [hidden] { display: none; }
.help { margin-top: 24px; padding: 16px 20px; font-size: 14px; }
.help summary { cursor: pointer; font-weight: 500; }
.help ol { margin: 12px 0 0; padding-left: 20px; color: hsl(var(--muted-foreground)); line-height: 1.6; }

/* Свой выпадающий список (DESIGN.md): настоящий <select> скрыт и остаётся в форме, кнопка и панель рисует select.js */
.cselect { position: relative; display: inline-flex; min-width: 0; }
.cselect-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.cselect-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 150px; height: 36px; padding: 0 10px 0 12px; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.cselect-trigger:hover { background: hsl(var(--accent)); }
.cselect-trigger:focus-visible, .cselect-trigger[aria-expanded='true'] { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25); border-color: hsl(var(--ring) / 0.6); }
.cselect-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.cselect-trigger svg, .cselect-item svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cselect-trigger svg { color: hsl(var(--muted-foreground)); transition: transform 0.15s; }
.cselect-trigger[aria-expanded='true'] svg { transform: rotate(180deg); }
.cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-panel { position: fixed; z-index: 60; max-width: min(360px, calc(100vw - 16px)); padding: 4px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: 0 4px 12px rgb(0 0 0 / 0.12); outline: none; font-size: 14px; }
.cselect-list { max-height: 280px; overflow-y: auto; }
.cselect-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; padding: 6px 8px; border-radius: calc(var(--radius) - 2px); cursor: pointer; }
.cselect-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-item.active { background: hsl(var(--accent)); }
.cselect-item[aria-selected='true'] { font-weight: 500; }
.cselect-item[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.cselect-item[hidden] { display: none; }
.cselect-search { width: 100%; height: 32px; margin: 0 0 4px; padding: 0 8px; border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--background)); color: inherit; font: inherit; font-size: 13px; }
.cselect-search:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25); }
.cselect-empty { padding: 8px; color: hsl(var(--muted-foreground)); }
.filter .cselect-trigger { min-width: 170px; }
.pager .cselect-trigger { min-width: 0; height: 32px; width: auto; }
.inline-form .cselect { flex: 0 0 auto; }

/* Главная: три шага проверки (карточки с номером) */
main .wrap > ol.how-steps, .how-steps { max-width: none; }
.how-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 0; padding: 0; counter-reset: how; }
.how-steps li { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px); background: hsl(var(--card)); box-shadow: var(--shadow-sm); }
.how-steps li::before { counter-increment: how; content: counter(how); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 13px; font-weight: 600; }
.how-steps strong { display: block; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.how-steps p { margin: 0; color: hsl(var(--muted-foreground)); font-size: 14px; line-height: 1.55; }
@media (max-width: 760px) { .how-steps { grid-template-columns: minmax(0, 1fr); } }

/* Редактор документов в админ-панели (ADR-0035): панель форматирования и живой предпросмотр */
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border: 1px solid hsl(var(--border)); border-bottom: 0; border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; background: hsl(var(--muted) / 0.4); position: sticky; top: 56px; z-index: 5; }
.md-toolbar[hidden], .md-preview[hidden] { display: none; }
.md-sep { width: 1px; height: 18px; background: hsl(var(--border)); margin: 0 4px; }
.md-live .md-toolbar + .md-panes textarea { border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px); }
.md-panes { display: grid; gap: 16px; }
.md-panes textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; min-height: 28rem; resize: vertical; }
.md-preview { overflow: auto; max-height: 80vh; padding: 20px 24px; }
.md-preview-hint { margin: 0 0 12px; font-size: 12px; }
.md-preview-body.doc { max-width: none; }
.md-help { font-size: 12px; margin-top: 8px; }
@media (min-width: 1280px) { .md-live .md-panes { grid-template-columns: 1fr 1fr; align-items: start; } .md-live .md-panes textarea { min-height: 36rem; } }

/* Личный кабинет: оболочка общая с админ-панелью, здесь только свои блоки */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0; padding: 20px 24px; }
.facts div { display: grid; gap: 2px; }
.facts dt { font-size: 13px; color: hsl(var(--muted-foreground)); }
.facts dd { margin: 0; font-weight: 500; }
.shell-main > .card { margin-bottom: 16px; }
.data-list { margin: 8px 0 12px; padding-left: 18px; list-style: disc; display: grid; gap: 4px; }

/* Тарифы, настройки, подписка (ADR-0045) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; }
.plan-form label, .settings-form label:not(.check) { display: grid; gap: 6px; }
.plan-form textarea, .plan-form > label { margin-top: 0; }
.plan-form > label { margin-bottom: 14px; }
.setting { padding: 12px 0; border-bottom: 1px solid hsl(var(--border)); }
.setting:last-child { border-bottom: 0; }
.setting-hint { margin: 6px 0 0; font-size: 13px; }
.plain-facts { padding: 0; margin: 0 0 16px; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.plan-card { display: grid; gap: 10px; align-content: start; }
.plan-card p { margin: 0; }
.plan-price { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.plan-price span { font-size: 13px; font-weight: 400; color: hsl(var(--muted-foreground)); }

/* Уведомление о cookie (public/cookie-notice.js): внизу страницы, не закрывает содержимое при прокрутке до конца */
.cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); }
.cookie-notice p { margin: 0; font-size: 14px; line-height: 1.5; }
.cookie-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.cookie-notice .btn { flex: none; }
@media (max-width: 560px) { .cookie-notice { flex-direction: column; align-items: stretch; } .cookie-actions { justify-content: stretch; } .cookie-actions .btn { flex: 1; } }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
