/* wiki.agentplux.com — единая дизайн-система.
 *
 * Философия: светлая, тихая, воздушная. Много белого, мягкие тени, крупная
 * типографика с плотной иерархией, аккуратные интерактивные элементы.
 * Используется и для платформы, и внутри генерируемых документов, чтобы всё
 * жило в едином визуальном языке. */

@import url('https://rsms.me/inter/inter.css');

:root {
    /* Neutrals */
    --ink-0: #ffffff;
    --ink-50: #fbfbfd;
    --ink-100: #f5f5f7;
    --ink-200: #e8e8ed;
    --ink-300: #d2d2d7;
    --ink-400: #a1a1a6;
    --ink-500: #86868b;
    --ink-700: #494949;
    --ink-900: #1d1d1f;

    /* Accents */
    --brand-blue: #007aff;
    --brand-blue-hi: #0a84ff;
    --brand-blue-lo: #e8f2ff;
    --brand-green: #34c759;
    --brand-orange: #ff9500;
    --brand-red: #ff3b30;
    --brand-purple: #af52de;

    /* Type scale (Apple HIG-ish) */
    --f-caption: 12px;
    --f-footnote: 13px;
    --f-body: 15px;
    --f-callout: 17px;
    --f-title-3: 20px;
    --f-title-2: 22px;
    --f-title-1: 28px;
    --f-large: 34px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 0 0 .5px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .06), 0 0 0 .5px rgba(0, 0, 0, .06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .06);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; }
body {
    font-family: var(--font);
    font-size: var(--f-body);
    line-height: 1.5;
    color: var(--ink-900);
    background: var(--ink-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ─── Header (единый с stats.afftech.ru / mediabuy) ──────────────────── */

.header {
    background: #0a2540;
    color: #fff;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    position: relative;
    z-index: 200;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a1d6b 50%, #1e3a5f 100%);
    z-index: 0;
}
.header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 50%, hsla(280, 70%, 30%, .6) 0%, transparent 70%);
    opacity: .3;
    z-index: 0;
    animation: auroraShift 8s ease-in-out infinite alternate;
}
@keyframes auroraShift {
    0%   { transform: translateX(-5%) scale(1.10); opacity: .2; }
    100% { transform: translateX( 5%) scale(1.15); opacity: .4; }
}
.header > * { position: relative; z-index: 1; }

.header-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}
.header-logo {
    width: 24px;
    height: 22px;
    max-width: 24px;
    max-height: 22px;
    flex-shrink: 0;
    display: inline-block;
    filter: brightness(0) invert(1);
}
.header-title-text { color: #fff; }

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, border-color .12s;
}
.user-chip:hover, .user-chip.is-open {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .35);
}
.user-chip-caret {
    color: rgba(255, 255, 255, .7);
    transition: transform .18s;
    flex-shrink: 0;
}
.user-chip.is-open .user-chip-caret { transform: rotate(180deg); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .3);
    background: linear-gradient(135deg, #7c3aed, #4a1d6b);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 600; font-size: 14px;
    letter-spacing: -.01em;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar-img { object-fit: cover; }

.user-name-inline {
    font-size: 14px;
    color: rgba(255, 255, 255, .95);
    font-weight: 500;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown menu — переносится в body чтобы не резаться header'ом */
.user-menu {
    position: fixed;
    top: 0;
    right: 0;
    min-width: 180px;
    background: var(--ink-0);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
    z-index: 500;
}
.user-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .14s ease, transform .14s ease, visibility 0s linear 0s;
}
.user-menu-item {
    display: block;
    padding: 9px 12px;
    color: var(--ink-900);
    text-decoration: none;
    font-size: var(--f-body);
    border-radius: var(--radius-sm);
    transition: background .1s;
}
.user-menu-item:hover { background: var(--ink-100); }

@media (max-width: 700px) {
    .header { padding: 14px 20px; }
    .user-name-inline { display: none; }
    .user-chip { padding: 4px; }
}

/* ─── Layout ──────────────────────────────────────────────────────────── */

.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px 96px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 32px 24px 96px; }

