:root {
    --bg: #f4f7fd;
    --surface: #ffffff;
    --surface-alt: #eef3fb;
    --surface-soft: #f8faff;
    --line: #d9e2f0;
    --line-strong: #c2cee1;
    --text: #1b2740;
    --muted: #6e7f99;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --brand-soft: rgba(37, 99, 235, 0.12);
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.1);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --blue-soft: #eaf1ff;
    --green-soft: #e7f6ee;
    --amber-soft: #fff5dc;
    --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 4px 12px rgba(15, 23, 42, 0.06);
    --radius: 16px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08) 0, transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #f3f6fc 100%);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
code { background: #edf3ff; border-radius: 8px; padding: 0.15rem 0.4rem; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-shell { width: min(100%, 1080px); }
.login-panel, .panel, .stat-card, .brand-card { background: rgba(255, 255, 255, 0.94); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-panel { padding: 2rem; background: rgba(255, 255, 255, 0.98); }
.login-brand { display: grid; grid-template-columns: 88px 1fr; gap: 1rem; align-items: center; margin-bottom: 2rem; }
.login-emblem, .brand-emblem { width: 88px; height: 88px; object-fit: contain; }
.login-brand h1, .brand-title, .topbar-title, .panel-title { margin: 0; }
.brand-eyebrow, .topbar-label, .panel-eyebrow, .stat-label { display: block; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.login-copy, .brand-copy, .panel-text, .map-summary span { color: var(--muted); line-height: 1.6; }
.login-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.32rem; }
.field label { font-weight: 600; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 0.65rem 0.82rem; background: #fff; color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); font-size: 0.95rem; }
.field input:focus { outline: 2px solid rgba(37, 99, 235, 0.14); border-color: var(--brand); }
.field-error { margin: 0; color: var(--danger); font-size: 0.92rem; }
.checkbox-row { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.button { border: 1px solid transparent; border-radius: 9px; padding: 0.6rem 0.88rem; font-weight: 600; cursor: pointer; box-shadow: none; font-size: 0.92rem; line-height: 1.2; }
.button-compact { padding: 0.42rem 0.72rem; font-size: 0.86rem; }
.button-primary { background: linear-gradient(180deg, #4f8cff, var(--brand)); color: #fff; border-color: rgba(37, 99, 235, 0.18); }
.button-secondary { background: linear-gradient(180deg, #ffffff, #f7faff); border-color: var(--line); color: #4f607b; }
.button-full { width: 100%; }
.login-footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); }
.app-shell { min-height: 100vh; }
.app-frame { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { padding: 0; background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%); color: var(--text); display: grid; align-content: start; gap: 0; border-right: 1px solid var(--line); box-shadow: inset -1px 0 0 rgba(255,255,255,0.55); }
.brand-card { background: transparent; border: 0; border-bottom: 1px solid var(--line); color: inherit; display: grid; grid-template-columns: 48px 1fr; gap: 0.85rem; padding: 1rem 1.1rem; box-shadow: none; border-radius: 0; align-items: center; }
.brand-card > div { display: grid; gap: 0.45rem; align-content: center; min-width: 0; }
.sidebar .brand-emblem { width: 48px; height: 48px; padding: 0.45rem; border-radius: 12px; background: linear-gradient(180deg, #f4f8ff, #e7efff); border: 1px solid var(--line); }
.brand-title { line-height: 1.15; }
.sidebar .brand-title { font-size: 1.15rem; overflow-wrap: anywhere; word-break: break-word; }
.sidebar .brand-eyebrow { font-size: 0.78rem; letter-spacing: 0.07em; }
.sidebar .brand-copy { font-size: 0.86rem; }
.brand-copy { margin: 0; }
.brand-copy, .sidebar .brand-eyebrow { color: var(--muted); }
.main-nav { display: grid; gap: 0.15rem; margin-top: 0; padding: 0.75rem 0.6rem 1rem; }
.nav-link { padding: 0.66rem 0.8rem; border-radius: 9px; color: #566884; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; font-size: 0.94rem; }
.nav-link:hover { background: #eef4ff; color: var(--text); transform: translateX(1px); }
.nav-link.is-active { background: linear-gradient(180deg, #eef4ff, #e7efff); color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.content-shell { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.82rem 1.15rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.72); backdrop-filter: blur(10px); }
.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.user-chip { display: grid; gap: 0.12rem; text-align: right; }
.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;
}
.global-search {
    position: relative;
    min-width: 320px;
    flex: 1 1 320px;
    max-width: 460px;
}
.global-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(248, 251, 255, 0.95);
    padding: 0.58rem 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
}
.global-search-results {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.14);
}

.global-search-results[hidden],
.autocomplete-results[hidden] {
    display: none !important;
}
.global-search-group {
    display: grid;
    gap: 0.3rem;
}
.global-search-group-title {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 0.35rem;
}
.global-search-item {
    display: grid;
    gap: 0.18rem;
    padding: 0.56rem 0.72rem;
    border-radius: 10px;
    background: transparent;
}
.global-search-item span,
.global-search-empty {
    color: var(--muted);
    font-size: 0.9rem;
}
.global-search-item:hover,
.global-search-item-active {
    background: rgba(37, 99, 235, 0.1);
}
.global-search-empty {
    padding: 0.45rem 0.35rem;
}
.user-name { font-weight: 700; }
.user-role { color: var(--muted); font-size: 0.9rem; }
.page-content { padding: 1.35rem; display: grid; gap: 1.1rem; }
.grid-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { padding: 0.9rem 1rem; background: linear-gradient(180deg, #ffffff, #f9fbff); }
.stat-value { display: block; margin-top: 0.7rem; font-size: 2rem; }
.stat-value-compact { font-size: 1rem; line-height: 1.5; word-break: break-word; }
.accent-amber { background: linear-gradient(135deg, #fffef7, var(--amber-soft)); }
.accent-blue { background: linear-gradient(135deg, #fbfdff, var(--blue-soft)); }
.accent-red { background: linear-gradient(135deg, #fffafb, var(--danger-soft)); }
.accent-green { background: linear-gradient(135deg, #fbfffd, var(--green-soft)); }
.two-column { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; }
.two-column-wide { grid-template-columns: 1.2fr 1fr; }
.panel { padding: 0.95rem 1rem; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,252,255,0.98)); }
.panel-narrow { max-width: 760px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.action-stack { display: grid; gap: 0.85rem; }
.action-card { display: grid; gap: 0.35rem; padding: 0.82rem 0.9rem; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(180deg, #ffffff, #f9fbff); }
.action-card span { color: var(--muted); line-height: 1.5; }
.map-summary { min-height: 180px; display: grid; place-content: center; text-align: center; gap: 0.5rem; background: linear-gradient(135deg, #edf4ff, #eef8f3); border-radius: 16px; }
.map-summary strong { font-size: 3rem; }
.map-placeholder { min-height: 360px; border-radius: 16px; border: 1px dashed var(--line-strong); background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.05)); padding: 1.4rem; }
.bullet-list { margin: 1rem 0 0; padding-left: 1rem; }
.bullet-list li + li { margin-top: 0.5rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { text-align: left; padding: 0.7rem 0.68rem; border-bottom: 1px solid #e8eef8; vertical-align: top; }
.data-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #f7faff; }
.data-table tbody tr:hover td { background: #f9fbff; }
.empty-state-cell { text-align: center; color: var(--muted); padding: 1.6rem; }
.pagination-wrap { margin-top: 1rem; }
.alert { padding: 0.9rem 1.05rem; border-radius: 10px; border: 1px solid var(--line); }
.alert.success { background: #edf8f1; color: #17633a; border-color: #cfe7d8; }
@media (max-width: 1100px) { .app-frame { grid-template-columns: 1fr; } .sidebar { padding-bottom: 0.75rem; gap: 1rem; } .grid-cards, .two-column, .two-column-wide { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .login-page, .page-content, .sidebar, .topbar { padding: 1rem; } .login-brand, .brand-card { grid-template-columns: 1fr; } .brand-card { padding: 1rem; gap: 0.75rem; } .topbar, .topbar-actions { flex-direction: column; align-items: stretch; } .user-chip { text-align: left; } .topbar-actions > .button, .topbar-actions > form .button { width: 100%; } .global-search { min-width: 0; max-width: none; } }
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0.65rem 0.82rem;
    background: #fff;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.field textarea {
    resize: vertical;
}

.field select:focus,
.field textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.14);
    border-color: var(--brand);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.field-span-2 {
    grid-column: span 2;
}

.geo-block {
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 255, 0.92));
}

.compact-header {
    margin-bottom: 0.8rem;
}

.geo-status,
.muted-text {
    color: var(--muted);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(244, 247, 253, 0.15), rgba(244, 247, 253, 0.95));
    padding-top: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.detail-item,
.sub-panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
    padding: 0.85rem;
}

.detail-item span {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.sub-panel + .sub-panel {
    margin-top: 1rem;
}

.attachment-list {
    margin: 0;
    padding-left: 1rem;
}

.attachment-list li + li {
    margin-top: 0.6rem;
}

.text-link {
    color: var(--brand);
    font-weight: 700;
}

@media (max-width: 720px) {
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
    }
}

.alert.error { background: #f8dfdb; color: #7a2014; }

.page-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.three-column {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--brand-soft);
    color: var(--brand);
}

.status-chip-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.stack-list {
    display: grid;
    gap: 0.7rem;
}

.list-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 720px) {
    .three-column {
        grid-template-columns: 1fr;
    }

    .inline-action,
    .button-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.inline-action { display: flex; gap: 0.6rem; align-items: center; }
.inline-action input { flex: 1 1 auto; }
.button-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.button-compact { padding: 0.55rem 0.8rem; font-size: 0.92rem; }
.template-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.registry-ocr-status { margin: 0.45rem 0 0; font-size: 0.92rem; }
.placeholder-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }
.placeholder-chip { display: inline-flex; padding: 0.45rem 0.7rem; border-radius: 999px; background: #f3eee4; border: 1px solid var(--line); color: var(--text); }
.summary-card { min-height: 160px; }
.summary-card span:last-child { color: var(--muted); }
.template-editor-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1rem; align-items: start; }
.snippet-toolbar { flex-wrap: wrap; align-items: stretch; }
.live-preview-panel { min-height: 100%; }
.template-live-preview-frame {
    width: 100%;
    min-height: 720px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.diff-table .diff-row-changed td { background: #fff8e8; }
.diff-table .diff-row-same td { background: transparent; }
.draft-mobile-shell { position: relative; overflow: hidden; }
.draft-mobile-section { margin: 0 0 0.8rem; }
.mobile-draft-tools { margin-bottom: 1rem; }
.draft-queue { margin-top: 1rem; display: grid; gap: 0.75rem; }
.draft-queue-header { display: grid; gap: 0.2rem; }
.draft-queue-list { display: grid; gap: 0.7rem; }
.draft-queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}
.draft-queue-meta { display: grid; gap: 0.2rem; }
.form-grid-mobile-priority .field:first-child,
.form-grid-mobile-priority .field:nth-child(2),
.form-grid-mobile-priority .field:nth-child(3),
.form-grid-mobile-priority .field:nth-child(4),
.form-grid-mobile-priority .field:nth-child(5),
.form-grid-mobile-priority .field:nth-child(6) { min-width: 0; }
.geo-block-mobile { background: linear-gradient(135deg, rgba(18, 71, 52, 0.05), rgba(200, 137, 45, 0.06)); }
.audit-json { white-space: pre-wrap; word-break: break-word; display: block; max-width: 480px; }
.nomenclature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.panel-span-2 {
    grid-column: span 2;
}
.nomenclature-inline-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    align-items: center;
}
.nomenclature-inline-form-wide {
    grid-template-columns: 1.2fr repeat(5, minmax(0, 1fr)) auto;
}
.nomenclature-inline-form-tall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.nomenclature-inline-form input,
.nomenclature-inline-form select,
.nomenclature-inline-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    background: #fff;
    color: var(--text);
}
.nomenclature-inline-form textarea {
    resize: vertical;
}
.inline-form-inline {
    margin-top: 0.5rem;
}
.role-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #f3eee4;
    border: 1px solid var(--line);
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.map-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.violations-map {
    min-height: 520px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #e7efe6;
}

.map-stats {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.map-popup {
    display: grid;
    gap: 0.35rem;
    min-width: 220px;
}

.operations-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.operation-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
}

.operation-card-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.operation-card-header > div {
    min-width: 0;
    flex: 1 1 220px;
}

.operation-card-header .button {
    flex: 0 0 auto;
    align-self: flex-start;
}

.operation-card-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.operation-card-stats strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.35rem;
}

.registry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.registry-actions form {
    display: inline;
}

.registry-actions .button {
    padding: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 700;
    border-radius: 0;
    line-height: inherit;
}

.registry-actions .button:hover {
    text-decoration: underline;
}

.batch-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.workflow-anchor-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: -0.4rem;
}

.draft-step-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.draft-live-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(18, 71, 52, 0.06), rgba(200, 137, 45, 0.08));
}

.draft-live-summary-item {
    display: grid;
    gap: 0.2rem;
}

.draft-live-summary-item span {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.draft-live-summary-item strong {
    line-height: 1.4;
}

@media (max-width: 720px) {
    .app-frame {
        min-height: auto;
    }

    .sidebar {
        position: relative;
        padding-bottom: 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .sidebar .brand-card {
        grid-template-columns: 52px 1fr;
        gap: 0.7rem;
        padding: 0.9rem;
    }

    .sidebar .brand-emblem {
        width: 52px;
        height: 52px;
    }

    .sidebar .brand-title {
        font-size: 1.1rem;
        line-height: 1.15;
    }

    .sidebar .brand-copy {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        overflow: visible;
        padding-bottom: 0;
        margin: 0;
        scroll-snap-type: none;
    }

    .nav-link {
        white-space: normal;
        text-align: center;
        line-height: 1.25;
        font-size: 0.92rem;
        padding: 0.72rem 0.65rem;
        min-height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav-more {
        grid-column: 1 / -1;
        display: block;
    }

    .main-nav-more summary {
        list-style: none;
    }

    .main-nav-more summary::-webkit-details-marker {
        display: none;
    }

    .main-nav-more-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.45rem;
    }

    .content-shell,
    .page-content,
    .panel,
    .stat-card,
    .brand-card,
    .action-card,
    .summary-card,
    .operation-card,
    .subject-card,
    .sub-panel,
    .draft-live-summary-item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .panel *,
    .stat-card *,
    .brand-card *,
    .action-card *,
    .summary-card *,
    .operation-card *,
    .subject-card *,
    .sub-panel * {
        min-width: 0;
    }

    .panel-title,
    .panel-text,
    .stat-value,
    .brand-title,
    .brand-copy,
    .action-card span,
    .summary-card span,
    .subject-card-title {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .page-content {
        gap: 1rem;
    }

    .panel {
        padding: 1rem;
        border-radius: 16px;
    }

    .panel-header,
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions .button,
    .page-actions form,
    .page-actions form .button {
        width: 100%;
    }

    .status-chip {
        white-space: nowrap;
    }

    .map-filter-grid {
        grid-template-columns: 1fr;
    }

    .grid-cards,
    .operations-grid,
    .draft-live-summary,
    .operation-card-stats {
        grid-template-columns: 1fr;
    }

    .batch-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .workflow-anchor-bar {
        position: sticky;
        bottom: 0;
        z-index: 10;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0.85rem 0 0.5rem;
        background: linear-gradient(180deg, rgba(247, 241, 232, 0.2), rgba(247, 241, 232, 0.96));
        backdrop-filter: blur(10px);
    }

    .draft-step-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }

    .nomenclature-grid {
        grid-template-columns: 1fr;
    }

    .panel-span-2 {
        grid-column: auto;
    }

    .nomenclature-inline-form,
    .nomenclature-inline-form-wide,
    .nomenclature-inline-form-tall {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .violations-map {
        min-height: 360px;
    }

    .draft-mobile-shell .panel-header {
        align-items: flex-start;
    }

    .draft-mobile-shell .panel-header .button {
        width: 100%;
    }

    .template-editor-grid {
        grid-template-columns: 1fr;
    }

    .template-live-preview-frame {
        min-height: 420px;
    }

    .table-wrap {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .data-table {
        min-width: 640px;
    }

    .data-table th,
    .data-table td {
        padding: 0.72rem 0.6rem;
        font-size: 0.92rem;
    }

    .mobile-draft-tools .inline-action {
        flex-direction: column;
        align-items: stretch;
    }

    .draft-queue-item {
        flex-direction: column;
        align-items: stretch;
    }

    .sticky-actions-mobile {
        position: sticky;
        bottom: 0;
        margin: 0 -1rem -1rem;
        padding: 1rem;
        background: rgba(255, 253, 250, 0.97);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(10px);
    }

    .sticky-actions-mobile .button {
        width: 100%;
    }

    .geo-block-mobile .panel-header {
        flex-direction: column;
        align-items: stretch;
    }
}


.subject-card-list {
    display: grid;
    gap: 1rem;
}

.subject-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.subject-card-archived {
    opacity: 0.88;
    background: rgba(244, 239, 231, 0.92);
}

.subject-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.subject-card-title {
    margin: 0;
}

.subject-edit-form {
    margin-top: 0.25rem;
}

.subject-toggle-form {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .subject-card-header {
        flex-direction: column;
    }

    .subject-toggle-form .button {
        width: 100%;
    }
}

.autocomplete-field {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    display: grid;
    gap: 0.35rem;
    padding: 0.45rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 253, 250, 0.98);
    box-shadow: 0 16px 32px rgba(46, 34, 19, 0.12);
}

.autocomplete-result {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    text-align: left;
    background: transparent;
    color: inherit;
    display: grid;
    gap: 0.2rem;
    cursor: pointer;
}

.autocomplete-result span {
    font-size: 0.88rem;
    color: var(--muted);
}

.autocomplete-result:hover,
.autocomplete-result-active {
    background: rgba(191, 138, 61, 0.12);
}

.compact-form-grid {
    margin-top: 0.75rem;
}
