/* Оформление взято из задачника сотрудников: он принят как общий дизайн-код для наших
   программ, поэтому здесь те же цвета, шрифт, скругления и тень, включая тёмную тему. */
:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-soft: #f1f4f6;
    --ink: #172026;
    --muted: #5e6a72;
    --line: #dce1df;
    --teal: #0f766e;
    --blue: #315b8a;
    --amber: #aa6b00;
    --green: #3e7a48;
    --red: #9c3327;
    --amber-fill: #fdf4e3;
    --green-fill: #eef6ef;
    --red-fill: #fbeeec;
    --shadow: 0 10px 24px rgba(23, 32, 38, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #101614;
        --surface: #18211f;
        --surface-soft: #202c29;
        --ink: #eef6f3;
        --muted: #a6b5b0;
        --line: #31423e;
        --teal: #47c7bb;
        --blue: #8bb9f0;
        --amber: #f3ba5c;
        --green: #8fd89b;
        --red: #f0a094;
        --amber-fill: #2b2318;
        --green-fill: #17251b;
        --red-fill: #2b1a18;
        --shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0 max(20px, calc((100vw - 1480px) / 2)) 40px;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 Inter, "Segoe UI", Arial, sans-serif;
}

.app-header { border-bottom: 1px solid var(--line); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar-heading h1 { margin: 2px 0 0; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; }
.mode-tabs { display: flex; align-items: flex-end; gap: 24px; min-height: 40px; overflow-x: auto; scrollbar-width: thin; }
.mode-tab { display: inline-flex; align-items: center; height: 40px; padding: 0 2px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { color: var(--ink); border-bottom-color: var(--teal); }

.profile-corner { display: flex; align-items: center; gap: 12px; color: var(--muted); }

/* Тот же компонент шестерёнки и панели, который используется в задачнике. */
.kset-gear {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.kset-gear:hover { background: var(--surface-soft); }
.kset-gear.is-active { background: var(--teal); color: #fff; border-color: var(--teal); }
.kset-gear svg { display: block; }
.kset-gear:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.kset-backdrop { position: fixed; inset: 0; background: transparent; z-index: 5990; }
.kset-panel {
    position: fixed;
    z-index: 6000;
    width: 324px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 96px);
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.45;
}
body.kset-open { overflow: hidden; }
.kset-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kset-title { font-size: 15px; font-weight: 600; }
.kset-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.kset-close:hover { background: var(--surface-soft); }
.kset-sec { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
.kset-profile { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.kset-avatar { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; background: var(--surface-soft); color: var(--teal); font-size: 18px; font-weight: 700; }
.kset-profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kset-name { font-size: 14px; font-weight: 600; }
.kset-login { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kset-logout-form { margin-top: 8px; }
.kset-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 7px 11px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.kset-logout:hover { color: #dc2626; border-color: #fecaca; background: #fff1f2; }
.kset-nav-link { display: flex; align-items: center; min-height: 40px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 13.5px; text-decoration: none; }
.kset-nav-link:hover { color: var(--teal); }

.eyebrow {
    display: block;
    color: var(--teal);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
}

.job-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin: 16px 0;
}

.job-card.job-complete { border-left-color: var(--green); }
.job-card.job-failed { border-left-color: var(--red); }
.job-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.job-heading h2 { margin-top: 2px; }
.job-card progress { width: 100%; height: 12px; accent-color: var(--teal); }
.job-card p:last-child { margin-bottom: 0; }

.drop-zone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 112px;
    max-width: 620px;
    padding: 20px;
    border: 2px dashed var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}

.drop-zone.is-dragging { border-color: var(--teal); background: var(--green-fill); }
.drop-zone input[type="file"] { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; cursor: pointer; }
.danger-outline { color: var(--red); border-color: color-mix(in srgb, var(--red) 42%, var(--line)); }
.memory-note { margin: 10px 0 0; font-size: 14px; }

.connection-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.connection-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-dot.status-on { background: var(--green); box-shadow: 0 0 0 3px var(--green-fill); }
.status-dot.status-off { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-fill); }
.connection-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(160px, 1fr) auto; gap: 8px; align-items: center; flex: 1 1 720px; }
.connection-form input, .connection-form select { max-width: none; }
.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; }

.one-c-signin-shell {
    min-height: min(610px, calc(100dvh - 150px));
    display: grid;
    place-items: center;
    padding: 40px 16px 64px;
}
.one-c-signin-card {
    width: min(100%, 450px);
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 4px 18px rgba(23, 32, 38, .06);
}
.one-c-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 22px;
    border-radius: 12px;
    background: #f3c400;
    color: #201d0b;
    font-size: 17px;
    font-weight: 800;
}
.one-c-signin-card h2 { margin-bottom: 8px; font-size: 26px; }
.signin-intro { margin: 0 0 24px; color: var(--muted); }
.signin-form { display: grid; gap: 14px; }
.signin-form label { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.signin-form input { max-width: none; margin-top: 6px; min-height: 50px; }
.signin-submit { width: 100%; min-height: 48px; margin-top: 6px; }
.signin-note { margin: 2px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.connected-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 48px;
    margin: 16px 0;
    padding: 8px 4px;
    border-bottom: 1px solid var(--line);
}
.quiet-form { margin: 0; }
.quiet-link { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: none; cursor: pointer; }
.quiet-link:hover { color: var(--teal); }
.quiet-link:disabled { color: var(--muted); cursor: wait; opacity: .7; }
.period-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.period-form > div:not(.submit-progress) { min-width: 190px; }
.period-form label { margin-top: 0; }
.submit-progress {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--blue);
    font-weight: 600;
}
.submit-progress[hidden] { display: none; }
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid color-mix(in srgb, var(--blue) 28%, transparent);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.working-indicator { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 700; }
.result-summary { margin: 16px 0 0; color: var(--green); font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.8s; } }