h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: var(--f-large); font-weight: 700; margin: 0 0 8px; }
h2 { font-size: var(--f-title-2); font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: var(--f-title-3); font-weight: 600; margin: 24px 0 8px; }

.subtitle {
    color: var(--ink-500);
    font-size: var(--f-callout);
    margin: 0 0 32px;
    font-weight: 400;
}

/* ─── Doc cards on dashboard ─────────────────────────────────────────── */

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.doc-card {
    background: var(--ink-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: box-shadow .18s, transform .18s;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}
.doc-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.doc-card .kind-badge {
    position: absolute; top: 16px; right: 16px;
    font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-500);
    padding: 3px 8px;
    background: var(--ink-100);
    border-radius: 999px;
}
.doc-card h3 {
    margin: 0 0 8px;
    font-size: var(--f-callout);
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-meta { display: flex; align-items: center; gap: 8px; font-size: var(--f-caption); color: var(--ink-500); }
.doc-owner { color: var(--ink-700); font-size: var(--f-footnote); margin-top: 6px; }

.priv-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--f-caption);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 500;
}
.priv-private   { color: var(--brand-orange); background: rgba(255, 149, 0, .10); }
.priv-employees { color: var(--brand-green);  background: rgba( 52, 199,  89, .12); }
.priv-selected  { color: var(--brand-purple); background: rgba(175,  82, 222, .12); }

/* «Имя первого расшаренного +N» + tooltip */
.priv-share-cell {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    max-width: 100%;
    font-size: var(--f-footnote);
    color: var(--ink-900);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}
.priv-share-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.priv-share-tip {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    max-width: 320px;
    background: var(--ink-900);
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: var(--f-caption);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .12s, transform .12s, visibility 0s linear .12s;
    z-index: 50;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.priv-share-tip::before {
    content: "";
    position: absolute;
    top: -5px; left: 12px;
    width: 10px; height: 10px;
    background: var(--ink-900);
    transform: rotate(45deg);
}
.priv-share-cell:hover .priv-share-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .12s, transform .12s, visibility 0s linear 0s;
}
.priv-share-tip-row {
    line-height: 1.35;
    color: rgba(255, 255, 255, .95);
}

/* ─── Tabs (scope switcher) ───────────────────────────────────────────── */

.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ink-200);
    margin: 24px 0 20px;
    padding: 0 4px;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--ink-500);
    text-decoration: none;
    font-size: var(--f-footnote);
    font-weight: 500;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .12s, border-color .12s, background .12s;
}
.tab:hover { color: var(--ink-900); background: var(--ink-100); }
.tab.is-active {
    color: var(--ink-900);
    border-bottom-color: var(--brand-blue);
    background: transparent;
}
.tab-count {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 7px;
    background: var(--ink-100);
    color: var(--ink-500);
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}
.tab.is-active .tab-count { background: var(--brand-blue-lo); color: var(--brand-blue); }
.admin-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-orange);
    box-shadow: 0 0 6px rgba(255,149,0,.55);
}

/* ─── Doc table ───────────────────────────────────────────────────────── */

.doc-table-wrap {
    background: var(--ink-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--f-body);
}
.doc-table thead th {
    text-align: left;
    font-size: var(--f-caption);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-500);
    padding: 12px 16px;
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-200);
    white-space: nowrap;
}
.doc-table tbody tr {
    cursor: pointer;
    transition: background .12s;
}
.doc-table tbody tr:hover { background: var(--brand-blue-lo); }
.doc-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-200);
    vertical-align: middle;
}
.doc-table tbody tr:last-child td { border-bottom: none; }

