:root {
    --bg: #0c0d10;
    --panel: #15171c;
    --panel-2: #1c1f26;
    --line: #2a2e37;
    --text: #f4f1ea;
    --muted: #9b9588;
    --gold: #d4af37;
    --gold-2: #f0d06a;
    --ok: #3dd68c;
    --warn: #f0b429;
    --bad: #ff6b6b;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(212, 175, 55, 0.12), transparent 50%),
        radial-gradient(900px 400px at 100% 0%, rgba(61, 214, 140, 0.06), transparent 45%),
        var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-frame {
    width: 100%;
    height: 88px;
    overflow: hidden;
    margin: 0 0 18px;
}

.logo-frame-sm {
    width: 220px;
    height: 36px;
    margin: 0;
}

.logo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.who { color: var(--muted); font-size: 14px; }

.auth-wrap {
    min-height: calc(100vh - 40px);
    display: grid;
    place-items: center;
    padding: 24px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    overflow: hidden;
}

h1, h2, h3 { margin: 0 0 8px; font-weight: 650; }
.lede { color: var(--muted); margin: 0 0 22px; }

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

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

label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

input, select, button, .btn {
    font: inherit;
}

input, select {
    width: 100%;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--gold);
    color: #16120a;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover, button:hover { filter: brightness(1.06); text-decoration: none; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-bad { background: #5a1f1f; color: #ffd4d4; }
.btn-ok { background: #163627; color: #baf7d6; }
.btn-warn { background: #3a2c10; color: #ffe3a3; }

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

.actions form { display: inline; }

.partner-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

.partner-code span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.name-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    max-width: 760px;
    padding-top: 8px;
}

.name-form > div { flex: 1; }

.partner-code strong {
    color: var(--gold-2);
    font-weight: 650;
    letter-spacing: 0.06em;
}

.flash {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.flash-ok { background: #163627; color: #baf7d6; }
.flash-bad { background: #3a1616; color: #ffd0d0; }
.flash-warn { background: #3a2c10; color: #ffe3a3; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-ok { background: #163627; color: var(--ok); }
.badge-warn { background: #3a2c10; color: var(--warn); }
.badge-bad { background: #3a1616; color: var(--bad); }

.muted { color: var(--muted); }
.mt { margin-top: 22px; }
.card-warn { border-color: rgba(240, 180, 41, 0.35); }
.search-bar { margin-bottom: 16px; align-items: end; }
.search-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}
.search-actions .btn,
.search-actions button { height: 44px; }
.stack { display: grid; gap: 14px; }
.forgot {
    margin: 10px 0 0;
    font-size: 13px;
    text-align: left;
}
.forgot a { color: var(--muted); }
.forgot a:hover { color: var(--gold-2); }

.page-home {
    max-width: 1120px;
}

.auth-wrap-short {
    min-height: auto;
    padding: 12px 0 40px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(280px, 42%) minmax(0, 58%);
    gap: 24px;
    align-items: center;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.15;
    margin-bottom: 14px;
}

.eyebrow {
    color: var(--gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 10px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-art {
    padding: 0;
    overflow: hidden;
    min-height: 240px;
}

.hero-art img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    background: #000;
}

.mfx-widget {
    display: flex;
    justify-content: center;
    padding: 16px 16px 0;
}

.mfx-widget img {
    display: block;
    width: 800px;
    max-width: 100%;
    height: auto;
    background: #000;
}

.example-card img,
.account-shot {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    background: #000;
    border-radius: 12px;
}

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

.block-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.block-list .card h3 { margin-bottom: 8px; }
.block-list .card p { margin: 0; line-height: 1.5; }

.example-card {
    padding: 0;
    overflow: hidden;
}

.example-card figcaption {
    padding: 14px 16px 16px;
    display: grid;
    gap: 4px;
}

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

.stat-grid div {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.stat-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.stat-grid strong { font-size: 18px; }

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

.board-col h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

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

.board-list li {
    display: grid;
    grid-template-columns: 1.4em minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
    font-size: 14px;
}

.board-list .rank { color: var(--muted); }

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

@media (max-width: 800px) {
    .board-grid { grid-template-columns: 1fr; }
}
.up { color: var(--ok); }
.down { color: var(--bad); }

.equity-chart,
.chart-fallback {
    width: 100%;
    height: auto;
    margin-top: 8px;
    border-radius: 12px;
}

.footnote { margin: 14px 0 0; font-size: 13px; }
code { color: var(--gold-2); }

.site-foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.copy {
    color: var(--muted);
    line-height: 1.6;
    max-width: 72ch;
    margin: 0 0 18px;
}

.jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 8px 0 10px;
    padding-bottom: 8px;
}

.jump-nav a {
    color: var(--muted);
    font-size: 13px;
}

.jump-nav a:hover { color: var(--gold-2); }

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ticks {
    margin: 0;
    padding: 0 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.ticks li { margin: 0 0 6px; }

@media (max-width: 800px) {
    .hero,
    .split { grid-template-columns: 1fr; }
    .hero-art img { max-height: 280px; }
    .row { flex-direction: column; align-items: stretch; }
    .topbar { flex-direction: column; align-items: flex-start; }
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.cal-note {
    margin: 8px 0 12px;
    color: var(--muted);
}

.cal-slide .name-form {
    margin-bottom: 14px;
}

.cal-row td {
    padding: 0;
    border-bottom: 0;
}

.cal-slide {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.cal-slide.open {
    grid-template-rows: 1fr;
}

.cal-slide-inner {
    overflow: hidden;
}

.cal-slide.open .cal-slide-inner {
    padding: 4px 10px 16px;
}

.cal-toggle.is-open {
    border-color: var(--gold);
    color: var(--gold-2);
}

.cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.cal-head {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 4px 0 8px;
}

.cal-day {
    min-height: 92px;
    background: #12141a;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--muted);
}

.cal-num {
    font-size: 13px;
    color: var(--text);
}

.cal-day strong {
    color: var(--text);
    font-size: 13px;
}

.cal-out {
    opacity: 0.35;
}

.cal-up {
    background: #1c5c45;
    border-color: #2f8f68;
    color: #e7fff4;
}

.cal-up strong,
.cal-up .cal-num { color: #f4fff9; }

.cal-down {
    background: #6a2d32;
    border-color: #a34a52;
    color: #ffe8e8;
}

.cal-down strong,
.cal-down .cal-num { color: #fff5f5; }

.cal-today .cal-num {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f4f1ea;
    color: #111;
    font-weight: 700;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    padding: 0;
    accent-color: var(--gold);
}

.hp {
    position: absolute;
    left: -9999px;
}

.cart-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.qty-field { width: 88px; }
.qty-field input { text-align: center; }

.account-slot {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}

.account-slot.open { grid-template-rows: 1fr; }

.account-slot-inner { overflow: hidden; }

.account-slot.open .account-slot-inner { padding-bottom: 4px; }

.voucher-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.voucher-row > div { flex: 1; }

.cart-totals { margin: 4px 0 8px; }

.cart-totals div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0;
}

.price {
    font-size: 22px;
    color: var(--gold-2);
    white-space: nowrap;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.legal h2 {
    font-size: 18px;
    margin-top: 26px;
}

.setting-block { margin-top: 12px; }

.setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    gap: 16px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.setting-row p { margin: 4px 0 0; }

.setting-default {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    font-weight: 650;
}

.setting-word { color: var(--text); }

.setting-value { color: var(--gold-2); }

.settings-jump { width: 220px; }

.dash-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.dial {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
}

.dial svg { width: 140px; height: 140px; }

.dial strong { display: block; font-size: 28px; }

.dial span { display: block; color: var(--muted); font-size: 13px; }

.bars { display: grid; gap: 12px; }

.bar-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 88px;
    gap: 10px;
    align-items: center;
}

.bar-row span { color: var(--muted); font-size: 13px; }

.bar-track {
    height: 10px;
    background: var(--panel-2);
    border-radius: 99px;
    overflow: hidden;
}

.bar-fill { height: 100%; border-radius: 99px; background: var(--muted); }
.bar-fill.up { background: var(--ok); }
.bar-fill.down { background: var(--bad); }

.bar-row strong { text-align: right; font-size: 14px; }

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

button.perf-tab {
    background: transparent;
    color: var(--muted);
    border: 0;
    border-radius: 0;
    padding: 0;
    font-size: 1.35rem;
    font-weight: 650;
}

button.perf-tab.is-on,
button.perf-tab:hover {
    color: var(--text);
    filter: none;
}

.graph-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

button.graph-mode {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 650;
}

button.graph-mode.is-on,
button.graph-mode:hover {
    background: var(--gold);
    color: #16120a;
    border-color: var(--gold);
    filter: none;
}

.graph-frame {
    position: relative;
    background: #0c0d10;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    min-height: 360px;
}

.graph-frame canvas {
    display: block;
    width: 100%;
    height: 360px;
}

.graph-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: var(--muted);
}

.graph-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    margin-top: 10px;
}

.graph-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 240px;
    color: var(--muted);
    font-size: 13px;
}

.graph-key span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.graph-key i {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex: 0 0 auto;
}

.graph-key i.is-line {
    height: 3px;
    width: 16px;
    border-radius: 99px;
}

.graph-tip {
    position: absolute;
    z-index: 2;
    min-width: 180px;
    max-width: 280px;
    padding: 10px 12px;
    background: #1c1f26;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 13px;
    pointer-events: none;
}

.graph-tip strong { display: block; margin-bottom: 6px; }

.graph-tip p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 3px 0;
}

.graph-tip span { color: var(--muted); }

.graph-tip b { font-weight: 650; white-space: nowrap; }

.graph-tip i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    margin-right: 6px;
}

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

.partner-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.partner-card h3,
.partner-card p { margin: 0; }

.partner-card p { color: var(--muted); line-height: 1.5; }

.partner-card .btn { margin-top: auto; }

.partner-logo {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0e1014;
    border-radius: 12px;
    overflow: hidden;
}

.partner-logo img,
.partner-shot {
    display: block;
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

.partner-shot {
    background: #0e1014;
    border-radius: 12px;
    padding: 8px;
}

.partner-mark {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--gold-2);
}

.partner-mark-sm { font-size: 14px; }

.partner-thumb {
    width: 72px;
    height: 40px;
    object-fit: contain;
    background: #0e1014;
    border-radius: 8px;
}

.partner-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.partner-tags .badge { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-size: 14px;
}

.check-line input {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}

button.passkey-login {
    width: 100%;
    margin-bottom: 14px;
}

.passkey-ios {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.45;
}

.phone-card { margin-bottom: 16px; }

.passkey-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.passkey-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.passkey-list .muted { display: block; font-size: 12px; }

.install-toast:not([hidden]) {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 12px 14px;
    background: var(--panel);
    border: 1px solid var(--gold);
    border-radius: 12px;
}

@media (max-width: 800px) {
    .dash-layout { grid-template-columns: 1fr; }
    .cal-day { min-height: 64px; font-size: 10px; }
    .cal-day strong, .cal-day span:not(.cal-num) { display: none; }
    .cal-up, .cal-down { min-height: 44px; }
}
