:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-muted: #fbfbfd;
    --surface-strong: #f2f2f4;
    --text: #111111;
    --text-soft: #3a3a3c;
    --muted: #6e6e73;
    --line: #d2d2d7;
    --line-soft: #e5e5ea;
    --black: #000000;
    --white: #ffffff;
    --accent: #B5AA70;
    --accent-strong: #9f9460;
    --accent-soft: rgba(181, 170, 112, 0.14);
    --success: #248A3D;
    --success-soft: rgba(36, 138, 61, 0.1);
    --error: #D70015;
    --error-soft: rgba(215, 0, 21, 0.09);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.06);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-sm: 7px;
}

.operations-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.operations-head h2 {
    margin-bottom: 0;
}

.operations-settings,
.operations-launchbar,
.operations-filters,
.operations-progress-top,
.operations-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.operations-settings {
    justify-content: flex-end;
}

.operations-settings label,
.operations-recon-mode,
.operations-filters label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.operations-settings input {
    width: 96px;
}

.operations-recon-mode {
    margin-left: auto;
}

.operations-recon-mode select {
    min-width: 118px;
}

.operations-tabs {
    display: flex;
    align-items: end;
    gap: 4px;
    margin: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.operations-tab {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--muted);
    text-decoration: none;
}

.operations-tab:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.operations-tab.active {
    color: var(--text);
    border-color: var(--line);
    background: var(--surface);
    margin-bottom: -1px;
}

.operation-history-panel {
    margin-bottom: 18px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.operation-history-report,
.operation-history-item {
    border-top: 1px solid var(--line-soft);
}

.operation-history-report:first-child {
    border-top: 0;
}

.operation-history-report > summary,
.operation-history-item > summary {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding-left: 76px;
    padding-right: 0;
    cursor: pointer;
    list-style: none;
}

.operation-history-report > summary::-webkit-details-marker,
.operation-history-item > summary::-webkit-details-marker {
    display: none;
}

.operation-history-report > summary::after,
.operation-history-item > summary::after {
    position: absolute;
    top: 50%;
    left: 30px;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
    content: "+";
}

.operation-history-item > summary::after {
    /* The nested card itself has 10px horizontal padding: 10 + 20 = 30px. */
    left: 20px;
}

.operation-history-report[open] > summary::after,
.operation-history-item[open] > summary::after {
    content: "-";
}

.operation-history-title {
    font-weight: 700;
}

.operation-history-counts {
    color: var(--text-soft);
    font-size: 0.86rem;
    white-space: nowrap;
}

.operation-history-body {
    padding: 0 0 14px;
}

.operation-history-summary,
.operation-history-metrics {
    margin: 0 0 10px;
}

.operation-history-items {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}

.operation-history-item {
    padding: 0 10px;
}

.operation-history-item > summary {
    grid-template-columns: auto minmax(160px, 0.7fr) minmax(200px, 1fr) auto;
    min-height: 52px;
}

.operation-history-item pre {
    margin: 0 0 10px;
    padding: 10px;
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
}

@media (max-width: 860px) {
    .operation-history-report > summary,
    .operation-history-item > summary {
        grid-template-columns: auto 1fr auto;
    }

    .operation-history-report > summary > .muted,
    .operation-history-counts,
    .operation-history-item > summary > .muted {
        grid-column: 2 / -1;
        white-space: normal;
        padding-bottom: 8px;
    }
}

.operations-launchbar {
    margin: 0 0 14px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.operations-launchbar button,
.operations-settings button {
    min-height: 34px;
}

.operations-progress-panel,
.operations-project-panel,
.operations-report-panel {
    margin-bottom: 18px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.operations-progress-top,
.operations-section-title {
    justify-content: space-between;
    margin-bottom: 10px;
}

.operations-progress-top > span:last-child {
    white-space: nowrap;
}

.operations-section-title h3 {
    margin: 0;
}

.operations-filters {
    margin-bottom: 12px;
}

.operations-filters select {
    min-width: 190px;
}

.inline-check {
    cursor: pointer;
}

.operations-project-table {
    margin-bottom: 0;
    box-shadow: none;
}

.operations-project-table th:first-child,
.operations-project-table td:first-child {
    width: 44px;
    text-align: center;
}

.operations-project-name {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 220px;
}

.operations-report {
    display: grid;
    gap: 10px;
}

.operations-report-item {
    background: var(--surface-muted);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.operations-report-item summary {
    display: grid;
    grid-template-columns: minmax(90px, auto) minmax(180px, 1fr) minmax(160px, 1.4fr);
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 12px;
    cursor: pointer;
}

.operations-report-item summary::-webkit-details-marker {
    display: none;
}

.operations-report-item summary::after {
    justify-self: end;
    color: var(--muted);
    content: "Раскрыть";
    font-size: 0.82rem;
}

.operations-report-item[open] summary::after {
    content: "Свернуть";
}

.operations-report-item pre {
    max-height: 320px;
    margin: 0;
    padding: 0 12px 12px;
    overflow: auto;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
}

.operations-report-item.is-ok {
    border-color: rgba(36, 138, 61, 0.24);
}

.operations-report-item.is-error {
    border-color: rgba(215, 0, 21, 0.24);
}

@media (max-width: 860px) {
    .operations-head {
        display: block;
    }

    .operations-settings {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .operations-report-item summary {
        grid-template-columns: 1fr;
    }

    .operations-report-item summary::after {
        justify-self: start;
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: 0;
}

a {
    color: var(--accent);
    font-weight: 400;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 12px 28px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: saturate(180%) blur(18px);
}

.topbar h1 {
    flex: 0 0 auto;
    margin: 0;
    font-size: 1rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

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

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}

.brand-name {
    display: block;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.05;
    text-transform: uppercase;
}

.brand-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 280px;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.32rem 0.78rem;
    color: var(--text-soft);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--text);
    border-color: var(--line);
    text-decoration: none;
}

.main-nav a.active {
    color: var(--text);
    border-color: var(--accent);
    background: var(--surface);
}

.user-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.user-bar a {
    color: var(--text);
}

.user-bar form,
form.competitor-import-form {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.user-bar button {
    min-height: 30px;
    padding: 0.25rem 0.62rem;
    background: transparent;
    color: var(--text);
    border-color: var(--line-soft);
}

.user-bar .topbar-stop-all {
    color: var(--error);
    border-color: rgba(215, 0, 21, 0.45);
}

@media (max-width: 980px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .main-nav {
        order: 3;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        overflow-x: auto;
        padding-top: 2px;
    }
}

.container {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px;
}

h2, h3, h4 {
    color: var(--text);
    letter-spacing: 0;
}

h2 {
    margin: 0 0 18px;
    font-size: clamp(1.55rem, 2.4vw, 2.25rem);
    font-weight: 500;
    line-height: 1.1;
}

h3 {
    margin: 32px 0 12px;
    font-size: 1.18rem;
    font-weight: 500;
}

h4 {
    margin: 24px 0 10px;
    font-size: 1rem;
    font-weight: 500;
}

p {
    color: var(--muted);
}

.table {
    width: 100%;
    margin: 0 0 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--shadow-soft);
}

.table th,
.table td {
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-soft);
    text-align: left;
    vertical-align: middle;
    font-size: 0.9rem;
}

.table th {
    position: sticky;
    top: 64px;
    z-index: 5;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover {
    background: var(--surface-muted);
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.system-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.system-panel {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.system-panel.full-width {
    margin-top: 14px;
}

.system-panel h3 {
    margin-top: 0;
}

.status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-soft);
}

.status-line:last-child {
    border-bottom: 0;
}

.runtime-setting-line {
    align-items: center;
}

.runtime-timeout-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    white-space: nowrap;
}

.runtime-timeout-control input {
    width: 96px;
    min-height: 34px;
    text-align: right;
}

.system-panel-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    white-space: nowrap;
}

.status-pill.ok {
    color: var(--success);
    border-color: rgba(36, 138, 61, 0.45);
}

.status-pill.warn {
    color: var(--accent-strong);
    border-color: rgba(181, 170, 112, 0.55);
}

.status-pill.error {
    color: var(--error);
    border-color: rgba(215, 0, 21, 0.45);
}

.strategic-network-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--accent);
    font-size: 17px;
    line-height: 1;
    vertical-align: -1px;
}

.competitor-name-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.competitor-name-field .competitor-name-input {
    flex: 1 1 auto;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 5px 0 10px;
    border-radius: 50%;
    background: var(--line);
}

.status-dot.ok {
    background: var(--success);
}

.status-dot.error {
    background: var(--error);
}

.system-issues {
    margin: 0;
    padding-left: 18px;
}

.system-issues li {
    margin: 7px 0;
    color: var(--text-soft);
}

.system-issues li.error {
    color: var(--error);
}

