:root {
    color-scheme: dark;
    --bg: #07111f;
    --bg-soft: #0d1b2f;
    --bg-panel: rgba(10, 20, 35, 0.84);
    --bg-panel-strong: rgba(15, 29, 49, 0.95);
    --bg-panel-muted: rgba(11, 23, 40, 0.72);
    --text: #e5eefc;
    --muted: #91a6c5;
    --line: rgba(149, 174, 214, 0.16);
    --line-strong: rgba(149, 174, 214, 0.28);
    --accent: #68e1c7;
    --accent-strong: #14b8a6;
    --accent-warm: #f7b84b;
    --accent-coral: #fb7185;
    --positive: #34d399;
    --negative: #fb7185;
    --warning: #fbbf24;
    --neutral: #93a8c8;
    --long: #38bdf8;
    --short: #f97316;
    --shadow: 0 24px 60px rgba(2, 8, 18, 0.42);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 999px;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    position: relative;
    font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(247, 184, 75, 0.16), transparent 24%),
        linear-gradient(180deg, #091423 0%, #07111f 46%, #050c17 100%);
    color: var(--text);
    line-height: 1.5;
}

body.theme-light,
html[data-theme="light"] body {
    color-scheme: light;
    --bg: #edf3fb;
    --bg-soft: #f6f9fe;
    --bg-panel: rgba(255, 255, 255, 0.92);
    --bg-panel-strong: rgba(255, 255, 255, 0.98);
    --bg-panel-muted: rgba(243, 248, 255, 0.86);
    --text: #11233a;
    --muted: #4f6785;
    --line: rgba(102, 125, 160, 0.2);
    --line-strong: rgba(89, 114, 154, 0.35);
    --accent: #0f766e;
    --accent-strong: #0f766e;
    --accent-warm: #b7791f;
    --accent-coral: #be123c;
    --positive: #15803d;
    --negative: #be123c;
    --warning: #a16207;
    --neutral: #48617f;
    --long: #0369a1;
    --short: #c2410c;
    --shadow: 0 18px 40px rgba(15, 42, 78, 0.12);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.11), transparent 28%),
        radial-gradient(circle at top right, rgba(183, 121, 31, 0.1), transparent 26%),
        linear-gradient(180deg, #f7faff 0%, #eef4fb 52%, #e7eff8 100%);
}

body.theme-light::before {
    background-image: linear-gradient(rgba(17, 35, 58, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 35, 58, 0.04) 1px, transparent 1px);
    opacity: 0.32;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 78%);
    pointer-events: none;
    opacity: 0.24;
}

.app-backdrop {
    position: fixed;
    inset: auto -18% -22% auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 113, 133, 0.12), transparent 68%);
    filter: blur(10px);
    pointer-events: none;
}

a {
    color: inherit;
}

.site-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(5, 12, 23, 0.72);
    border-bottom: 1px solid rgba(149, 174, 214, 0.12);
}

.header-stack {
    display: grid;
    gap: 18px;
    padding: 24px 0 22px;
}

.brand-block {
    display: grid;
    gap: 10px;
}

.brand-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 700;
}

.site-header h1,
.page-header h2,
.panel h3 {
    margin: 0;
    line-height: 1.05;
}

.site-header h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -0.04em;
}

.brand-copy {
    margin: 10px 0 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 0.98rem;
}

.header-badges,
.page-header-note,
.panel-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(149, 174, 214, 0.12);
    border-radius: 16px;
    text-decoration: none;
    background: rgba(12, 24, 40, 0.65);
    color: var(--muted);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(104, 225, 199, 0.34);
    background: rgba(17, 31, 50, 0.92);
    color: var(--text);
}

.nav-link.is-active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(56, 189, 248, 0.16));
    border-color: rgba(104, 225, 199, 0.38);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
}

main.site-shell {
    padding: 34px 0 64px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 22px;
}

.page-header h2 {
    font-size: clamp(1.8rem, 2.5vw, 2.6rem);
    letter-spacing: -0.04em;
}

.page-header p:last-child,
.subtle-copy,
.panel-note {
    margin: 8px 0 0;
    color: var(--muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-card,
.panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 29, 49, 0.92), rgba(9, 19, 33, 0.92));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.metric-card::after,
.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 32%);
    pointer-events: none;
}

.metric-card {
    padding: 18px 18px 20px;
}

