:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17243a;
    background: #e5edf7;
    --shell: #18263b;
    --shell-deep: #142136;
    --shell-muted: #a2b4c8;
    --workspace: #f3f7fc;
    --surface: #fff;
    --line: #d5e0ec;
    --muted: #647991;
    --primary: #4f8cff;
    --primary-dark: #3474e5;
    --danger: #cf3e4f;
    --warning: #d78a21;
    --success: #329265;
    --radius: 1rem;
    --shadow: 0 1px 2px rgb(24 38 59 / 5%), 0 14px 36px rgb(45 74 112 / 9%);
    --portal-content-max: 86rem;
    --portal-section-gap: 1.2rem;
}

* { box-sizing: border-box; }

html { min-width: 20rem; }

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 10%, rgb(67 135 244 / 13%), transparent 28rem),
        #eef1f5;
}

a { color: var(--primary-dark); }
p { line-height: 1.55; }
h1, h2, h3, h4 { overflow-wrap: anywhere; color: #171c24; }

.skip-link {
    position: fixed;
    top: .5rem;
    left: .5rem;
    z-index: 20;
    padding: .65rem .85rem;
    border-radius: .45rem;
    color: #fff;
    background: var(--primary-dark);
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.status-card {
    width: min(100%, 42rem);
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card { width: min(100%, 31rem); }
.auth-card::before {
    content: "";
    display: block;
    width: 3rem;
    height: .35rem;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
    background: var(--primary);
}
.auth-title { margin-bottom: .55rem; color: #263142; font-size: clamp(1.35rem, 4vw, 1.8rem); }
.unavailable-card { width: min(100%, 34rem); border-top: .35rem solid var(--warning); }
.unavailable-card .auth-title { color: #4a3a27; }
.name-fields { display: grid; gap: .55rem; margin: 0; padding: .9rem; border: 1px solid var(--line); border-radius: .6rem; background: #f7f9fc; }
.name-fields legend { padding: 0 .35rem; color: #2e527d; font-size: .86rem; font-weight: 800; }
.name-fields legend span { color: var(--danger); }
.name-fields p { margin: 0 0 .25rem; color: var(--muted); font-size: .78rem; }

.eyebrow {
    margin: 0 0 .6rem;
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 .8rem;
    font-size: clamp(1.75rem, 4vw, 2.55rem);
    line-height: 1.12;
    letter-spacing: -.025em;
}

/* Shared heading for authenticated modules. Keep contrast and mobile behavior here. */
.portal-module-hero {
    --module-hero-accent: #68e5ff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
    padding: clamp(1.2rem, 2.5vw, 1.75rem);
    border: 1px solid rgb(102 227 255 / 24%);
    border-radius: 1.4rem;
    color: #f4fbff;
    background:
        radial-gradient(circle at 88% 10%, rgb(44 214 255 / 17%), transparent 34%),
        linear-gradient(135deg, #112643, #111c32 72%);
    box-shadow: 0 1.35rem 3.75rem rgb(4 16 34 / 22%);
}
.portal-module-hero::after {
    content: "";
    position: absolute;
    right: -4rem;
    bottom: -7rem;
    width: 14rem;
    height: 14rem;
    border: 1px solid rgb(104 229 255 / 30%);
    border-radius: 50%;
    box-shadow: 0 0 0 1.5rem rgb(104 229 255 / 5%), 0 0 0 3rem rgb(104 229 255 / 3%);
    pointer-events: none;
}
.portal-module-hero > * { position: relative; z-index: 1; min-width: 0; }
.portal-module-hero h1 {
    max-width: 28ch;
    margin: .15rem 0 .45rem;
    color: #f4fbff;
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    text-shadow: 0 1px 1rem rgb(88 220 255 / 18%);
}
.portal-module-hero .portal-module-hero__eyebrow {
    margin: 0;
    color: var(--module-hero-accent) !important;
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.portal-module-hero .portal-module-hero__description {
    max-width: 52rem;
    margin: 0;
    color: #c6d9e8;
    line-height: 1.55;
}
.portal-module-hero__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}
.portal-module-hero__actions .secondary-link,
.portal-module-hero__actions .secondary-button,
.portal-module-hero .portal-module-hero__badge {
    border-color: rgb(255 255 255 / 28%);
    color: #f4fbff;
    background: rgb(255 255 255 / 9%);
}
.portal-module-hero__actions .secondary-link:hover,
.portal-module-hero__actions .secondary-link:focus-visible,
.portal-module-hero__actions .secondary-button:hover,
.portal-module-hero__actions .secondary-button:focus-visible {
    border-color: rgb(104 229 255 / 62%);
    color: #fff;
    background: rgb(104 229 255 / 15%);
}

label { font-size: .9rem; font-weight: 650; }

input, select, textarea {
    width: 100%;
    padding: .68rem .78rem;
    border: 1px solid #cbd1d9;
    border-radius: .5rem;
    color: inherit;
    background: #fff;
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}

textarea { min-height: 10rem; resize: vertical; line-height: 1.5; }
input[type="radio"], input[type="checkbox"] { width: auto; }

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(67 135 244 / 15%);
}

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
    outline: 3px solid rgb(67 135 244 / 45%);
    outline-offset: 2px;
}

button {
    width: fit-content;
    margin-top: .45rem;
    padding: .68rem 1rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 1px 2px rgb(30 80 160 / 18%);
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, filter .08s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

button:where(:not(:disabled)):hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgb(30 80 160 / 20%); }
button:where(:not(:disabled)):active { filter: brightness(.9); box-shadow: inset 0 2px 4px rgb(8 28 61 / 20%); }
button:disabled,
button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; filter: grayscale(.2); }
.secondary-button { border-color: #cbd8e6; color: #38404b; background: #edf2f7; box-shadow: 0 1px 2px rgb(33 53 78 / 8%); }
.secondary-button:where(:not(:disabled)):hover { border-color: #9eb9d9; color: #1f5fae; background: #e3edf8; box-shadow: 0 5px 14px rgb(42 82 130 / 12%); }
.danger-button,
button.is-danger { border-color: #c7354a; color: #fff; background: #c7354a; box-shadow: 0 1px 2px rgb(120 22 40 / 18%); }
.danger-button:where(:not(:disabled)):hover,
button.is-danger:where(:not(:disabled)):hover { border-color: #a92438; background: #a92438; box-shadow: 0 6px 16px rgb(145 28 48 / 20%); }

.auth-form { display: grid; gap: .65rem; margin-top: 1.5rem; }
.auth-form button { width: 100%; margin-top: .6rem; }
.password-requirements { display: grid; gap: .28rem; margin: -.15rem 0 .25rem; padding: 0; list-style: none; color: #8d2331; font-size: .82rem; }
.password-requirements li::before { content: "○"; display: inline-block; width: 1.2rem; font-weight: 800; }
.password-requirements li.is-met { color: #216747; }
.password-requirements li.is-met::before { content: "✓"; }
.password-visibility-field { position:relative; display:block; width:100%; }
.password-visibility-field > input { width:100%; padding-right:3rem; }
.password-visibility-toggle { position:absolute; top:50%; right:.35rem; display:grid; width:2.15rem!important; height:2.15rem; margin:0!important; padding:0; place-items:center; border:0; border-radius:.45rem; color:#566477; background:transparent; box-shadow:none; transform:translateY(-50%); }
.password-visibility-toggle:hover,.password-visibility-toggle:focus-visible { color:var(--primary-dark); background:#eaf0f8; }
.password-visibility-toggle svg { width:1.15rem; height:1.15rem; fill:currentColor; }
.registration-cleanup-notice { display:flex; align-items:flex-start; gap:.75rem; margin:1rem 0; padding:.85rem; border:1px solid #c6d8ef; border-radius:.65rem; color:#274c79; background:#f1f6fc; }
.registration-cleanup-notice svg { flex:0 0 auto; width:1.25rem; height:1.25rem; margin-top:.1rem; fill:currentColor; }
.registration-cleanup-notice div { display:grid; gap:.2rem; }
.registration-cleanup-notice strong { font-size:.88rem; }
.registration-cleanup-notice span { font-size:.78rem; line-height:1.45; }
.auth-remember{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:.25rem;cursor:pointer}.auth-remember input{position:absolute;width:1px;height:1px;opacity:0}.auth-remember i{position:relative;flex:0 0 auto;width:2.75rem;height:1.45rem;border-radius:999px;background:#a5adb8;transition:background .15s}.auth-remember i::after{content:"";position:absolute;top:.2rem;left:.2rem;width:1.05rem;height:1.05rem;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgb(0 0 0 / 28%);transition:transform .15s}.auth-remember input:checked+i{background:#2b9b59}.auth-remember input:checked+i::after{transform:translateX(1.3rem)}.auth-remember input:focus-visible+i{outline:3px solid rgb(47 116 220 / 25%);outline-offset:2px}
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin: 1.25rem 0 0; font-size: .9rem; }

.form-error, .form-success {
    padding: .75rem .9rem;
    border: 1px solid;
    border-radius: .55rem;
}
.form-error { border-color: #f2c4ca; color: #8d2331; background: #fff3f4; }
.form-success { border-color: #bfe2d1; color: #216747; background: #f0faf5; }
.portal-toast {
    position: fixed;
    top: calc(4.25rem + max(.8rem, env(safe-area-inset-top)));
    right: clamp(.8rem, 3vw, 2rem);
    z-index: 120;
    display: flex;
    align-items: center;
    gap: .65rem;
    width: min(24rem, calc(100vw - 1.6rem));
    margin: 0;
    padding: .85rem 1rem;
    border-color: #64bb89;
    border-radius: .85rem;
    color: #174f34;
    background: #f2fff7;
    box-shadow: 0 16px 42px rgb(17 75 47 / 24%);
    animation: portal-toast-in .2s ease-out both;
    transition: opacity .18s ease, transform .18s ease;
}
.portal-toast > span { display:grid;flex:0 0 auto;place-items:center;width:1.65rem;height:1.65rem;border-radius:50%;color:#fff;background:#29965a;font-weight:900; }
.portal-toast.is-leaving { opacity:0;transform:translateY(-.6rem); }
@keyframes portal-toast-in { from { opacity:0;transform:translateY(-.65rem); } }
@media (prefers-reduced-motion:reduce) { .portal-toast { animation:none;transition:none; } }
.account-email { color: var(--muted); }

/* Permanent application shell */
.portal-body { --portal-header-height:4.25rem; display:block; max-width:100%; overflow-x:hidden; overflow-x:clip; padding:0; background:var(--workspace); }
.portal-layout {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    grid-template-rows: 4.25rem minmax(0, 1fr) auto;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
}

.portal-header {
    grid-column: 1 / -1;
    grid-row: 1;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem 0 1.25rem;
    color: #fff;
    background: var(--shell-deep);
    border-bottom: 1px solid rgb(122 157 202 / 18%);
    box-shadow: 0 8px 28px rgb(6 17 33 / 16%);
    position: sticky;
    top: 0;
    height: var(--portal-header-height);
    min-height: var(--portal-header-height);
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}
.portal-brand img {
    display: block;
    width: 6.6rem;
    height: 2.35rem;
    object-fit: contain;
    object-position: left center;
}

.account-summary { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.account-summary > span {
    overflow: hidden;
    color: #e8ebef;
    font-size: .9rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-summary form { margin: 0; }
.problem-report-button {
    display: inline-flex;
    align-items: center;
    gap: .48rem;
    min-height: 2.45rem;
    margin: 0;
    padding: .48rem .78rem;
    border: 1px solid rgb(91 218 213 / 55%);
    border-radius: 999px;
    color: #f4ffff;
    background: linear-gradient(135deg, rgb(25 151 166 / 82%), rgb(63 109 210 / 82%));
    box-shadow: 0 8px 22px rgb(8 41 86 / 28%);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, filter .08s ease;
}
.problem-report-button > span { display:grid;place-items:center;width:1.2rem;height:1.2rem;border-radius:50%;color:#17344c;background:#b7fff8;font-weight:900; }
.problem-report-button b { font-size:.8rem;letter-spacing:.01em;white-space:nowrap; }
.problem-report-button__compact { display:none; }
.problem-report-button:hover,.problem-report-button:focus-visible { border-color:#c3fffa;transform:translateY(-1px);box-shadow:0 10px 25px rgb(8 41 86 / 38%); }
.problem-report-button:active { transform:translateY(0);filter:brightness(.9); }
.problem-report-dialog { width:min(42rem,calc(100vw - 2rem));max-height:calc(100vh - 2rem);padding:0;border:1px solid #bed4e6;border-radius:1.25rem;color:#233c51;background:#fff;box-shadow:0 28px 90px rgb(10 27 49 / 38%); }
.problem-report-dialog::backdrop { background:rgb(7 19 35 / 62%);backdrop-filter:blur(4px); }
.problem-report-form { display:grid;gap:.8rem;margin:0;padding:1.25rem; }
.problem-report-form>header { display:flex;align-items:flex-start;justify-content:space-between;gap:1rem; }
.problem-report-form>header p { margin:0 0 .15rem;color:#158b9b;font-size:.74rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase; }
.problem-report-form h2 { margin:0;color:#173653;font-size:1.45rem; }
.problem-report-form>p { margin:0;color:#5f778a; }
.problem-report-dialog__close { width:2.35rem;height:2.35rem;margin:0;padding:0;border:1px solid #d9e4ed;border-radius:50%;color:#5a7183;background:#f4f8fb;font-size:1.45rem;line-height:1;box-shadow:none; }
.problem-report-dialog__close:hover,.problem-report-dialog__close:focus-visible { color:#183b56;border-color:#9ccfd8;background:#eaf9f9; }
.problem-report-form textarea { width:100%;min-height:10rem;resize:vertical; }
.problem-report-dialog__page { overflow-wrap:anywhere;padding:.65rem .75rem;border:1px solid #dce8f0;border-radius:.7rem;background:#f7fafc;font-size:.78rem; }
.problem-report-dialog__status { min-height:1.35rem;color:#5f778a;font-weight:700; }
.problem-report-dialog__status.is-success { color:#217050; }
.problem-report-dialog__status.is-error { color:#9b2636; }
.problem-report-dialog__actions { display:flex;justify-content:flex-end;gap:.65rem; }
.problem-report-table td { min-width:9rem;vertical-align:top; }
.problem-report-table td:nth-child(3),.problem-report-table td:nth-child(4) { min-width:17rem; }
.problem-report-table td>small,.problem-report-table td>code { display:block;margin-top:.35rem;overflow-wrap:anywhere;white-space:normal; }
.problem-report-message { max-width:38rem;margin:0;white-space:normal;overflow-wrap:anywhere; }
.problem-report-page-context { margin-top:.55rem; }
.problem-report-page-context summary { color:#287184;cursor:pointer;font-size:.78rem;font-weight:800; }
.problem-report-page-context small { display:block;margin-top:.35rem;max-width:28rem;overflow-wrap:anywhere; }
.problem-report-status { display:inline-flex;padding:.3rem .55rem;border-radius:999px;color:#41586b;background:#edf2f6;font-size:.76rem;font-weight:850; }
.problem-report-status.is-considering { color:#7c5a15;background:#fff3cf; }
.problem-report-status.is-planned { color:#22684b;background:#dbf5e8; }
.problem-report-actions { display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.65rem; }
.problem-report-actions form { margin:0; }
.text-button {
    margin: 0;
    padding: .48rem .72rem;
    border: 1px solid rgb(162 180 200 / 32%);
    border-radius: 999px;
    color: #f2f7fc;
    background: rgb(255 255 255 / 8%);
    box-shadow: none;
}
.text-button:hover { border-color: rgb(79 140 255 / 65%); background: rgb(79 140 255 / 18%); }

.portal-navigation {
    grid-column: 1;
    grid-row: 2 / 4;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    height: calc(100vh - var(--portal-header-height));
    padding: 1.2rem .75rem 1rem;
    background: var(--shell);
    position: sticky;
    top: var(--portal-header-height);
    align-self: start;
    overflow: hidden;
}
.portal-navigation-primary,
.portal-navigation-utility {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 0;
}
.portal-navigation-primary { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.portal-navigation-primary::before {
    content: "Рабочее пространство";
    display: block;
    padding: .25rem .7rem .7rem;
    color: #7188a4;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.portal-navigation-utility {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid rgb(162 180 200 / 18%);
}
.portal-navigation a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    padding: .52rem .7rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    color: var(--shell-muted);
    font-size: .79rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: color .16s, background-color .16s, border-color .16s;
}
.nav-icon {
    display: block;
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    overflow: visible;
}
.portal-navigation a:hover { color: #fff; border-color: rgb(79 140 255 / 16%); background: rgb(255 255 255 / 7%); }
.portal-navigation a[aria-current="page"] { color: #fff; border-color: rgb(79 140 255 / 24%); background: linear-gradient(100deg, rgb(79 140 255 / 25%), rgb(57 217 208 / 9%)); box-shadow: inset 3px 0 #39d9d0, 0 8px 22px rgb(2 12 28 / 14%); }
.portal-navigation a[aria-current="page"] .nav-icon { color: #39d9d0; }

.portal-main {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: clamp(1.25rem, 3vw, 2rem);
    background:
        radial-gradient(circle at 88% 3%, rgb(79 140 255 / 11%), transparent 27rem),
        radial-gradient(circle at 18% 92%, rgb(57 217 208 / 7%), transparent 25rem),
        var(--workspace);
}
.portal-page {
    display: grid;
    align-content: start;
    gap: var(--portal-section-gap);
    width: min(100%, var(--portal-content-max));
    min-width: 0;
    margin-inline: auto;
}
.portal-page > * { min-width: 0; max-width: 100%; }
.portal-module-page { display: grid; align-content: start; gap: var(--portal-section-gap); min-width: 0; }
.portal-module-content { min-width: 0; }
.portal-page .comments-page { width:100%; min-width:0; max-width:none; margin:0; gap:var(--portal-section-gap); }
.portal-footer {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    max-width: 100%;
    padding: 1rem clamp(1.25rem, 3vw, 2rem);
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: rgb(255 255 255 / 92%);
    font-size: .82rem;
    line-height: 1.55;
    text-align: center;
}
.portal-footer span { display: block; }
.portal-footer span + span { margin-top: .25rem; }
.portal-subnav,
.portal-toolbar {
    width: 100%;
    min-width: 0;
    padding: .55rem;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: rgb(255 255 255 / 90%);
    box-shadow: 0 2px 8px rgb(25 32 45 / 6%);
}
.portal-subnav {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
    scrollbar-width: thin;
}
.portal-subnav[data-horizontal-scroll="true"] { cursor: grab; }
.portal-subnav[data-horizontal-dragging="true"] {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}
.portal-subnav a,
.portal-subnav button {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: .55rem .8rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    color: #4d5663;
    background: #eef3f8;
    box-shadow: none;
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
}
.portal-subnav a:hover,
.portal-subnav a[aria-current="page"],
.portal-subnav button:hover,
.portal-subnav button:focus-visible,
.portal-subnav button[aria-selected="true"] { color: #fff; border-color: var(--primary); background: var(--primary); }
.portal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.portal-toolbar > form { margin: 0; }
.portal-toolbar .secondary-link,
.portal-toolbar button { margin: 0; }
.knowledge-category-tabs {
    flex-wrap: nowrap;
    margin: 1rem 0;
}
.knowledge-category-badge { display: inline-flex; margin-top: .55rem; padding: .25rem .5rem; border-radius: 999px; color: #3d5573; background: #edf3fb; font-size: .72rem; font-weight: 750; }
.knowledge-preview { color: #586170; }
.knowledge-article-full .knowledge-body { max-width: 70rem; line-height: 1.7; }
.knowledge-portal-navigation { display:grid;gap:1rem;margin:1rem 0 1.5rem;padding:1.1rem;border:1px solid #d5e3ef;border-radius:1rem;background:linear-gradient(145deg,#f9fcff,#eef8f8); }
.knowledge-portal-navigation__heading { display:flex;align-items:flex-end;justify-content:space-between;gap:1rem; }
.knowledge-portal-navigation__heading p { margin:0;color:#16879a;font-size:.72rem;font-weight:850;letter-spacing:.09em;text-transform:uppercase; }
.knowledge-portal-navigation__heading h2 { margin:.18rem 0 0; }
.knowledge-portal-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.65rem; }
.knowledge-portal-grid a { display:flex;align-items:center;gap:.7rem;min-height:3.45rem;padding:.75rem .85rem;border:1px solid #d8e5ef;border-radius:.75rem;color:#264661;background:#fff;font-weight:750;text-decoration:none;box-shadow:0 4px 14px rgb(23 62 91 / 5%);transition:transform .16s,border-color .16s,box-shadow .16s; }
.knowledge-portal-grid a:hover,.knowledge-portal-grid a:focus-visible { transform:translateY(-2px);border-color:#50bfc7;box-shadow:0 9px 22px rgb(23 62 91 / 12%); }
.knowledge-portal-grid a[aria-current="page"] { color:#fff;border-color:#247d91;background:linear-gradient(135deg,#247d91,#376bc5); }
.knowledge-portal-grid svg { display:block;flex:0 0 auto;width:1.25rem;height:1.25rem;fill:currentColor;overflow:visible; }
.knowledge-topic-illustration { display:grid;gap:.65rem;margin:1rem 0 1.5rem;padding:.65rem;border:1px solid #d5e3ef;border-radius:1rem;background:#f7fbfd;overflow:hidden; }
.knowledge-topic-illustration img { display:block;width:100%;height:auto;border-radius:.7rem;object-fit:cover; }
.knowledge-topic-illustration figcaption { padding:0 .35rem .25rem;color:#52687b;font-size:.85rem;line-height:1.5; }
.knowledge-article-full { padding:clamp(1.1rem,3vw,2rem); }
.knowledge-article-full .editor-content { color:#26394b;font-size:1rem;line-height:1.8; }
.knowledge-article-full .editor-content h2,.knowledge-article-full .editor-content h3 { max-width:42ch;color:#173653;line-height:1.25; }
.knowledge-article-full .editor-content p,.knowledge-article-full .editor-content ul,.knowledge-article-full .editor-content ol,.knowledge-article-full .editor-content blockquote { max-width:72ch; }
.knowledge-article-full .editor-content blockquote { margin:1.25rem 0;padding:1rem 1.15rem;border-left:.28rem solid #2cb2b0;border-radius:.55rem;background:#eefafa; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(-n+3) { margin:1rem 0 1.5rem;border:2px solid;border-radius:.8rem;box-shadow:0 5px 16px rgb(28 62 91 / 7%); }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(-n+3) table { margin:0; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(-n+3) td { background:transparent; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(1) { border-color:#62b982;background:#effaf3; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(1) th { color:#174b2d;background:#d9f2e2; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(2) { border-color:#72aee8;background:#f0f7fe; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(2) th { color:#174a78;background:#dceefe; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(3) { border-color:#e2b65e;background:#fff9ea; }
[data-knowledge-article="kontur-mchd-authorities"] .editor-table-wrap:nth-of-type(3) th { color:#74500f;background:#ffedbe; }
.portal-footer span { display: block; max-width: var(--portal-content-max); margin: 0 auto; }

.welcome-panel, .content-panel { width:100%; min-width:0; max-width:none; }
.welcome-panel { padding: .75rem 0 1.5rem; }
.welcome-panel h1 { color: #17243a; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.welcome-panel h1, .content-panel h1 { max-width: 28ch; }
.welcome-panel > p:last-child, .content-panel > p { color: var(--muted); }
.portal-main h2 { margin: 2rem 0 1rem; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.guest-review-notice {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    max-width: none;
    width: 100%;
    min-width: 0;
    margin: 0 0 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid #74c993;
    border-left-width: .28rem;
    border-radius: .55rem;
    color: #174b2d;
    background: #effbf3;
    box-shadow: 0 2px 8px rgb(28 111 60 / 8%);
}
.guest-review-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: #fff;
    background: #2b9b59;
    font-weight: 800;
}
.guest-review-notice h1 { margin: 0 0 .25rem; font-size: 1rem; }
.guest-review-notice p { margin: 0; color: #386448; font-size: .88rem; }

.content-panel, .dashboard-deadlines {
    padding: clamp(1.15rem, 2vw, 1.65rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgb(255 255 255 / 96%);
    box-shadow: var(--shadow);
}
.dashboard-chat, .dashboard-news, .dashboard-deadlines { position: relative; overflow: hidden; }
.dashboard-chat::before, .dashboard-news::before, .dashboard-deadlines::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 11rem;
    height: 11rem;
    border-radius: 50%;
    background: rgb(79 140 255 / 5%);
    transform: translate(35%, -55%);
    pointer-events: none;
}
.content-panel h2:first-child { margin-top: 0; }

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .85rem;
}
.portal-card {
    position: relative;
    display: grid;
    gap: .55rem;
    min-height: 9rem;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: inherit;
    background: #fff;
    box-shadow: 0 1px 2px rgb(25 32 45 / 4%);
    text-decoration: none;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.portal-card::after { content: "→"; position: absolute; right: 1rem; bottom: .8rem; color: #a7afba; }
.portal-card:hover, .portal-card:focus-visible { transform: translateY(-2px); border-color: #8fb5eb; box-shadow: var(--shadow); }
.portal-card:active { transform: translateY(0); box-shadow: inset 0 2px 5px rgb(33 53 78 / 12%); }
.portal-card strong { color: #202631; font-size: 1.05rem; }
.portal-card span { color: var(--muted); font-size: .9rem; line-height: 1.5; }

.dashboard-deadlines { width:100%; min-width:0; max-width:none; margin-top:1.5rem; border-top:.2rem solid #ffb14a; }
.dashboard-chat { border-top: .2rem solid #39d9d0; }
.dashboard-news { border-top: .2rem solid var(--primary); }
.dashboard-news { margin-bottom: 1.5rem; }
.dashboard-news .dashboard-section-heading h2 { margin-top: .25rem; }
.dashboard-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.dashboard-section-heading h2, .dashboard-deadlines h3 { margin: .25rem 0 0; }
.deadline-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: .75rem;
    margin-top: 1rem;
}
.deadline-summary-card {
    display: grid;
    gap: .2rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-top: .22rem solid #798391;
    border-radius: .55rem;
    color: inherit;
    background: #f7faff;
    text-decoration: none;
}
.deadline-summary-card strong { font-size: 1.6rem; }
.deadline-summary-card span { color: #38404b; font-size: .9rem; }
.deadline-summary-card small { color: var(--muted); }
.deadline-summary-expired { border-top-color: var(--danger); }
.deadline-summary-due { border-top-color: var(--warning); }
.deadline-summary-valid { border-top-color: var(--success); }
.deadline-summary-reminders { border-top-color: var(--primary); }
.dashboard-deadlines h3 { margin-top: 1.5rem; font-size: 1.05rem; }
.dashboard-deadline-list { display: grid; gap: .55rem; padding: 0; list-style: none; }
.dashboard-deadline-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    border-left: .25rem solid #798391;
    border-radius: .45rem;
    background: #f7faff;
}
.dashboard-deadline-list div { display: grid; gap: .15rem; }
.dashboard-deadline-list span, .dashboard-deadline-list time { color: var(--muted); font-size: .82rem; }

.empty-state {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px dashed #cbd1d9;
    border-radius: .55rem;
    color: var(--muted);
    background: #f8fafc;
}

.news-feed, .knowledge-list { display: grid; gap: 1rem; margin-top: 1.5rem; }
.news-feed { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); align-items: start; }
.news-article, .knowledge-article { min-width:0; padding:1.1rem; border:1px solid var(--line); border-radius:.75rem; background:#f7faff; }
.news-article-full { max-width: 58rem; margin-inline: auto; }
.news-article h2 a { color: inherit; text-decoration: none; }
.news-article h2 a:hover { color: var(--primary); }
.news-read-more { display: inline-flex; margin-top: .8rem; }
.employee-status-panel{margin:1.4rem 0;padding:1.15rem;border:1px solid var(--line);border-radius:.8rem;background:#f7faff}.employee-status-panel>.profile-heading{display:flex;align-items:start;justify-content:space-between;gap:1rem}.employee-status-panel>.profile-heading strong{padding:.4rem .7rem;border-radius:999px;color:#214f82;background:#e3f0ff}.employee-status-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:.8rem;margin-top:1rem}.employee-status-card{display:grid;grid-template-columns:5.5rem 1fr;gap:.75rem;align-items:center;padding:.7rem;border:2px solid transparent;border-radius:.75rem;background:#fff;cursor:pointer}.employee-status-card:has(input:checked),.employee-status-card.is-selected{border-color:var(--primary);box-shadow:0 0 0 3px rgb(67 135 244 / 12%)}.employee-status-card input{position:absolute;opacity:0}.employee-status-card img{width:5.5rem;height:3.5rem;object-fit:cover;border-radius:.5rem}.employee-status-card span{display:grid;gap:.3rem}.employee-status-card small{color:var(--muted);line-height:1.35}.employee-status-grid>button{align-self:end}.chat-auto-reply{padding:.15rem .4rem;border-radius:999px;color:#5b3d8a;background:#eee7fb;font-size:.68rem;font-weight:700}
.news-article time, .knowledge-article time { color: var(--muted); font-size: .82rem; }
.news-article h2, .knowledge-article h2 { margin: .35rem 0 .6rem; color: #202631; font-size: 1.3rem; }
.news-summary { color: #38404b; font-weight: 650; }
.news-body, .knowledge-body { overflow-wrap: anywhere; line-height: 1.65; }
.news-pagination, .knowledge-pagination, .contacts-pagination { margin-top: 1.5rem; }
.knowledge-authoring { margin-top: 1.5rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: .6rem; background: #f8fafc; }
.knowledge-authoring h2 { margin: 0 0 1rem; }
.knowledge-form { display: grid; gap: .7rem; }
.article-editor{min-height:18rem;padding:.75rem;border:1px solid var(--line);border-radius:.6rem;background:#fff}.article-editor:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgb(67 135 244 / 12%)}.article-editor .codex-editor__redactor{padding-bottom:5rem!important}.article-editor .ce-block__content,.article-editor .ce-toolbar__content{max-width:52rem}.editor-content{min-width:0;max-width:100%;line-height:1.65}.editor-content p{margin:.65rem 0}.editor-content h2,.editor-content h3,.editor-content h4{margin:1.1rem 0 .55rem}.editor-content blockquote{margin:1rem 0;padding:.7rem 1rem;border-left:4px solid var(--primary);background:#f4f7fb}.editor-content blockquote p{margin:0}.editor-content cite{display:block;margin-top:.4rem;color:var(--muted)}.editor-content pre{max-width:100%;overflow:auto;padding:.85rem;border-radius:.5rem;color:#e8edf5;background:#172033}.editor-content pre code{padding:0;background:transparent}.editor-content ul,.editor-content ol{padding-left:1.5rem}.editor-content hr{margin:1.25rem 0;border:0;border-top:1px solid var(--line)}.editor-table-wrap{width:100%;min-width:0;max-width:100%;overflow-x:auto}.editor-content table{width:100%;border-collapse:collapse}.editor-content th,.editor-content td{padding:.55rem .65rem;border:1px solid var(--line);text-align:left;vertical-align:top}.editor-content th{background:#edf3fc}
.article-editor .ce-block__content,
.article-editor .ce-toolbar__content {
    width: 100%;
    max-width: 52rem;
    padding-inline: 2.75rem .5rem;
}
.article-editor .ce-toolbar__actions {
    right: auto;
    left: .35rem;
    padding-right: 0;
}
.article-editor .ce-toolbar__plus,
.article-editor .ce-toolbar__settings-btn { color: #35516e; background: #eef5fb; }
.knowledge-publish-form, .knowledge-action-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.knowledge-action-form p { margin: 0; color: var(--muted); font-size: .85rem; }

/* Messenger */
.chat-total-unread {
    display:inline-grid;
    flex:0 0 auto;
    min-width:1.35rem;
    height:1.35rem;
    padding:0 .28rem;
    place-items:center;
    border:1px solid rgb(255 255 255 / 18%);
    border-radius:999px;
    color:#b8c5d4;
    background:rgb(255 255 255 / 8%);
    font-size:.65rem;
    font-weight:850;
    line-height:1;
}
.chat-total-unread.has-unread {
    border-color:#ffbdc6;
    color:#fff;
    background:#d43d51;
    box-shadow:0 0 0 .18rem rgb(212 61 81 / 18%);
    animation:chat-unread-blink 1.1s ease-in-out infinite;
}
@keyframes chat-unread-blink { 50% { opacity:.38; transform:scale(.92); } }

.profile-avatar-panel { display:grid; min-width:0; max-width:100%; grid-template-columns:8rem minmax(0,1fr); gap:1.25rem; margin:1rem 0; padding:1rem; border:1px solid var(--line); border-radius:.65rem; background:#f8fafc; }.profile-avatar-panel>div{min-width:0}.profile-avatar{width:8rem;height:8rem;border-radius:50%;object-fit:cover}.profile-avatar-panel h2{margin:0 0 .35rem;font-size:1rem}.profile-avatar-panel p{margin:.2rem 0 .8rem;color:var(--muted);font-size:.8rem}.profile-avatar-panel form{display:flex;min-width:0;align-items:end;gap:.6rem}.profile-avatar-panel form label{min-width:0;flex:1}

@media (max-width: 760px) {
    .profile-avatar-panel{grid-template-columns:1fr}
    .profile-avatar{margin:auto}
    .profile-avatar-panel form{display:grid}
}

.contact-list, .admin-list, .deadline-list, .deadline-run-list, .deadline-type-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: .8rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}
.contact-card, .admin-card, .deadline-card, .deadline-run-card, .deadline-type-form {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: #fafbfc;
}
.contact-card { display: grid; gap: .35rem; }
.contact-card strong, .contact-card a, .admin-card p, .admin-card code { overflow-wrap: anywhere; }
.employee-meta { display: block; color: var(--muted); font-size: .8rem; }
.employee-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0; }
.employee-badge { display: inline-flex; padding: .22rem .48rem; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.employee-badge.is-manager { color: #176c3a; background: #e5f7ec; }
.employee-badge.is-administrator { color: #9d2636; background: #ffe9ec; }
.admin-card h3 { margin: 0 0 .45rem; }
.admin-cleanup-card { margin-top:1.25rem; border-color:#c8d8ec; background:#f7faff; }
.admin-cleanup-card > p { max-width:52rem; color:var(--muted); font-size:.84rem; line-height:1.5; }

.admin-main, .deadline-main { display: grid; gap: 1rem; }
.deadline-filter, .deadline-inline-form, .deadline-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    align-items: end;
    gap: .75rem;
}
.deadline-filter label, .deadline-inline-form label, .deadline-form label { display: grid; gap: .3rem; }
.deadline-form textarea, .deadline-form fieldset, .deadline-form label:has(textarea), .deadline-form label:has(select[multiple]) { grid-column: 1 / -1; }
.deadline-form fieldset { display: flex; flex-wrap: wrap; gap: .8rem; border: 1px solid var(--line); border-radius: .5rem; }
.deadline-form fieldset label { display: flex; align-items: center; gap: .4rem; }
.deadline-form small, .deadline-delivery-list span { color: var(--muted); font-weight: 400; }
.deadline-type-form, .deadline-actions, .deadline-renew-form, .admin-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .65rem;
}
.deadline-type-form { margin: 0; }
.deadline-type-form label, .deadline-renew-form label, .admin-inline-form label { display: grid; gap: .3rem; }
.deadline-type-form label:first-of-type { flex: 1 1 14rem; }
.deadline-checkbox { display: flex !important; align-items: center; }
.deadline-actions form, .deadline-actions button { margin: 0; }
.deadline-renew-form { flex-basis: 100%; }
.deadline-group { margin-top: 1.5rem; }
.deadline-group h3 { color: #333b47; font-size: 1.1rem; }
.deadline-card { border-left: .25rem solid #798391; }
.deadline-status-expired { border-left-color: var(--danger); }
.deadline-status-due_soon { border-left-color: var(--warning); }
.deadline-status-valid { border-left-color: var(--success); }
.deadline-run-card form, .deadline-notification-card form { margin-top: .8rem; }
.deadline-delivery-list { padding-left: 1.25rem; }
.deadline-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.deadline-card-heading h4 { margin: 0; font-size: 1.05rem; }
.deadline-card-heading span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.deadline-main .portal-page{gap:.75rem}.deadline-heading{align-items:center}.deadline-summary-compact{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.45rem}.deadline-summary-compact span{display:grid;min-width:6.4rem;padding:.5rem .65rem;border:1px solid #dbe5ef;border-radius:.65rem;background:#fff;text-align:center;font-size:.7rem}.deadline-summary-compact b{font-size:1.2rem}.deadline-summary-compact .is-danger b{color:var(--danger)}.deadline-summary-compact .is-warning b{color:#bd6a00}.deadline-summary-compact .is-success b{color:var(--success)}.deadline-section{padding:1rem}.deadline-section>h2{margin-top:0}.deadline-section-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem}.deadline-section-heading h2{margin:0}.deadline-explanation{margin:.2rem 0 .75rem;color:var(--muted);font-size:.82rem}.deadline-history{margin-top:.8rem;border-top:1px solid var(--line);padding-top:.7rem}.deadline-history>summary{color:var(--primary-dark);font-weight:800;cursor:pointer}.deadline-run-list,.deadline-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr));gap:.65rem}.deadline-card,.deadline-run-card{padding:.75rem}.deadline-card p,.deadline-run-card p{margin:.35rem 0;font-size:.8rem}.deadline-group{margin-top:.85rem}.deadline-group h3{margin:.2rem 0 .5rem}.deadline-actions{gap:.4rem}.deadline-actions .danger-button{background:var(--danger);color:#fff}.deadline-renew-form{flex-basis:auto}.deadline-form{gap:.65rem}.deadline-types{order:20}
.deadline-auto-note{padding:.65rem .75rem;border:1px solid #bcded2;border-radius:.7rem;color:#245d4a;background:#eefaf5;font-size:.82rem}

.deadline-notification-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.deadline-notification-tools form, .deadline-notification-card form { margin-bottom: 0; }
.deadline-notification-list { display: grid; gap: .75rem; max-width: none; }
.deadline-notification-card { border-left: .25rem solid #8b96a5; }
.deadline-notification-card.is-unread { border-left-color: var(--primary); background: #f7faff; }
.deadline-notification-card h2 { margin: .2rem 0 0; }
.assistant-center-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.55rem;margin-top:.8rem}.assistant-object-link{display:inline-flex;align-items:center;gap:.45rem;min-height:2.35rem;padding:.48rem .7rem;border:1px solid #80bad3;border-radius:.65rem;color:#185f85;background:linear-gradient(135deg,#f5fdff,#e7f5fb);font-size:.75rem;font-weight:800;text-decoration:none}.assistant-object-link:hover,.assistant-object-link:focus-visible{border-color:#3b94bc;background:#eaf8fd;box-shadow:0 0 0 .18rem rgb(42 141 183/10%)}.assistant-object-link svg{width:1rem;height:1rem;fill:currentColor}.assistant-object-link b{font-size:1rem}

.admin-inline-form { margin: 1rem 0; }
.admin-main { grid-template-columns: minmax(0, 1fr); align-content: start; }
.admin-section { border-radius: .35rem; box-shadow: 0 2px 8px rgb(25 32 45 / 5%); }
.admin-section[hidden] { display: none; }
.admin-trash-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; margin-top: 1rem; }
.admin-trash-actions form { margin: 0; }
.admin-trash-actions button { width: auto; }
.admin-section > h2 {
    margin: calc(clamp(1.15rem, 2vw, 1.65rem) * -1) calc(clamp(1.15rem, 2vw, 1.65rem) * -1) 1rem;
    padding: .85rem clamp(1.15rem, 2vw, 1.65rem);
    border-bottom: 1px solid var(--line);
    color: #343b45;
    background: #f3f5f7;
    font-size: 1rem;
}
.profile-details { display: grid; gap: 0; max-width: 42rem; margin: 1.25rem 0; }
.profile-details div { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.profile-details dt { color: var(--muted); font-size: .82rem; font-weight: 700; }
.profile-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.profile-mobile-apps{margin:1.5rem 0;padding:1.2rem;border:1px solid #bfdbfe;border-radius:1rem;background:linear-gradient(145deg,#f8fbff,#eef6ff)}
.profile-mobile-apps>.profile-heading strong{padding:.42rem .7rem;border-radius:999px;color:#1d4ed8;background:#dbeafe;font-size:.76rem}
.profile-mobile-apps__lead{max-width:54rem;margin:.45rem 0 1rem;color:var(--muted);line-height:1.55}
.profile-mobile-apps__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem}
.profile-mobile-app-card{display:grid;grid-template-columns:4.5rem minmax(0,1fr) auto;align-items:center;gap:.85rem;min-width:0;padding:.9rem;border:1px solid #d9e6f4;border-radius:.9rem;background:#fff;box-shadow:0 8px 24px rgb(31 65 114 / 7%)}
.profile-mobile-app-card img{width:4.5rem;height:4.5rem;border-radius:1.05rem;box-shadow:0 7px 15px rgb(15 23 42 / 14%)}
.profile-mobile-app-card h3{margin:0 0 .22rem;font-size:1rem}.profile-mobile-app-card p{margin:0;color:var(--muted);font-size:.79rem;line-height:1.4}
.profile-mobile-download{display:inline-flex;align-items:center;justify-content:center;min-height:2.5rem;padding:.58rem .8rem;border-radius:.7rem;background:#1769e0;color:#fff;font-size:.78rem;font-weight:800;text-decoration:none;white-space:nowrap}
.profile-mobile-download:hover{background:#0f56bd}.profile-mobile-download.is-disabled{background:#e7edf5;color:#708096;cursor:not-allowed}
.profile-mobile-apps>small{display:block;margin-top:.8rem;color:#64748b}
.profile-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.presence-status { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.presence-status::before { content: ""; width: .48rem; height: .48rem; border-radius: 50%; background: currentColor; }
.presence-status.is-online { color: #18753d; background: #eaf8ef; }
.presence-status.is-offline { color: #6f7782; background: #eef0f3; }
.profile-action-grid { display:grid; min-width:0; max-width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin-top:1.25rem; }
.profile-action-grid>* { min-width:0; }
.profile-card { padding: 1rem; border: 1px solid var(--line); border-radius: .55rem; background: #f8f9fb; }
.profile-card h2, .profile-about h2, .notification-settings h2 { margin: 0 0 .45rem; font-size: 1.05rem; }
.profile-card p { margin: 0 0 .8rem; color: var(--muted); font-size: .84rem; }
.profile-card form, .profile-about form { display: grid; gap: .65rem; margin-top: .75rem; }
.profile-card label { display: grid; gap: .28rem; font-size: .8rem; font-weight: 700; }
.profile-card button, .profile-about button { justify-self: start; }
.messenger-card { opacity: .82; }
.telegram-card { opacity:1; border-color:#b9d7fb; background:linear-gradient(145deg,#f8fbff,#eef6ff); }
.telegram-card.is-connected { border-color:#a9dfbd; background:linear-gradient(145deg,#f8fffa,#edf9f1); }
.telegram-connection-status strong { color:#18753d; }
.telegram-check-message { margin-bottom:.8rem!important; padding:.65rem .75rem; border-radius:.5rem; font-weight:750; }
.telegram-check-message.is-success { color:#176b38; background:#dcf5e5; }
.telegram-check-message.is-pending { color:#805d18; background:#fff2cf; }
.telegram-check-message.is-error { color:#9d2336; background:#ffe7eb; }
.telegram-connect-steps { display:grid; gap:.52rem; margin:.8rem 0; padding-left:1.35rem; color:#39485a; font-size:.84rem; line-height:1.45; }
.telegram-card-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.65rem; margin-top:.8rem; }
.telegram-card-actions form { display:block; margin:0; }
.telegram-card-actions .secondary-link, .telegram-card-actions button { margin:0; }
.telegram-privacy-note { margin-top:.85rem!important; padding-top:.7rem; border-top:1px solid #d5e5f6; }
.telegram-connect-body { min-width:20rem; min-height:100vh; padding:1rem; }
.telegram-connect-page { display:grid; place-items:center; width:100%; }
.telegram-connect-panel { width:min(100%,34rem); padding:clamp(1.25rem,5vw,2.2rem); border:1px solid #b9d7fb; border-radius:1rem; background:#fff; box-shadow:var(--shadow); }
.telegram-connect-panel p { color:var(--muted); }
.telegram-connect-panel .secondary-link { display:inline-flex; margin-top:.45rem; }
.telegram-connect-hint { margin:.9rem 0 0; font-size:.82rem; }
.profile-live-result { margin:.75rem 0 0; padding:.65rem .75rem; border-radius:.5rem; font-weight:750; }
.profile-live-result.is-success { color:#176b38; background:#dcf5e5; }
.profile-live-result.is-error { color:#9d2336; background:#ffe7eb; }
.feature-soon { display: inline-block; padding: .35rem .55rem; border-radius: .35rem; color: #66707d; background: #e9ecf0; font-size: .76rem; font-weight: 750; }
.profile-about { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.notification-settings { min-width:0; max-width:100%; margin-top:1rem; }
.notification-settings form { min-width:0; max-width:100%; }
.notification-channel-guide { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.75rem; margin:1rem 0; }
.notification-channel-guide article { display:flex; flex-direction:column; gap:.25rem; min-width:0; padding:.85rem; border:1px solid var(--line); border-radius:.65rem; background:#f7f9fc; }
.notification-channel-guide strong { color:#263244; font-size:.9rem; }
.notification-channel-guide span, .notification-channel-guide small { color:#667383; font-size:.78rem; line-height:1.4; }
.notification-channel-guide small.is-success { color:#176b38; }
.notification-channel-guide small.is-error { color:#9d2336; }
.notification-actions { display:flex; flex-wrap:wrap; gap:.65rem; align-items:center; }
.notification-matrix { width:100%; min-width:0; max-width:100%; overflow-x:auto; margin:1rem 0; border:1px solid var(--line); border-radius:.5rem; }
.notification-matrix table { width: 100%; min-width: 48rem; border-collapse: collapse; }
.notification-matrix th, .notification-matrix td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: center; }
.notification-matrix th:first-child { position: sticky; left: 0; z-index: 1; min-width: 11rem; text-align: left; background: #f6f7f9; }
.notification-matrix thead th { color: #5e6875; background: #f0f2f5; font-size: .75rem; }
.notification-master-row { background: #f1f7ff; }
.matrix-toggle { display: inline-flex; cursor: pointer; }
.matrix-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.matrix-toggle span { position: relative; width: 2.3rem; height: 1.25rem; border-radius: 999px; background: #a5adb8; }
.matrix-toggle span::after { content: ""; position: absolute; top: .17rem; left: .17rem; width: .91rem; height: .91rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .15s ease; }
.matrix-toggle input:checked + span { background: #2b9b59; }
.matrix-toggle input:checked + span::after { transform: translateX(1.05rem); }
.matrix-toggle input:disabled + span { opacity: .38; cursor: not-allowed; }
.matrix-toggle input:focus-visible + span { outline: 3px solid rgb(47 116 220 / 25%); outline-offset: 2px; }
.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; }
.admin-settings-form { display: grid; gap: .7rem; max-width: 52rem; }
.admin-settings-form > label { font-size: .84rem; font-weight: 750; }
.admin-settings-form > small { margin-top: -.35rem; color: var(--muted); }
.admin-settings-form > button { justify-self: start; margin-top: .4rem; }
.admin-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin: .35rem 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .4rem;
    background: #f7f8fa;
}
.admin-setting-row > div { display: grid; gap: .25rem; }
.admin-setting-row span { color: var(--muted); font-size: .8rem; }
.toggle-switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; }
.toggle-switch input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.toggle-switch > span {
    position: relative;
    width: 2.8rem;
    height: 1.45rem;
    border-radius: 999px;
    background: #9ca5b1;
    transition: background .18s ease;
}
.toggle-switch > span::after {
    content: "";
    position: absolute;
    top: .2rem;
    left: .2rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 28%);
    transition: transform .18s ease;
}
.toggle-switch input:checked + span { background: #2b9b59; }
.toggle-switch input:checked + span::after { transform: translateX(1.35rem); }
.toggle-switch input:focus-visible + span { outline: 3px solid rgb(47 116 220 / 25%); outline-offset: 2px; }
.toggle-switch b { min-width: 5rem; font-size: .78rem; }
.toggle-switch.is-disabled { cursor: not-allowed; opacity: .55; }
.admin-login-methods { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.admin-login-methods > strong { width: 100%; font-size: .82rem; }
.admin-login-methods small { width: 100%; color: var(--muted); }
.admin-delete-warning { padding: .7rem .8rem; border: 1px solid #efbbc2; border-radius: .4rem; color: #a32738; background: #fff5f6; font-size: .82rem; font-weight: 700; }
.danger-text-button { padding: .3rem 0; border: 0; color: var(--danger); background: transparent; box-shadow: none; font-weight: 800; }
.danger-text-button:hover { color: #9e2635; background: transparent; text-decoration: underline; }
.back-to-top {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 10;
    width: 2.8rem;
    height: 2.8rem;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(.6rem);
    transition: opacity .18s ease, transform .18s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.admin-inline-form label { min-width: min(100%, 12rem); }
.admin-permission-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.admin-permission-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.admin-role-permissions { margin-top: 1rem; }
.admin-role-permissions > label { display: grid; gap: .4rem; max-width: 28rem; font-weight: 700; }
.admin-role-panel { margin-top: 1rem; }
.admin-role-panel[hidden] { display: none; }
.admin-permission-option { display: flex; align-items: flex-start; gap: .7rem; width: 100%; cursor: pointer; }
.admin-permission-option input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; }
.admin-permission-option input:disabled { cursor: not-allowed; }
.admin-table-wrap { width:100%; min-width:0; max-width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:.55rem; }
.admin-status-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:.75rem;margin:.8rem 0 1.2rem}.admin-health-state{display:inline-flex;align-items:center;justify-content:center;padding:.45rem .7rem;border-radius:999px;font-size:.75rem;font-weight:800}.admin-health-state.is-ok{color:#17683a;background:#e8f7ee}.admin-health-state.is-warning{color:#805400;background:#fff4cf}.admin-health-state.is-critical{color:#9b2430;background:#fff0f1}.admin-health-state.is-unknown{color:var(--muted);background:#eef2f7}.admin-status-list{display:grid;gap:.45rem;margin:.75rem 0 1.2rem}.admin-status-list>div{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.65rem .75rem;border:1px solid var(--line);border-radius:.45rem;background:#fff}.admin-status-list strong{font-size:.72rem}.admin-status-list .is-ok{color:#17683a}.admin-status-list .is-error{color:var(--danger)}.admin-status-issues{margin:.7rem 0 1.2rem;padding-left:1.2rem;color:var(--danger)}.admin-access-matrix th small{display:block;margin-top:.2rem;color:var(--muted);font-weight:400}.admin-onboarding-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:.7rem;align-items:end}.admin-onboarding-form label{display:grid;gap:.3rem;font-size:.75rem;font-weight:700}.admin-onboarding-form small{font-weight:400;color:var(--muted)}.admin-onboarding-state{display:grid;gap:.2rem;margin:.7rem 0;padding:.6rem .7rem;border-radius:.45rem;font-size:.75rem}.admin-onboarding-state span{color:var(--muted)}.admin-onboarding-state.is-ready{background:#e8f7ee;color:#17683a}.admin-onboarding-state.is-incomplete{background:#fff4cf;color:#805400}
.admin-critical-form{display:grid;gap:.5rem}.admin-critical-form label{display:grid;gap:.25rem;font-size:.72rem;font-weight:700}.admin-critical-confirm{display:flex!important;align-items:center;gap:.45rem!important;margin:.7rem 0;color:#805400;font-size:.75rem}.admin-critical-confirm input{width:auto}
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: #596271; background: #f5f7f9; font-size: .78rem; letter-spacing: .025em; text-transform: uppercase; }
.admin-table tbody tr:hover { background: #f8faff; }
.admin-table details { margin-top:.4rem; }.admin-table details summary { cursor:pointer; color:#315f8c; }.admin-table details pre { max-width:36rem; max-height:18rem; margin:.4rem 0 0; padding:.55rem; overflow:auto; border-radius:.45rem; color:#eaf4ff; background:#152536; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.72rem; }
.audit-action-description{display:block;margin-top:.3rem;color:var(--muted);font-size:.72rem;line-height:1.35}.admin-group-section{margin-top:1rem;padding:.9rem;border:1px solid var(--line);border-radius:.55rem;background:#f8fafc}.admin-group-section h4{margin:0;font-size:.92rem}.admin-group-hint{margin:.25rem 0 .7rem;color:var(--muted);font-size:.75rem}.admin-group-people{display:grid;gap:.4rem;margin:0 0 .75rem;padding:0;list-style:none}.admin-group-people li{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.5rem .6rem;border-radius:.4rem;background:#fff}.admin-group-person-actions{display:flex;flex-wrap:wrap;gap:.35rem}.admin-group-person-actions form{margin:0}.admin-mini-button,.admin-add-button{width:auto;margin:0;padding:.38rem .55rem;border-radius:.35rem;font-size:.7rem;line-height:1.2}.admin-mini-button{border:1px solid #cbd8ea;color:var(--primary-dark);background:#fff;box-shadow:none}.admin-mini-button.is-danger{border-color:#efbbc2;color:var(--danger);background:#fff5f6}.admin-group-add-form{display:flex;align-items:end;flex-wrap:wrap;gap:.5rem;margin-top:.65rem}.admin-group-add-form label{display:grid;gap:.25rem;min-width:min(100%,16rem);font-size:.75rem;font-weight:700}.admin-add-button{background:var(--primary)}
.admin-chat-smile{display:inline-block;width:auto;max-width:3rem;height:auto;max-height:2.5rem;vertical-align:middle;object-fit:contain}
.admin-system-avatars{margin:.8rem 0;padding:.75rem;border:1px solid #cbdfea;border-radius:.9rem;background:linear-gradient(145deg,#f7fbfd,#edf6fa)}
.admin-system-avatar-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem}
.admin-system-avatar-grid form{display:grid;grid-template-columns:3.5rem minmax(0,1fr);align-items:center;gap:.55rem;padding:.65rem;border:1px solid #d2e1e9;border-radius:.75rem;background:#fff}
.admin-system-avatar-grid img{grid-row:1/3;width:3.5rem;height:3.5rem;border-radius:.8rem;object-fit:cover;box-shadow:0 .3rem .8rem #183f5d1a}
.admin-system-avatar-grid form>div{display:grid;gap:.08rem}.admin-system-avatar-grid form>div small{color:var(--muted);font-size:.68rem;line-height:1.3}
.admin-system-avatar-file{position:relative;display:inline-flex;justify-content:center;padding:.38rem .5rem;border:1px solid #b8d1df;border-radius:.5rem;color:#286686;background:#f2f8fb;font-size:.72rem;font-weight:850;cursor:pointer}.admin-system-avatar-file input{position:absolute;width:1px;height:1px;opacity:0}.admin-system-avatar-grid button{grid-column:1/-1;min-height:0;padding:.45rem .55rem}
@media(max-width:980px){.admin-system-avatar-grid{grid-template-columns:1fr}}@media(max-width:620px){.admin-system-avatar-grid form{grid-template-columns:3.5rem minmax(0,1fr)}}
.portal-reaction-smile { display:block; width:2rem; height:2rem; object-fit:contain; }

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .62rem .85rem;
    border: 1px solid #cbd1d9;
    border-radius: .5rem;
    color: #38404b;
    background: #fff;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 2px rgb(33 53 78 / 7%);
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, filter .08s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.secondary-link:hover, .secondary-link:focus-visible, .secondary-link[aria-current="page"] { border-color: #8fb5eb; color: var(--primary-dark); background: #edf5ff; box-shadow: 0 5px 14px rgb(42 82 130 / 12%); }
.secondary-link:active { filter: brightness(.92); box-shadow: inset 0 2px 4px rgb(33 53 78 / 14%); }
.secondary-link[aria-disabled="true"] { opacity: .5; pointer-events: none; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    button, .secondary-link, .portal-card { transition: none; }
    .chat-total-unread.has-unread { animation:none; }
}


@media (max-width: 64rem) {
    .notification-channel-guide { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .portal-layout { grid-template-columns: 4.25rem minmax(0, 1fr); }
    .portal-navigation {
        grid-column: 1;
        grid-row: 2 / 4;
        flex-direction: column;
        height: calc(100vh - 4.25rem);
        padding: .75rem .55rem;
        position: sticky;
    }
    .portal-navigation-primary, .portal-navigation-utility { flex-direction: column; }
    .portal-navigation-primary::before { display: none; }
    .portal-navigation-utility { margin-top: auto; padding: .65rem 0 0; border-top: 1px solid #343b45; border-left: 0; }
    .portal-navigation a { justify-content: center; padding: .7rem; }
    .portal-navigation a > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .nav-icon { width: 1.2rem; height: 1.2rem; }
    .portal-main { grid-column: 2; grid-row: 2; }
    .portal-footer { grid-column: 2; grid-row: 3; }
}

@media (max-width: 48rem) {
    body { padding: .75rem; }
    .portal-body { padding: 0; }
    .portal-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 4.25rem minmax(0, 1fr) auto;
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
        min-height: 100svh;
        padding-bottom: calc(4.15rem + env(safe-area-inset-bottom));
    }
    .portal-header { grid-column: 1; padding-inline: .8rem; }
    .portal-brand { max-width: 45%; font-size: .9rem; }
    .portal-brand img { width: 5.7rem; height: 2rem; }
    .account-summary { gap: .4rem; }
    .account-summary > span { max-width: min(7rem, 28vw); font-size: .78rem; }
    .text-button { padding: .42rem .55rem; font-size: .78rem; }
    .problem-report-button { min-height:2.2rem;padding:.4rem .55rem;gap:.35rem; }
    .problem-report-button__full { display:none; }
    .problem-report-button__compact { display:inline; }
    .problem-report-button > span { width:1rem;height:1rem;font-size:.72rem; }
    .problem-report-dialog { width:calc(100vw - 1rem);max-height:calc(100svh - 1rem); }
    .problem-report-form { padding:1rem; }
    .problem-report-dialog__actions { align-items:stretch;flex-direction:column-reverse; }
    .problem-report-dialog__actions button { width:100%; }
    .portal-navigation {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        grid-column: 1;
        grid-row: auto;
        flex-direction: row;
        align-items: stretch;
        width: auto;
        max-width: 100vw;
        height: calc(4.15rem + env(safe-area-inset-bottom));
        padding: .35rem max(.35rem, env(safe-area-inset-right)) max(.35rem, env(safe-area-inset-bottom)) max(.35rem, env(safe-area-inset-left));
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        border-top: 1px solid rgb(106 134 169 / 22%);
        background: rgb(255 255 255 / 94%);
        box-shadow: 0 -10px 30px rgb(33 57 88 / 13%);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
    .portal-navigation-primary,
    .portal-navigation-utility { flex-direction: row; flex: 0 0 auto; gap: .15rem; overflow: visible; }
    .portal-navigation-utility { margin: 0; padding: 0 0 0 .15rem; border: 0; border-left: 1px solid var(--line); }
    .portal-navigation a { min-width: 3rem; min-height: 3.35rem; justify-content: center; padding: .55rem; color: #647991; }
    .portal-navigation a:hover { color: #17243a; border-color: #d5e0ec; background: #f3f7fc; transform: none; }
    .portal-navigation a[aria-current="page"] { color: #17243a; border-color: #dce7f3; background: #eaf1f9; box-shadow: inset 0 3px #39d9d0; }
    .portal-main { grid-column:1; grid-row:2; width:100%; min-width:0; max-width:100%; overflow-x:clip; padding:.8rem; }
    .portal-footer { grid-column: 1; grid-row: 3; padding: .9rem .8rem; }
    .back-to-top { bottom: calc(5rem + env(safe-area-inset-bottom)); }
    h1 { font-size: clamp(1.45rem, 7vw, 1.85rem); }
    .portal-module-hero { align-items: flex-start; flex-direction: column; padding: 1.1rem; }
    .portal-module-hero h1 { font-size: clamp(1.7rem, 8vw, 2.15rem); }
    .portal-module-hero__actions { width: 100%; }
    .portal-module-hero__actions > * { width: 100%; text-align: center; }
    .dashboard-section-heading, .dashboard-deadline-list li, .deadline-card-heading { align-items: start; flex-direction: column; }
    .content-panel, .dashboard-deadlines { padding: .85rem; }
    .admin-section > h2 { margin: -.85rem -.85rem .85rem; padding: .75rem .85rem; }
    .admin-card, .contact-card, .deadline-card, .deadline-run-card, .deadline-type-form { padding: .85rem; }
    .admin-inline-form, .deadline-type-form, .deadline-actions, .deadline-renew-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .admin-inline-form > *, .deadline-type-form > *, .deadline-actions > *, .deadline-renew-form > * { min-width: 0; width: 100%; }
    .admin-inline-form button, .deadline-type-form button, .deadline-renew-form button { width: 100%; }
    .admin-permission-list li { align-items: flex-start; flex-direction: column; }
    .profile-details div { grid-template-columns: 1fr; gap: .25rem; }
    .portal-body input, .portal-body select, .portal-body textarea, .portal-body button, .portal-body form, .portal-body fieldset, .portal-body label { min-width:0; max-width:100%; }
    .portal-body input[type="file"] { width:100%; overflow:hidden; }
    .profile-section, .notification-settings, .profile-card,
    .profile-section > *, .notification-settings > *, .profile-action-grid,
    .profile-avatar-panel, .profile-avatar-panel > div, .notification-settings form { min-width:0; max-width:100%; }
    .notification-matrix { width:100%; min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
    .notification-channel-guide { grid-template-columns:1fr 1fr; }
    .profile-action-grid { grid-template-columns: 1fr; }
    .profile-mobile-apps__grid{grid-template-columns:1fr}
    .profile-mobile-app-card{grid-template-columns:3.75rem minmax(0,1fr)}
    .profile-mobile-app-card img{width:3.75rem;height:3.75rem}.profile-mobile-download{grid-column:1/-1;width:100%}
    .telegram-card-actions { align-items:stretch; flex-direction:column; }
    .telegram-card-actions form, .telegram-card-actions button, .telegram-card-actions .secondary-link { width:100%; text-align:center; }
    .profile-heading { align-items: flex-start; flex-direction: column; }
    .admin-setting-row { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.comments-search{display:grid;gap:7px;padding:14px 16px;border:1px solid #dbe7f2;border-radius:15px;background:#fff}.comments-search>div{display:flex;align-items:center;gap:9px}.comments-search input{flex:1;min-width:0}.comments-search .secondary-link{white-space:nowrap}@media(max-width:560px){.comments-search>div{align-items:stretch;flex-direction:column}.comments-search .secondary-link{text-align:center}}
.entity-comment-link{display:inline-flex;align-items:center;gap:.48rem;margin:.8rem 0;padding:.42rem .58rem;border:1px solid transparent;border-radius:.5rem;color:var(--accent,#1f6feb);font-weight:700;text-decoration:none;transition:color .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease}.entity-comment-link:hover,.entity-comment-link:focus-visible{border-color:rgba(67,124,255,.28);background:rgba(67,124,255,.07);box-shadow:0 4px 12px rgb(38 85 145 / 10%)}.entity-comment-link:active{box-shadow:inset 0 2px 4px rgb(38 85 145 / 12%)}.entity-comment-link span,.entity-comment-link b,.entity-comment-count{display:inline-flex;align-items:center;border:1px solid rgba(67,124,255,.24);border-radius:999px;padding:.14rem .48rem;background:rgba(67,124,255,.08);font-size:.76rem}.entity-comment-link b{color:#b8325f;background:rgba(230,75,126,.09);border-color:rgba(230,75,126,.22)}.entity-comment-count{margin-top:.4rem;width:max-content;max-width:100%}.calendar-event small{margin-left:auto;font-size:.7rem;white-space:nowrap}