.doc-title-link {
    color: var(--ink-900);
    font-weight: 500;
    text-decoration: none;
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.doc-title-link:hover { color: var(--brand-blue); }

.col-title { width: auto; }
.col-owner { width: 160px; }
.col-kind, .col-priv { width: 110px; }
.col-date { width: 120px; color: var(--ink-500); font-size: var(--f-footnote); white-space: nowrap; }
.owner-self { font-weight: 500; color: var(--brand-blue); }
.owner-mail { color: var(--ink-700); font-size: var(--f-footnote); }

.kind-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-500);
    padding: 3px 8px;
    background: var(--ink-100);
    border-radius: 999px;
}

.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }

/* Mobile: свернём таблицу */
@media (max-width: 700px) {
    .col-owner, .col-kind, .col-priv { display: none; }
    .doc-title-link { max-width: 240px; white-space: normal; }
    .col-date { font-size: 11px; }
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: var(--f-body);
    font-weight: 500;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: white;
    background: var(--brand-blue);
    transition: background .15s;
}
.btn:hover { background: var(--brand-blue-hi); }
.btn.ghost { background: var(--ink-100); color: var(--ink-900); }
.btn.ghost:hover { background: var(--ink-200); }
.btn.danger { background: rgba(255, 59, 48, .1); color: var(--brand-red); }
.btn.danger:hover { background: rgba(255, 59, 48, .2); }
.btn.sm { padding: 6px 12px; font-size: var(--f-footnote); }

.link { color: var(--brand-blue); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ─── Section & empty state ───────────────────────────────────────────── */

.section { margin-top: 44px; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin-bottom: 16px;
}
.section-head h2 { margin: 0; }
.section-head .hint { color: var(--ink-500); font-size: var(--f-footnote); }

.empty {
    padding: 40px 24px;
    text-align: center;
    background: var(--ink-0);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--ink-500);
}
.empty strong { color: var(--ink-900); }

/* ─── Doc reader (view page) ─────────────────────────────────────────── */

.doc-frame {
    background: var(--ink-0);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.doc-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--ink-200);
    background: rgba(251, 251, 253, .7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.doc-toolbar .doc-title-inline {
    font-weight: 600;
    font-size: var(--f-callout);
    color: var(--ink-900);
    flex: 1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.doc-toolbar .actions { display: flex; gap: 8px; align-items: center; }

.doc-body {
    padding: 32px 40px 48px;
    max-width: 100%;
}

/* Typography inside the doc-body — единая для всех генерируемых доков */
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 { letter-spacing: -.02em; }
.doc-body h1 { font-size: var(--f-large); font-weight: 700; margin: 0 0 12px; }
.doc-body h2 { font-size: var(--f-title-1); font-weight: 600; margin: 40px 0 12px; border-bottom: 1px solid var(--ink-200); padding-bottom: 8px; }
.doc-body h3 { font-size: var(--f-title-2); font-weight: 600; margin: 28px 0 10px; }
.doc-body h4 { font-size: var(--f-title-3); font-weight: 600; margin: 20px 0 8px; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul, .doc-body ol { margin: 0 0 12px; padding-left: 1.4em; }
.doc-body li { margin: 4px 0; }
.doc-body code {
    font-family: var(--mono);
    font-size: .92em;
    background: var(--ink-100);
    padding: 2px 6px;
    border-radius: 6px;
}
.doc-body pre {
    background: var(--ink-100);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: .92em;
    line-height: 1.55;
    margin: 0 0 16px;
}
.doc-body pre code { background: transparent; padding: 0; }
.doc-body blockquote {
    margin: 0 0 12px;
    padding: 8px 16px;
    border-left: 3px solid var(--brand-blue);
    background: var(--brand-blue-lo);
    border-radius: 4px;
    color: var(--ink-700);
}
.doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 20px;
    font-size: var(--f-footnote);
}
.doc-body th, .doc-body td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--ink-200); }
.doc-body th { background: var(--ink-100); font-weight: 600; }
.doc-body tr:last-child td { border-bottom: none; }
.doc-body a { color: var(--brand-blue); text-decoration: none; }
.doc-body a:hover { text-decoration: underline; }
.doc-body img { max-width: 100%; border-radius: var(--radius-md); }

