:root {
    color-scheme: dark;
    --bg: #080a0e;
    --sidebar: #0b0e13;
    --workspace: #0e1117;
    --panel: #131821;
    --panel-strong: #171d27;
    --panel-soft: #10151d;
    --text: #f2f5f8;
    --muted: #8f9aaa;
    --subtle: #657081;
    --line: #252c37;
    --line-soft: #1c222c;
    --accent: #6ee7b7;
    --accent-strong: #34d399;
    --accent-soft: rgba(52, 211, 153, .12);
    --orange: #f59e0b;
    --orange-soft: rgba(245, 158, 11, .13);
    --red: #f05252;
    --red-soft: rgba(240, 82, 82, .12);
    --gray: #394250;
    --radius: 15px;
    --radius-small: 10px;
    --shadow: 0 20px 60px rgba(0, 0, 0, .24);
    --sidebar-width: 248px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--workspace);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

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

a:hover {
    color: #a7f3d0;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: .9em;
}

.hidden {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 17px 18px;
    overflow-y: auto;
    background:
        radial-gradient(circle at 16% 0%, rgba(52, 211, 153, .08), transparent 26%),
        var(--sidebar);
    border-right: 1px solid var(--line-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    letter-spacing: -.025em;
}

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

.brand > span:last-child {
    display: flex;
    flex-direction: column;
    font-size: 18px;
}

.brand strong {
    color: var(--accent);
    font-weight: 760;
}

.brand small {
    margin-top: -1px;
    color: var(--subtle);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.3;
    text-transform: uppercase;
}

.brand-mark {
    width: 33px;
    height: 33px;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    padding: 7px;
    border: 1px solid rgba(110, 231, 183, .23);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(110, 231, 183, .15), rgba(110, 231, 183, .03));
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.brand-mark i {
    width: 4px;
    border-radius: 4px 4px 2px 2px;
    background: var(--accent);
}

.brand-mark i:nth-child(1) {
    height: 8px;
    opacity: .55;
}

.brand-mark i:nth-child(2) {
    height: 16px;
}

.brand-mark i:nth-child(3) {
    height: 12px;
    opacity: .75;
}

.main-nav {
    margin-top: 34px;
    display: grid;
    gap: 5px;
}

.main-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 630;
}

.main-nav a > span {
    width: 20px;
    color: var(--subtle);
    font-size: 17px;
    line-height: 1;
    text-align: center;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, .025);
    color: var(--text);
}

.main-nav a.active {
    border-color: rgba(110, 231, 183, .14);
    background: var(--accent-soft);
    color: #d8ffef;
}

.main-nav a.active > span {
    color: var(--accent);
}

.main-nav .settings-mobile {
    display: none;
}

.sidebar-targets {
    margin-top: 30px;
}

.sidebar-label {
    display: flex;
    justify-content: space-between;
    padding: 0 10px 9px;
    color: var(--subtle);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.sidebar-label span {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--panel);
    color: var(--muted);
    text-align: center;
}

.sidebar-targets > a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 6px 10px;
    overflow: hidden;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
}

.sidebar-targets > a:hover {
    background: rgba(255, 255, 255, .025);
    color: var(--text);
}

.sidebar-targets > a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    display: inline-block;
    border-radius: 50%;
    background: var(--gray);
    box-shadow: 0 0 0 3px rgba(57, 66, 80, .11);
}

.status-pass {
    background: var(--accent-strong);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.status-fail {
    background: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}

.status-unavailable {
    background: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-soft);
}

.sidebar-footer {
    margin-top: auto;
    padding: 19px 9px 0;
    border-top: 1px solid var(--line-soft);
    color: var(--subtle);
    font-size: 11px;
}

.sidebar-settings {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    margin: -8px -7px 16px;
    padding: 9px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
}

.sidebar-settings > span:first-child {
    color: var(--subtle);
    font-size: 17px;
    line-height: 1.25;
    text-align: center;
}