.metric-label,
.panel-kicker {
    margin: 0;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
}

.metric-value {
    margin: 12px 0 4px;
    font-size: clamp(1.8rem, 2.6vw, 2.7rem);
    line-height: 1;
    letter-spacing: -0.05em;
    font-weight: 700;
}

.metric-footnote {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.panel {
    padding: 20px;
}

.panel-wide {
    grid-column: 1 / -1;
}

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

.panel-heading h3 {
    margin-top: 6px;
    font-size: 1.25rem;
}

.detail-list {
    display: grid;
    grid-template-columns: minmax(130px, 0.9fr) minmax(0, 1.2fr);
    gap: 12px 16px;
    margin: 0;
}

.detail-list-wide {
    grid-template-columns: repeat(2, minmax(120px, 0.8fr) minmax(0, 1.2fr));
}

.detail-list dt {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-list dd {
    margin: 0;
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}

.count-list {
    display: grid;
    gap: 10px;
}

.count-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(149, 174, 214, 0.08);
}

.count-item span {
    color: var(--muted);
}

.count-item strong {
    font-size: 1.05rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.88;
}

.badge-positive {
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.22);
    color: var(--positive);
}

.badge-negative {
    background: rgba(251, 113, 133, 0.14);
    border-color: rgba(251, 113, 133, 0.22);
    color: var(--negative);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.22);
    color: var(--warning);
}

.badge-neutral {
    background: rgba(147, 168, 200, 0.12);
    border-color: rgba(147, 168, 200, 0.2);
    color: var(--neutral);
}

.badge-long {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.22);
    color: var(--long);
}

.badge-short {
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.22);
    color: var(--short);
}

.badge-outline {
    background: transparent;
    border-color: rgba(149, 174, 214, 0.18);
    color: var(--text);
}

.badge-outline::before {
    opacity: 0.45;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 140px;
    padding: 18px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(149, 174, 214, 0.2);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.table-scroll {
    overflow-x: auto;
    margin: 0 -4px -4px;
    padding: 0 4px 4px;
}

.data-table {
    width: 100%;
    min-width: 700px;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    padding: 0 14px 12px;
    text-align: left;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.data-table tbody td {
    padding: 14px;
    border-top: 1px solid rgba(149, 174, 214, 0.08);
    vertical-align: top;
}

.data-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: background 180ms ease;
}

.data-table tbody tr:hover {
    background: rgba(104, 225, 199, 0.05);
}

.chart-card {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(8, 17, 29, 0.78), rgba(8, 17, 29, 0.42));
    border: 1px solid rgba(149, 174, 214, 0.1);
}

.chart-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.chart-summary-card {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(149, 174, 214, 0.08);
}

.chart-summary-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.chart-summary-value {
    font-size: 1.05rem;
    font-weight: 700;
}

.equity-chart svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-grid-line {
    stroke: rgba(149, 174, 214, 0.14);
    stroke-width: 1;
}

.chart-area {
    fill: rgba(104, 225, 199, 0.12);
}

.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart-dot {
    fill: var(--accent-warm);
    stroke: rgba(5, 12, 23, 0.9);
    stroke-width: 2;
}