/* ─── Attachment view ─────────────────────────────────────────────────── */

.attach-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px 40px;
}
.attach-icon {
    width: 64px; height: 64px;
    border-radius: var(--radius-md);
    background: var(--brand-blue-lo);
    color: var(--brand-blue);
    display: grid; place-items: center;
    font-weight: 600; font-size: 12px; letter-spacing: .06em;
}
.attach-meta strong { display: block; font-size: var(--f-title-3); font-weight: 600; margin-bottom: 4px; }
.attach-meta .dim { color: var(--ink-500); font-size: var(--f-footnote); }

/* ─── Small forms ─────────────────────────────────────────────────────── */

select, input[type="text"] {
    font-family: inherit;
    font-size: var(--f-footnote);
    padding: 6px 10px;
    background: var(--ink-100);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .12s, background .12s;
}
select:focus, input[type="text"]:focus { border-color: var(--brand-blue); background: var(--ink-0); }

.inline-form { display: inline-flex; gap: 6px; align-items: center; }

/* ─── Privacy dashed-link ─────────────────────────────────────────────── */

.priv-dashed {
    font-family: inherit;
    font-size: var(--f-footnote);
    color: var(--ink-700);
    background: none;
    border: none;
    padding: 4px 2px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: var(--ink-400);
    transition: color .12s, text-decoration-color .12s;
}
.priv-dashed:hover {
    color: var(--brand-blue);
    text-decoration-color: var(--brand-blue);
}
.priv-dashed-static {
    cursor: default;
    color: var(--ink-500);
}
.priv-dashed-static:hover { color: var(--ink-500); text-decoration-color: var(--ink-400); }

/* ─── Bottom sheet (Apple slide-up) ───────────────────────────────────── */

.sheet-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0);
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: background .28s ease, opacity .28s ease, visibility 0s linear .28s;
}
.sheet-backdrop.is-open {
    background: rgba(0, 0, 0, .38);
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: background .28s ease, opacity .28s ease, visibility 0s linear 0s;
}
.sheet {
    position: fixed !important;
    left: 50% !important;
    bottom: 0 !important;
    top: auto !important;
    right: auto !important;
    width: min(560px, calc(100% - 24px));
    max-height: 88vh;
    transform: translate(-50%, 100%);
    background: var(--ink-0);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, .25);
    z-index: 100;
    transition: transform .32s cubic-bezier(.22, .8, .3, 1), visibility 0s linear .32s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}
.sheet.is-open {
    transform: translate(-50%, 0);
    visibility: visible;
    pointer-events: auto;
    transition: transform .32s cubic-bezier(.22, .8, .3, 1), visibility 0s linear 0s;
}

.sheet-handle {
    width: 40px; height: 5px;
    background: var(--ink-300);
    border-radius: 999px;
    margin: 10px auto 0;
    flex-shrink: 0;
}
.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
    flex-shrink: 0;
}
.sheet-head h3 {
    margin: 0;
    font-size: var(--f-title-3);
    font-weight: 600;
    letter-spacing: -.02em;
}
.sheet-close {
    background: var(--ink-100);
    border: none;
    color: var(--ink-700);
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .12s;
}
.sheet-close:hover { background: var(--ink-200); }

