:root {
    color-scheme: light;
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --panel: #ffffff;
    --panel-strong: #ffffff;
    --panel-hover: #f8fafc;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --text: #0f172a;
    --text-soft: #475569;
    --text-muted: #64748b;
    --accent: #4f46e5;
    --accent-soft: #e0e7ff;
    --cyan: #0d9488;
    --cyan-soft: #ccfbf1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 20px;
    --radius-small: 12px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    --content: 1320px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 75% -10%, rgba(79, 70, 229, 0.06), transparent 34rem),
        radial-gradient(circle at 8% 34%, rgba(13, 148, 136, 0.04), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: 'Sora', Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

.page-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.topbar {
    position: relative;
    z-index: 10;
    height: 78px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px);
}

.topbar-inner {
    width: min(calc(100% - 48px), var(--content));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(79, 70, 229, 0.12), rgba(79, 70, 229, 0.02));
    color: var(--accent);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.8);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-copy strong {
    font-size: 13px;
    letter-spacing: 0.16em;
    color: #0f172a;
}

.brand-copy small {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.system-state {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
}

.state-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.shell {
    width: min(calc(100% - 48px), var(--content));
    min-height: calc(100vh - 176px);
    margin: 0 auto;
    padding: 52px 0 88px;
}

.report-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 14px;
}