.chart-caption {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

body .metric-card,
body .panel {
    opacity: 0;
    transform: translateY(16px);
}

body.is-ready .metric-card,
body.is-ready .panel {
    animation: rise-in 620ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

body.is-ready .metric-card:nth-child(2),
body.is-ready .panel:nth-child(2) {
    animation-delay: 60ms;
}

body.is-ready .metric-card:nth-child(3),
body.is-ready .panel:nth-child(3) {
    animation-delay: 120ms;
}

body.is-ready .metric-card:nth-child(4),
body.is-ready .panel:nth-child(4) {
    animation-delay: 180ms;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .brand-row,
    .page-header,
    .panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-list-wide {
        grid-template-columns: minmax(130px, 0.9fr) minmax(0, 1.2fr);
    }
}

@media (max-width: 700px) {
    .site-shell {
        width: min(100% - 20px, 1180px);
    }

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

    .nav-link {
        justify-content: center;
    }

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

    .panel,
    .metric-card {
        padding: 18px;
    }

    .detail-list {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .detail-list dt {
        margin-top: 10px;
    }

    .data-table {
        min-width: 620px;
    }
}

.comparison-table tbody td {
    white-space: nowrap;
}

.count-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(149, 174, 214, 0.08);
}

.count-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.count-card-metric {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.count-card-copy {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.signal-chart-grid {
    display: grid;
    gap: 16px;
}

.signal-chart-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(149, 174, 214, 0.08);
}

.signal-chart-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.signal-chart-header h4 {
    margin: 6px 0 0;
    font-size: 1rem;
    word-break: break-all;
}

.signal-chart-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.signal-metric-card {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(149, 174, 214, 0.08);
}

.signal-metric-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.signal-detail-list {
    margin-bottom: 16px;
}

.signal-chart-shell {
    margin-bottom: 0;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.88rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 4px;
    border-radius: 999px;
}

.legend-entry {
    background: #68e1c7;
}

.legend-stop {
    background: #fb7185;
}

.legend-tp1 {
    background: #fbbf24;
}

.legend-tp2 {
    background: #60a5fa;
}

.legend-signal {
    background: rgba(255, 255, 255, 0.35);
    height: 10px;
    width: 10px;
    border-radius: 50%;
}

.signal-rr-chart svg {
    display: block;
    width: 100%;
    height: auto;
}

.signal-lwc-canvas {
    display: block;
    width: 100%;
    height: 360px;
    border-radius: 16px;
}

.signal-window-highlight {
    fill: rgba(255, 255, 255, 0.05);
}

.signal-candle-wick {
    stroke: rgba(228, 236, 252, 0.75);
    stroke-width: 1.5;
}

.signal-candle-up {
    fill: rgba(52, 211, 153, 0.8);
}

.signal-candle-down {
    fill: rgba(251, 113, 133, 0.82);
}

.signal-level-line {
    stroke-width: 2;
    stroke-dasharray: 6 6;
}

.signal-level-text {
    font-size: 10px;
    font-weight: 700;
}

.signal-level-entry {
    stroke: #68e1c7;
    fill: #68e1c7;
}

.signal-level-stop {
    stroke: #fb7185;
    fill: #fb7185;
}

.signal-level-tp1 {
    stroke: #fbbf24;
    fill: #fbbf24;
}

.signal-level-tp2 {
    stroke: #60a5fa;
    fill: #60a5fa;
}

.signal-chart-footer {
    margin-top: 14px;
}

@media (max-width: 920px) {
    .signal-chart-header,
    .count-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.header-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    align-self: flex-start;
    justify-self: flex-start;
    width: fit-content;
    max-width: min(100%, 720px);
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-panel-muted);
}

.header-actions > * {
    flex: 0 0 auto;
}

.session-user {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    max-width: 280px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-button,
#manual-refresh-button,
.theme-toggle-button {
    appearance: none;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-panel-strong) 86%, transparent);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.logout-button:hover,
.logout-button:focus-visible,
#manual-refresh-button:hover,
#manual-refresh-button:focus-visible,
.theme-toggle-button:hover,
.theme-toggle-button:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line-strong));
    background: color-mix(in srgb, var(--bg-panel-strong) 94%, transparent);
    box-shadow: 0 8px 18px rgba(2, 8, 18, 0.2);
    outline: none;
}

.logout-button:active,
#manual-refresh-button:active,
.theme-toggle-button:active {
    transform: translateY(0);
}

.logout-button {
    min-width: 86px;
}

#manual-refresh-button {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-strong) 24%, transparent), color-mix(in srgb, var(--long) 22%, transparent));
}

.theme-toggle-button {
    border-color: color-mix(in srgb, var(--long) 36%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--long) 18%, transparent), color-mix(in srgb, var(--accent) 14%, transparent));
}

body.theme-light .theme-toggle-button {
    border-color: color-mix(in srgb, var(--long) 36%, var(--line));
    background: linear-gradient(135deg, color-mix(in srgb, var(--long) 14%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
}

#last-refreshed-at {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 920px) {
    .header-actions {
        align-self: flex-start;
        justify-self: flex-start;
        justify-content: flex-start;
        max-width: 100%;
    }

    .session-user {
        max-width: 220px;
    }
}



.signals-table {
    min-width: 1080px;
}

.signals-table tbody td {
    vertical-align: middle;
}

.signal-id-cell {
    display: grid;
    gap: 4px;
    min-width: 190px;
}

.signal-id-cell strong {
    font-size: 0.96rem;
    letter-spacing: -0.02em;
}

.signal-id-cell span {
    color: var(--muted);
    font-size: 0.78rem;
    word-break: break-all;
}

.chart-toggle-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(104, 225, 199, 0.22);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(56, 189, 248, 0.12));
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.chart-toggle-button:hover,
.chart-toggle-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(104, 225, 199, 0.38);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.24), rgba(56, 189, 248, 0.18));
    box-shadow: 0 10px 24px rgba(3, 10, 18, 0.28);
    outline: none;
}

