:root {
    --bg: #f1f5f9;
    --panel: #ffffff;
    --ink: #142132;
    --ink-soft: #52617a;
    --ink-faint: #8290a5;
    --line: #e1e8f1;
    --line-strong: #cbd7e6;
    --brand: #155e8a;
    --brand-strong: #0f4668;
    --brand-soft: #e9f2f9;
    --accent: #0e8f86;
    --danger: #c23a2b;
    --warn: #b0731a;
    --ok: #177a52;
    --navy: #0b1929;
    --navy-soft: #14293f;
    --sidebar-w: 252px;
    --appbar-h: 64px;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 35, 58, 0.04), 0 14px 34px -22px rgba(16, 35, 58, 0.35);
    --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 26px;
    line-height: 1.28;
    letter-spacing: 0.2px;
}

h2 {
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: 0.1px;
}

h3 {
    font-size: 14.5px;
}

hr.divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.mono {
    font-family: var(--mono);
    font-size: 12.5px;
}

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

.subtext {
    color: var(--ink-faint);
    font-size: 12.5px;
    line-height: 1.5;
}

.nowrap {
    white-space: nowrap;
}

.danger-text {
    color: var(--danger);
    font-weight: 600;
}

.ok-text {
    color: var(--ok);
}

.hint {
    color: var(--ink-faint);
    font-size: 12.5px;
}

.icon {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
}

/* App shell */

.admin-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f7fafd 0, rgba(247, 250, 253, 0) 260px),
        var(--bg);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    overflow-y: auto;
    color: #a9bacd;
    background:
        radial-gradient(120% 55% at 0% 0%, rgba(33, 118, 156, 0.3), transparent 62%),
        linear-gradient(180deg, #0b1929 0%, #0e2236 55%, #0a1726 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 18px;
    color: #ffffff;
}

.sidebar .brand:hover {
    text-decoration: none;
}