.sidebar-settings > span:last-child {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.sidebar-settings strong {
    overflow: hidden;
    color: inherit;
    font-size: 11px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer .sidebar-settings small {
    margin: 0;
    color: var(--subtle);
    font-size: 9px;
}

.sidebar-settings:hover,
.sidebar-settings.active {
    border-color: rgba(110, 231, 183, .14);
    background: var(--accent-soft);
    color: #d8ffef;
}

.sidebar-settings.active > span:first-child {
    color: var(--accent);
}

.sidebar-footer > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.sidebar-footer small {
    display: block;
    margin: 8px 0 3px;
    line-height: 1.5;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--subtle);
    font-size: 11px;
}

.link-button:hover {
    color: var(--text);
}

.workspace {
    grid-column: 2;
    min-width: 0;
    padding: 30px clamp(22px, 3vw, 52px) 64px;
}

.workspace-header {
    min-height: 90px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 24px;
}

.workspace-header h1,
.setup-card h1,
.auth-card h1 {
    margin: 1px 0 5px;
    font-size: clamp(28px, 3vw, 39px);
    font-weight: 710;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.workspace-header > div > p:last-child,
.setup-card > div > p:last-child,
.auth-card > p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.last-run {
    display: flex;
    flex-direction: column;
    color: var(--subtle);
    font-size: 10px;
    text-align: right;
}

.last-run strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 680;
    line-height: 1;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    border-color: #5ee1ae;
    background: var(--accent);
    color: #07120d;
    box-shadow: 0 9px 25px rgba(52, 211, 153, .13);
}

.button-primary:hover {
    background: #9af1d0;
    color: #07120d;
}

.button-secondary {
    border-color: var(--line);
    background: var(--panel);
    color: var(--text);
}

.button-secondary:hover {
    border-color: #374151;
    background: var(--panel-strong);
    color: var(--text);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(130px, .8fr) minmax(135px, .8fr) minmax(135px, .8fr) auto;
    align-items: end;
    gap: 12px;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(19, 24, 33, .78);
    box-shadow: var(--shadow);
}

label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

label > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

label > small {
    margin-top: -3px;
    color: var(--subtle);
    font-size: 10px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: 0;
    background: #0c1016;
    color: var(--text);
}

input,
select {
    min-height: 40px;
    padding: 8px 11px;
}

textarea {
    min-height: 180px;
    padding: 13px 14px;
    resize: vertical;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: 0;
}

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

.metric-card {
    min-height: 133px;
    display: flex;
    flex-direction: column;
    padding: 19px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(150deg, var(--panel-strong), var(--panel));
    box-shadow: var(--shadow);
}

.metric-card-primary {
    border-color: rgba(110, 231, 183, .2);
    background:
        radial-gradient(circle at 95% 0%, rgba(52, 211, 153, .15), transparent 45%),
        linear-gradient(150deg, #17211f, #131a1d);
}

.metric-card > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.metric-card > strong {
    margin-top: auto;
    font-size: clamp(25px, 2.5vw, 34px);
    font-weight: 720;
    letter-spacing: -.045em;
    line-height: 1.12;
}

.metric-card-primary > strong {
    color: var(--accent);
}

.metric-card > small {
    margin-top: 4px;
    color: var(--subtle);
    font-size: 10px;
}

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

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 17px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 690;
    letter-spacing: -.02em;
}

.legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 11px;
    color: var(--subtle);
    font-size: 10px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.legend i {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
}

.legend-good {
    background: var(--accent-strong);
}

.legend-warning {
    background: var(--orange);
}

.legend-critical {
    background: var(--red);
}

.legend-none {
    background: var(--gray);
}

.chart-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 60px 0 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.availability-chart {
    min-width: max-content;
    height: 180px;
    display: flex;
    align-items: end;
    gap: 6px;
    padding: 0 2px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(to bottom, transparent 24%, var(--line-soft) 25%, transparent 25.8%, transparent 49%, var(--line-soft) 50%, transparent 50.8%, transparent 74%, var(--line-soft) 75%, transparent 75.8%);
}

.day-bar {
    position: relative;
    width: 23px;
    height: 100%;
    display: flex;
    flex: 0 0 23px;
    flex-direction: column;
    align-items: stretch;
    justify-content: end;
    padding: 0;
    border: 0;
    background: transparent;
}

.bar-track {
    height: 146px;
    display: flex;
    align-items: flex-end;
    border-radius: 5px 5px 2px 2px;
    background: rgba(255, 255, 255, .018);
}

.bar-track i {
    width: 100%;
    min-height: 4px;
    display: block;
    border-radius: 5px 5px 2px 2px;
    background: var(--gray);
    opacity: .75;
    transition: filter .16s ease, opacity .16s ease;
}

.day-bar.level-good .bar-track i {
    background: linear-gradient(180deg, #86efc5, var(--accent-strong));
    box-shadow: 0 0 16px rgba(52, 211, 153, .13);
}

.day-bar.level-warning .bar-track i {
    background: linear-gradient(180deg, #fbbf24, var(--orange));
}

.day-bar.level-critical .bar-track i {
    background: linear-gradient(180deg, #fb7185, var(--red));
}

.day-bar.level-none .bar-track i {
    height: 4px !important;
}

.day-bar small {
    width: 37px;
    margin: 8px 0 0 -7px;
    color: var(--subtle);
    font-size: 8px;
    font-weight: 650;
    line-height: 1;
    text-align: center;
}

.day-bar:hover .bar-track i,
.day-bar:focus-visible .bar-track i {
    filter: brightness(1.24);
    opacity: 1;
}

.day-bar::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: calc(100% + 9px);
    width: max-content;
    max-width: 240px;
    padding: 8px 10px;
    border: 1px solid #354052;
    border-radius: 8px;
    background: #080b10;
    color: var(--text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 5px);
    transition: opacity .12s ease, transform .12s ease;
}

.day-bar:hover::after,
.day-bar:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.day-bar:first-child::after {
    left: 0;
    transform: translate(0, 5px);
}

.day-bar:first-child:hover::after,
.day-bar:first-child:focus-visible::after {
    transform: translate(0, 0);
}

.day-bar:last-child::after {
    right: 0;
    left: auto;
    transform: translate(0, 5px);
}

.day-bar:last-child:hover::after,
.day-bar:last-child:focus-visible::after {
    transform: translate(0, 0);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 10px;
    font-weight: 680;
    white-space: nowrap;
}

.error-list {
    display: grid;
}

.error-entry {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.error-entry:first-child {
    padding-top: 4px;
    border-top: 0;
}

.error-time {
    display: flex;
    flex-direction: column;
    color: var(--muted);
    font-size: 11px;
}

.error-time strong {
    color: var(--text);
    font-size: 12px;
}

.error-body > h3 {
    margin: 0 0 9px;
    font-size: 14px;
    font-weight: 690;
}

.check-row {
    display: grid;
    grid-template-columns: 62px 70px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    min-height: 27px;
    padding: 4px 0;
    color: var(--muted);
    font-size: 11px;
}

.check-row > strong {
    color: var(--text);
}

.check-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.check-status.pass {
    background: var(--accent-soft);
    color: var(--accent);
}

.check-status.fail {
    background: var(--red-soft);
    color: #fb9292;
}

.check-status.unavailable {
    background: var(--orange-soft);
    color: #fbbf24;
}

.diagnostic-details {
    margin-top: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: var(--panel-soft);
}

.diagnostic-details summary {
    padding: 8px 11px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.diagnostic-details pre {
    max-height: 300px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-top: 1px solid var(--line-soft);
    color: #a9b5c5;
    font: 10px/1.55 "SFMono-Regular", Consolas, monospace;
    white-space: pre-wrap;
}

.empty-log {
    min-height: 145px;
    display: grid;
    place-items: center;
    color: var(--subtle);
    text-align: center;
}

.empty-log strong {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.loading-panel {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--muted);
}

.loading-panel i {
    width: 15px;
    height: 15px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

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

.flash {
    padding: 11px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12px;
}

.flash-success {
    border-color: rgba(52, 211, 153, .24);
    background: var(--accent-soft);
    color: #a7f3d0;
}

.flash-error {
    border-color: rgba(240, 82, 82, .26);
    background: var(--red-soft);
    color: #fda4a4;
}

.empty-state {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
    color: var(--muted);
    text-align: center;
}

.empty-state > span {
    color: var(--accent);
    font-size: 44px;
}

.empty-state h2 {
    margin: 12px 0 4px;
    color: var(--text);
}

.empty-state p {
    margin: 0 0 18px;
}

.form-panel {
    padding-bottom: 78px;
}

.target-form {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.target-form > textarea {
    min-height: 350px;
}

.form-note {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--subtle);
    font-size: 11px;
}

.form-note strong {
    color: var(--muted);
}

.save-button {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 30;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .35);
}

.compact-panel {
    padding: 20px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.check-grid > div {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    padding: 13px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
}

.check-grid i {
    color: var(--accent);
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
}

.check-grid strong {
    margin-top: auto;
    font-size: 12px;
}

.check-grid span {
    color: var(--subtle);
    font-size: 10px;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.system-grid .panel {
    margin: 0;
}

.system-grid .notification-panel,
.system-grid .update-panel {
    grid-column: 1 / -1;
}

.notification-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(190px, .45fr) auto;
    align-items: start;
    gap: 14px;
}

.notification-form .button {
    align-self: end;
}

.notification-note {
    display: grid;
    gap: 5px;
    margin-top: 17px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}

.notification-note p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.notification-note small {
    margin-top: 4px;
    color: var(--subtle);
}

.update-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    align-items: start;
    gap: 24px;
}

.update-form {
    display: grid;
    align-items: start;
    gap: 13px;
}

input[type="file"] {
    min-height: 47px;
    padding: 7px;
    color: var(--muted);
}

input[type="file"]::file-selector-button {
    min-height: 31px;
    margin-right: 10px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-strong);
    color: var(--text);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.update-form .panel-copy {
    margin: 0;
}

.update-form .button {
    justify-self: start;
}

.update-form.is-submitting input[type="file"] {
    pointer-events: none;
    opacity: .62;
}

.update-progress {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 680;
}

.update-form.is-submitting .button {
    cursor: wait;
    opacity: .68;
}

.update-history {
    min-height: 100%;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
}

.update-history > strong {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.update-history > p {
    margin: 13px 0 0;
    color: var(--subtle);
    font-size: 11px;
}

.history-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
}

.update-history > strong + .history-row {
    margin-top: 8px;
}

.history-row > i {
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
}

.history-ok {
    background: var(--accent-strong);
}

.history-fail {
    background: var(--red);
}

.history-row > span {
    display: flex;
    flex-direction: column;
}

.history-row strong {
    color: var(--text);
    font-size: 11px;
}

.history-row small {
    color: var(--subtle);
    font-size: 9px;
}

.panel-copy {
    margin: -6px 0 15px;
    color: var(--muted);
    font-size: 11px;
}

.copy-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    min-height: 48px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #0b0f15;
}

.copy-field code,
.copy-field > a {
    padding: 11px 12px;
    overflow: auto;
    color: #b8c3d1;
    font: 10px/1.5 "SFMono-Regular", Consolas, monospace;
    white-space: nowrap;
}

.copy-button {
    min-width: 78px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.copy-button:hover {
    background: #202733;
    color: var(--text);
}

.health-list {
    display: grid;
}

.health-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 11px;
}

.health-list > div:first-child {
    border-top: 0;
}

.health-list strong {
    font-size: 9px;
    text-transform: uppercase;
}

.health-ok {
    color: var(--accent);
}

.health-bad {
    color: var(--orange);
}

.big-status {
    margin: 8px 0 17px;
    font-size: clamp(18px, 2vw, 25px);
    font-weight: 680;
    letter-spacing: -.035em;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 520px) minmax(360px, 1fr);
    background: var(--bg);
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(30px, 6vw, 78px);
    background: var(--sidebar);
}

.auth-brand {
    position: absolute;
    top: 30px;
}

.auth-card h1 {
    margin-bottom: 8px;
}

.auth-form {
    display: grid;
    gap: 17px;
    margin-top: 28px;
}

.auth-form .button {
    width: 100%;
}

.auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(35px, 8vw, 120px);
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 25%, rgba(52, 211, 153, .12), transparent 28%),
        linear-gradient(145deg, #10161d, #0b0e13);
}

.auth-aside h2 {
    margin: 4px 0 30px;
    font-size: clamp(31px, 4.5vw, 62px);
    font-weight: 650;
    letter-spacing: -.055em;
    line-height: 1.02;
}

.auth-aside > p:last-child {
    max-width: 530px;
    color: var(--muted);
}

.signal-demo {
    height: 145px;
    display: flex;
    align-items: end;
    gap: 9px;
    margin-bottom: 24px;
    padding: 16px 0 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(to bottom, transparent 49%, var(--line-soft) 50%, transparent 51%);
}

.signal-demo i {
    width: 20px;
    height: 100%;
    display: block;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--accent), #1f9d73);
}

.signal-demo .warn {
    height: 78% !important;
    background: var(--orange);
}

.signal-demo .bad {
    height: 35% !important;
    background: var(--red);
}

.setup-layout {
    min-height: 100vh;
    padding: 26px clamp(20px, 5vw, 70px) 60px;
    background:
        radial-gradient(circle at 85% 0%, rgba(52, 211, 153, .09), transparent 25%),
        var(--workspace);
}

.setup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.step-badge {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
}

.setup-card {
    max-width: 920px;
    margin: 58px auto 0;
    padding: clamp(25px, 5vw, 52px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.setup-form {
    display: grid;
    gap: 20px;
    margin-top: 28px;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 15px;
}

.fatal-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--bg);
}

.fatal-layout .auth-card {
    max-width: 600px;
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

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

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

    .filter-panel .button {
        grid-column: span 2;
    }

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

@media (max-width: 780px) {
    .app-shell {
        display: block;
        padding-top: 63px;
    }

    .sidebar {
        position: fixed;
        inset: 0 0 auto 0;
        width: auto;
        min-height: 63px;
        height: 63px;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px 13px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .brand > span:last-child {
        font-size: 15px;
    }

    .brand small,
    .sidebar-targets,
    .sidebar-footer {
        display: none;
    }

    .brand-mark {
        width: 31px;
        height: 31px;
    }

    .main-nav {
        display: flex;
        gap: 3px;
        margin: 0 0 0 auto;
    }

    .main-nav a {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 0;
    }

    .main-nav a > span {
        width: 19px;
        font-size: 17px;
    }

    .main-nav .settings-mobile {
        display: flex;
    }

    .workspace {
        padding: 25px 16px 85px;
    }

    .workspace-header {
        flex-direction: column;
        min-height: 0;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .last-run {
        text-align: left;
    }

    .system-grid,
    .target-form {
        grid-template-columns: 1fr;
    }

    .update-layout {
        grid-template-columns: 1fr;
    }

    .notification-form {
        grid-template-columns: 1fr;
    }

    .notification-form .button {
        justify-self: start;
    }

    .target-form > textarea,
    .form-note {
        grid-column: 1;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-card {
        min-height: 100vh;
    }

    .auth-aside {
        display: none;
    }
}

@media (max-width: 560px) {
    .workspace-header h1,
    .setup-card h1,
    .auth-card h1 {
        font-size: 29px;
    }

    .filter-panel,
    .metric-grid,
    .check-grid,
    .setup-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel .button {
        grid-column: 1;
    }

    .metric-card {
        min-height: 112px;
    }

    .panel {
        padding: 16px;
    }

    .panel-heading {
        flex-direction: column;
        gap: 10px;
    }

    .legend {
        justify-content: flex-start;
    }

    .error-entry {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .error-time {
        flex-direction: row;
        gap: 6px;
    }

    .check-row {
        grid-template-columns: 52px 66px minmax(0, 1fr);
    }

    .form-note {
        flex-direction: column;
    }

    .setup-layout {
        padding-inline: 14px;
    }

    .setup-card {
        margin-top: 34px;
        padding: 22px 17px;
    }

    .step-badge {
        display: none;
    }

    .save-button {
        right: 16px;
        bottom: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}