.chart-toggle-button[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(149, 174, 214, 0.22);
}

.signal-chart-row td {
    padding: 0 14px 16px;
    border-top: none;
}

.signal-chart-inline-shell {
    margin-top: -4px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(7, 16, 28, 0.96), rgba(10, 20, 35, 0.88));
    border: 1px solid rgba(149, 174, 214, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.signal-chart-inline-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.signal-chart-inline-header h4,
.signal-chart-topline h5 {
    margin: 6px 0 0;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.signal-chart-inline-badges,
.signal-chart-topline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.signal-rr-chart-inline {
    min-height: 240px;
}

.signal-chart-frame {
    display: grid;
    gap: 16px;
}

.signal-chart-topline {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.signal-chart-overline {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
}

.signal-chart-summary-grid {
    margin-bottom: 0;
}

.signal-chart-surface {
    position: relative;
    padding: 14px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(104, 225, 199, 0.1), transparent 28%),
        linear-gradient(180deg, rgba(5, 12, 23, 0.98), rgba(8, 17, 29, 0.96));
    border: 1px solid rgba(149, 174, 214, 0.12);
    overflow: hidden;
}

.signal-chart-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 28%);
    pointer-events: none;
}

.signal-chart-surface svg {
    position: relative;
    z-index: 1;
}

.signal-chart-surface-glow {
    fill: rgba(255, 255, 255, 0.02);
    stroke: rgba(149, 174, 214, 0.08);
    stroke-width: 1;
}

.signal-grid-line {
    stroke: rgba(149, 174, 214, 0.12);
}