.sidebar-card,
.report-nav,
.sidebar-security {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.sidebar-card {
    min-width: 0;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar-query-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 22px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-label {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-card strong {
    width: 100%;
    overflow: hidden;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.query-type {
    margin-top: 12px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text-soft);
    font-size: 10px;
    text-transform: uppercase;
    background: var(--bg-soft);
}

.report-nav {
    position: relative;
    padding: 9px;
    display: grid;
    gap: 3px;
}

.report-nav-highlight {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 10px;
    background: var(--accent-soft);
    pointer-events: none;
    transition: transform 240ms ease, width 240ms ease, height 240ms ease;
}

.report-nav a {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
}

.report-nav a i {
    width: 15px;
    color: var(--text-muted);
    text-align: center;
}

.report-nav a:hover,
.report-nav a.active {
    color: var(--accent);
    font-weight: 600;
}

.report-nav a:hover {
    background: rgba(224, 231, 255, 0.45);
}

.report-nav a.active i,
.report-nav a:hover i {
    color: var(--accent);
}

.sidebar-security {
    padding: 15px 17px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.sidebar-security i {
    color: var(--success);
}

.report-main {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.panel {
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 34px;
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    top: -190px;
    right: -80px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.08);
    filter: blur(45px);
    pointer-events: none;
}

.hero-topline,
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.export-control {
    position: relative;
}

.export-control > .button {
    min-height: 37px;
    padding: 0 12px;
    font-size: 10px;
}

.export-chevron {
    margin-left: 2px;
    font-size: 9px;
}

.export-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    min-width: 205px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.14);
}

.export-menu button {
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 10px;
    text-align: left;
}

.export-menu button:hover {
    background: var(--bg-soft);
    color: var(--accent);
}

.export-menu button i {
    width: 15px;
    color: var(--accent);
    text-align: center;
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

h1,
h2,
p {
    margin-top: 0;
}

.hero-card h1 {
    max-width: 760px;
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    color: #0f172a;
}

.section-header h2,
.standalone-header h2 {
    margin-bottom: 0;
    font-size: 21px;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.status-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.legacy {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
    color: #b45309;
}

.hero-description,
.section-description {
    color: var(--text-soft);
    line-height: 1.65;
}

.hero-description {
    max-width: 650px;
    margin: 18px 0 20px;
    font-size: 14px;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 10px;
}

.report-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.stats-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-soft);
}

.stat {
    min-width: 0;
    padding: 17px 19px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-right: 1px solid var(--line);
}

.stat:last-child {
    border-right: 0;
}

.stat span {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat strong {
    font-size: 21px;
    color: #0f172a;
}

.stat-accent strong {
    color: var(--accent);
}

.section-panel {
    padding: 30px;
    scroll-margin-top: 24px;
}

.section-description {
    max-width: 700px;
    margin: 12px 0 24px;
    font-size: 12px;
}

.section-counter {
    padding-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.depth-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.depth-chip {
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 9px;
    text-transform: uppercase;
    background: var(--bg-soft);
}

.depth-chip strong {
    color: var(--text-soft);
}

.tree-canvas {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 8px 0 2px;
    overflow-x: auto;
}

.tree-list,
.tree-children {
    min-width: 560px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-children {
    position: relative;
    margin-left: 24px;
    padding-left: 28px;
}

.tree-children::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 27px;
    left: 7px;
    width: 1px;
    background: linear-gradient(to bottom, rgba(79, 70, 229, 0.4), var(--line));
}

.tree-item {
    position: relative;
    padding: 7px 0;
}

.tree-children > .tree-item::before {
    content: "";
    position: absolute;
    top: 34px;
    left: -20px;
    width: 20px;
    height: 1px;
    background: var(--line-strong);
}

.tree-node {
    min-height: 56px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #ffffff;
}

.tree-node.node-query {
    border-color: rgba(79, 70, 229, 0.3);
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.04), #ffffff);
}

.tree-node.node-source {
    border-color: rgba(13, 148, 136, 0.25);
}

.node-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    flex-shrink: 0;
}

.node-source .node-icon {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.node-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-copy strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.node-copy span {
    overflow: hidden;
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.node-depth,
.node-hits {
    padding: 5px 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 9px;
    white-space: nowrap;
    background: var(--bg-soft);
}

.node-status-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.node-status-empty {
    opacity: 0.64;
}

.summary-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.summary-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-soft);
}

.summary-heading {
    margin-bottom: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.summary-heading > div {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.summary-heading i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    flex-shrink: 0;
}

.summary-heading strong {
    font-size: 12px;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-heading span {
    color: var(--text-muted);
    font-size: 10px;
    flex-shrink: 0;
}

.value-list {
    display: grid;
    gap: 5px;
}

.value-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.bank-value-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    font-size: 16px;
    flex-shrink: 0;
}

.bank-value-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Цвет для универсальной иконки банка, если нет логотипа */
.bank-value-icon-wildberries { color: #a855f7; }
.bank-value-icon-ozon { color: #2563eb; }
.bank-value-icon-mts { color: #dc2626; }
.bank-value-icon-sber { color: #16a34a; }
.bank-value-icon-vtb { color: #2563eb; }
.bank-value-icon-tbank { color: #111827; }
.bank-value-icon-ubrir { color: #0891b2; }
.bank-value-icon-yandex { color: #dc2626; }

.value-text {
    min-width: 0;
    overflow: hidden;
    color: #0f172a;
    font-family: 'Sora', Inter, sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    margin-left: auto;
    flex-shrink: 0;
}

.copy-button:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.section-stack {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 14px;
    scroll-margin-top: 24px;
}

.standalone-header {
    padding: 8px 4px 2px;
}

.records-list {
    display: grid;
    gap: 14px;
}

.source-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.source-header {
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
}

.source-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.source-title i {
    color: var(--cyan);
}

.source-title strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.source-header span {
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
    font-weight: 600;
}

.source-records {
    min-width: 0;
}

.records-more {
    width: calc(100% - 32px);
    margin: 14px 16px 16px;
}

.record-row {
    border-bottom: 1px solid var(--line);
}

.record-row:last-child {
    border-bottom: 0;
}

.record-row-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 500;
    background: #f8fafc;
}

.record-row-header > span:first-child {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--accent);
}

.record-context {
    color: var(--text-muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 9px;
    flex-shrink: 0;
}

/* =========================================
   ИЗМЕНЕНИЯ ДЛЯ ВЫВОДА В ОДНУ КОЛОНКУ
   ========================================= */
.fields-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 колонка вместо 2 */
    border-top: 1px solid var(--line);
}

.data-field {
    min-width: 0;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr); /* Лейбл слева, Значение справа */
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.data-field:last-child {
    border-bottom: 0;
}

.data-field label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500; /* Убрали жирность и капс */
    text-transform: none; /* Убрали капс-лок */
    letter-spacing: normal;
}

.field-value-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-value-row .value-text {
    overflow-wrap: anywhere;
    color: #0f172a;
    font-family: 'Sora', Inter, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
}
/* ========================================= */

.empty-block {
    min-height: 130px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 11px;
}

.empty-block i {
    font-size: 20px;
}

.error-panel {
    padding: 25px;
    border-color: rgba(239, 68, 68, 0.3);
}

.error-panel > .section-header > i {
    color: var(--danger);
}

.error-item {
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    font-size: 11px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.state-page,
.landing {
    min-height: 58vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.state-page {
    gap: 10px;
    color: var(--text-soft);
}

.state-page strong {
    color: #0f172a;
    font-size: 14px;
}

.state-page > span:not(.error-code) {
    color: var(--text-muted);
    font-size: 11px;
}

.loader {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 25px;
}

.loader i {
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.landing {
    max-width: 760px;
    margin: 0 auto;
}

.landing-icon,
.state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 22px;
}

.landing h1,
.state-page h1 {
    margin-bottom: 16px;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.045em;
    color: #0f172a;
}

.landing > p,
.state-page > p {
    max-width: 610px;
    margin-bottom: 28px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.7;
}

.landing-points {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.landing-points div {
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text-soft);
    font-size: 10px;
    background: #ffffff;
    font-weight: 500;
}

.landing-points i {
    color: var(--accent);
}

.state-icon-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

.error-code {
    color: var(--danger);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.button {
    min-height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: background 150ms ease, border-color 150ms ease;
}

.button:hover {
    background: var(--bg-soft);
}

.button-primary {
    width: 100%;
    border-color: transparent;
    background: var(--accent);
    color: white;
    font-weight: 700;
}

.button-primary:hover {
    background: #4338ca;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    padding: 24px;
    display: grid;
    place-items: center;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
}

.modal-card {
    width: min(100%, 430px);
    max-height: calc(100dvh - 48px);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow-y: auto;
}

.modal-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 24px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: var(--accent-soft);
    color: var(--accent);
}

.modal-card h2 {
    margin-bottom: 12px;
    font-size: 25px;
    color: #0f172a;
}

.modal-card > p {
    margin-bottom: 24px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.65;
}

.modal-card label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.input-row {
    height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--bg-soft);
}

.input-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.input-row i {
    color: var(--text-muted);
}

.input-row input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
}

.form-error {
    margin: 9px 0 12px;
    color: var(--danger);
    font-size: 10px;
    font-weight: 600;
}

.modal-card .button {
    margin-top: 14px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 11px;
    background: #ecfdf5;
    color: #047857;
    box-shadow: var(--shadow);
    font-size: 10px;
    font-weight: 600;
}

.clipboard-fallback {
    position: fixed;
    left: -9999px;
    opacity: 0;
}

footer {
    width: min(calc(100% - 48px), var(--content));
    min-height: 98px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
}

@media (max-width: 1040px) {
    .report-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        grid-template-columns: minmax(220px, 0.6fr) 1fr;
    }

    .sidebar-security {
        display: none;
    }

    .report-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-content: center;
    }

    .report-nav a {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .topbar-inner,
    .shell,
    footer {
        width: min(calc(100% - 28px), var(--content));
    }

    .system-state,
    .brand-copy small {
        display: none;
    }

    .shell {
        padding-top: 28px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-card {
        display: none;
    }

    .report-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow-x: auto;
    }

    .report-nav a {
        min-width: 52px;
        padding: 11px;
        font-size: 0;
    }

    .report-nav a i {
        font-size: 13px;
    }

    .hero-card,
    .section-panel {
        padding: 23px;
    }

    .hero-topline,
    .section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .status-badge {
        align-self: flex-start;
    }

    .hero-actions {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat:nth-child(2) {
        border-right: 0;
    }

    .stat:nth-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }

    .summary-grid,
    .fields-grid {
        grid-template-columns: 1fr;
    }

    .tree-list,
    .tree-children {
        min-width: 0;
    }

    .tree-children {
        margin-left: 10px;
        padding-left: 18px;
    }

    .tree-node {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 10px;
    }

    .node-icon {
        width: 32px;
        height: 32px;
    }

    .node-meta {
        grid-column: 2;
        justify-content: flex-start;
    }
    
    /* АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ (Стек один под другим) */
    .data-field {
        grid-template-columns: 1fr;
        gap: 6px;
        align-items: start;
        padding: 12px 16px;
    }

    .data-field:last-child {
        border-bottom: 0;
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
    }
}

@media print {
    @page {
        margin: 14mm;
    }

    html,
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    body {
        filter: grayscale(1);
    }

    .topbar,
    .sidebar,
    .report-nav,
    .export-control,
    footer,
    .copy-button,
    .records-more,
    #report-errors {
        display: none !important;
    }

    #search-tree,
    .hero-description,
    .report-meta,
    .section-description,
    .depth-legend,
    .section-counter {
        display: none !important;
    }

    .shell {
        width: 100%;
        min-height: 0;
        padding: 0;
    }

    .report-layout {
        display: block;
    }

    .report-main {
        display: block;
    }

    .panel,
    .source-card,
    .summary-card,
    .value-row,
    .data-field {
        box-shadow: none !important;
        border-color: #b8b8b8 !important;
    }

    .hero-card,
    .section-panel {
        margin-bottom: 10px;
        padding: 12px;
    }

    .hero-topline {
        display: block;
    }

    .hero-card h1,
    .section-header h2,
    .summary-heading strong,
    .source-title strong,
    .value-text,
    .field-value-row .value-text {
        color: #000000 !important;
    }

    .source-card,
    .summary-card,
    .record-row {
        break-inside: avoid;
    }

    .summary-grid {
        margin-top: 8px;
        gap: 6px;
    }

    .summary-card {
        padding: 8px;
    }

    .summary-heading {
        margin-bottom: 5px;
    }

    .value-list {
        gap: 2px;
    }

    .value-row {
        padding: 3px 5px;
        gap: 5px;
    }

    .bank-value-icon {
        width: 20px;
        height: 20px;
        border-radius: 5px;
    }

    .bank-value-icon img {
        width: 17px;
        height: 17px;
    }

    .copy-button {
        display: none;
    }

    .records-list {
        gap: 6px;
    }

    .source-header,
    .record-row-header {
        padding: 7px 9px;
    }

    .fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .data-field {
        padding: 6px 9px;
        display: block;
    }

    .data-field label {
        display: block;
        margin-bottom: 2px;
        font-size: 8px;
    }

    .field-value-row .value-text {
        font-size: 9px;
        line-height: 1.25;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}