.sidebar .brand img {
    display: block;
    border-radius: 9px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 8px 18px rgba(0, 0, 0, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-text strong {
    font-size: 16px;
    letter-spacing: 0.4px;
    line-height: 1.3;
}

.brand-text small {
    color: #7f97b0;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding-top: 4px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-label {
    padding: 0 10px 6px;
    color: #5e7692;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 9px;
    color: #a9bacd;
    font-size: 13.5px;
    line-height: 1.35;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.side-link:hover {
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
    text-decoration: none;
}

.side-link .icon {
    width: 18px;
    height: 18px;
    opacity: 0.75;
}

.side-link.is-active {
    color: #ffffff;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(43, 148, 187, 0.28), rgba(43, 148, 187, 0.08));
    box-shadow: inset 0 0 0 1px rgba(96, 189, 224, 0.22);
}

.side-link.is-active .icon {
    color: #6fd0ed;
    opacity: 1;
}

.sidebar-foot {
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11.5px;
    color: #6d86a1;
}

.service-state {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9fd8c4;
    font-size: 12px;
}

.sidebar-version {
    color: #5e7692;
    font-size: 11px;
}

.pulse-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ccf91;
    box-shadow: 0 0 0 0 rgba(60, 207, 145, 0.55);
    animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(60, 207, 145, 0.5);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(60, 207, 145, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(60, 207, 145, 0);
    }
}

.nav-overlay {
    display: none;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.appbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--appbar-h);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.nav-toggle {
    display: none;
}

.appbar-trail {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-trail strong {
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-root {
    color: var(--ink-faint);
}

.appbar-sep {
    color: var(--line-strong);
}

.appbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-switcher {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.exam-switcher-label {
    font-size: 12px;
    color: var(--ink-faint);
    white-space: nowrap;
}

.exam-switcher select {
    height: 34px;
    min-width: 148px;
    max-width: 230px;
    padding: 0 26px 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    text-overflow: ellipsis;
}

.exam-switcher select:focus-visible {
    outline: 2px solid var(--accent, #2f6fed);
    outline-offset: 1px;
}

.exam-switcher-go {
    padding: 5px 10px;
    font-size: 12px;
}

.appbar-divider {
    width: 1px;
    height: 20px;
    background: var(--line);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
    background: #eef3f9;
    border-color: var(--line);
    color: var(--brand);
    text-decoration: none;
}

.icon-btn:focus-visible {
    outline: 2px solid rgba(21, 94, 138, 0.35);
    outline-offset: 2px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 3px 12px 3px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f5f8fc;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d7aa8, #0f4a70);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.container {
    width: 100%;
    max-width: 1460px;
    margin: 0 auto;
    padding: 26px 30px 44px;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 30px 24px;
    color: var(--ink-faint);
    font-size: 11.5px;
}

/* Page header */

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

.page-head p {
    margin-top: 5px;
    font-size: 13px;
}

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

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

/* Panels */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-bottom: 20px;
}

.highlight-panel {
    border-left: 4px solid var(--accent);
}

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

.panel-head h2 {
    letter-spacing: 0.1px;
}

.panel-sub {
    margin-top: 3px;
    color: var(--ink-faint);
    font-size: 12.5px;
}

.panel-note {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    color: var(--ink-faint);
    font-size: 12px;
}

.panel-flush {
    padding: 0;
}

.panel-flush > .panel-head {
    padding: 20px 22px;
    margin-bottom: 0;
}

.panel-flush > .table-wrap {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
}

.panel-flush > .empty {
    margin: 0 22px 20px;
}

.panel-flush > .chip-row {
    padding: 0 22px 14px;
    margin-bottom: 0;
}

.panel-flush > .pagination {
    padding-bottom: 18px;
}

.panel-flush > .table-wrap:last-child {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.two-col > .panel {
    margin-bottom: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.detail-grid > .panel {
    margin-bottom: 0;
}

.split-main {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.split-main > .panel {
    margin-bottom: 0;
}

.stack-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.stack-col > .panel {
    margin-bottom: 0;
}

.stack-col .data-table {
    min-width: 0;
}

.empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 13px;
    background: #f8fbfd;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
}

.empty-panel {
    text-align: center;
    padding: 64px 24px;
}

.empty-panel h1 {
    font-size: 44px;
    color: var(--ink-faint);
    margin-bottom: 8px;
}

.empty-panel p {
    margin-bottom: 20px;
    color: var(--ink-soft);
}

/* Stat cards */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    --stat-accent: var(--ink-faint);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 16px 17px 15px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 3px solid var(--stat-accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card.is-ok {
    --stat-accent: var(--ok);
}

.stat-card.is-accent {
    --stat-accent: var(--brand);
}

.stat-card.is-danger {
    --stat-accent: var(--danger);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #f1f5fa;
    color: var(--stat-accent);
}

.stat-icon .icon {
    width: 17px;
    height: 17px;
}

.stat-card.is-ok .stat-icon {
    background: #e8f6ef;
}

.stat-card.is-accent .stat-icon {
    background: #e8f2fa;
}

.stat-card.is-danger .stat-icon {
    background: #fdecea;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.4px;
    font-variant-numeric: tabular-nums;
}

.stat-meta {
    color: var(--ink-faint);
    font-size: 11.5px;
    line-height: 1.5;
}

.stat-meta a {
    font-weight: 600;
}

.stat-ok {
    color: var(--ok);
}

.stat-danger {
    color: var(--danger);
}

.stat-hint {
    color: var(--ink-faint);
    font-size: 12px;
}

/* Summary strip */

.summary-strip {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 3px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 118px;
    padding: 10px 24px 11px;
    border-right: 1px solid var(--line);
}

.summary-item:last-child {
    border-right: 0;
}

.summary-item em {
    color: var(--ink-faint);
    font-style: normal;
    font-size: 11.5px;
}

.summary-item strong {
    font-size: 20px;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.summary-strip.is-dense .summary-item {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 16px 11px;
}

/* Charts */

.chart-panel {
    min-width: 0;
}

.chart-frame {
    overflow-x: auto;
    padding: 2px 0 0;
}

.trend-chart {
    display: block;
    width: 100%;
    min-width: 560px;
    height: auto;
}

.chart-grid {
    stroke: #e6edf5;
    stroke-width: 1;
    stroke-dasharray: 3 5;
}

.bar-events {
    fill: #2b7fae;
    opacity: 0.88;
}

.bar-alerts {
    fill: #cf4a3a;
    opacity: 0.9;
}

.chart-label {
    fill: #8290a5;
    font-family: var(--mono);
    font-size: 10px;
}

.chart-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--ink-faint);
    font-size: 11.5px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--ink-soft);
    font-size: 11.5px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-dot.is-events {
    background: #2b7fae;
}

.legend-dot.is-alerts {
    background: #cf4a3a;
}

/* Category meters */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.category-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
}

.category-name {
    color: var(--ink-soft);
    font-weight: 600;
}

.category-count {
    color: var(--ink-faint);
    font-family: var(--mono);
    font-size: 11.5px;
}

progress.meter {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #edf2f8;
}

progress.meter::-webkit-progress-bar {
    background: #edf2f8;
    border-radius: 999px;
}

progress.meter::-webkit-progress-value {
    background: linear-gradient(90deg, #2b7fae, #155e8a);
    border-radius: 999px;
}

progress.meter::-moz-progress-bar {
    background: linear-gradient(90deg, #2b7fae, #155e8a);
    border-radius: 999px;
}

progress.meter.is-warn::-webkit-progress-value {
    background: linear-gradient(90deg, #d99a2b, #b0731a);
}

progress.meter.is-warn::-moz-progress-bar {
    background: linear-gradient(90deg, #d99a2b, #b0731a);
}

progress.meter.is-danger::-webkit-progress-value {
    background: linear-gradient(90deg, #d9604f, #b33122);
}

progress.meter.is-danger::-moz-progress-bar {
    background: linear-gradient(90deg, #d9604f, #b33122);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--ink);
    padding: 8px 15px;
    border-radius: 9px;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn:hover {
    background: #f4f8fc;
    border-color: #a9bccf;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid rgba(21, 94, 138, 0.4);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    color: #ffffff;
}

.panel-danger-zone {
    border-color: rgba(178, 52, 42, 0.28);
}

.panel-danger-zone .panel-head h2 {
    color: var(--danger);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
    font-weight: 600;
}

.btn-danger:hover {
    background: #a93226;
    border-color: #a93226;
    color: #ffffff;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ink-soft);
}

.btn-ghost:hover {
    background: #eef3f9;
    border-color: var(--line);
    color: var(--brand);
}

.btn-sm {
    padding: 5px 11px;
    font-size: 12.5px;
    border-radius: 7px;
}

.btn-sm .icon {
    width: 14px;
    height: 14px;
}

.btn-block {
    width: 100%;
}

/* Forms */

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--ink-soft);
    min-width: 0;
}

.field > span {
    font-weight: 600;
    color: var(--ink);
}

.field small {
    color: var(--ink-faint);
    font-size: 12px;
}

.field input,
.field select,
.field textarea,
.filter-form input,
.filter-form select,
.filter-bar input,
.filter-bar select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fbfdff;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    padding: 8px 11px;
    min-height: 40px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-form input:focus,
.filter-form select:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(21, 94, 138, 0.12);
    background: #ffffff;
}

.field input:disabled {
    background: #f1f4f8;
    color: var(--ink-faint);
    cursor: not-allowed;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.65;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
}

.check-inline input[type="checkbox"],
.check-inline input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
    margin: 0;
    cursor: pointer;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-form input[type="search"],
.filter-form input[type="text"],
.filter-form select {
    width: auto;
    min-width: 150px;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 13px;
    background: #ffffff;
}

.filter-form input[type="search"] {
    min-width: 220px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar input[type="search"],
.filter-bar input[type="text"] {
    width: auto;
    min-width: 230px;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 13px;
    background: #ffffff;
}

.filter-bar select {
    width: auto;
    min-width: 130px;
    min-height: 34px;
    padding: 5px 9px;
    font-size: 13px;
    background: #ffffff;
}

.filter-bar .check-inline {
    font-size: 12.5px;
}

/* Flash */

.flash-stack {
    margin-bottom: 18px;
}

.flash {
    border-radius: 10px;
    padding: 11px 15px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.55;
}

.flash:last-child {
    margin-bottom: 0;
}

.flash-stack + .page-head {
    margin-top: 0;
}

.flash-success {
    background: #eaf7f1;
    border-color: #bfe4d4;
    color: #146044;
}

.flash-error {
    background: #fdecea;
    border-color: #f5c6c0;
    color: #94291d;
}

.flash-warning {
    background: #fdf5e6;
    border-color: #f0dcb4;
    color: #7a5212;
}

/* Tables */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th,
.data-table td {
    padding: 11px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    background: #f6f9fc;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

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

.data-table tbody tr:hover {
    background: #f9fbfd;
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.data-table .actions {
    text-align: right;
    white-space: nowrap;
}

.data-table .row-sub {
    margin-top: 2px;
}

.data-table-compact {
    min-width: 560px;
}

.exams-table td:first-child {
    min-width: 150px;
}

.data-table-compact th,
.data-table-compact td {
    padding: 10px;
}

.strong-link {
    font-weight: 600;
    color: var(--brand);
}

/* Chips, badges */

.chip-row {
    display: flex;
    gap: 7px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--ink-soft);
    font-size: 12.5px;
}

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

.chip.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.tag-row {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
    vertical-align: middle;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid #cfe0f2;
    background: #f1f7fd;
    color: #275f96;
    font-size: 11.5px;
    line-height: 1.7;
    white-space: nowrap;
}

a.tag-chip:hover {
    border-color: var(--brand);
    background: #e5f0fb;
    color: var(--brand);
    text-decoration: none;
}

.tag-cloud {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #fafcff;
}

.page-tags {
    margin-top: 8px;
}

.subsection-title {
    margin: 18px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.field-hint {
    display: block;
    margin-top: 5px;
    color: var(--ink-faint, #7b8794);
    font-size: 12px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #edf2f8;
    color: var(--ink-soft);
    font-size: 11.5px;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-ok {
    background: #e6f6ee;
    color: #147a52;
}

.badge-danger {
    background: #fbe4e1;
    color: #a52a1c;
}

.badge-warn {
    background: #fdf0d9;
    color: #8a5a12;
}

.state-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
}

.state-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.75;
}

.state-online {
    background: #e6f6ee;
    color: #147a52;
    border-color: #bfe6d4;
}

.state-stale {
    background: #fdf5e6;
    color: #8a5a12;
    border-color: #efd9ac;
}

.state-ended {
    background: #eef1f5;
    color: #617083;
    border-color: #d7dee7;
}

.state-ok {
    background: #e6f6ee;
    color: #147a52;
    border-color: #bfe6d4;
}

.state-danger {
    background: #fbe4e1;
    color: #a52a1c;
    border-color: #f2c4bd;
}

.sev-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.sev-3 {
    background: #fbe4e1;
    color: #a52a1c;
}

.sev-2 {
    background: #fdf0d9;
    color: #8a5a12;
}

.sev-1 {
    background: #e6f0fa;
    color: #1d5a8c;
}

.sev-0 {
    background: #eef1f5;
    color: #5c6a7c;
}

/* Detail lists */

.kv {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 9px 16px;
    margin: 0;
    font-size: 13.5px;
}

.kv dt {
    color: var(--ink-faint);
}

.kv dd {
    margin: 0;
    word-break: break-word;
}

.kv-inline {
    grid-template-columns: repeat(4, auto minmax(0, 1fr));
    align-items: baseline;
}

.stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.stats-inline span {
    display: inline-flex;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 7px;
    background: #f3f7fb;
    color: var(--ink);
    font-size: 12.5px;
    font-family: var(--mono);
}

.stats-inline em {
    color: var(--ink-faint);
    font-style: normal;
}

.subheading {
    margin: 22px 0 10px;
    color: var(--ink-soft);
}

.command-list,
.alert-list,
.audit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.command-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fbfdff;
}

.command-list .subtext:last-child {
    margin-left: auto;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.alert-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.alert-body {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.audit-list li {
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.audit-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.audit-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.audit-action {
    font-weight: 600;
    font-family: var(--mono);
    font-size: 12.5px;
}

/* Domains */

.domain-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.domain-list li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}

.domain-list li:first-child {
    padding-top: 0;
}

.domain-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.domain-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.domain-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.domain-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--ink-faint);
    font-size: 11.5px;
}

/* Timeline */

.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fbfdff;
}

.event-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.event-time {
    color: var(--ink-faint);
}

.event-kind {
    font-weight: 600;
    color: var(--ink-soft);
}

.event-code {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-faint);
}

.event-title {
    font-size: 14px;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.event-detail {
    color: var(--ink-soft);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.raw-data {
    margin-top: 8px;
}

.raw-data summary {
    cursor: pointer;
    color: var(--brand);
    font-size: 12.5px;
}

.raw-data pre {
    margin: 8px 0 0;
    padding: 12px;
    background: #0f1c2b;
    color: #d6e4f3;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
    overflow-x: auto;
    max-height: 420px;
}

/* Tabs */

.tab-bar {
    display: flex;
    gap: 2px;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 15px;
    border-bottom: 2px solid transparent;
    color: var(--ink-soft);
    font-size: 13.5px;
    white-space: nowrap;
}

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

.tab-link.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
}

.tab-link .badge {
    margin-left: 2px;
}

/* Notice composer */

.notice-levels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.level-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fbfdff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.level-option input {
    margin: 4px 0 0;
    accent-color: var(--brand);
}

.level-option strong {
    display: block;
    font-size: 12.5px;
    color: var(--ink);
}

.level-option small {
    display: block;
    color: var(--ink-faint);
    font-size: 11px;
    line-height: 1.45;
}

.level-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(21, 94, 138, 0.08);
}

.level-option.is-critical:has(input:checked) {
    border-color: var(--danger);
    background: #fdf0ee;
    box-shadow: 0 0 0 3px rgba(194, 58, 43, 0.08);
}

.template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.template-chip {
    padding: 3px 9px;
    border: 1px dashed var(--line-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink-soft);
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
}

.template-chip:hover {
    border-color: var(--brand);
    color: var(--brand);
    border-style: solid;
}

/* Screenshots */

.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.shot-grid.is-multi {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.shot-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.shot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 16 / 10;
    color: #7691ad;
    font-size: 12px;
    background:
        repeating-linear-gradient(135deg, #0f2236 0, #0f2236 10px, #12283e 10px, #12283e 20px);
}

.shot-placeholder .icon {
    width: 24px;
    height: 24px;
}

/* Import */

.import-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.import-grid > .panel {
    margin-bottom: 0;
}

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 18px;
    text-align: center;
    border: 1.5px dashed var(--line-strong);
    border-radius: 12px;
    background: #fbfdff;
}

.upload-zone input[type="file"] {
    max-width: 100%;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.upload-zone .hint {
    max-width: 420px;
}

.paste-box {
    font-family: var(--mono);
    font-size: 12.5px;
    min-height: 190px;
    line-height: 1.6;
}

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

.import-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 13px 16px;
    margin-bottom: 18px;
    border: 1px solid #bfe4d4;
    border-radius: 11px;
    background: #eef9f3;
    color: #146044;
    font-size: 13px;
}

.import-result.is-error {
    border-color: #f5c6c0;
    background: #fdecea;
    color: #94291d;
}

.sample-table {
    font-family: var(--mono);
    font-size: 11.5px;
    white-space: pre;
    overflow-x: auto;
    margin: 0;
    padding: 12px 14px;
    border-radius: 9px;
    background: #0f1c2b;
    color: #d6e4f3;
    line-height: 1.7;
}

.credential-table td code {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink);
    background: #f3f7fb;
    padding: 1px 6px;
    border-radius: 4px;
}

/* Text link */

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    font-weight: 600;
}

.text-link::after {
    content: "\2192";
    font-size: 12px;
}

/* Pagination */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #ffffff;
    color: var(--ink-soft);
    font-size: 12.5px;
}

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

.page-link.is-current {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.page-gap {
    color: var(--ink-faint);
    padding: 0 4px;
}

/* Login */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 12% 16%, rgba(35, 137, 168, 0.24), transparent 42%),
        radial-gradient(circle at 88% 82%, rgba(20, 80, 122, 0.22), transparent 45%),
        linear-gradient(180deg, #0b1929, #0a1726);
    padding: 28px 16px;
}

.login-wrap {
    width: 100%;
    max-width: 430px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 30px 26px;
    box-shadow: 0 26px 60px rgba(2, 12, 24, 0.45);
}

.login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.login-brand img {
    border-radius: 14px;
    margin-bottom: 12px;
}

.login-brand h1 {
    font-size: 22px;
    letter-spacing: 0.4px;
}

.login-brand p {
    margin-top: 6px;
    color: var(--ink-faint);
    font-size: 13px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-notice {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-card .flash {
    margin-bottom: 16px;
}

/* Runtime environment panel */

.env-panel {
    border-left: 3px solid var(--brand);
}

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

.env-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid var(--line-strong);
    background: #f4f7fb;
    color: var(--ink-soft);
}

.env-ok {
    background: #e6f6ee;
    color: #147a52;
    border-color: #bfe6d4;
}

.env-warn {
    background: #fdf0d9;
    color: #8a5a12;
    border-color: #efd9ac;
}

.env-danger {
    background: #fbe4e1;
    color: #a52a1c;
    border-color: #f2c3bd;
}

.env-unknown {
    background: #eef1f5;
    color: #617083;
    border-color: #d7dee7;
}

.row-tags {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.env-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.env-col {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.env-title {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--brand-strong);
}

.kv.kv-compact {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 7px 14px;
    font-size: 13px;
}

.env-evidence {
    margin: 12px 0 0;
    padding: 10px 12px 10px 26px;
    list-style: none;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #ffffff;
    counter-reset: evidence;
}

.env-evidence li {
    position: relative;
    font-family: var(--mono);
    font-size: 11.8px;
    color: var(--ink-soft);
    word-break: break-all;
}

.env-evidence li + li {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--line);
}

.env-evidence li::before {
    counter-increment: evidence;
    content: counter(evidence);
    position: absolute;
    left: -18px;
    color: var(--ink-faint);
    font-size: 10.5px;
    line-height: 1.9;
}

/* Screen layout map */

.screen-map {
    position: relative;
    min-height: 150px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0) 0 0 / 14px 14px,
        linear-gradient(160deg, #102338, #0b1929);
}

.screen-box {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 6px;
    overflow: hidden;
    border: 1px solid #4b7ba6;
    border-radius: 4px;
    background: rgba(21, 94, 138, 0.32);
    color: #cfe3f3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.screen-box.is-primary {
    border-color: var(--accent);
    background: rgba(14, 143, 134, 0.30);
    color: #d8f5f1;
}

.screen-no {
    font-size: 11.5px;
    font-weight: 700;
}

.screen-meta {
    font-family: var(--mono);
    font-size: 10.5px;
    opacity: 0.85;
}

.screen-tag {
    align-self: flex-start;
    margin-top: 2px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(216, 245, 241, 0.22);
    font-size: 10px;
}

.screen-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.screen-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}

.screen-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

/* Radio field group */

.field-group {
    margin: 2px 0;
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.field-group legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-strong);
}

.field-group .hint {
    margin-bottom: 10px;
}

.field-group .check-inline + .check-inline {
    margin-top: 7px;
}

/* Batch screenshots */

.batch-panel.is-running {
    border-color: rgba(21, 138, 94, 0.38);
}

.batch-run {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.batch-run-main {
    flex: 1 1 460px;
    min-width: 0;
}

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

.batch-metrics > div {
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.batch-metrics span {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-soft);
    font-size: 11.5px;
    letter-spacing: 0.04em;
}

.batch-metrics strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.batch-progress {
    height: 7px;
    border-radius: 999px;
    background: #e7edf4;
    overflow: hidden;
}

.batch-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #2fa06d);
    transition: width 0.4s ease;
}

.batch-hint {
    margin: 10px 0 0;
}

.batch-stop {
    flex: 0 0 auto;
    padding-bottom: 2px;
}

.batch-start {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.watch-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.batch-intervals {
    display: flex;
    align-items: center;
    gap: 10px 22px;
    flex-wrap: wrap;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.batch-start-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.batch-start-foot .panel-sub {
    max-width: 720px;
    margin: 0;
    line-height: 1.7;
}

.batch-history {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.batch-history h3 {
    margin: 0 0 10px;
    font-size: 13.5px;
    letter-spacing: 0.02em;
}

.batch-history .data-table th,
.batch-history .data-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.chip-batch {
    border-color: rgba(21, 138, 94, 0.35);
    background: rgba(21, 138, 94, 0.08);
    color: #12684a;
}

.chip-ai {
    border-color: rgba(109, 40, 217, 0.32);
    background: rgba(109, 40, 217, 0.08);
    color: #5b21b6;
}

.batch-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    min-width: 0;
}

.batch-trigger-text {
    color: var(--ink-soft);
    font-size: 12.5px;
    max-width: 560px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td .batch-trigger-text {
    margin-top: 5px;
    max-width: 300px;
    font-size: 11.5px;
}

@media (max-width: 720px) {
    .batch-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .batch-stop {
        width: 100%;
    }

    .batch-stop .btn {
        width: 100%;
    }
}

/* Screenshot request groups */

.shot-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shot-group {
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.shot-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.shot-group-head .subtext {
    display: block;
    margin-top: 2px;
}

.shot-group-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shot-note {
    margin: -4px 0 12px;
    padding: 8px 11px;
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12.5px;
}

.shot-waiting {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 18px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    color: var(--ink-soft);
    font-size: 12.5px;
}

.shot-figure {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #0d1b2b;
    cursor: zoom-in;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.shot-figure:hover,
.shot-figure:focus-visible {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    outline: none;
}

.shot-figure:focus-visible {
    border-color: var(--brand);
}

.shot-figure .shot-thumb {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shot-figure figcaption {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 11px 10px;
    background: #ffffff;
    font-size: 11.8px;
    color: var(--ink-faint);
}

.shot-figure figcaption strong {
    font-size: 12.5px;
    color: var(--ink);
}

/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px 20px;
    background: rgba(6, 14, 24, 0.90);
    backdrop-filter: blur(2px);
}

.lightbox[hidden] {
    display: none;
}

.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #d8e6f4;
    font-size: 12.5px;
}

.lightbox-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.lightbox-tools a,
.lightbox-tools button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(216, 230, 244, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #eaf2fa;
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
}

.lightbox-tools a:hover,
.lightbox-tools button:hover {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
}

.lightbox-tools button[disabled] {
    opacity: 0.4;
    cursor: default;
}

.lightbox-tools button[disabled]:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
    background: #0d1b2b;
}

.lightbox-count {
    font-family: var(--mono);
    font-size: 11.5px;
    opacity: 0.8;
}

/* Process monitoring */

.notice-warn {
    margin: 0 16px 14px;
    padding: 10px 13px;
    border: 1px solid #f0dcb4;
    border-left: 3px solid var(--warn);
    border-radius: 9px;
    background: #fdf7ea;
    color: #7a5212;
    font-size: 12.8px;
}

.proc-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.proc-overview-item {
    display: flex;
    flex-direction: column;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfdff;
}

.proc-overview-item em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--ink-faint);
}

.proc-overview-item strong {
    font-size: 19px;
    line-height: 1.3;
}

.proc-cat-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 16px 12px;
}

.proc-cat-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #ffffff;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.proc-cat-chip:hover {
    border-color: var(--brand);
    text-decoration: none;
}

.proc-cat-chip.is-active {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.proc-cat-chip strong {
    font-family: var(--mono);
    font-size: 12.5px;
}

.proc-cat-chip.sev-3 {
    border-color: #f0c4bd;
    background: #fdf1ef;
    color: #a52a1c;
}

.proc-cat-chip.sev-3.is-active {
    border-color: var(--danger);
    background: #fbe4e1;
}

.proc-cat-chip.sev-2 {
    border-color: #f0dcb4;
    background: #fdf7ea;
    color: #7a5212;
}

.proc-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 16px 12px;
}

.filter-input {
    flex: 1 1 260px;
    min-width: 200px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(21, 94, 138, 0.14);
}

.check-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
}

.proc-table td {
    vertical-align: top;
}

.proc-table-wrap {
    max-height: 72vh;
    overflow: auto;
}

.proc-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -1px 0 var(--line);
}

.proc-name-cell {
    min-width: 240px;
    max-width: 420px;
}

.proc-name-cell > strong {
    display: inline-block;
    margin-right: 6px;
    overflow-wrap: anywhere;
}

.proc-net-link {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    padding: 1px 7px;
    border: 1px solid #cfe2f1;
    border-radius: 999px;
    background: #f4f9fd;
    color: var(--brand);
    font-size: 10.5px;
    font-weight: 600;
    vertical-align: 1px;
}

.proc-net-link:hover {
    background: #e8f3fb;
    text-decoration: none;
}

.proc-net-count {
    margin-left: 4px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.proc-path,
.proc-cmd {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--ink-faint);
    white-space: normal;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.proc-cmd {
    color: #96a3b6;
}

.proc-row.is-danger {
    background: #fdf3f1;
}

.proc-row.is-warn {
    background: #fdf8ec;
}

.proc-row.is-flag {
    background: #f7faff;
}

.proc-row.is-hidden {
    display: none;
}

.proc-alert-list,
.proc-flow-list {
    list-style: none;
    margin: 0;
    padding: 0 16px 16px;
}

.proc-alert-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.proc-alert-list li:last-child,
.proc-flow-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.proc-flow-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
}

.proc-flow-list li.is-note {
    background: #fbfaf4;
}

.flow-time {
    font-size: 11.5px;
    color: var(--ink-faint);
    white-space: nowrap;
}

.flow-body {
    min-width: 0;
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.flow-body strong {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.proc-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 7px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #ffffff;
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.45;
}

.proc-chip:hover {
    border-color: var(--brand);
    text-decoration: none;
}

.proc-chip strong {
    font-size: 12.5px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.proc-chip.sev-3 {
    border-color: #f0c4bd;
    background: #fdf1ef;
}

.proc-chip.sev-2 {
    border-color: #f0dcb4;
    background: #fdf7ea;
}

/* Workbench: filters, pivot tables, drill-down */

.summary-item.is-link {
    color: inherit;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.summary-item.is-link:hover {
    background: #f6f9fc;
    text-decoration: none;
}

.summary-item.is-link:hover em {
    color: var(--brand);
}

.summary-item.is-active {
    background: var(--brand-soft);
    box-shadow: inset 0 -2px 0 var(--brand);
}

.summary-item.is-active em {
    color: var(--brand-strong);
}

.workbench {
    padding: 16px 20px;
}

.workbench-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    flex-wrap: wrap;
}

.workbench-row + .workbench-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.workbench .chip-row {
    margin-bottom: 0;
}

.chip-group {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    min-width: 0;
}

.workbench-label {
    align-self: center;
    margin-right: 2px;
    color: var(--ink-faint);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.chip-count {
    margin-left: 6px;
    color: var(--ink-faint);
    font-family: var(--mono);
    font-size: 10.5px;
}

.chip.is-active .chip-count {
    color: rgba(255, 255, 255, 0.78);
}

.view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f3f7fb;
}

.view-tab {
    padding: 5px 12px;
    border-radius: 7px;
    color: var(--ink-soft);
    font-size: 12.5px;
    line-height: 1.4;
    white-space: nowrap;
}

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

.view-tab.is-active {
    background: #ffffff;
    color: var(--brand);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 35, 58, 0.10);
}

.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-weight: 600;
}

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

.th-sort .sort-mark {
    color: #b9c6d7;
    font-size: 9px;
    line-height: 1;
}

.th-sort.is-sorted {
    color: var(--brand);
}

.th-sort.is-sorted .sort-mark {
    color: var(--brand);
}

.cell-link {
    font-weight: 600;
    color: var(--brand);
    overflow-wrap: anywhere;
}

.cell-proc {
    white-space: nowrap;
}

.cell-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.cell-sub {
    margin-top: 2px;
}

.mini-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mini-list li {
    max-width: 360px;
    overflow: hidden;
    color: var(--ink-soft);
    font-family: var(--mono);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-list li a {
    color: var(--ink-soft);
}

.mini-list li a:hover {
    color: var(--brand);
}

.mini-list .mini-more {
    color: var(--ink-faint);
    font-family: inherit;
    font-size: 11px;
}

.focus-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 9px 15px;
    border: 1px solid #cfe2f1;
    border-radius: 11px;
    background: #f4f9fd;
    color: var(--ink-soft);
    font-size: 12.5px;
}

.focus-bar .focus-label {
    color: var(--ink-faint);
}

.focus-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 11.5px;
}

.focus-chip a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: var(--ink-faint);
    font-family: inherit;
}

.focus-chip a:hover {
    background: #eef3f9;
    color: var(--danger);
    text-decoration: none;
}

.focus-clear {
    margin-left: auto;
    font-size: 12px;
}

.process-name {
    color: var(--ink);
    font-family: var(--mono);
    font-weight: 600;
    word-break: break-all;
}

.process-sep {
    color: var(--ink-faint);
}

.two-col.is-even {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-lead {
    margin-top: 12px;
    color: var(--ink-soft);
    font-size: 13px;
}

.detail-anchor {
    scroll-margin-top: calc(var(--appbar-h) + 16px);
}

/* Responsive */

@media (max-width: 1220px) {
    .split-main,
    .two-col,
    .two-col.is-even,
    .detail-grid,
    .import-grid {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .kv-inline {
        grid-template-columns: 120px minmax(0, 1fr);
    }

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

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 18px 0 50px rgba(3, 12, 22, 0.4);
    }

    .app-main {
        margin-left: 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(4, 12, 22, 0.55);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    body.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
    }

    .appbar {
        padding: 0 18px;
    }

    .container {
        padding: 22px 20px 40px;
    }

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

@media (max-width: 1180px) {
    .exam-switcher-label {
        display: none;
    }

    .exam-switcher select {
        max-width: 180px;
    }
}

@media (max-width: 760px) {
    .container {
        padding: 18px 16px 36px;
    }

    .appbar {
        padding: 0 12px;
        gap: 8px;
    }

    .exam-switcher select {
        min-width: 106px;
        max-width: 128px;
    }

    .exam-switcher-go,
    .appbar-divider {
        display: none;
    }

    .appbar-root,
    .appbar-sep {
        display: none;
    }

    .user-name {
        display: none;
    }

    .user-chip {
        padding-right: 4px;
    }

    .app-footer {
        padding: 14px 16px 22px;
    }

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

    .stat-value {
        font-size: 24px;
    }

    .summary-item {
        min-width: 0;
        flex: 1 1 45%;
        padding: 9px 16px;
    }

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

    .filter-form {
        width: 100%;
    }

    .filter-form input[type="search"] {
        min-width: 0;
        flex: 1;
    }

    .filter-bar {
        width: 100%;
    }

    .filter-bar input[type="search"],
    .filter-bar select {
        min-width: 0;
        flex: 1 1 140px;
    }

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

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

    .kv {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .kv.kv-compact {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .env-col {
        padding: 13px;
    }

    .screen-map {
        min-height: 120px;
        padding: 6px;
    }

    .shot-group {
        padding: 12px;
    }

    .shot-group-head {
        align-items: flex-start;
    }

    .shot-grid.is-multi {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .lightbox {
        padding: 12px;
    }

    .lightbox-tools a,
    .lightbox-tools button {
        padding: 0 9px;
    }

    h1 {
        font-size: 22px;
    }

    .panel {
        padding: 16px;
    }

    .panel-flush {
        padding: 0;
    }

    .panel-flush > .panel-head {
        padding: 16px;
    }

    .panel-flush > .chip-row {
        padding: 0 16px 12px;
    }
}

@media (max-width: 520px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-icon {
        width: 34px;
        height: 34px;
    }

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

    .shot-grid.is-multi {
        grid-template-columns: minmax(0, 1fr);
    }

    .lightbox-title {
        font-size: 11.5px;
    }

    .page-actions {
        width: 100%;
    }
}

/* Shared screen configuration */

.screen-exam-pick {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screen-exam-pick select {
    min-width: 180px;
}

.screen-share-panel {
    margin-bottom: 18px;
}

.screen-share-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f8fafc;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--ink-soft);
    white-space: nowrap;
}

.screen-share-state.is-live {
    border-color: rgba(23, 122, 82, 0.28);
    background: #ecf8f2;
    color: var(--ok);
}

.screen-share-state.is-paused {
    border-color: rgba(176, 115, 26, 0.28);
    background: #fdf6e9;
    color: var(--warn);
}

.screen-share-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 0 22px;
}

.screen-share-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.5;
}

.screen-share-input:focus {
    outline: 2px solid rgba(21, 94, 138, 0.22);
    outline-offset: 1px;
    border-color: var(--brand);
}

.screen-share-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.screen-share-row .btn.is-copied {
    background: var(--ok);
    border-color: var(--ok);
    color: #ffffff;
}

.screen-share-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 22px 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.screen-share-meta div {
    min-width: 0;
}

.screen-share-meta dt {
    margin-bottom: 2px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.screen-share-meta dd {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.screen-share-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
    padding: 16px 22px 20px;
    border-top: 1px solid var(--line);
}

.screen-share-actions .hint {
    max-width: 620px;
    text-align: right;
}

.screen-config-form {
    padding-bottom: 0;
}

.screen-config-head {
    align-items: center;
}

.screen-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.screen-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.screen-switch-track {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cfd9e6;
    transition: background 0.18s ease;
}

.screen-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(16, 35, 58, 0.28);
    transition: transform 0.18s ease;
}

.screen-switch input:checked + .screen-switch-track {
    background: var(--accent);
}

.screen-switch input:checked + .screen-switch-track::after {
    transform: translateX(18px);
}

.screen-switch input:focus-visible + .screen-switch-track {
    outline: 2px solid rgba(21, 94, 138, 0.35);
    outline-offset: 2px;
}

.screen-config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 22px;
}

.screen-config-grid .field-group,
.screen-config-form > fieldset.field-group {
    margin: 0;
}

.screen-config-form > fieldset.field-group {
    margin: 0 22px 16px;
}

.screen-radio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.screen-radio {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.screen-radio:hover {
    border-color: var(--line-strong);
    background: #fbfdff;
}

.screen-radio:has(input:checked) {
    border-color: rgba(21, 94, 138, 0.45);
    background: var(--brand-soft);
}

.screen-radio input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.screen-radio span {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.screen-radio strong {
    font-size: 13px;
    color: var(--ink);
}

.screen-radio small {
    font-size: 12px;
    color: var(--ink-soft);
}

.screen-limit-field input {
    max-width: 160px;
}

.screen-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px 18px;
}

.screen-toggle-grid .check-inline + .check-inline {
    margin-top: 0;
}

.member-picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.member-picker-toolbar .hint {
    margin: 0;
}

.member-picker-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.member-count {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.member-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 340px;
    overflow: auto;
    padding: 2px 4px 4px 2px;
    transition: opacity 0.18s ease;
}

.member-picker.is-muted {
    opacity: 0.42;
}

.member-picker.is-muted:focus-within,
.member-picker.is-muted:hover {
    opacity: 1;
}

.member-choice {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.member-choice:hover {
    border-color: var(--line-strong);
    background: #fbfdff;
}

.member-choice:has(input:checked) {
    border-color: rgba(14, 143, 134, 0.4);
    background: #f0faf8;
}

.member-choice input {
    flex: 0 0 auto;
    margin: 0;
}

.member-choice-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.member-choice-main strong {
    font-size: 12.8px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-choice-main small {
    font-size: 11.5px;
    color: var(--ink-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-form-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    z-index: 4;
}

.screen-form-foot .hint {
    margin: 0;
    text-align: right;
}

@media (max-width: 980px) {
    .screen-config-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .screen-share-row {
        flex-wrap: wrap;
    }

    .screen-share-input {
        flex-basis: 100%;
    }

    .screen-share-meta {
        grid-template-columns: minmax(0, 1fr);
    }

    .screen-share-actions {
        flex-direction: column;
    }

    .screen-share-actions .hint,
    .screen-form-foot .hint {
        text-align: left;
    }

    .member-picker-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .screen-form-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .screen-share-row {
        flex-wrap: wrap;
        padding-left: 16px;
        padding-right: 16px;
    }

    .screen-share-meta {
        margin-left: 16px;
        margin-right: 16px;
    }

    .screen-config-grid,
    .screen-config-form > fieldset.field-group {
        margin-left: 16px;
        margin-right: 16px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .screen-form-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

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

    .screen-share-actions {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Remote forensics */

.forensic-payload {
    color: var(--ink-soft);
    white-space: pre-wrap;
    word-break: break-all;
}

.forensic-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.forensic-stream {
    margin-top: 16px;
}

.forensic-stream-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.forensic-out {
    max-height: 520px;
    margin: 0;
    padding: 14px 16px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f7fafc;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ---------- Reforen remote-forensics additions ---------- */

.form-grid {
    display: grid;
    gap: 14px;
}

.plain-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--ink-soft);
}

.plain-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.6;
}

.plain-list .icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--brand);
}

.metric-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) 58px;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.metric-row strong {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.metric-progress {
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: #e8eef6;
    overflow: hidden;
    appearance: none;
}

.metric-progress::-webkit-progress-bar {
    background: #e8eef6;
    border-radius: 999px;
}

.metric-progress::-webkit-progress-value {
    background: var(--brand);
    border-radius: 999px;
}

.metric-progress::-moz-progress-bar {
    background: var(--brand);
    border-radius: 999px;
}

.code-block {
    max-height: 420px;
    margin: 8px 0;
    padding: 12px 14px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f6f9fc;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-summary {
    margin-bottom: 4px;
    color: var(--ink-soft);
    font-size: 12.5px;
}

details summary {
    color: var(--brand);
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
}

details[open] summary {
    margin-bottom: 6px;
}

.gallery-group + .gallery-group {
    border-top: 1px solid var(--line);
}

.gallery-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 20px 10px;
}

.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    padding: 0 20px 18px;
}

.shot-card {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.shot-card a {
    display: block;
    background: #edf3fa;
}

.shot-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.shot-card figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    color: var(--ink-faint);
    font-size: 11.5px;
}

.shot-card figcaption strong {
    color: var(--ink);
    font-size: 12.5px;
}

.timeline-padded {
    padding: 16px 20px 20px;
}

.recording-panel {
    padding: 0;
    overflow: hidden;
}

.player-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    background: #0b1420;
}

.player-stage img {
    display: block;
    max-width: 100%;
    max-height: 72vh;
}

.player-placeholder {
    position: absolute;
    padding: 0 20px;
    color: #9fb3c8;
    font-size: 13px;
    text-align: center;
}

.player-placeholder[hidden] {
    display: none;
}

.player-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.player-controls input[type="range"] {
    flex: 1 1 240px;
    accent-color: var(--brand);
}

.player-counter {
    font-size: 12px;
    color: var(--ink-soft);
    white-space: nowrap;
}

.player-speed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-faint);
    font-size: 12px;
}

.player-speed select {
    min-height: 30px;
    padding: 2px 8px;
}

.player-time {
    font-size: 12px;
    white-space: nowrap;
}

#proc-table tr.is-hidden {
    display: none;
}

.panel-divider {
    margin: 16px 0;
    border: 0;
    border-top: 1px dashed var(--line);
}

.aim-wrap {
    position: relative;
    margin: 10px 0 14px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #0d1a26;
    line-height: 0;
}

.aim-wrap img {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}

.aim-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid #ff5a5f;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 12px rgba(255, 90, 95, 0.7);
    pointer-events: none;
}

.aim-marker[hidden] {
    display: none;
}

.input-replay {
    max-height: 320px;
    min-height: 48px;
}

.input-batch {
    border-top: 1px solid var(--line);
}

.input-batch > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    color: var(--ink-soft);
    font-size: 12.5px;
}

.input-batch > summary:hover {
    background: #f7fafc;
}

.input-batch > summary span.muted {
    margin-left: auto;
}

.input-batch > .table-wrap {
    border: 0;
    border-top: 1px dashed var(--line);
    border-radius: 0;
}

.input-batch:last-of-type {
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}