.signal-window-highlight {
    fill: rgba(255, 255, 255, 0.05);
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.signal-marker-line {
    stroke: rgba(104, 225, 199, 0.6);
    stroke-width: 1.5;
    stroke-dasharray: 6 6;
}

.signal-marker-label {
    fill: rgba(104, 225, 199, 0.92);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.signal-axis-tick {
    fill: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.signal-axis-marker {
    stroke: rgba(149, 174, 214, 0.25);
    stroke-width: 1;
}

.signal-axis-label {
    fill: var(--muted);
    font-size: 10px;
    text-anchor: middle;
}

.signal-candle-wick {
    stroke: rgba(228, 236, 252, 0.82);
    stroke-width: 1.4;
}

.signal-candle-up {
    fill: rgba(52, 211, 153, 0.92);
}

.signal-candle-down {
    fill: rgba(251, 113, 133, 0.92);
}

.signal-level-line {
    stroke-width: 1.8;
    stroke-dasharray: 7 7;
}

.signal-level-text {
    font-size: 10px;
    font-weight: 700;
}

.signal-chart-footnotes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 0.84rem;
}

@media (max-width: 920px) {
    .signal-chart-inline-header,
    .signal-chart-topline {
        flex-direction: column;
        align-items: flex-start;
    }
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

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

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(149, 174, 214, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.pagination-link:hover,
.pagination-link:focus-visible {
    border-color: rgba(104, 225, 199, 0.38);
    background: rgba(104, 225, 199, 0.08);
}

.pagination-link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.account-balance-panel {
    position: relative;
    overflow: hidden;
}

.account-balance-summary {
    margin: 18px 0;
}

.account-balance-grid {
    align-items: end;
}

.manual-trade-panel {
    position: relative;
    overflow: hidden;
}

.manual-trade-form {
    display: grid;
    gap: 16px;
}

.manual-trade-fieldset {
    margin: 0;
    padding: 0;
    border: none;
    display: grid;
    gap: 16px;
}

.manual-trade-fieldset:disabled {
    opacity: 0.72;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(149, 174, 214, 0.16);
    background: rgba(8, 16, 28, 0.74);
    color: var(--text);
    padding: 12px 14px;
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: rgba(104, 225, 199, 0.4);
    box-shadow: 0 0 0 3px rgba(104, 225, 199, 0.12);
    background: rgba(8, 16, 28, 0.92);
}

.form-field textarea {
    resize: vertical;
    min-height: 88px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

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

#manual-trade-submit,
#account-balance-submit {
    appearance: none;
    border: 1px solid rgba(104, 225, 199, 0.24);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(56, 189, 248, 0.18));
    color: var(--text);
    min-height: 42px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

#manual-trade-submit:hover,
#manual-trade-submit:focus-visible,
#account-balance-submit:hover,
#account-balance-submit:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(104, 225, 199, 0.4);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(56, 189, 248, 0.24));
    outline: none;
}

#manual-trade-submit:disabled,
#account-balance-submit:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.form-note {
    margin: 0;
    color: var(--muted);
    max-width: 560px;
    line-height: 1.5;
}

.form-feedback {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(149, 174, 214, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.form-feedback.is-success {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
}

.form-feedback.is-error {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.12);
}

.form-feedback.is-neutral {
    border-color: rgba(104, 225, 199, 0.24);
    background: rgba(104, 225, 199, 0.1);
}

.settings-grid {
    align-items: start;
}

.settings-hero-panel {
    background:
        radial-gradient(circle at top right, rgba(104, 225, 199, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(15, 29, 49, 0.96), rgba(9, 19, 33, 0.94));
}

.settings-summary-grid {
    margin-bottom: 18px;
}

.settings-status-row,
.settings-action-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.settings-status {
    margin: 0;
}

.settings-status-positive {
    color: var(--positive);
}

.settings-status-negative {
    color: var(--negative);
}

.settings-status-neutral {
    color: var(--muted);
}

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

.settings-form-grid-two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-form-spacer {
    display: none;
}

.field-block,
.toggle-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(149, 174, 214, 0.08);
}

.field-block-wide {
    grid-column: 1 / -1;
}

.field-label {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.field-help,
.toggle-card small {
    color: var(--muted);
    font-size: 0.84rem;
}

.field-block input,
.field-block textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(149, 174, 214, 0.16);
    background: rgba(5, 12, 23, 0.72);
    color: var(--text);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field-block textarea {
    resize: vertical;
    min-height: 104px;
}

.field-block input:focus,
.field-block textarea:focus,
.toggle-card input:focus {
    outline: none;
    border-color: rgba(104, 225, 199, 0.42);
    box-shadow: 0 0 0 3px rgba(104, 225, 199, 0.12);
}

.field-block input::placeholder,
.field-block textarea::placeholder {
    color: rgba(145, 166, 197, 0.7);
}

.toggle-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.toggle-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.toggle-card input {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-strong);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(149, 174, 214, 0.18);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(149, 174, 214, 0.28);
}

.chart-toggle-button:disabled,
#manual-refresh-button:disabled,
.field-block input:disabled,
.field-block textarea:disabled,
.toggle-card input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 920px) {
    .settings-form-grid-two-up {
        grid-template-columns: 1fr;
    }

    .settings-status-row,
    .settings-action-row {
        align-items: stretch;
    }
}


.runtime-finding-card {
    min-height: 100%;
}

.runtime-metrics-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.runtime-panel {
    background: linear-gradient(180deg, rgba(11, 20, 34, 0.82), rgba(7, 15, 26, 0.88));
}

.runtime-drawer {
    display: grid;
    gap: 18px;
}

.runtime-drawer-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    cursor: pointer;
    list-style: none;
}

.runtime-drawer-summary::-webkit-details-marker {
    display: none;
}

.runtime-drawer-summary h3 {
    margin-top: 6px;
}

.runtime-summary-aside {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex-shrink: 0;
}

.runtime-drawer-hint {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.runtime-drawer-body {
    display: grid;
    gap: 18px;
    padding-top: 2px;
}

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

.runtime-runs-table {
    min-width: 1120px;
}

.runtime-run-timings,
.runtime-run-context {
    display: grid;
    gap: 4px;
}

.runtime-run-timings span,
.runtime-run-context span {
    color: var(--muted);
    font-size: 0.84rem;
}

.runtime-run-context strong {
    font-size: 0.92rem;
    line-height: 1.4;
}

@media (max-width: 920px) {
    .runtime-drawer-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .runtime-summary-aside {
        justify-items: flex-start;
    }
}

:root {
    --bg: #0b1220;
    --bg-soft: #121a28;
    --bg-panel: rgba(13, 20, 31, 0.9);
    --bg-panel-strong: rgba(16, 24, 36, 0.96);
    --bg-panel-muted: rgba(17, 26, 38, 0.8);
    --text: #e7edf6;
    --muted: #97a6ba;
    --line: rgba(151, 166, 186, 0.13);
    --line-strong: rgba(151, 166, 186, 0.22);
    --accent: #7fb7c9;
    --accent-strong: #5c95a8;
    --accent-warm: #d2b07a;
    --accent-coral: #d88484;
    --positive: #7cc49b;
    --negative: #d48787;
    --warning: #d6b36d;
    --neutral: #93a4ba;
    --long: #74a9c7;
    --short: #cc9364;
    --shadow: 0 18px 42px rgba(4, 8, 15, 0.28);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

body {
    background:
        radial-gradient(circle at top left, rgba(127, 183, 201, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(210, 176, 122, 0.06), transparent 24%),
        linear-gradient(180deg, #0d1420 0%, #0a111b 48%, #080d15 100%);
}

body::before {
    opacity: 0.12;
}

.app-backdrop {
    background: radial-gradient(circle, rgba(127, 183, 201, 0.08), transparent 70%);
    filter: blur(16px);
}

.site-header {
    background: rgba(8, 13, 21, 0.78);
    border-bottom: 1px solid rgba(151, 166, 186, 0.09);
}

.header-stack {
    gap: 16px;
    padding: 22px 0 20px;
}

.brand-row {
    align-items: flex-start;
}

.brand-copy {
    max-width: 760px;
    font-size: 0.95rem;
}

.header-utility-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.header-support-copy {
    margin: 0;
    max-width: 780px;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-nav-shell {
    display: grid;
    gap: 14px;
}

.nav-group {
    display: grid;
    gap: 10px;
}

.nav-group-label {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}

.site-nav {
    gap: 10px;
}

.nav-link {
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.nav-link.is-active {
    background: linear-gradient(135deg, rgba(127, 183, 201, 0.12), rgba(127, 183, 201, 0.05));
    border-color: rgba(127, 183, 201, 0.22);
}

.metric-card,
.panel,
.count-card,
.chart-card,
.signal-chart-inline-shell,
.signal-chart-surface,
.runtime-panel {
    background: linear-gradient(180deg, rgba(14, 21, 32, 0.96), rgba(11, 17, 26, 0.96));
    border-color: rgba(151, 166, 186, 0.1);
    box-shadow: var(--shadow);
}

.metric-card::after,
.panel::after {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 30%);
}

.metric-value {
    letter-spacing: -0.045em;
}

.readiness-panel {
    overflow: hidden;
}

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

.readiness-summary-card .count-card-metric {
    font-size: 1.05rem;
    line-height: 1.4;
}

.readiness-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.readiness-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(151, 166, 186, 0.08);
}

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

.readiness-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.operator-note-list {
    display: grid;
    gap: 10px;
}

.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.quick-link-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(151, 166, 186, 0.1);
    background: rgba(255, 255, 255, 0.025);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.quick-link-card:hover,
.quick-link-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(127, 183, 201, 0.24);
    background: rgba(127, 183, 201, 0.05);
    outline: none;
}

.quick-link-kicker {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.quick-link-card strong {
    font-size: 1rem;
}

.quick-link-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.mini-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 920px) {
    .header-utility-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

    .quick-link-grid,
    .readiness-grid,
    .readiness-checklist {
        grid-template-columns: 1fr;
    }
}

.shell-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar-shell {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    padding: 26px 20px 24px;
    border-right: 1px solid rgba(149, 174, 214, 0.12);
    background: rgba(6, 14, 26, 0.9);
    backdrop-filter: blur(18px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 22px;
}

.sidebar-brand h1 {
    font-size: 1.6rem;
    margin-top: 4px;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(104, 225, 199, 0.45) rgba(12, 24, 40, 0.35);
}

.sidebar-nav::-webkit-scrollbar {
    width: 10px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(12, 24, 40, 0.35);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.72), rgba(20, 184, 166, 0.72));
    border-radius: 999px;
    border: 2px solid rgba(12, 24, 40, 0.4);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.88), rgba(20, 184, 166, 0.88));
}

.sidebar-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid rgba(149, 174, 214, 0.12);
    background: rgba(12, 24, 40, 0.5);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    transform: translateX(2px);
    color: var(--text);
    border-color: rgba(104, 225, 199, 0.34);
    background: rgba(17, 31, 50, 0.92);
}