.system-issues li.warning {
    color: var(--accent-strong);
}

.system-alert {
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text-soft);
    background: var(--surface);
}

.system-alert.ok {
    color: var(--success);
    border-color: rgba(36, 138, 61, 0.45);
}

.system-alert.warn {
    color: var(--accent-strong);
    border-color: rgba(181, 170, 112, 0.55);
}

.muted {
    color: var(--muted);
}

form {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

form label {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    margin-right: 12px;
    margin-bottom: 12px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 400;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="file"],
select,
textarea {
    max-width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 980px;
    font: inherit;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

input[type="range"] {
    accent-color: var(--accent);
}

input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 14px;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 980px;
    font: inherit;
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
    min-height: 82px;
    border-radius: var(--radius);
    resize: vertical;
}

button,
.button-link,
.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 3px 4px;
    padding: 6px 15px;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 980px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

button:hover:not(:disabled),
.button-link:hover,
.download-link:hover {
    color: var(--accent-strong);
    text-decoration: none;
    background: transparent;
    border-color: var(--accent-strong);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
}

.secondary-button {
    color: var(--text);
    background: transparent;
    border-color: var(--muted);
}

.secondary-button:hover:not(:disabled),
.button-link.secondary-button:hover {
    color: var(--text);
    background: transparent;
    border-color: var(--black);
}

.danger-button,
.btn-delete-project,
.btn-delete-reference,
.btn-delete-competitor,
.detach-competitor {
    color: var(--error);
    background: transparent;
    border-color: var(--error);
}

.danger-button:hover:not(:disabled),
.btn-delete-project:hover:not(:disabled),
.btn-delete-reference:hover:not(:disabled),
.btn-delete-competitor:hover:not(:disabled),
.detach-competitor:hover:not(:disabled) {
    color: var(--error);
    background: transparent;
    border-color: var(--black);
}

button + button,
button + .button-link,
.button-link + button,
.button-link + .button-link,
a + button,
button + a,
select + button,
input + button {
    margin-left: 8px;
}

.warning-box,
.import-panel,
.category-block {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.warning-box {
    padding: 14px 16px;
    margin: 14px 0 22px;
}

.warning-box ul {
    margin: 0 0 10px 18px;
    padding: 0;
}

.import-panel {
    padding: 16px;
    margin: 14px 0 18px;
}

.import-actions,
.catalog-save-panel,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.catalog-save-panel,
.toolbar {
    margin: 12px 0 18px;
}

.competitor-import-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.competitor-import-form input[type="file"] {
    max-width: 220px;
}

.competitor-import-status,
#catalogSelectionStatus,
.import-detail,
.muted {
    color: var(--muted);
    font-size: 0.86rem;
}

.import-detail {
    margin-top: 8px;
}

.reference-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0 12px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.reference-page-toolbar button,
.reference-page-toolbar select {
    min-height: 30px;
    font-size: 0.86rem;
}

.reference-region-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-soft);
}

.reference-region-filter select {
    min-width: 180px;
}

.reference-card-grid {
    display: grid;
    gap: 10px;
    margin: 12px 0 28px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.reference-list-header {
    display: grid;
    grid-template-columns: 42px minmax(260px, 1.2fr) minmax(170px, auto) minmax(250px, 0.8fr) minmax(270px, auto);
    gap: 14px;
    padding: 8px 14px;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    font-size: 0.78rem;
}

.reference-card {
    display: grid;
    grid-template-columns: 42px minmax(260px, 1.2fr) minmax(170px, auto) minmax(250px, 0.8fr) minmax(270px, auto);
    align-items: stretch;
    gap: 14px;
    min-width: 0;
    padding: 10px 14px 20px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: none;
    transition: background 0.12s ease;
}

.reference-card:last-child {
    border-bottom: 1px solid var(--line-soft);
}

.reference-card:hover {
    background: var(--surface-muted);
}

.reference-row-main,
.reference-settings-cell,
.reference-row-status {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
}

.reference-id-cell {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 30px;
    padding-top: 5px;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.reference-card-header,
.reference-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.reference-card-header {
    justify-content: space-between;
}

.reference-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    min-width: 0;
}

.reference-main-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.reference-field-stack {
    display: grid;
    align-content: flex-start;
    grid-template-rows: 30px 30px;
    gap: 8px;
    min-width: 0;
}

.reference-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.reference-name-input {
    width: 260px;
    max-width: 260px;
    min-height: 30px;
    font-size: 0.92rem;
    font-weight: 500;
}

.reference-region-inline,
.reference-second-line,
.reference-mask-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.reference-region-input {
    width: 160px;
    min-height: 30px;
}

.reference-second-line {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.reference-url-input {
    width: 260px;
    max-width: 260px;
    min-height: 30px;
    font-size: 0.86rem;
}

.reference-inline-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 7px 12px;
}

.reference-inline-fields label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.reference-mask-field > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reference-mask-field {
    height: 30px;
    align-items: center;
}

.reference-mask-field input[type="range"] {
    width: 112px;
}

.reference-api-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.reference-secondary-fields {
    grid-template-rows: 30px 30px 30px;
}

.reference-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.reference-row-status {
    position: relative;
    grid-template-rows: 30px 30px;
}

.reference-status-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 30px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reference-status-summary strong {
    color: var(--text);
    font-weight: 500;
}

.reference-operation-stats {
    position: relative;
    flex: 0 0 auto;
}

.reference-operation-stats summary,
.project-operation-stats summary {
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.82rem;
    list-style: none;
}

.reference-operation-stats summary::-webkit-details-marker,
.project-operation-stats summary::-webkit-details-marker {
    display: none;
}

.reference-operation-stats summary::before,
.project-operation-stats summary::before {
    content: '>';
    display: inline-block;
    margin-right: 4px;
    transition: transform 0.12s ease;
}

.reference-operation-stats[open] summary::before,
.project-operation-stats[open] summary::before {
    transform: rotate(90deg);
}

.reference-operation-stats > div {
    position: absolute;
    z-index: 3;
    right: 0;
    top: calc(100% + 6px);
    display: grid;
    gap: 4px;
    min-width: 220px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    white-space: normal;
}

.reference-operation-stats > div span {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.reference-card-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
}

.reference-card-meta > div {
    min-width: 0;
}

.reference-meta-label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.78rem;
}

.reference-card-meta strong {
    font-weight: 500;
}

.compact-input {
    max-width: 150px;
}

.reference-card-progress .progress-track {
    margin: 0;
}

.reference-card-progress {
    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;
}

.reference-card-message {
    display: none;
}

.reference-card-actions {
    display: grid;
    justify-content: end;
    align-content: flex-start;
    gap: 6px;
    padding-top: 0;
}

.reference-action-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
}

.reference-card-actions button,
.reference-card-actions .button-link {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.reference-card-actions button,
.reference-card-actions .button-link {
    margin-left: 0;
}

.competitor-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0 12px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.competitor-page-toolbar select {
    min-height: 30px;
    font-size: 0.86rem;
}

.competitor-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-soft);
}

.competitor-filter select {
    min-width: 180px;
}

.competitor-card-grid {
    display: grid;
    gap: 10px;
    margin: 12px 0 24px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.competitor-list-header {
    display: grid;
    grid-template-columns: 42px minmax(430px, 1.25fr) minmax(170px, auto) minmax(250px, 0.75fr) minmax(240px, auto);
    gap: 14px;
    padding: 8px 14px;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    font-size: 0.78rem;
}

.competitor-card {
    display: grid;
    grid-template-columns: 42px minmax(430px, 1.25fr) minmax(170px, auto) minmax(250px, 0.75fr) minmax(240px, auto);
    align-items: stretch;
    gap: 14px;
    min-width: 0;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    transition: background 0.12s ease;
}

.competitor-card:last-child {
    border-bottom: 1px solid var(--line-soft);
}

.competitor-card:hover {
    background: var(--surface-muted);
}

.competitor-row-main,
.competitor-defense-cell,
.competitor-row-status {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
}

.competitor-id-cell {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 30px;
    padding-top: 5px;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.competitor-title-line,
.competitor-second-line,
.competitor-status-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
}

.competitor-main-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.competitor-field-stack,
.competitor-protection-stack {
    display: grid;
    align-content: flex-start;
    grid-template-rows: 30px 30px;
    gap: 8px;
    min-width: 0;
}

.competitor-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.competitor-name-input {
    width: 260px;
    max-width: 260px;
    min-height: 30px;
    font-size: 0.92rem;
    font-weight: 500;
}

.competitor-url-input {
    width: 260px;
    max-width: 260px;
    min-height: 30px;
    font-size: 0.86rem;
}

.competitor-region-inline,
.competitor-adapter-field,
.competitor-mask-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
}

.competitor-region-input {
    width: 150px;
    min-height: 30px;
}

