:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    background: #09111f;
    color: #e6edf7;
}

.settings-hero, .setting-card header, .setting-form, .settings-filters { display: flex; gap: 1rem; align-items: end; }
.settings-hero { justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.settings-hero h1 { margin: .15rem 0; }
.settings-hero > div > p:last-child { color: #aebed2; }
.settings-restart, .setting-state, .setting-category {
    border: 1px solid #3a5478;
    border-radius: 999px;
    padding: .35rem .65rem;
    background: #162943;
    color: #c8d7ea;
    font-size: .78rem;
    font-weight: 700;
}
.settings-filters {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #29405f;
    border-radius: 1rem;
    background: #0e1a2d;
    flex-wrap: wrap;
}
.settings-filters label, .setting-form label {
    display: grid;
    gap: .3rem;
    flex: 1;
    min-width: 12rem;
    color: #aebed2;
    font-size: .875rem;
}
.settings-filters input, .settings-filters select, .setting-form input {
    min-height: 42px;
    padding: .65rem;
    border: 1px solid #3a5478;
    border-radius: .5rem;
    background: #09111f;
    color: #f7fafc;
    font: inherit;
}
.settings-filters input::placeholder, .setting-form input::placeholder { color: #8397b2; }
.settings-filters input:focus, .settings-filters select:focus, .setting-form input:focus {
    outline: 2px solid #ffbe3d;
    outline-offset: 2px;
}
.settings-filters button, .setting-form button {
    min-height: 42px;
    padding: .7rem 1rem;
    border: 0;
    border-radius: .5rem;
    background: #ffbe3d;
    color: #111827;
    font-weight: 800;
    cursor: pointer;
}
.settings-list { display: grid; gap: .8rem; }
.setting-card {
    border: 1px solid #29405f;
    border-radius: 1rem;
    padding: 1rem;
    background: #0e1a2d;
}
.setting-card.is-missing { background: #0b1526; }
.setting-card header { justify-content: space-between; align-items: start; }
.setting-card h2 { font-size: .95rem; margin: .45rem 0 .8rem; overflow-wrap: anywhere; }
.setting-form { flex-wrap: wrap; }
.risk-check { font-size: .85rem; color: #ffd470; display: flex !important; grid-auto-flow: column; align-items: center; }
.risk-check input { min-width: auto; accent-color: #ffbe3d; }
.remove-setting-form { margin-top: .65rem; display: flex; justify-content: flex-end; gap: 1rem; align-items: center; }
.setting-card footer { margin-top: .7rem; color: #8397b2; font-size: .78rem; }
.notice { padding: .8rem 1rem; margin: 1rem 0; border-radius: .75rem; }
.notice.success { border: 1px solid #2f7c68; background: #102f2a; color: #8ce6c5; }
.notice.error { border: 1px solid #92403b; background: #3b1515; color: #ffd9d6; }
.empty-state { color: #8397b2; }
@media (max-width: 700px) { .settings-hero, .setting-card header { align-items: start; flex-direction: column; } }
.binance-account-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; align-items: end; }
.binance-account-form label { display: grid; gap: .3rem; }
.binance-account-form input:not([type="checkbox"]) { padding: .65rem; border: 1px solid #cbd5df; border-radius: .4rem; min-width: 0; }
.binance-account-form label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: .5rem; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #15284a 0, #09111f 42%); }
.build-footer { padding: 1rem 5vw; color: #8397b2; font-size: .8rem; text-align: right; }
.topbar { display: flex; gap: 1rem; align-items: center; padding: 1rem 5vw; border-bottom: 1px solid #29405f; background: #09111fcc; }
.brand { color: #ffbe3d; font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.logout-form { margin-left: auto; }
.link-button { padding: 0; border: 0; background: transparent; color: #ffbe3d; cursor: pointer; }
.container { width: min(1100px, 90vw); margin: 0 auto; padding: 5rem 0; }
.hero { max-width: 760px; }
.hero h1 { margin: .3rem 0 1rem; font-size: clamp(2.4rem, 6vw, 5rem); line-height: .98; }
.hero p { color: #aebed2; font-size: 1.15rem; line-height: 1.7; }
.eyebrow { color: #ffbe3d !important; font-size: .8rem !important; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 3rem; }
.status-grid article { padding: 1.25rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; }
.status-grid span { display: block; margin-bottom: .5rem; color: #8397b2; font-size: .8rem; text-transform: uppercase; }
.status-grid strong { color: #f7fafc; overflow-wrap: anywhere; }
.auth-card { width: min(480px, 100%); margin: 0 auto; padding: 2rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; }
.auth-card h1 { margin-top: .25rem; }
.auth-card form { display: grid; gap: .75rem; margin-top: 1.5rem; }
.auth-card input:not([type="checkbox"]) { width: 100%; padding: .8rem; border: 1px solid #3a5478; border-radius: .5rem; background: #09111f; color: #f7fafc; }
.auth-card button { padding: .85rem 1rem; border: 0; border-radius: .5rem; background: #ffbe3d; color: #111827; font-weight: 800; cursor: pointer; }
.checkbox-row { display: flex; gap: .5rem; align-items: center; }
.validation { color: #ff9f9f; }
.main-nav { display: flex; gap: 1rem; margin-left: auto; }
.main-nav a, .primary-action a { color: #ffbe3d; font-weight: 700; }
.logout-form { margin-left: 0; }
.primary-action { margin-top: 2rem; }
.dashboard-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; }
.dashboard-heading h1 { margin: .25rem 0; font-size: clamp(2rem, 5vw, 3.5rem); }
.dashboard-heading p { color: #aebed2; }
.freshness, .notice { color: #aebed2; }
.notice { margin: 1.5rem 0; padding: 1rem; border: 1px solid #765d25; border-radius: .75rem; background: #2b2412; }
.portfolio-filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; margin: 2rem 0; padding: 1rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; }
.portfolio-filters fieldset { display: flex; flex-wrap: wrap; gap: 1rem; border: 0; padding: 0; }
.portfolio-filters label { display: flex; gap: .4rem; align-items: center; }
.portfolio-filters select { padding: .5rem; border: 1px solid #3a5478; border-radius: .4rem; background: #09111f; color: #f7fafc; }
.portfolio-cards { margin-top: 1rem; }
.chart-card, .composition-card, .account-balances-card, .certification-card, .paper-test-card, .trading-risk-card, .trading-cycles-card { margin-top: 2rem; padding: 1.25rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; }
.account-action-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.section-title { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.section-title h2 { margin: 0; }
.section-title p, .section-title > span { color: #8397b2; }
.section-title p { margin: .5rem 0 1rem; }
.section-title > span { font-size: .85rem; white-space: nowrap; }
.certification-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; align-items: end; }
.certification-form label { display: grid; gap: .4rem; color: #aebed2; font-size: .85rem; }
.certification-form input, .certification-form select { width: 100%; padding: .65rem; border: 1px solid #3a5478; border-radius: .4rem; background: #09111f; color: #f7fafc; }
.certification-form button { padding: .75rem 1rem; border: 0; border-radius: .5rem; background: #ffbe3d; color: #111827; font-weight: 800; cursor: pointer; }
.certification-form button:disabled { cursor: wait; opacity: .65; }
.account-refresh-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.account-refresh-actions button { padding: .55rem .8rem; border: 1px solid #3a5478; border-radius: .5rem; background: #162943; color: #f7fafc; font-weight: 700; cursor: pointer; }
.account-refresh-actions button:disabled { cursor: wait; opacity: .65; }
.secondary-button { padding: .55rem .8rem; border: 1px solid #3a5478; border-radius: .5rem; background: #162943; color: #f7fafc; font-weight: 700; cursor: pointer; }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.danger-button { padding: .55rem .8rem; border: 1px solid #92403b; border-radius: .5rem; background: #3b1515; color: #ffd9d6; font-weight: 700; cursor: pointer; white-space: nowrap; }
.danger-button:disabled { cursor: default; opacity: .55; }
.certification-card output, .paper-test-card output { display: block; min-height: 1.5rem; margin-top: 1rem; color: #aebed2; overflow-wrap: anywhere; white-space: pre-line; }
.chart-title { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.chart-title span { color: #8397b2; font-size: .85rem; }
.chart-card canvas { width: 100%; height: auto; margin-top: 1rem; background: #09111f; border-radius: .5rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; border-bottom: 1px solid #29405f; text-align: left; }
th { color: #8397b2; font-size: .75rem; text-transform: uppercase; }
td { overflow-wrap: anywhere; }
.cycles-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; }
.cycles-heading h1 { margin: .25rem 0; font-size: clamp(2rem, 5vw, 3.5rem); }
.cycles-heading p { margin-bottom: 0; color: #aebed2; }
.cycles-count { min-width: 180px; padding: 1rem 1.25rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; text-align: right; }
.cycles-count strong, .cycles-count span { display: block; }
.cycles-count strong { color: #ffbe3d; font-size: 1.75rem; }
.cycles-count span { color: #8397b2; font-size: .85rem; }
.cycle-search { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(130px, 1fr)); gap: 1rem; margin: 2rem 0; padding: 1.25rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; }
.cycle-search label { display: grid; gap: .45rem; color: #aebed2; font-size: .875rem; }
.cycle-search input, .cycle-search select { width: 100%; min-height: 42px; padding: .65rem; border: 1px solid #3a5478; border-radius: .5rem; background: #09111f; color: #f7fafc; font: inherit; }
.cycle-search input:focus, .cycle-search select:focus { outline: 2px solid #ffbe3d; outline-offset: 2px; }
.cycle-search-actions { display: flex; gap: .75rem; align-items: center; grid-column: 1 / -1; }
.cycle-search-actions button, .cycle-search-actions a { min-height: 42px; padding: .7rem 1rem; border-radius: .5rem; font-weight: 800; text-decoration: none; }
.cycle-search-actions button { border: 0; background: #ffbe3d; color: #111827; cursor: pointer; }
.cycle-search-actions a { border: 1px solid #3a5478; color: #e6edf7; }
.cycles-results { padding: 1.25rem; border: 1px solid #29405f; border-radius: 1rem; background: #0e1a2d; }
.cycles-results-bar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .75rem; }
.cycles-results-bar h2 { margin: 0; }
.cycles-results-bar span { color: #8397b2; font-size: .875rem; }
.cycles-table { min-width: 1180px; }
.cycles-table td { vertical-align: top; }
.cycles-table td strong, .cycles-table td small { display: block; }
.cycles-table td small { margin-top: .25rem; color: #8397b2; font-size: .75rem; }
.number-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cycle-state { display: inline-block; padding: .3rem .55rem; border: 1px solid #3a5478; border-radius: 999px; color: #c8d7ea; font-size: .75rem; font-weight: 800; }
.cycle-state-open { border-color: #2f7c68; background: #102f2a; color: #8ce6c5; }
.cycle-state-closing { border-color: #8a6b28; background: #302810; color: #ffd470; }
.cycle-state-closed { background: #162943; }
.result-positive { color: #8ce6c5; }
.result-negative { color: #ff9f9f; }
.result-neutral { color: #aebed2; }
.empty-cell { padding: 3rem 1rem; color: #8397b2; text-align: center; }
.pagination { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.pagination a { min-width: 40px; padding: .55rem .7rem; border: 1px solid #3a5478; border-radius: .45rem; color: #e6edf7; text-align: center; text-decoration: none; }
.pagination a:hover, .pagination a:focus { border-color: #ffbe3d; }
.pagination a.current { border-color: #ffbe3d; background: #ffbe3d; color: #111827; font-weight: 800; }
.pagination a.disabled { pointer-events: none; opacity: .4; }
@media (max-width: 700px) {
    .container { padding: 2.5rem 0; }
    .dashboard-heading, .chart-title, .section-title, .cycles-heading, .cycles-results-bar { display: block; }
    .topbar > span { display: none; }
    .topbar { flex-wrap: wrap; }
    .main-nav { order: 3; width: 100%; margin-left: 0; }
    .cycle-search { grid-template-columns: 1fr; }
    .cycle-search-actions { grid-column: auto; }
    .cycles-count { margin-top: 1rem; text-align: left; }
    .pagination { justify-content: center; }
}