.sidebar-link.is-active {
    color: var(--text);
    border-color: rgba(104, 225, 199, 0.38);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(56, 189, 248, 0.16));
}

.sidebar-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.content-shell {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

.topbar-shell {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 30px 18px;
    border-bottom: 1px solid rgba(149, 174, 214, 0.12);
    background: rgba(5, 12, 23, 0.76);
    backdrop-filter: blur(18px);
}

.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    align-self: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(104, 225, 199, 0.35);
    background: rgba(9, 20, 34, 0.85);
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible {
    border-color: rgba(104, 225, 199, 0.65);
    background: rgba(14, 27, 44, 0.95);
}

.nav-overlay {
    display: none;
}

.topbar-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.topbar-title {
    margin: 0;
    font-size: clamp(1.8rem, 2.8vw, 2.5rem);
    letter-spacing: -0.04em;
}

.page-content {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 64px;
}

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

    .sidebar-shell {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        height: 100dvh;
        z-index: 30;
        transform: translateX(-105%);
        transition: transform 220ms ease;
        border-right: 1px solid rgba(149, 174, 214, 0.2);
        border-bottom: none;
        box-shadow: 0 24px 60px rgba(2, 8, 18, 0.62);
    }

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

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

    .nav-overlay {
        position: fixed;
        inset: 0;
        z-index: 20;
        background: rgba(4, 9, 18, 0.58);
        backdrop-filter: blur(2px);
    }

    body.nav-open .nav-overlay {
        display: block;
    }

    .topbar-shell {
        padding-top: 18px;
    }
}