.sheet-body {
    padding: 6px 20px 12px;
    overflow-y: auto;
    flex: 1;
}
.sheet-foot {
    padding: 12px 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--ink-200);
    background: var(--ink-50);
    flex-shrink: 0;
}
@media (max-width: 700px) {
    .sheet { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .sheet-foot { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

/* ─── Radio-cards ──────────────────────────────────────────────────── */

.priv-radio-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.priv-radio {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ink-50);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.priv-radio:hover { background: var(--ink-100); }
.priv-radio input {
    accent-color: var(--brand-blue);
    margin-top: 3px;
    flex-shrink: 0;
}
.priv-radio:has(input:checked) {
    background: var(--brand-blue-lo);
    border-color: var(--brand-blue);
}
.priv-radio-body strong {
    display: block;
    font-size: var(--f-body);
    font-weight: 500;
    color: var(--ink-900);
}
.priv-radio-body span {
    display: block;
    font-size: var(--f-footnote);
    color: var(--ink-500);
    margin-top: 2px;
}

/* ─── User picker ─────────────────────────────────────────────────── */

.user-picker { border-top: 1px solid var(--ink-200); margin-top: 8px; padding-top: 12px; }
.user-picker-filter {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--f-body);
    border: 1px solid var(--ink-300);
    border-radius: var(--radius-md);
    background: var(--ink-0);
    margin-bottom: 10px;
    outline: none;
    transition: border-color .12s;
}
.user-picker-filter:focus { border-color: var(--brand-blue); }

.user-picker-list {
    max-height: 40vh;
    overflow-y: auto;
    margin: 0 -6px;
    padding: 0 6px;
}
.user-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background .1s;
    position: relative;
}
.user-picker-item:hover { background: var(--ink-100); }
.user-picker-item.is-selected {
    background: var(--brand-blue-lo);
}
.user-picker-item.is-selected .up-check { opacity: 1; color: var(--brand-blue); }
.up-check { opacity: 0; transition: opacity .12s; flex-shrink: 0; }

.up-ava {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 600; font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.up-ava-img { object-fit: cover; }
.up-info { flex: 1; min-width: 0; }
.up-name { font-size: var(--f-body); color: var(--ink-900); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-mail { font-size: var(--f-footnote); color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-picker-empty, .user-picker-loading { padding: 24px 12px; text-align: center; color: var(--ink-500); font-size: var(--f-footnote); }

/* ─── Not-found / access denied page ──────────────────────────────────── */

.nf-card {
    background: var(--ink-0);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 56px 40px;
    margin-top: 32px;
    text-align: center;
}
.nf-glyph {
    color: var(--ink-300);
    margin-bottom: 20px;
    display: inline-flex;
}
.nf-card h1 {
    font-size: var(--f-large);
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 8px;
}
.nf-card p {
    color: var(--ink-500);
    font-size: var(--f-callout);
    margin: 0 0 28px;
    max-width: 48ch;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Footer note ─────────────────────────────────────────────────────── */

.footer-note {
    margin-top: 48px;
    text-align: center;
    font-size: var(--f-caption);
    color: var(--ink-400);
}

/* ─── Sign-in page ────────────────────────────────────────────────────── */

body.signin-page { margin: 0; }

.signin-aurora {
    min-height: 100vh;
    background: #0a2540;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}
.signin-aurora::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2d1b4e 0%, #4a1d6b 50%, #1e3a5f 100%);
    z-index: 0;
}
.signin-aurora::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 50%, hsla(280, 70%, 30%, .6) 0%, transparent 70%);
    opacity: .5;
    z-index: 0;
    animation: auroraShift 8s ease-in-out infinite alternate;
}
.signin-content {
    position: relative;
    z-index: 1;
}

.signin-yandex {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: #fff;
    color: #000;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    transition: transform .12s, box-shadow .12s;
}
.signin-yandex:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.signin-yandex:active { transform: translateY(0); }

.signin-broken {
    color: rgba(255, 255, 255, .9);
    background: rgba(0, 0, 0, .3);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 700px) {
    h1 { font-size: 26px; }
    .doc-body { padding: 24px 20px 36px; }
    .doc-toolbar { padding: 12px 16px; flex-wrap: wrap; }
    .container { padding: 24px 16px 64px; }
}