.competitor-adapter-select {
    width: 150px;
    min-height: 30px;
}

.competitor-protection-stack {
    min-width: 170px;
}

.competitor-protection-stack .mode-pill {
    justify-self: flex-start;
    min-height: 30px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.competitor-mask-field {
    height: 30px;
    align-items: center;
}

.competitor-defense-empty {
    display: block;
    min-height: 30px;
}

.competitor-mask-field > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.competitor-mask-field input[type="range"] {
    width: 112px;
}

.competitor-status-detail {
    word-break: break-word;
}

.competitor-card-actions {
    display: grid;
    justify-content: end;
    align-content: flex-start;
    gap: 6px;
}

.competitor-action-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
}

.competitor-card-actions button,
.competitor-card-actions .button-link {
    min-height: 28px;
    margin-left: 0;
    padding: 4px 9px;
    font-size: 0.82rem;
    white-space: nowrap;
}

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

.reference-create-panel {
    margin: 12px 0;
}

.competitor-create-panel,
.reference-create-panel {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.competitor-create-panel h4,
.reference-create-panel h4 {
    margin-top: 0;
}

.compact-create-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.compact-create-form label {
    margin: 0;
}

.compact-create-form input[type="text"] {
    width: 190px;
}

.compact-create-form button {
    margin: 0;
}

.help-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.text-error,
.error-cell {
    color: var(--error);
    font-weight: 400;
}

.error-cell {
    max-width: 400px;
    word-break: break-word;
}

.active-run-notice,
.inline-status {
    color: var(--success);
    font-weight: 400;
}

.inline-status {
    margin-left: 1em;
}

.import-status-row,
.preflight-progress-top,
.run-progress-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 999px;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.25s ease;
}

.run-progress-cell {
    min-width: 240px;
}

.run-datetime,
.run-match-summary,
.run-duration-cell,
.run-file-cell {
    white-space: nowrap;
}

.run-datetime {
    color: var(--muted);
}

.run-match-summary {
    min-width: 92px;
}

.run-progress-count {
    color: var(--text);
    font-weight: 500;
}

.run-progress-percent {
    min-width: 38px;
    color: var(--muted);
    text-align: right;
}

.run-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 190px;
    width: 205px;
}

.run-actions button {
    padding: 5px 9px;
}

.run-delete-link {
    display: inline-block;
    color: var(--error);
    font-weight: 400;
    text-decoration: underline;
}

.run-status-text {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    color: var(--text-soft);
    background: var(--surface-strong);
    border-radius: 999px;
    font-weight: 400;
}

.run-status[data-status="done"] .run-status-text {
    color: var(--success);
    background: var(--success-soft);
}