@media (max-width: 720px) {
    .topbar-shell {
        flex-direction: column;
        align-items: start;
    }

    .page-content {
        width: min(100%, calc(100% - 20px));
        padding-top: 22px;
    }
}
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.login-card {
    position: relative;
    width: min(100%, 430px);
    display: grid;
    gap: 18px;
    justify-items: center;
    padding: 32px 28px 28px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top center, rgba(127, 183, 201, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(14, 21, 32, 0.98), rgba(10, 16, 25, 0.98));
    border: 1px solid rgba(151, 166, 186, 0.12);
    box-shadow: 0 30px 70px rgba(4, 8, 15, 0.42);
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 28%);
    pointer-events: none;
}

.login-copy {
    position: relative;
    z-index: 1;
    margin: -8px 0 0;
    color: var(--muted);
    font-size: 0.96rem;
    text-align: center;
}

.login-brand-mark,
.login-form-panel {
    position: relative;
    z-index: 1;
}

.login-brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(127, 183, 201, 0.9), rgba(210, 176, 122, 0.78));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 16px 30px rgba(4, 8, 15, 0.28);
}

.login-title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 2.8rem);
    line-height: 1;
    letter-spacing: -0.06em;
    text-align: center;
}

.login-form-panel {
    display: grid;
    gap: 16px;
    align-content: start;
    width: 100%;
    max-width: 360px;
    padding: 22px 20px 20px;
    border-radius: 18px;
    background: rgba(6, 12, 20, 0.72);
    border: 1px solid rgba(151, 166, 186, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.login-form-header {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.login-form-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(151, 166, 186, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.login-form input:focus {
    outline: none;
    border-color: rgba(127, 183, 201, 0.36);
    box-shadow: 0 0 0 3px rgba(127, 183, 201, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.login-submit {
    margin-top: 8px;
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(104, 225, 199, 0.24);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(56, 189, 248, 0.18));
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.login-submit:hover,
.login-submit:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(104, 225, 199, 0.4);
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(56, 189, 248, 0.24));
    outline: none;
}

.logout-form {
    margin: 0;
}

@media (max-width: 900px) {
    .login-card {
        padding: 28px 22px 22px;
    }
}

@media (max-width: 540px) {
    .login-shell {
        padding: 16px;
    }

    .login-card,
    .login-form-panel {
        padding: 18px;
    }

    .login-title {
        font-size: 2rem;
    }
}