.profile-list { display: grid; gap: 8px; max-width: 620px; }
.profile-choice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.profile-choice small { margin-left: auto; color: var(--green); font-weight: 700; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; }
.inline-form > div { flex: 1 1 240px; max-width: 420px; }
.issued-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 12px 0; padding: 16px; border: 2px solid var(--amber); border-radius: 8px; background: var(--amber-fill); }
.issued-secret .eyebrow { width: 100%; color: var(--amber); }
.issued-secret code { font-size: 20px; font-weight: 800; user-select: all; }
.compact-filters { margin-bottom: 14px; }
.compact-filters label { font-size: 13px; }
.history-source-rows { max-height: 46vh; }
.fallback-card > summary { cursor: pointer; color: var(--blue); }
.fallback-card[open] > summary { margin-bottom: 12px; }
.selected-source { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 12px 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.selected-source form { margin-left: auto; }
.paste-panel { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.paste-panel summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.paste-panel textarea { max-width: 100%; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

h1 { font-size: 26px; margin: 20px 0 12px; }
h2 { font-size: 20px; margin: 0 0 12px; }
a { color: var(--blue); }

button, .button {
    font: inherit;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button.primary, .button.primary {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    font-weight: 600;
}

/* Выключенная кнопка не красится насыщенным цветом: система рисует надпись затемнением
   собственного фона, и на синем она становится нечитаемой. */
button.primary:disabled { background: var(--surface-soft); color: var(--muted); border-color: var(--line); cursor: default; }
button.quiet { background: transparent; color: var(--muted); border-color: transparent; padding: 6px 10px; }

input[type="text"], input[type="password"], input[type="file"], input[type="number"], input[type="date"], select, textarea {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    width: 100%;
    max-width: 420px;
}

label { display: block; margin: 12px 0 4px; color: var(--muted); }

/* Таблица.
   Прокрутка живёт на обёртке и работает в обе стороны: без этого при узком окне столбцы
   справа просто исчезали из виду. Заголовок остаётся на месте при прокрутке вниз. */
.rows {
    max-height: 62vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

table { border-collapse: collapse; width: 100%; }

/* Столбцы не сжимаются до нечитаемости: таблица становится шире обёртки, и появляется
   горизонтальный ползунок — вместо того чтобы прятать правые столбцы. */
th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    white-space: nowrap;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 600;
}

tbody tr:hover { background: var(--surface-soft); }
tbody tr.review { background: var(--amber-fill); }
tbody tr.stop { background: var(--red-fill); }

.state-ready { color: var(--green); font-weight: 600; }
.state-review { color: var(--amber); font-weight: 600; }
.state-stop { color: var(--red); font-weight: 600; }

/* Причина, по которой строка не готова. Раньше она была только в крайнем правом столбце,
   который при узком окне не был виден вовсе, — теперь её можно открыть прямо на строке. */
button.why {
    font: inherit;
    font-weight: 600;
    padding: 0;
    border: 0;
    border-bottom: 1px dashed currentColor;
    background: none;
    color: inherit;
    cursor: pointer;
    border-radius: 0;
}

tr.why-row td {
    white-space: normal;
    background: var(--surface-soft);
    color: var(--ink);
    padding: 12px 16px;
}

.issue-list { display: grid; gap: 10px; }
.issue-card { padding: 14px 16px; border-left: 3px solid var(--amber); border-radius: 8px; background: var(--surface); }
.issue-card h3 { margin: 0 0 5px; font-size: 16px; }
.issue-card p { margin: 0; color: var(--muted); }
.issue-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.issue-form label { flex: 0 1 260px; margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.issue-form label input, .issue-form label select { max-width: none; margin-top: 5px; }
.issue-form-wide label { flex-basis: 520px; }
.mapping-history > summary { cursor: pointer; font-weight: 700; }
.mapping-history[open] > summary { margin-bottom: 10px; }
.mapping-list { display: grid; gap: 10px; }
.mapping-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.mapping-item div { display: grid; gap: 3px; }
.mapping-item small { color: var(--muted); }

.problem { background: var(--red-fill); color: var(--red); padding: 12px 16px; border-radius: 8px; margin: 12px 0; }
.done { background: var(--green-fill); color: var(--green); padding: 12px 16px; border-radius: 8px; margin: 12px 0; }

.muted { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filters input, .filters select { max-width: 220px; }

.login-page { max-width: 420px; margin: 60px auto; }

.transient { transition: opacity .25s ease, transform .25s ease; }
.transient.is-hiding { opacity: 0; transform: translateY(-4px); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--teal) 58%, transparent);
    outline-offset: 2px;
}

/* Карточка строки остаётся боковой на большом экране и становится полноценным листом на
   узком. Так таблица сохраняет рабочую плотность, а детали не превращаются в десятки столбцов. */
.row-open { display: block; margin-top: 3px; color: var(--blue); font-size: 12px; font-weight: 600; }
.record-drawer-backdrop { position: fixed; inset: 0; z-index: 7000; background: rgba(15, 23, 26, .42); backdrop-filter: blur(1px); }
.record-drawer {
    position: fixed;
    z-index: 7010;
    inset: 0 0 0 auto;
    width: min(760px, calc(100vw - 72px));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 24px;
    background: var(--bg);
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 50px rgba(0, 0, 0, .18);
}
.record-drawer-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.record-drawer-head h2 { margin: 3px 0; font-size: 23px; }
.record-drawer-head p { margin: 0; color: var(--muted); }
.drawer-close { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 25px; text-decoration: none; }
.drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 18px 0; }
.source-boundary { color: var(--muted); font-size: 13px; }
.drawer-section { display: block; margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.drawer-section h3 { margin: 0 0 13px; font-size: 17px; }
.drawer-section .issue-card { border: 1px solid var(--line); border-left: 4px solid var(--amber); }
.issue-category { color: var(--amber); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.issue-card h4 { margin: 4px 0; }
.issue-route, .payload-field dl { display: grid; gap: 5px; margin: 10px 0; }
.issue-route div, .payload-field dl div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
.issue-route dt, .payload-field dt { color: var(--muted); font-size: 12px; }
.issue-route dd, .payload-field dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.issue-action { color: var(--ink) !important; font-weight: 700; }
.payload-fields { display: grid; gap: 9px; }
.payload-field { padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.payload-field > div { display: grid; grid-template-columns: minmax(170px, .75fr) minmax(0, 1.25fr); gap: 14px; }
.payload-value { overflow-wrap: anywhere; }
.payload-field code { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.service-fields summary { cursor: pointer; font-weight: 700; }
.field-grid { display: grid; gap: 8px; margin-top: 12px; }
.field-line { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.field-line small { grid-column: 2; color: var(--muted); }
.change-grid .field-line { grid-template-columns: 150px 1fr 1fr; }
.before-value { color: var(--muted); }
.after-value { color: var(--green); font-weight: 600; }

/* Версионный справочник: высокая информационная плотность без отдельной пятой вкладки. */
.catalog-hero { display: flex; justify-content: space-between; gap: 28px; margin: 18px 0 14px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.catalog-hero h2 { margin: 4px 0 5px; font-size: 25px; }
.catalog-hero p { max-width: 760px; margin: 0; color: var(--muted); }
.catalog-version-stamp { display: grid; gap: 7px; min-width: 235px; margin: 0; }
.catalog-version-stamp div { display: flex; justify-content: space-between; gap: 15px; }
.catalog-version-stamp dt { color: var(--muted); font-size: 12px; }
.catalog-version-stamp dd { margin: 0; font-size: 13px; text-align: right; }
.catalog-sections { display: flex; gap: 7px; overflow-x: auto; padding: 3px 0 12px; scrollbar-width: thin; }
.catalog-sections a { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.catalog-sections a.active { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 11%, var(--surface)); color: var(--teal); }
.catalog-search { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.catalog-search label { min-width: 126px; margin: 0 0 9px; font-weight: 700; }
.catalog-search > div { display: flex; flex: 1; align-items: center; gap: 9px; }
.catalog-search input { max-width: 620px; }
.catalog-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .72fr); gap: 16px; align-items: start; }
.catalog-list-card, .catalog-editor { min-width: 0; }
.catalog-editor { position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow: auto; }
.catalog-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.catalog-card-head h2 { margin-top: 3px; }
.catalog-card-head > b { display: inline-flex; min-width: 42px; justify-content: center; padding: 5px 9px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); }
.catalog-table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.catalog-table { min-width: 720px; font-size: 13px; }
.catalog-table th, .catalog-table td { padding: 8px 10px; white-space: normal; }
.catalog-table td > span { display: block; color: var(--muted); font-size: 12px; }
.catalog-table td:last-child { width: 72px; }
.catalog-edit-form label { color: var(--ink); font-size: 12px; font-weight: 700; }
.catalog-edit-form input, .catalog-edit-form select, .catalog-edit-form textarea { max-width: none; }
.catalog-edit-form textarea { min-height: 74px; resize: vertical; }
.form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catalog-change-metadata { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.permission-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 7px; background: var(--amber-fill); color: var(--amber); font-size: 13px; }
.check-line { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 42px; }
.check-line input { width: auto; }
.means-list { display: grid; gap: 7px; }
.means-list article { display: grid; grid-template-columns: minmax(150px, .45fr) 1fr auto; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.means-list article div { display: grid; }
.means-list article span, .means-list article p { color: var(--muted); font-size: 12px; }
.means-list article p { margin: 0; }
.catalog-readonly-grid { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); gap: 16px; }
.readonly-values { display: grid; gap: 9px; }
.readonly-values div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.readonly-values dt { color: var(--muted); }
.readonly-values dd { margin: 0; text-align: right; }
.revision-list { display: grid; gap: 8px; }
.revision-list article { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.revision-list article > div { display: flex; justify-content: space-between; gap: 16px; }
.revision-list span, .revision-list small { color: var(--muted); font-size: 12px; }
.revision-list p { margin: 7px 0; }
.impact-preview { margin-top: 16px; border-left: 4px solid var(--teal); }
.impact-totals { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 12px 0; }
.risk-badge { padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.risk-medium { background: var(--amber-fill); color: var(--amber); }
.risk-high, .risk-rollback { background: var(--red-fill); color: var(--red); }
.catalog-approval-form { display: grid; max-width: 680px; margin-top: 16px; }
.catalog-approval-form input, .catalog-approval-form textarea { max-width: none; }
.danger-button { margin-top: 14px; border-color: var(--red); background: var(--red); color: #fff; font-weight: 700; }

@media (max-width: 1100px) {
    body { padding-left: 16px; padding-right: 16px; }
    .profile-name { display: none; }
    .connection-form { grid-template-columns: 1fr 1fr; }
    .prom-table th:nth-child(6), .prom-table td:nth-child(6),
    .prom-table th:nth-child(7), .prom-table td:nth-child(7),
    .fiz-table th:nth-child(5), .fiz-table td:nth-child(5),
    .fiz-table th:nth-child(7), .fiz-table td:nth-child(7),
    .fiz-table th:nth-child(9), .fiz-table td:nth-child(9),
    .history-table th:nth-child(2), .history-table td:nth-child(2),
    .history-table th:nth-child(3), .history-table td:nth-child(3),
    .fsa-history-table th:nth-child(3), .fsa-history-table td:nth-child(3),
    .fsa-history-table th:nth-child(6), .fsa-history-table td:nth-child(6),
    .journal-table th:nth-child(3), .journal-table td:nth-child(3),
    .journal-table th:nth-child(7), .journal-table td:nth-child(7) { display: none; }
    .catalog-grid, .catalog-readonly-grid { grid-template-columns: 1fr; }
    .catalog-editor { position: static; max-height: none; }
}

@media (max-width: 760px) {
    body { padding-left: 12px; padding-right: 12px; font-size: 15px; }
    .topbar { min-height: 64px; }
    .topbar-heading h1 { font-size: 21px; }
    .mode-tabs { gap: 18px; }
    .card { padding: 14px; }
    .connection-form { grid-template-columns: 1fr; }
    .one-c-signin-shell { min-height: auto; padding: 24px 0 40px; }
    .one-c-signin-card { padding: 26px 22px; border-radius: 16px; }
    .connected-bar { align-items: flex-start; }
    .period-form { align-items: stretch; }
    .period-form > div:not(.submit-progress), .period-form > button { width: 100%; }
    .issue-form > * { width: 100%; max-width: none; }
    .job-heading { gap: 10px; }
    .fiz-table th:nth-child(8), .fiz-table td:nth-child(8) { display: none; }
    .fsa-history-table th:nth-child(4), .fsa-history-table td:nth-child(4) { display: none; }
    .fsa-table th:nth-child(2), .fsa-table td:nth-child(2),
    .fsa-table th:nth-child(4), .fsa-table td:nth-child(4),
    .fsa-table th:nth-child(5), .fsa-table td:nth-child(5) { display: none; }
    .selected-source form { width: 100%; margin-left: 0; }
    th, td { padding: 8px 9px; }
    .rows { max-height: 58vh; }
    .record-drawer { width: 100%; padding: 16px 12px 28px; }
    .record-drawer-backdrop { display: none; }
    .payload-field > div, .field-line, .change-grid .field-line { grid-template-columns: 1fr; }
    .field-line small { grid-column: 1; }
    .issue-route div, .payload-field dl div { grid-template-columns: 105px minmax(0, 1fr); }
    .catalog-hero { display: grid; padding: 17px; }
    .catalog-version-stamp { min-width: 0; }
    .catalog-sections { flex-wrap: wrap; overflow-x: visible; }
    .catalog-table { min-width: 690px; }
    .catalog-search { display: grid; }
    .catalog-search > div { flex-wrap: wrap; }
    .catalog-search input { flex: 1 1 100%; }
    .form-pair { grid-template-columns: 1fr; }
    .means-list article { grid-template-columns: 1fr; }
    .revision-list article > div { display: grid; gap: 2px; }
}