.run-status[data-status="running"] .run-status-text,
.run-status[data-status="queued"] .run-status-text {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.run-status[data-status="failed"] .run-status-text {
    color: var(--error);
    background: transparent;
}

tr[data-status]:not([data-status="running"]):not([data-status="paused"]) .run-elapsed {
    display: none;
}

.monitor-button {
    min-width: 232px;
}

.monitor-button:hover:not(:disabled),
.monitor-button.secondary-button:hover:not(:disabled) {
    color: var(--accent-strong);
    background: transparent;
    border-color: var(--accent-strong);
}

.monitor-button.is-loading {
    position: relative;
    padding-left: 2rem;
}

button.is-loading {
    position: relative;
    padding-left: 2rem;
}

.monitor-button.is-loading::before,
button.is-loading::before {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    width: 0.75rem;
    height: 0.75rem;
    margin-top: -0.375rem;
    border: 2px solid rgba(181, 170, 112, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.launch-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.ui-message-box {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    max-width: min(520px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.ui-message-box.status-error {
    border-color: rgba(180, 35, 24, 0.35);
    color: var(--danger);
}

.ui-message-box.status-ok {
    border-color: rgba(20, 125, 75, 0.35);
    color: var(--success);
}

.ui-message-box.is-hidden {
    display: none;
}

.ui-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.18);
}

.ui-confirm-box {
    width: min(420px, 100%);
    padding: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

.ui-confirm-box p {
    margin: 0 0 16px;
    color: var(--text);
    line-height: 1.45;
}

.ui-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.preflight-forecast,
.preflight-progress {
    max-width: 640px;
    margin-top: 8px;
}

.preflight-report {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.preflight-competitor {
    margin: 12px 0 6px;
}

.preflight-competitor.ok strong {
    color: var(--success);
}

.preflight-competitor.partial strong {
    color: var(--accent-strong);
}

.preflight-competitor.warn strong,
.preflight-competitor.error strong {
    color: var(--error);
}

.preflight-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
}

.preflight-card.ok {
    border-left-color: var(--success);
}

.preflight-card.partial {
    border-left-color: var(--accent);
}

.preflight-card.error {
    border-left-color: var(--error);
}

.preflight-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.preflight-card-header strong {
    color: var(--muted);
    font-weight: 500;
}

.preflight-card.ok .preflight-card-header strong {
    color: var(--success);
}

.preflight-card.partial .preflight-card-header strong {
    color: var(--accent-strong);
}

.preflight-card.error .preflight-card-header strong {
    color: var(--error);
}

.preflight-summary,
.preflight-category-meta,
.preflight-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.preflight-category-title {
    color: var(--text);
    font-weight: 500;
}

.category-action-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.category-button-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.project-competitor-row .category-button-row {
    flex-wrap: nowrap;
}

.category-button-row button,
.category-button-row .button-link {
    margin: 0;
}

.protected-session-status,
.competitor-connect-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 520px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.25;
}

.competitor-connect-status:empty {
    display: none;
    min-height: 0;
}

.row-settings-link {
    margin-top: 0;
}

.project-competitor-row button,
.project-competitor-row .button-link,
.competitor-import-form input[type="file"]::file-selector-button {
    box-sizing: border-box;
    height: 36px;
    min-height: 36px;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
}

.project-competitor-row .competitor-import-form {
    min-height: 36px;
}

.project-competitor-row .competitor-import-form input[type="file"] {
    min-height: 36px;
}

.project-competitor-row td {
    vertical-align: middle;
}

.status-ok {
    color: var(--success);
}

.status-error {
    color: var(--error);
}

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

.coverage-panel {
    display: grid;
    gap: 12px;
    margin: 16px 0 24px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

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

.coverage-head h3 {
    margin: 0;
}

.coverage-subtitle {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.coverage-totals {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.coverage-totals span,
.coverage-status,
.coverage-competitor {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    color: var(--text-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 0.86rem;
}

.coverage-totals strong {
    margin-right: 4px;
    font-weight: 500;
}

.coverage-accordion {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.coverage-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 38px;
    padding: 8px 12px;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.coverage-accordion summary::-webkit-details-marker {
    display: none;
}

.coverage-accordion summary::after {
    content: "+";
    color: var(--muted);
}

.coverage-accordion[open] summary {
    border-bottom: 1px solid var(--line-soft);
}

.coverage-accordion[open] summary::after {
    content: "-";
}

.coverage-accordion summary span {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.86rem;
}

.coverage-accordion .coverage-warning-list,
.coverage-accordion .coverage-list {
    padding: 10px;
}

.coverage-warning-list {
    display: grid;
    gap: 6px;
}

.coverage-warning {
    padding: 9px 11px;
    color: var(--error);
    background: var(--error-soft);
    border: 1px solid rgba(215, 0, 21, 0.16);
    border-radius: var(--radius-sm);
}

.coverage-list {
    display: grid;
    gap: 8px;
}

.coverage-row {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(260px, 0.8fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.coverage-row.coverage-unsupported {
    border-left-color: var(--error);
}

.coverage-row.coverage-not_ready,
.coverage-row.coverage-partial {
    border-left-color: var(--accent);
}

.coverage-row.coverage-monitored {
    border-left-color: var(--success);
}

.coverage-title-line,
.coverage-paths,
.coverage-competitors {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.coverage-title-line strong {
    color: var(--text);
    font-weight: 500;
}

.coverage-unsupported .coverage-status {
    color: var(--error);
    border-color: rgba(215, 0, 21, 0.26);
}

.coverage-not_ready .coverage-status,
.coverage-partial .coverage-status {
    color: var(--accent-strong);
    border-color: rgba(181, 170, 112, 0.32);
}

.coverage-monitored .coverage-status {
    color: var(--success);
    border-color: rgba(36, 138, 61, 0.26);
}

.coverage-reason {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.9rem;
}

.coverage-paths {
    margin-top: 8px;
}

.coverage-paths span {
    max-width: 460px;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
}

.coverage-competitors {
    justify-content: flex-end;
}

.coverage-competitor-ok {
    color: var(--success);
    border-color: rgba(36, 138, 61, 0.24);
}

.coverage-competitor-missing_url,
.coverage-competitor-needs_collection,
.coverage-competitor-not_applicable {
    color: var(--accent-strong);
    border-color: rgba(181, 170, 112, 0.34);
}

.coverage-competitor-error {
    color: var(--error);
    border-color: rgba(215, 0, 21, 0.28);
}

.coverage-empty {
    color: var(--muted);
}

.review-queue-link {
    margin: 8px 0 14px;
}

.review-queue-link .muted {
    margin-left: 8px;
}

.category-map-table textarea {
    width: min(680px, 100%);
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: 0.85rem;
}

.connection-panel {
    margin: 0 0 18px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.connection-panel-head,
.connection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.connection-panel h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 500;
}

.connection-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.connection-metrics div {
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
}

.connection-metrics span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.connection-metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 1.05rem;
    font-weight: 500;
}

.connection-actions {
    justify-content: flex-start;
}

.connection-next {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.connection-next li + li {
    margin-top: 5px;
}

.connection-details {
    margin-top: 14px;
}

.connection-details summary {
    cursor: pointer;
    color: var(--text-soft);
}

.compact-connection-table {
    margin-top: 10px;
    box-shadow: none;
}

.connection-status-cell {
    min-width: 170px;
}

.connection-status-cell .muted {
    display: block;
    margin-top: 4px;
    white-space: nowrap;
}

.candidate-line {
    margin: 6px 0;
    padding: 9px 10px;
    color: var(--text-soft);
    background: var(--surface-muted);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
    word-break: break-word;
}

.candidate-line.ok {
    border-left-color: var(--success);
}

.candidate-line.partial {
    border-left-color: var(--accent);
}

.candidate-line.warn {
    border-left-color: var(--error);
}

.candidate-line.saved {
    border-left-color: var(--black);
}

.preflight-category-group {
    display: grid;
    gap: 8px;
    margin: 4px 0 0 0;
}

.preflight-category-accordion {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: 0;
}

.preflight-category-accordion summary {
    cursor: pointer;
    list-style: none;
    padding: 9px 12px;
    color: var(--text);
    font-weight: 400;
}

.preflight-category-accordion summary::-webkit-details-marker {
    display: none;
}

.preflight-category-accordion summary::after {
    content: "+";
    float: right;
    color: var(--muted);
}

.preflight-category-accordion[open] summary::after {
    content: "-";
}

.preflight-category-accordion .preflight-category-group {
    border-top: 1px solid var(--line-soft);
    margin: 0;
    padding: 10px;
}

.preflight-url-list {
    display: grid;
    gap: 4px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.preflight-url-row {
    display: block;
    margin: 0;
    padding: 0;
}

.preflight-url {
    display: block;
    max-width: 100%;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.unknown-sample {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.unknown-sample button {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.category-block {
    margin-bottom: 16px;
    overflow: hidden;
}

.catalog-accordion {
    padding: 0;
}

.category-summary {
    cursor: pointer;
    padding: 14px 16px;
    color: var(--text);
    background: var(--surface);
    font-weight: 500;
}

.catalog-accordion .table {
    width: calc(100% - 24px);
    margin: 0 12px 12px;
    box-shadow: none;
}

.caution-value {
    display: inline-block;
    min-width: 1.5em;
    color: var(--accent);
    font-weight: 500;
    text-align: center;
}

.advanced-adapter summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 400;
}

.inline-advanced {
    align-self: stretch;
    min-width: 240px;
}

.inline-advanced summary {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
}

.inline-advanced[open] {
    width: 100%;
    padding-top: 4px;
}

.inline-advanced[open] label {
    margin-top: 8px;
}

.wiki-shell {
    max-width: 980px;
}

.wiki-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    max-width: 980px;
}

.wiki-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wiki-accordion {
    margin: 0 0 10px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.wiki-accordion summary {
    cursor: pointer;
    padding: 15px 18px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    list-style: none;
}

.wiki-accordion summary::-webkit-details-marker {
    display: none;
}

.wiki-accordion summary::after {
    content: "+";
    float: right;
    color: var(--muted);
    font-weight: 400;
}

.wiki-accordion[open] summary {
    border-bottom: 1px solid var(--line-soft);
}

.wiki-accordion[open] summary::after {
    content: "−";
}

.wiki-content {
    padding: 14px 18px 18px;
}

.wiki-view-text {
    color: var(--text-soft);
    white-space: pre-line;
}

.wiki-edit-mode .wiki-view-text {
    display: none;
}

.wiki-edit-panel label {
    display: flex;
    margin: 0 0 12px;
}

.wiki-edit-panel input,
.wiki-edit-panel textarea {
    width: 100%;
}

.wiki-edit-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wiki-image-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.wiki-image-actions input[type="file"] {
    max-width: 320px;
}

.wiki-edit-actions button {
    margin: 3px 0;
}

.wiki-image {
    margin: 12px 0;
}

.wiki-image img {
    display: block;
    max-width: 100%;
    max-height: 680px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: var(--surface-muted);
    object-fit: contain;
}

.wiki-image figcaption {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.84rem;
}

.wiki-content p {
    margin: 0 0 10px;
}

.wiki-content ul,
.wiki-content ol {
    margin: 0 0 0 20px;
    padding: 0;
    color: var(--text-soft);
}

.wiki-content li + li {
    margin-top: 6px;
}

.compact-sites-table .action-cell,
.action-cell {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    color: var(--text-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.protected-sites-table .mode-pill {
    color: var(--accent);
    border-color: var(--accent);
}

.site-protection-pill {
    gap: 6px;
    border-radius: 4px;
}

.site-protection-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.site-protection-pill.protected {
    color: #ffffff;
    background: #1f2328;
    border-color: #1f2328;
}

.site-protection-pill.simple {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 13%, white);
    border-color: color-mix(in srgb, var(--accent) 64%, white);
}

.inline-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.inline-form label {
    margin: 0;
}

.inline-form button {
    margin-bottom: 0;
}

.breadcrumbs {
    position: sticky;
    top: 64px;
    z-index: 25;
    margin: -28px -28px 24px;
    padding: 10px 28px;
    color: var(--muted);
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: saturate(180%) blur(18px);
}

@media (max-width: 820px) {
    .connection-metrics {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }
}

@media (max-width: 560px) {
    .connection-metrics {
        grid-template-columns: 1fr;
    }
}

.breadcrumbs a {
    color: var(--text-soft);
    font-weight: 400;
}

.breadcrumbs a:hover {
    color: var(--text);
}

@media (max-width: 1160px) {
    .reference-list-header,
    .competitor-list-header {
        grid-template-columns: minmax(320px, 1.2fr) minmax(260px, 0.8fr);
    }

    .reference-list-header {
        grid-template-columns: 42px minmax(260px, 1fr) minmax(170px, auto) minmax(250px, 0.8fr);
    }

    .competitor-list-header {
        grid-template-columns: 42px minmax(360px, 1fr) minmax(170px, auto) minmax(250px, 0.8fr);
    }

    .reference-list-header span:last-child,
    .competitor-list-header span:last-child {
        display: none;
    }

    .reference-card,
    .competitor-card {
        grid-template-columns: minmax(320px, 1.2fr) minmax(260px, 0.8fr);
    }

    .reference-card {
        grid-template-columns: 42px minmax(260px, 1fr) minmax(170px, auto) minmax(250px, 0.8fr);
    }

    .competitor-card {
        grid-template-columns: 42px minmax(360px, 1fr) minmax(170px, auto) minmax(250px, 0.8fr);
    }

    .reference-card-actions,
    .competitor-card-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .reference-card-actions {
        grid-column: 2 / -1;
    }

    .competitor-card-actions {
        grid-column: 2 / -1;
    }
}

#createProjectForm {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

#createProjectForm label {
    margin: 0;
}

#createProjectForm button {
    margin-bottom: 0;
}

.projects-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.projects-head h2 {
    margin: 0;
}

.projects-monitoring-count {
    display: inline-block;
    margin-top: 3px;
    font-size: 0.84rem;
}

#createProjectForm.project-create-inline {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

#createProjectForm.project-create-inline input {
    width: min(360px, 52vw);
}

.project-preview-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-preview-card {
    display: grid;
    grid-template-columns: minmax(290px, 1.1fr) minmax(340px, 1.1fr) minmax(380px, auto);
    align-items: center;
    gap: 16px;
    min-height: 84px;
    padding: 10px 14px 20px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.project-title-row,
.project-run-top,
.project-run-output,
.project-preview-actions,
.project-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.project-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    color: var(--muted);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    font-size: 0.9rem;
}

.project-name-input {
    width: min(330px, 36vw);
}

.project-meta-line {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.92rem;
}

.project-meta-truncate {
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-competitor-summary {
    white-space: nowrap;
}

.project-operation-stats {
    flex: 0 0 auto;
}

.project-operation-stats[open] {
    flex-basis: 100%;
}

.project-operation-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, max-content));
    gap: 6px 14px;
    width: max-content;
    max-width: 100%;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line-soft);
    color: var(--text-soft);
    font-size: 0.82rem;
}

.project-operation-stats-grid span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-operation-stats-grid strong {
    color: var(--text);
    font-weight: 500;
}

.operations-cell-subline {
    display: block;
    margin-top: 3px;
    font-size: 0.82rem;
}

.operations-project-stats {
    display: block;
    margin-top: 4px;
}

.operations-project-stats summary {
    cursor: pointer;
    color: var(--text-soft);
    font-size: 0.82rem;
    list-style: none;
}

.operations-project-stats summary::-webkit-details-marker {
    display: none;
}

.operations-project-stats summary::before {
    content: '> ';
}

.operations-project-stats[open] summary::before {
    content: 'v ';
}

.operations-project-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 5px 12px;
    min-width: 310px;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line-soft);
    color: var(--text-soft);
    font-size: 0.8rem;
}

.operations-project-stats-grid span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.operations-project-stats-grid strong {
    color: var(--text);
    font-weight: 500;
}

.project-run-result {
    min-width: 0;
    overflow: hidden;
}

.project-run-output {
    min-height: 34px;
    margin-top: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.project-run-message {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-run-error {
    color: var(--error);
}

.project-separator {
    color: var(--muted);
}

.project-card-status {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.9rem;
}

.project-card-status:empty {
    display: none;
}

.project-card-status.status-ok {
    color: var(--success);
}

.project-card-status.status-warning {
    color: var(--accent-strong);
}

.project-card-status.status-error {
    color: var(--error);
}

.project-preview-actions {
    justify-content: flex-end;
    gap: 8px;
}

.project-preview-actions button,
.project-preview-actions .button-link,
.project-run-output .download-link {
    min-height: 32px;
    margin: 0;
    padding: 5px 12px;
}

@media (max-width: 1180px) {
    .project-preview-card {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
    }

    .project-preview-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .project-name-input {
        width: min(330px, 48vw);
    }
}

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

@media (max-width: 860px) {
    .topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .container {
        padding: 18px;
    }

    .table {
        display: block;
        overflow-x: auto;
    }

    .table th {
        position: static;
    }

    .reference-page-toolbar,
    .competitor-page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .reference-list-header,
    .competitor-list-header {
        display: none;
    }

    .reference-region-filter,
    .competitor-filter {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .reference-card,
    .competitor-card {
        grid-template-columns: 1fr;
    }

    .projects-head {
        align-items: stretch;
        flex-direction: column;
    }

    #createProjectForm.project-create-inline {
        align-items: stretch;
        justify-content: flex-start;
    }

    #createProjectForm.project-create-inline input {
        width: 100%;
    }

    .project-preview-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .project-preview-actions {
        justify-content: flex-start;
    }

    .project-name-input {
        width: min(260px, 100%);
        max-width: 100%;
    }

    .project-meta-truncate,
    .project-run-message {
        max-width: 100%;
        white-space: normal;
    }

    .coverage-head,
    .coverage-row {
        grid-template-columns: 1fr;
    }

    .coverage-head {
        display: grid;
    }

    .coverage-totals,
    .coverage-competitors {
        justify-content: flex-start;
    }

    .coverage-paths span {
        max-width: 100%;
        white-space: normal;
    }

    .reference-card {
        grid-template-columns: 42px 1fr;
    }

    .competitor-card {
        grid-template-columns: 42px 1fr;
    }

    .reference-id-cell,
    .competitor-id-cell {
        grid-row: 1 / span 3;
    }

    .reference-row-main,
    .reference-settings-cell,
    .reference-row-status,
    .reference-card-actions,
    .competitor-row-main,
    .competitor-defense-cell,
    .competitor-row-status,
    .competitor-card-actions {
        grid-column: 2;
    }

    .reference-main-fields,
    .competitor-main-fields {
        flex-direction: column;
    }

    .reference-name-input,
    .reference-url-input,
    .competitor-name-input,
    .competitor-url-input {
        width: min(260px, 100%);
        max-width: 100%;
    }

    .reference-card-actions,
    .competitor-card-actions {
        justify-content: flex-start;
    }

    .competitor-action-row {
        justify-content: flex-start;
    }

    .competitor-create-grid {
        grid-template-columns: 1fr;
    }

    form label {
        width: 100%;
        margin-right: 0;
    }

    input[type="text"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        width: 100%;
    }

    .monitor-button {
        width: 100%;
    }
}

.operations-schedule-panel {
    margin: 0 0 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.operations-schedule-grid {
    display: grid;
    gap: 8px;
}

.operations-schedule-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.2fr) max-content max-content minmax(120px, .8fr) minmax(150px, 1fr) minmax(180px, 1.4fr) max-content;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    border-top: 1px solid var(--line-soft);
    padding-top: 8px;
    font-size: 0.88rem;
}

.operations-schedule-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.operations-schedule-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--text-soft);
}

.operations-schedule-name {
    color: var(--text) !important;
}

.operations-schedule-row input[type="number"] {
    width: 54px;
}

.operations-schedule-row select {
    min-width: 72px;
}

.operations-schedule-clock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.operations-schedule-clock select {
    min-width: 58px;
}

.operations-schedule-projects {
    position: relative;
}

.operations-schedule-projects summary {
    cursor: pointer;
    color: var(--accent);
    white-space: nowrap;
}

.operations-schedule-project-list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: min(360px, 70vw);
    max-height: 300px;
    overflow: auto;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.operations-schedule-project-list label {
    display: flex;
    padding: 4px 0;
    color: var(--text) !important;
}

.operations-schedule-save {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .operations-schedule-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .operations-schedule-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operations-schedule-row > .operations-schedule-save {
        width: 100%;
    }
}

/* Operations schedule controls: fixed action column and readable time picker. */
.operations-schedule-panel {
    --operations-schedule-action-width: 132px;
}
.operations-schedule-title {
    align-items: center;
}
.operations-schedule-grid {
    gap: 0;
}
.operations-schedule-row {
    grid-template-columns: minmax(170px, 1.25fr) 108px 124px minmax(200px, 1.15fr) minmax(170px, 1fr) var(--operations-schedule-action-width);
    min-height: 50px;
    padding: 8px 0;
}
.operations-schedule-row input[type="time"] {
    width: 92px;
}
.operations-schedule-row input[type="time"].schedule-time-green::-webkit-calendar-picker-indicator {
    filter: invert(39%) sepia(84%) saturate(635%) hue-rotate(95deg) brightness(84%) contrast(90%);
}
.operations-schedule-row input[type="time"].schedule-time-red::-webkit-calendar-picker-indicator {
    filter: invert(19%) sepia(91%) saturate(2660%) hue-rotate(343deg) brightness(84%) contrast(93%);
}
.operations-schedule-row select {
    width: 100%;
    min-width: 0;
}
.operations-schedule-field {
    white-space: nowrap;
}
.operations-schedule-project-picker {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.operations-schedule-project-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.link-button {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}
.link-button:hover {
    text-decoration: underline;
}
.operations-schedule-status {
    min-width: 0;
    overflow-wrap: anywhere;
}
.operations-schedule-action {
    width: var(--operations-schedule-action-width);
    min-width: var(--operations-schedule-action-width);
    justify-content: center;
    white-space: nowrap;
}
@media (max-width: 1300px) {
    .operations-schedule-row {
        grid-template-columns: minmax(180px, 1fr) 108px 124px minmax(170px, 1fr) var(--operations-schedule-action-width);
    }
    .operations-schedule-project-picker {
        grid-column: 1 / span 3;
    }
    .operations-schedule-status {
        grid-column: 4 / span 1;
    }
}
@media (max-width: 760px) {
    .operations-schedule-panel {
        --operations-schedule-action-width: 100%;
    }
    .operations-schedule-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .operations-schedule-project-picker,
    .operations-schedule-status,
    .operations-schedule-action {
        grid-column: 1 / -1;
    }
    .operations-schedule-action {
        width: 100%;
        min-width: 0;
    }
}

.pricing-settings-page {
    max-width: 1480px;
}

.pricing-settings-head {
    margin-bottom: 16px;
}

.pricing-rule-panel {
    margin-bottom: 14px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.pricing-rule-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding: 0 16px;
    cursor: pointer;
    list-style: none;
}

.pricing-rule-panel > summary::-webkit-details-marker {
    display: none;
}

.pricing-rule-panel > summary::after {
    order: 3;
    color: var(--muted);
    content: "Открыть";
    font-size: 0.84rem;
}

.pricing-rule-panel[open] > summary {
    border-bottom: 1px solid var(--line-soft);
}

.pricing-rule-panel[open] > summary::after {
    content: "Свернуть";
}

.pricing-rule-panel-title {
    font-size: 1rem;
    font-weight: 650;
}

.pricing-rule-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.pricing-rule-form {
    padding: 16px;
}

.pricing-rule-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
}

.pricing-rule-cell {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 9px;
    min-height: 62px;
    padding: 10px 11px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    color: var(--text);
    cursor: pointer;
}

.pricing-rule-cell:hover {
    background: var(--surface-muted);
}

.pricing-rule-cell input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent-strong);
}

.pricing-rule-cell input:disabled {
    cursor: not-allowed;
}

.pricing-rule-label {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    line-height: 1.25;
}

.pricing-rule-basis {
    min-width: 34px;
    padding: 3px 6px;
    color: var(--text-soft);
    background: var(--surface-strong);
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    font-size: 0.76rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.collection-rule-cell {
    grid-template-columns: 18px minmax(0, 1fr);
}

.pricing-rule-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.pricing-rule-actions button {
    min-width: 142px;
    min-height: 36px;
}

@media (max-width: 1420px) {
    .pricing-rule-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .pricing-rule-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .pricing-rule-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .pricing-rule-panel > summary {
        min-height: 52px;
        padding: 0 12px;
    }

    .pricing-rule-form {
        padding: 12px;
    }

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

@media (max-width: 480px) {
    .pricing-rule-panel > summary {
        gap: 8px;
    }

    .pricing-rule-panel-title {
        font-size: 0.92rem;
    }

    .pricing-rule-count {
        font-size: 0.78rem;
        white-space: normal;
    }

    .pricing-rule-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pricing-rule-actions button {
        width: 100%;
    }
}

.pricing-observed-groups {
    margin-top: 16px;
}

.pricing-observed-groups h3 {
    margin: 0 0 9px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 600;
}

.pricing-rule-cell-unconfigured {
    color: var(--muted);
    cursor: default;
}

.pricing-rule-cell-unconfigured:hover {
    background: transparent;
}

.pricing-rule-cell-unconfigured .pricing-rule-basis {
    color: var(--muted);
    background: var(--surface-muted);
}

.pricing-rule-cell-candidate .pricing-rule-basis {
    color: var(--muted);
    background: var(--surface-muted);
}

/* Server operation dispatcher */
.dispatcher-panel {
    margin-top: 16px;
}
.dispatcher-table td {
    vertical-align: top;
}
.dispatcher-table td:first-child {
    min-width: 310px;
}
.dispatcher-table td:nth-child(2) {
    min-width: 220px;
}
.dispatcher-attention td {
    background: #fff1f1;
}
.dispatcher-details {
    margin-top: 6px;
}
.dispatcher-details summary {
    color: var(--muted, #667085);
    cursor: pointer;
}
.dispatcher-details pre {
    max-width: 680px;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    margin: 8px 0 0;
    font: inherit;
    color: var(--muted, #667085);
}
.dispatcher-stop {
    min-width: 110px;
}
@media (max-width: 900px) {
    .dispatcher-table td:first-child,
    .dispatcher-table td:nth-child(2) {
        min-width: 190px;
    }
}

/* Unified control system: shared typography, radius, and control heights. */
:root {
    --ui-font-family: "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
    --ui-control-height-compact: 30px;
    --ui-control-height-default: 36px;
    --ui-control-height-large: 44px;
    --ui-control-radius: 980px;
}

body,
h1, h2, h3, h4, h5, h6,
button,
input,
select,
textarea {
    font-family: var(--ui-font-family);
}

.main-nav a,
button,
.button-link,
.download-link,
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea,
input[type="file"]::file-selector-button {
    border-radius: var(--ui-control-radius) !important;
}

.main-nav a,
button:not(.link-button),
.button-link,
.download-link,
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select {
    min-height: var(--ui-control-height-default) !important;
}

.user-bar button,
.reference-card-actions button,
.competitor-card-actions button,
.run-actions button,
.category-button-row button,
.unknown-sample button {
    min-height: var(--ui-control-height-compact) !important;
}

.link-button {
    min-height: 0 !important;
}



/* Unified content accordion indicators. */
details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion) > summary {
    position: relative;
    min-height: 48px;
    padding-left: 76px;
    padding-right: 0;
    list-style: none;
}

details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion) > summary::-webkit-details-marker {
    display: none;
}

details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion) > summary::marker {
    content: "";
}

details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion) > summary::before {
    display: none;
    content: none;
}

details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion) > summary::after {
    position: absolute;
    top: 50%;
    left: 30px;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    float: none;
    color: var(--accent);
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
    content: "+";
}

details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion)[open] > summary::after {
    content: "-";
}
/* Operations schedule timing controls as one joined panel. */
@media (min-width: 1301px) {
    .operations-schedule-row {
        grid-template-columns: minmax(170px, 1.25fr) max-content minmax(200px, 1.15fr) minmax(170px, 1fr) var(--operations-schedule-action-width);
    }
}
@media (max-width: 1300px) {
    .operations-schedule-row {
        grid-template-columns: minmax(180px, 1fr) max-content minmax(170px, 1fr) var(--operations-schedule-action-width);
    }
    .operations-schedule-project-picker {
        grid-column: 1 / span 2;
    }
    .operations-schedule-status {
        grid-column: 3 / span 1;
    }
}
.operations-schedule-timing {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    width: max-content;
}
.operations-schedule-timing .operations-schedule-field {
    box-sizing: border-box;
    height: 36px;
    gap: 6px;
    margin: 0;
    padding: 0 8px;
}
.operations-schedule-timing .operations-schedule-field + .operations-schedule-field {
    border-left: 1px solid var(--line-soft);
}
.operations-schedule-timing input[type="number"],
.operations-schedule-timing input[type="time"] {
    background: transparent;
    border: 0;
    box-shadow: none;
}
.operations-schedule-timing input:focus {
    outline: 1px solid var(--accent);
    outline-offset: -2px;
}
@media (max-width: 760px) {
    .operations-schedule-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .operations-schedule-timing {
        grid-column: 1 / -1;
    }
    .operations-schedule-project-picker,
    .operations-schedule-status,
    .operations-schedule-action {
        grid-column: 1 / -1;
    }
}
@media (min-width: 1301px) {
    .operations-schedule-timing {
        position: relative;
        left: -100px;
    }
}
/* Unified joined controls for each operations schedule row. */
.operations-schedule-control-group {
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    box-sizing: border-box;
    display: inline-flex;
    gap: 0;
    max-width: 100%;
    min-width: 0;
    width: max-content;
}
.operations-schedule-control-group .operations-schedule-timing,
.operations-schedule-control-group .operations-schedule-project-picker,
.operations-schedule-control-group .operations-schedule-project-actions {
    display: contents;
}
.operations-schedule-control-group .operations-schedule-field {
    box-sizing: border-box;
    flex: 0 0 auto;
    height: 36px;
    margin: 0;
    padding: 0 8px;
}
.operations-schedule-control-group .operations-schedule-projects {
    box-sizing: border-box;
    flex: 0 0 auto;
    height: 36px;
    margin: 0;
    padding: 0 8px;
}
.operations-schedule-control-group .operations-schedule-projects > summary {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    height: 36px;
    min-height: 36px !important;
    padding: 0 4px 0 76px !important;
    white-space: nowrap;
}
.operations-schedule-control-group .link-button {
    align-items: center;
    background: transparent;
    border: 0;
    box-sizing: border-box;
    color: var(--text-soft);
    display: flex;
    font: inherit;
    height: 36px;
    justify-content: center;
    margin: 0;
    min-height: 36px !important;
    padding: 0 10px;
    white-space: nowrap;
}
.operations-schedule-control-group .link-button:hover {
    background: transparent;
    color: var(--text);
    text-decoration: none;
}
.operations-schedule-control-group .operations-schedule-field + .operations-schedule-field,
.operations-schedule-control-group .operations-schedule-projects,
.operations-schedule-control-group [data-schedule-select-active],
.operations-schedule-control-group [data-schedule-clear-projects] {
    border-left: 1px solid var(--line-soft);
}
@media (min-width: 1301px) {
    .operations-schedule-row {
        grid-template-columns: minmax(170px, 1.25fr) max-content minmax(170px, 1fr) var(--operations-schedule-action-width);
    }
    .operations-schedule-control-group {
        left: -100px;
        position: relative;
    }
}
@media (max-width: 1300px) {
    .operations-schedule-row {
        grid-template-columns: minmax(180px, 1fr) max-content var(--operations-schedule-action-width);
    }
    .operations-schedule-status {
        grid-column: 1 / span 2;
    }
    .operations-schedule-action {
        grid-column: 3;
    }
}
@media (max-width: 1100px) and (min-width: 761px) {
    .operations-schedule-row {
        grid-template-columns: minmax(0, 1fr) var(--operations-schedule-action-width);
    }
    .operations-schedule-name,
    .operations-schedule-control-group {
        grid-column: 1 / -1;
    }
    .operations-schedule-control-group {
        flex-wrap: wrap;
        left: auto;
        position: static;
        width: 100%;
    }
    .operations-schedule-status {
        grid-column: 1;
    }
    .operations-schedule-action {
        grid-column: 2;
    }
}
@media (max-width: 760px) {
    .operations-schedule-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .operations-schedule-name,
    .operations-schedule-control-group,
    .operations-schedule-status,
    .operations-schedule-action {
        grid-column: 1 / -1;
    }
    .operations-schedule-control-group {
        flex-wrap: wrap;
        left: auto;
        position: static;
        width: 100%;
    }
}

/* Keep checkbox indicators consistent across the service. */
input[type="checkbox"] { accent-color: #000 !important; }

/* Project card actions: six equal controls in two rows. */
.project-preview-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 44px;
    gap: 0;
    width: 100%;
}
.project-preview-actions > button,
.project-preview-actions > .button-link {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    height: 44px;
    justify-content: center;
    margin: 0;
    min-height: 44px !important;
    min-width: 0;
    padding: 0 6px;
    width: 100%;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .project-preview-actions > button,
    .project-preview-actions > .button-link {
        font-size: 0.875rem;
        padding: 0 3px;
    }
}

/* Align project information with its two-row action grid. */
.project-preview-main { display: grid; grid-template-rows: 44px 44px; gap: 0; min-width: 0; }
.project-title-row { box-sizing: border-box; display: grid; grid-template-columns: 42px minmax(0, 1fr) 96px; gap: 0; height: 44px; min-width: 0; border: 1px solid var(--line-soft); border-bottom: 0; }
.project-id-cell { align-items: center; box-sizing: border-box; display: flex; height: 100%; justify-content: center; border-right: 1px solid var(--line-soft); }
.project-title-row .project-id { flex: 0 0 30px; width: 30px; height: 30px; }
.project-title-row .project-name-input { box-sizing: border-box; width: 100%; max-width: none; min-width: 0; height: 100%; min-height: 0 !important; margin: 0; padding: 0 8px; border: 0; border-right: 1px solid var(--line-soft); border-radius: 0 !important; }
.project-title-row > .status-pill { align-self: center; justify-self: center; margin: 0; }
.project-meta-line { box-sizing: border-box; display: grid; grid-template-columns: minmax(56px, .75fr) minmax(92px, 1.45fr) minmax(84px, 1.1fr) minmax(44px, .6fr); grid-template-rows: 44px; gap: 0; height: 44px; min-width: 0; margin-top: 0; border: 1px solid var(--line-soft); }
.project-meta-line > .project-reference-count, .project-meta-line > .project-competitor-summary, .project-meta-line > .project-file-action, .project-meta-line > .project-operation-stats { align-items: center; box-sizing: border-box; display: flex; height: 100%; min-width: 0; padding: 0 6px; border-right: 1px solid var(--line-soft); }
.project-meta-line > .project-reference-count, .project-meta-line > .project-competitor-summary { overflow: hidden; color: var(--text-soft); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.project-meta-line > .project-file-action { justify-content: center; padding: 0 3px; }
.project-file-action > .download-link { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0 !important; margin: 0; padding: 0 3px; border-radius: 0 !important; font-size: .78rem; white-space: nowrap; }
.project-meta-line > .project-operation-stats { position: relative; display: block; margin: 0; padding: 0; overflow: visible; border-right: 0; }
details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion).project-operation-stats > summary { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; min-height: 44px !important; padding: 0 !important; font-size: 0; }
details:not(.lead-date-picker):not(.operation-history-report):not(.operation-history-item):not(.dashboard-project-accordion).project-operation-stats > summary::after { left: 50% !important; transform: translate(-50%, -50%) !important; }
.project-operation-stats[open] { z-index: 5; }
.project-operation-stats[open] > .project-operation-stats-grid { position: absolute; top: 100%; right: 0; z-index: 10; box-sizing: border-box; width: max-content; min-width: min(310px, calc(100vw - 40px)); max-width: min(520px, calc(100vw - 40px)); margin: 0; padding: 10px; border: 1px solid var(--line-soft); background: var(--surface); box-shadow: var(--shadow-soft); }
/* Project cards: project facts at left, run summary above a single action rail. */
.project-preview-list { display: flex; flex-direction: column; gap: 10px; }
.project-preview-card {
    display: grid;
    grid-template-columns: minmax(0, .42fr) minmax(0, .58fr);
    grid-template-rows: 44px 44px;
    align-items: stretch; gap: 0; min-height: 88px; padding: 0; box-sizing: border-box;
    border: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; position: relative;
}
.project-preview-card + .project-preview-card { border-top: 1px solid var(--line-soft); }
.project-preview-main {
    display: grid; grid-column: 1; grid-row: 1 / span 2;
    grid-template-rows: 44px 44px; height: 88px; min-width: 0;
}
.project-title-row {
    display: grid; grid-template-columns: 52px minmax(0,1fr) 96px; height: 44px; min-width: 0;
    box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line-soft);
}
.project-id-cell {
    display: flex; align-items: center; justify-content: center; height: 100%; box-sizing: border-box;
    border-right: 1px solid var(--line-soft);
}
.project-title-row .project-id { flex: 0 0 30px; width: 30px; height: 30px; }
.project-title-row .project-name-input {
    width: 100%; max-width: none; min-width: 0; height: 100%; min-height: 0 !important;
    margin: 0; padding: 0 10px; box-sizing: border-box; border: 0; border-radius: 0 !important;
    background: transparent;
}
.project-title-row .project-name-input:focus {
    border: 0; box-shadow: none; outline: 1px solid var(--accent); outline-offset: -2px;
}
.project-title-row > .status-pill { align-self: center; justify-self: center; margin: 0; }
.project-meta-line {
    display: grid; grid-template-columns: minmax(56px,.7fr) minmax(0,1.7fr) 44px;
    grid-template-rows: 44px; height: 44px; min-width: 0; margin: 0; gap: 0; overflow: visible;
    box-sizing: border-box; border-bottom: 1px solid var(--line-soft);
}
.project-meta-line > .project-reference-count,
.project-meta-line > .project-competitor-summary,
.project-meta-line > .project-operation-stats {
    display: flex; align-items: center; height: 100%; min-width: 0; padding: 0 7px;
    box-sizing: border-box; border-right: 1px solid var(--line-soft);
}
.project-meta-line > .project-reference-count,
.project-meta-line > .project-competitor-summary {
    overflow: hidden; color: var(--text-soft); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap;
}
.project-meta-line > .project-operation-stats { display: block; margin: 0; padding: 0; border: 0; position: relative; }
.project-run-result {
    display: flex; grid-column: 2; grid-row: 1; align-items: center; height: 44px; min-width: 0;
    padding: 0 10px; box-sizing: border-box; border-left: 1px solid var(--line-soft); overflow: hidden;
}
.project-run-top, .project-run-output {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; height: 44px; min-width: 0;
    margin: 0; overflow: hidden; box-sizing: border-box;
}
.project-run-top { flex: 0 1 auto; padding-right: 8px; border-right: 1px solid var(--line-soft); }
.project-run-output { flex: 1 1 auto; padding: 0 8px; }
.project-run-top .project-latest-status { flex: 0 0 auto; margin: 0; }
.project-run-top > span, .project-run-output > span { flex: 0 0 auto; min-width: 0; }
.project-run-message { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card-status {
    display: flex; align-items: center; position: static; flex: 0 1 auto; min-width: 0; max-width: 34%;
    height: 100%; box-sizing: border-box; margin: 0; padding: 0 0 0 8px; overflow: hidden;
    border: 0; border-left: 1px solid var(--line-soft); background: transparent; font-size: .82rem;
    text-overflow: ellipsis; white-space: nowrap;
}
.project-card-status:empty { display: none; }
.project-card-status.status-ok { color: var(--success); }
.project-card-status.status-warning { color: var(--accent-strong); }
.project-card-status.status-error { color: var(--error); }
.project-preview-actions {
    display: grid; grid-column: 2; grid-row: 2; grid-template-columns: repeat(7,minmax(0,1fr));
    grid-template-rows: 44px; gap: 0; width: 100%; min-width: 0; border-left: 1px solid var(--line-soft);
}
.project-preview-actions > button,
.project-preview-actions > .button-link,
.project-preview-actions > .project-file-action {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 44px;
    min-width: 0; min-height: 44px !important; margin: 0 !important; padding: 0 4px;
    box-sizing: border-box; border: 0 !important; border-radius: 0 !important;
    background: transparent !important; color: var(--text); font: inherit; font-size: .88rem;
    text-align: center; text-decoration: none; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; transform: none;
}
.project-preview-actions > * + * { border-left: 1px solid var(--line-soft) !important; }
.project-preview-actions > .project-file-action { padding: 0; }
.project-preview-actions .project-file-action > .download-link {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-width: 0;
    min-height: 0 !important; margin: 0 !important; padding: 0 3px; box-sizing: border-box;
    border: 0 !important; border-radius: 0 !important; background: transparent !important;
    color: var(--text); font: inherit; font-size: .82rem; text-align: center; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-preview-actions .project-file-action > .download-link:hover,
.project-preview-actions > button:hover:not(:disabled),
.project-preview-actions > .button-link:hover,
.project-preview-actions > button:focus-visible,
.project-preview-actions > .button-link:focus-visible {
    background: var(--accent-soft) !important; box-shadow: none !important; transform: none !important;
}
.project-preview-actions > button:disabled { cursor: not-allowed; opacity: .55; }
.project-preview-actions > .btn-delete-project { color: var(--error); }
.project-preview-actions > .btn-delete-project:hover:not(:disabled) { background: rgba(220,38,38,.07) !important; }
.project-preview-actions > :focus-visible {
    outline: 1px solid var(--accent) !important; outline-offset: -2px; position: relative; z-index: 2;
}
@media (max-width: 1180px) {
    .project-preview-card { grid-template-columns: minmax(0,1fr); grid-template-rows: 88px 44px 44px; }
    .project-preview-main { grid-column: 1; grid-row: 1; }
    .project-run-result { grid-column: 1; grid-row: 2; padding: 0 10px; border-left: 0; border-top: 1px solid var(--line-soft); }
    .project-preview-actions { grid-column: 1; grid-row: 3; border-left: 0; border-top: 1px solid var(--line-soft); }
}
@media (max-width: 760px) {
    .project-preview-card { grid-template-rows: 88px 44px 88px; }
    .project-preview-actions { grid-template-columns: repeat(4,minmax(0,1fr)); grid-template-rows: repeat(2,44px); }
    .project-preview-actions > :nth-child(4n + 1) { border-left: 0 !important; }
    .project-preview-actions > :nth-child(n + 5) { border-top: 1px solid var(--line-soft) !important; }
}
@media (max-width: 480px) {
    .project-title-row { grid-template-columns: 44px minmax(0,1fr) 82px; }
    .project-meta-line { grid-template-columns: minmax(55px,.7fr) minmax(0,1.5fr) 40px; }
    .project-preview-card { grid-template-rows: 88px 44px 132px; }
    .project-preview-actions { grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(3,44px); }
    .project-preview-actions > :nth-child(3n + 1) { border-left: 0 !important; }
    .project-preview-actions > :nth-child(n + 4) { border-top: 1px solid var(--line-soft) !important; }
    .project-preview-actions > button,
    .project-preview-actions > .button-link,
    .project-preview-actions > .project-file-action { font-size: .78rem; padding: 0 3px; }
}
.project-title-row > .project-id-cell { background: var(--surface-strong); }
.project-title-row .project-id { border: 0; border-radius: 0; color: var(--text); }


/* Project action rail borders and restrained gold hover. */
.project-preview-actions {
    box-sizing: border-box;
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
    border: 1px solid var(--line-soft);
}
.project-preview-actions > button,
.project-preview-actions > .button-link,
.project-preview-actions > .project-file-action {
    position: relative;
    height: 100% !important;
    min-height: 0 !important;
}
.project-preview-actions > button::after,
.project-preview-actions > .button-link::after,
.project-preview-actions > .project-file-action::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border: 1px solid transparent;
    pointer-events: none;
}
.project-preview-actions > button:hover:not(:disabled),
.project-preview-actions > .button-link:hover,
.project-preview-actions > .project-file-action:hover,
.project-preview-actions .project-file-action > .download-link:hover,
.project-preview-actions > .btn-delete-project:hover:not(:disabled) {
    background: transparent !important;
}
.project-preview-actions > button:hover:not(:disabled)::after,
.project-preview-actions > .button-link:hover::after,
.project-preview-actions > .project-file-action:hover::after,
.project-preview-actions > button:focus-visible::after,
.project-preview-actions > .button-link:focus-visible::after,
.project-preview-actions > .project-file-action:focus-within::after {
    border-color: var(--accent);
}
.project-preview-actions > button:hover:not(:disabled),
.project-preview-actions > .button-link:hover,
.project-preview-actions > .project-file-action:hover,
.project-preview-actions > :focus-visible,
.project-preview-actions > .project-file-action:focus-within {
    z-index: 3;
    outline: 0 !important;
}
.project-preview-actions .project-file-action > .download-link:focus-visible { outline: 0; }
@media (max-width: 760px) {
    .project-preview-actions { grid-template-rows: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .project-preview-actions { grid-template-rows: repeat(3, minmax(0, 1fr)); }
}

/* User management: compact, flush controls sized to the supplied sketch. */
.user-create-section {
    margin-top: 36px;
}
.user-create-section h3 {
    margin: 0 0 14px;
}
.user-create-panel {
    display: grid;
    grid-template-columns: 408px 490px 213px 212px;
    align-items: end;
    gap: 0;
    margin: 0;
    padding: 24px 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}
.user-create-panel .user-create-field {
    display: grid;
    grid-template-rows: 1.35em 48px;
    gap: 8px;
    min-width: 0;
    margin: 0;
    color: var(--text-soft);
    font-size: .86rem;
    line-height: 1.35;
}
.user-create-panel .user-create-field > span {
    align-self: center;
    padding-left: 2px;
}
.user-create-panel input,
.user-create-panel select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0;
    border-radius: 0 !important;
}
.user-create-panel .user-create-field + .user-create-field,
.user-create-panel .user-create-submit {
    margin-left: -1px;
}
.user-create-panel .user-create-role {
    grid-template-rows: 1.35em 48px;
}
.user-create-panel .user-create-submit {
    box-sizing: border-box;
    width: 100%;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 0 0 -1px;
    border-radius: 0 !important;
    white-space: nowrap;
}
.user-password-reset-panel {
    display: grid;
    grid-template-columns: minmax(300px, 408px) minmax(320px, 490px) 160px;
    align-items: end;
    gap: 0;
    margin: 0;
    padding: 24px 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}
.user-password-reset-panel label {
    display: grid;
    grid-template-rows: 1.35em 48px;
    gap: 8px;
    min-width: 0;
    margin: 0;
    color: var(--text-soft);
    font-size: .86rem;
    line-height: 1.35;
}
.user-password-reset-panel label > span {
    align-self: center;
    padding-left: 2px;
}
.user-password-reset-panel select,
.user-password-reset-panel input,
.user-password-reset-panel button {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0;
    border-radius: 0 !important;
}
.user-password-reset-panel label + label,
.user-password-reset-panel button {
    margin-left: -1px;
}
.user-password-reset-panel button {
    white-space: nowrap;
}
.login-password-help {
    max-width: 560px;
    margin-top: 16px;
    line-height: 1.5;
}
@media (max-width: 1500px) {
    .user-create-panel {
        grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.75fr) minmax(150px, .75fr) minmax(160px, .75fr);
    }
    .user-password-reset-panel {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(130px, .5fr);
    }
}
@media (max-width: 760px) {
    .user-create-panel {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
    }
    .user-create-panel .user-create-field {
        grid-template-rows: 1.35em 48px;
    }
    .user-create-panel .user-create-field + .user-create-field,
    .user-create-panel .user-create-submit {
        margin-left: 0;
    }
    .user-password-reset-panel {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
    }
    .user-password-reset-panel label + label,
    .user-password-reset-panel button {
        margin-left: 0;
    }
}


.reference-api-key-panel {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.reference-api-key-panel h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.reference-api-key-label {
    display: block;
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 0.86rem;
}

.reference-api-key-controls {
    display: flex;
    align-items: stretch;
    max-width: 740px;
}

.reference-api-key-controls input {
    flex: 1 1 480px;
    min-width: 0;
    height: 42px;
    border-right: 0;
}

.reference-api-key-controls button {
    flex: 0 0 auto;
    min-width: 150px;
    height: 42px;
    white-space: nowrap;
}

.reference-api-key-help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

@media (max-width: 640px) {
    .reference-api-key-panel {
        padding: 12px;
    }

    .reference-api-key-controls {
        flex-direction: column;
        gap: 8px;
    }

    .reference-api-key-controls input {
        flex-basis: auto;
        border-right: 1px solid var(--line);
    }

    .reference-api-key-controls button {
        width: 100%;
    }
}
