:root {
    --chocolate: #4b241c;
    --chocolate-2: #6f3828;
    --chocolate-3: #2d1713;
    --gold: #d9a441;
    --gold-soft: #f4dfaa;
    --cream: #fbf7ee;
    --surface: #ffffff;
    --surface-2: #f5f0e7;
    --ink: #1d1715;
    --muted: #736762;
    --line: #e5dbce;
    --green: #16835c;
    --green-soft: #dff4ea;
    --red: #b63a3a;
    --red-soft: #fbe5e5;
    --blue: #3567b7;
    --shadow: 0 18px 45px rgba(64, 35, 25, .11);
    --radius: 18px;
    --radius-sm: 11px;
    --sidebar: 276px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: light;
}

html[data-theme="dark"] {
    --cream: #160f0d;
    --surface: #211816;
    --surface-2: #2b201d;
    --ink: #f8efe6;
    --muted: #c5b7ae;
    --line: #44332d;
    --green-soft: #163a2e;
    --red-soft: #422323;
    --shadow: 0 18px 48px rgba(0, 0, 0, .35);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 92% 5%, rgba(217,164,65,.12), transparent 29%), radial-gradient(circle at 4% 98%, rgba(75,36,28,.09), transparent 26%); z-index: -1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .72rem .82rem; color: var(--ink); background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(217,164,65,.16); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
td { font-size: .9rem; }
progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-2); accent-color: var(--gold); }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--gold), #edc771); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--gold), #edc771); border-radius: 99px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); transition: grid-template-columns .28s ease; }
.app-shell.is-collapsed { grid-template-columns: 84px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; background: linear-gradient(155deg, var(--chocolate-3), var(--chocolate)); color: #fff; overflow: hidden auto; box-shadow: 12px 0 40px rgba(38,20,15,.14); }
.brand { min-height: 52px; display: flex; align-items: center; gap: .8rem; min-width: 235px; }
.brand-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: block;
    object-fit: contain;
    border: 1px solid rgba(217,164,65,.42);
    border-radius: 13px;
    background: #050505;
    box-shadow: 0 8px 22px rgba(217,164,65,.22);
}
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; display: inline-grid; place-items: center; border-radius: 13px; color: var(--chocolate-3); background: linear-gradient(145deg, #f6dc9b, var(--gold)); font: 800 1.3rem Georgia, serif; box-shadow: 0 8px 22px rgba(217,164,65,.22); }
.brand-mark-large { width: 64px; height: 64px; font-size: 2rem; border-radius: 20px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.brand-copy small { color: #d9c6bb; font-size: .62rem; letter-spacing: .08em; }
.nav-list { display: flex; flex-direction: column; gap: .3rem; }
.nav-item { min-width: 230px; min-height: 44px; display: flex; align-items: center; gap: .9rem; padding: .65rem .75rem; border: 1px solid transparent; border-radius: 12px; color: #e5d9d2; transition: background .2s, transform .2s, color .2s, border-color .2s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(3px); }
.nav-item.is-active { color: #fff; background: linear-gradient(105deg, rgba(217,164,65,.24), rgba(255,255,255,.07)); border-color: rgba(217,164,65,.34); }
.nav-icon { width: 28px; text-align: center; font-size: 1.1rem; }
.sidebar-foot { margin-top: auto; display: grid; gap: .45rem; min-width: 230px; }
.sidebar-foot form, .sidebar-foot button { width: 100%; }
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .8rem clamp(1rem, 3vw, 2.4rem); border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 30%); background: color-mix(in srgb, var(--cream) 86%, transparent); backdrop-filter: blur(18px); }
.topbar-title { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--chocolate), var(--chocolate-2)); font-weight: 800; }
.avatar-image { overflow: hidden; border: 2px solid color-mix(in srgb, var(--gold), transparent 20%); background: var(--surface-2); box-shadow: 0 6px 18px rgba(75,36,28,.18); }
.avatar-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.page { width: min(1440px, 100%); margin: 0 auto; flex: 1; padding: clamp(1rem, 2.5vw, 2.4rem); }
.footer { padding: 1.25rem; color: var(--muted); text-align: center; font-size: .78rem; }
.footer a { color: var(--chocolate-2); font-weight: 750; text-decoration: underline; text-decoration-color: color-mix(in srgb,var(--gold),transparent 35%); text-underline-offset: 3px; }
html[data-theme="dark"] .footer a { color: var(--gold); }
.impersonation-banner { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; padding: .62rem 1rem; color: #fff; background: linear-gradient(90deg, #6d2e77, #a14374); font-size: .84rem; }

.panel { padding: clamp(1rem, 2vw, 1.4rem); border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--shadow); }
.stack { display: grid; gap: 1rem; }
.page-heading, .section-heading, .card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-heading { margin-bottom: 1.2rem; }
.page-heading h1, .section-heading h2, .card-grid h2, .panel h2 { margin: .15rem 0 0; }
.page-heading h1 { font-size: clamp(1.65rem, 4vw, 2.3rem); }
.eyebrow { margin: 0; color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.heading-actions, .card-actions, .row-actions, .modal-actions, .filter-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.text-link { color: var(--chocolate-2); font-size: .82rem; font-weight: 800; }
html[data-theme="dark"] .text-link { color: var(--gold); }

.button { width: auto; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 11px; padding: .66rem 1rem; font-weight: 750; font-size: .88rem; transition: transform .2s, box-shadow .2s, background .2s, color .2s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--chocolate), var(--chocolate-2)); box-shadow: 0 9px 24px rgba(75,36,28,.2); }
.button-gold { color: var(--chocolate-3); background: linear-gradient(135deg, #f4d98b, var(--gold)); box-shadow: 0 9px 24px rgba(217,164,65,.22); }
.button-outline { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button-ghost { color: inherit; background: transparent; }
.button-danger { color: var(--red); border-color: color-mix(in srgb, var(--red), transparent 65%); background: var(--red-soft); }
.button-compact { min-height: 34px; padding: .4rem .68rem; border-radius: 9px; font-size: .76rem; }
.button-large { min-height: 52px; width: 100%; font-size: 1rem; }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); transition: transform .2s, background .2s; }
.icon-button:hover { transform: rotate(4deg) scale(1.04); }
.icon-danger { width: 28px; height: 28px; flex-basis: 28px; color: var(--red); border: 0; background: transparent; }

.hero-card { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; padding: clamp(1.3rem, 4vw, 2.3rem); border-radius: 24px; color: #fff; background: linear-gradient(125deg, var(--chocolate-3), var(--chocolate) 58%, #82502e); box-shadow: 0 22px 52px rgba(63,32,23,.23); overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(217,164,65,.28); border-radius: 50%; right: -80px; top: -140px; box-shadow: 0 0 0 28px rgba(217,164,65,.06), 0 0 0 62px rgba(217,164,65,.04); }
.hero-card > * { position: relative; z-index: 1; }
.hero-card h1 { margin: .2rem 0; font-size: clamp(1.8rem, 5vw, 3rem); }
.hero-card p:last-child { margin-bottom: 0; color: #dfd1ca; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.metric-grid-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-card { min-height: 132px; padding: 1.15rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 30px rgba(54,30,22,.07); position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--gold); }
.metric-card.income::before { background: var(--green); }
.metric-card.expense::before { background: var(--red); }
.metric-card.net::before { background: var(--gold); }
.metric-card.loan::before { background: #7054b8; }
.metric-card span, .metric-card small { color: var(--muted); font-size: .76rem; }
.metric-card strong { font-size: clamp(1.1rem, 2.4vw, 1.65rem); }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1rem; margin-top: 1rem; }
.span-two { min-width: 0; }
.record-list, .progress-list { display: grid; margin-top: .6rem; }
.record-row { display: flex; align-items: center; gap: .8rem; padding: .78rem .15rem; border-bottom: 1px solid var(--line); }
.record-row:last-child { border: 0; }
.record-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.record-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-main small, .cell-meta { display: block; color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.record-icon { width: 37px; height: 37px; flex: 0 0 37px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.record-icon.income { color: var(--green); background: var(--green-soft); }
.record-icon.expense { color: var(--red); background: var(--red-soft); }
.record-icon.net { color: var(--chocolate-2); background: var(--gold-soft); }
.amount-income { color: var(--green); }
.amount-expense { color: var(--red); }
.progress-item { padding: .72rem 0; border-bottom: 1px solid var(--line); }
.progress-item div { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.progress-item span { color: var(--muted); font-size: .72rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; align-content: start; }
.account-card { min-height: 210px; padding: 1.25rem; border-radius: 20px; color: #fff; background: linear-gradient(145deg, var(--chocolate-3), var(--chocolate-2)); box-shadow: 0 16px 34px rgba(64,34,25,.18); position: relative; overflow: hidden; }
.account-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -55px; top: -65px; background: rgba(217,164,65,.12); }
.account-card > * { position: relative; z-index: 1; }
.account-card p, .account-card small { color: #d7c9c2; }
.account-card > strong { display: block; margin: 1rem 0; font-size: 1.5rem; }
.account-card .button-outline { border-color: rgba(255,255,255,.22); color: #fff; background: rgba(255,255,255,.08); }
.is-muted { opacity: .6; }
.status-chip, .step-chip { display: inline-flex; align-items: center; width: fit-content; padding: .25rem .52rem; border-radius: 99px; color: var(--muted); background: var(--surface-2); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.account-card .status-chip { color: #fff; background: rgba(255,255,255,.13); }
.budget-card, .goal-card, .asset-card, .loan-card { display: flex; flex-direction: column; gap: .65rem; min-width: 0; }
.budget-card h2, .goal-card h2, .asset-card h2, .loan-card h2 { font-size: 1.05rem; }
.budget-card .card-actions, .goal-card .card-actions, .asset-card .card-actions, .loan-card .card-actions { margin-top: auto; }
.loan-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.loan-numbers span { display: flex; flex-direction: column; padding: .6rem; border-radius: 12px; background: var(--surface-2); }
.loan-numbers small { color: var(--muted); }
.compact-select { width: auto; min-height: 34px; padding: .35rem 1.8rem .35rem .55rem; font-size: .74rem; }

.split-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,360px); align-items: start; gap: 1rem; }
.sticky-form { position: sticky; top: 92px; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table-panel .table-wrap { margin: -.25rem -.25rem 0; }
.mobile-records { display: none; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; padding-top: 1rem; }
.pagination a { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-size: .78rem; }
.pagination a.is-current { color: #fff; border-color: var(--chocolate); background: var(--chocolate); }
.empty-inline { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.empty-state { max-width: 600px; margin: 7vh auto; display: grid; justify-items: center; text-align: center; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; color: var(--red); background: var(--red-soft); font-size: 1.7rem; font-weight: 900; }

.field { display: grid; gap: .4rem; min-width: 0; }
.field > span, .inline-field > span { color: var(--muted); font-size: .73rem; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.inline-form, .inline-field { display: flex; align-items: end; gap: .55rem; flex-wrap: wrap; }
.inline-field { flex-direction: column; align-items: flex-start; }
.inline-field input, .inline-field select, .inline-form input, .inline-form select { width: auto; min-width: 150px; }
.field-help, .fine-print { color: var(--muted); font-size: .75rem; line-height: 1.55; }
.input-action { display: flex; position: relative; }
.input-action input { padding-right: 3rem; }
.input-action button { width: 42px; position: absolute; right: 2px; top: 2px; bottom: 2px; border: 0; color: var(--muted); background: transparent; }
.segmented { display: grid; grid-template-columns: repeat(2,1fr); gap: .45rem; }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span { min-height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: .8rem; font-weight: 800; cursor: pointer; }
.segmented label input:checked + span { color: var(--chocolate-3); border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(217,164,65,.12); }
.check-field { display: flex; gap: .55rem; align-items: center; font-size: .84rem; }
.check-field input { width: 18px; min-height: 18px; accent-color: var(--chocolate); }
.callout { display: flex; flex-direction: column; gap: .25rem; padding: .9rem; border-left: 4px solid var(--gold); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.callout strong { color: var(--ink); }

.tab-guide {
    margin-bottom: 1rem;
    border: 1px solid color-mix(in srgb,var(--gold),var(--line) 58%);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, rgba(217,164,65,.14), transparent 38%),
        color-mix(in srgb,var(--surface) 96%,transparent);
    box-shadow: 0 13px 34px rgba(64,35,25,.07);
    overflow: hidden;
}
.tab-guide summary {
    min-height: 70px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    align-items: center;
    gap: .8rem;
    padding: .75rem 1rem;
    cursor: pointer;
    list-style: none;
    transition: background .25s;
}
.tab-guide summary:hover { background: color-mix(in srgb,var(--gold-soft) 25%,transparent); }
.tab-guide summary::-webkit-details-marker { display: none; }
.guide-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(217,164,65,.45);
    border-radius: 13px;
    color: var(--chocolate-3);
    background: linear-gradient(145deg,#f7e5b4,var(--gold));
    box-shadow: 0 8px 20px rgba(217,164,65,.18);
    font: 800 1rem Georgia,serif;
}
.guide-summary-copy { min-width: 0; display: flex; flex-direction: column; gap: .18rem; }
.guide-summary-copy strong { font-size: .9rem; }
.guide-summary-copy small { color: var(--muted); font-size: .7rem; }
.guide-toggle { display: flex; align-items: center; gap: .55rem; color: var(--chocolate-2); font-size: .72rem; font-weight: 850; white-space: nowrap; }
html[data-theme="dark"] .guide-toggle { color: var(--gold); }
.guide-toggle i {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--surface-2);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), background .25s;
}
.guide-toggle i::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px,-1px); }
.tab-guide[open] .guide-toggle i { transform: rotate(180deg); background: var(--gold-soft); }
.guide-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s cubic-bezier(.2,.8,.2,1); }
.tab-guide[open] .guide-reveal { grid-template-rows: 1fr; }
.guide-content { min-height: 0; overflow: hidden; padding: 0 1rem; opacity: 0; transform: translateY(-7px); transition: opacity .3s ease, transform .38s ease, padding-bottom .38s ease; }
.tab-guide[open] .guide-content { padding-bottom: 1rem; opacity: 1; transform: none; }
.guide-content > p { max-width: 1000px; margin: 0 0 .8rem 50px; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.guide-tips { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; margin-left: 50px; }
.guide-tips > span { display: flex; align-items: flex-start; gap: .55rem; padding: .72rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: .76rem; line-height: 1.5; }
.guide-tips i { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 8px; color: var(--chocolate-3); background: var(--gold-soft); font-size: .65rem; font-style: normal; font-weight: 900; }
.exchange-strip { display: flex; align-items: center; flex-wrap: wrap; gap: .38rem .55rem; margin: .75rem 0 0 50px; padding-top: .7rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .69rem; }
.exchange-strip strong { color: var(--ink); }
.exchange-strip small { margin-left: auto; color: var(--muted); }
.exchange-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb,var(--green),transparent 83%); }
.exchange-live-dot.is-stale { background: var(--gold); box-shadow: 0 0 0 4px rgba(217,164,65,.18); }

.filter-panel { margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 25px rgba(53,28,20,.06); overflow: hidden; }
.filter-panel summary { width: fit-content; min-height: 39px; display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; color: var(--chocolate-2); font-size: .76rem; font-weight: 850; cursor: pointer; list-style: none; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-toggle-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--chocolate-3); background: var(--gold-soft); transition: transform .25s; }
.filter-panel[open] .filter-toggle-icon { transform: rotate(90deg); }
.filter-form { display: grid; grid-template-columns: repeat(5,minmax(130px,1fr)); align-items: end; gap: .7rem; padding: 0 .8rem .8rem; animation: filter-in .25s ease; }
@keyframes filter-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.app-dialog { width: min(580px, calc(100% - 1.4rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: transparent; overflow: auto; }
.app-dialog-wide { width: min(780px, calc(100% - 1.4rem)); }
.app-dialog::backdrop { background: rgba(25,15,12,.68); backdrop-filter: blur(7px); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(25,15,12,.68); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(440px,100%); padding: 1.5rem; border-radius: 20px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 70px rgba(0,0,0,.28); animation: modal-in .22s ease; }
.modal-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--red); background: var(--red-soft); font-weight: 900; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.toast { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 12px; font-size: .84rem; animation: toast-in .3s ease; }
.toast-success { color: var(--green); border: 1px solid color-mix(in srgb,var(--green),transparent 65%); background: var(--green-soft); }
.toast-error { color: var(--red); border: 1px solid color-mix(in srgb,var(--red),transparent 65%); background: var(--red-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
.reminder-drawer { margin-bottom: 1rem; border: 1px solid color-mix(in srgb,var(--gold),transparent 45%); border-radius: 14px; background: var(--surface); }
.reminder-drawer summary { padding: .8rem 1rem; cursor: pointer; font-weight: 800; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .3rem; border-radius: 99px; color: var(--chocolate-3); background: var(--gold-soft); font-size: .7rem; }
.reminder-list { padding: 0 1rem .7rem; }
.reminder-list article { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.reminder-list p { margin: .2rem 0 0; color: var(--muted); font-size: .8rem; }

.bar-chart { min-height: 260px; display: flex; align-items: end; gap: .65rem; padding: 1rem 0; overflow-x: auto; }
.bar-group { min-width: 44px; flex: 1; display: grid; gap: .5rem; text-align: center; }
.bar-stack { height: 200px; display: flex; align-items: end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.bar { width: min(18px,40%); height: var(--bar); min-height: 2px; border-radius: 7px 7px 2px 2px; animation: grow .55s ease; }
.bar-income { background: var(--green); }
.bar-expense { background: var(--red); }
@keyframes grow { from { height: 0; } }
.bar-group small { color: var(--muted); font-size: .65rem; }
.chart-legend { display: flex; gap: 1rem; color: var(--muted); font-size: .75rem; }
.chart-legend span { display: flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend-income { background: var(--green); }
.legend-expense { background: var(--red); }
.horizontal-chart { display: grid; gap: .8rem; padding-top: .7rem; }
.horizontal-chart > div > span { display: flex; justify-content: space-between; margin-bottom: .35rem; }
.horizontal-chart small { color: var(--muted); }

.settings-grid { display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 1rem; margin-bottom: 1rem; }
.chip-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
.management-chip { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.management-chip > span { min-width: 0; display: flex; flex-direction: column; }
.management-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.management-chip small { color: var(--muted); font-size: .65rem; }
.compact-panel { margin-top: 1rem; }

.public-body { display: flex; min-height: 100vh; flex-direction: column; }
.public-header { min-height: 74px; display: flex; justify-content: space-between; align-items: center; padding: .8rem clamp(1rem,5vw,4rem); border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface) 90%,transparent); backdrop-filter: blur(16px); }
.public-header .brand { color: var(--ink); }
.public-header .brand-copy small { color: var(--muted); }
.public-main { width: min(1200px,100%); margin: auto; padding: 2rem 1rem; }
.auth-card { width: min(470px,100%); margin: 4vh auto; display: grid; justify-items: center; text-align: center; overflow: hidden; position: relative; }
.auth-card::before { content: ""; width: 220px; height: 220px; position: absolute; top: -130px; right: -100px; border-radius: 50%; background: rgba(217,164,65,.12); }
.trading-identity-logo {
    width: 154px;
    height: 154px;
    display: block;
    object-fit: contain;
    border: 1px solid rgba(217,164,65,.38);
    border-radius: 28px;
    background: #050505;
    box-shadow: 0 18px 42px rgba(50,25,17,.18), 0 0 0 6px rgba(217,164,65,.08);
}
.trading-identity-logo-install { width: 180px; height: 180px; }
.auth-card h1 { margin: .6rem 0 .2rem; font-size: 2rem; }
.lead { margin-top: 0; color: var(--muted); }
.auth-points { width: 100%; display: grid; gap: .5rem; margin: 1rem 0 1.3rem; text-align: left; color: var(--muted); font-size: .83rem; }
.auth-card form { width: 100%; }
.install-shell { width: min(1180px,100%); margin: 0 auto; display: grid; grid-template-columns: minmax(260px,.7fr) minmax(0,1.3fr); gap: 2rem; align-items: start; }
.install-intro { position: sticky; top: 2rem; padding: 2rem 0; }
.install-intro h1 { margin: .7rem 0; font-size: clamp(2.2rem,6vw,4.2rem); line-height: .95; }
.install-intro > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.feature-list { display: grid; gap: .7rem; padding: 0; list-style: none; color: var(--muted); }
.feature-list li::before { content: "◆"; margin-right: .5rem; color: var(--gold); }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-form { grid-template-columns: repeat(3,minmax(130px,1fr)); }
}

@media (max-width: 840px) {
    .app-shell, .app-shell.is-collapsed { display: block; }
    .sidebar { width: min(310px,86vw); position: fixed; left: 0; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .app-shell.is-mobile-open .sidebar { transform: translateX(0); }
    .app-shell.is-mobile-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(20,12,10,.58); backdrop-filter: blur(3px); }
    .topbar { height: 68px; }
    .dashboard-grid, .split-layout, .settings-grid, .install-shell { grid-template-columns: 1fr; }
    .sticky-form, .install-intro { position: static; }
    .install-intro { padding: .5rem 0; }
    .filter-form { grid-template-columns: repeat(2,minmax(130px,1fr)); }
}

@media (max-width: 640px) {
    .page { padding: .9rem; }
    .page-heading { align-items: flex-start; }
    .page-heading, .hero-card { flex-direction: column; }
    .hero-card { align-items: stretch; }
    .hero-card .button { width: fit-content; }
    .metric-grid, .metric-grid-three, .card-grid, .form-grid, .chip-list { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .metric-card { min-height: 112px; }
    .filter-form { grid-template-columns: 1fr; }
    .filter-actions { justify-content: flex-start; }
    .table-wrap { display: none; }
    .mobile-records { display: grid; }
    .mobile-record { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .55rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
    .mobile-record > small, .mobile-record > .row-actions { grid-column: 2 / -1; }
    .mobile-record > div:not(.row-actions) { min-width: 0; display: flex; flex-direction: column; }
    .mobile-record small { color: var(--muted); font-size: .68rem; }
    .record-row { align-items: flex-start; }
    .record-row > strong { font-size: .76rem; }
    .heading-actions { width: 100%; }
    .tab-guide summary { grid-template-columns: 38px minmax(0,1fr) auto; gap: .6rem; padding: .7rem .75rem; }
    .guide-icon { width: 36px; height: 36px; }
    .guide-summary-copy small, .guide-toggle > span { display: none; }
    .guide-content > p, .guide-tips, .exchange-strip { margin-left: 0; }
    .guide-tips { grid-template-columns: 1fr; }
    .exchange-strip small { width: 100%; margin-left: 0; }
    .public-main { padding: 1rem; }
    .install-form { padding: 1rem; }
}

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

/* J Trading Pro v3 experience */
:root {
    --gold: #d4af37;
    --gold-deep: #9c7920;
    --gold-wash: #fbf2d1;
    --green: #76611f;
    --green-soft: #f7efd2;
    --red: #7f2f25;
    --red-soft: #f4e7e3;
    --blue: #4b241c;
}

html[data-theme="dark"] {
    --gold-wash: #302814;
    --green-soft: #302814;
    --red-soft: #38201c;
}

body.has-overlay { overflow: hidden; }
.workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.sidebar-head { display: flex; align-items: center; gap: .55rem; }
.sidebar-close { display: none; margin-left: auto; color: #fff; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.nav { display: grid; gap: .25rem; }
.nav > a {
    min-width: 230px;
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .65rem .72rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #e7dad4;
    font-size: .86rem;
    font-weight: 690;
    transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.nav > a:hover { color: #fff; background: rgba(255,255,255,.075); transform: translateX(3px); }
.nav > a.active { color: #fff; border-color: rgba(212,175,55,.35); background: linear-gradient(105deg, rgba(212,175,55,.22), rgba(255,255,255,.06)); }
.nav > a > span:first-child { width: 27px; text-align: center; font-size: 1rem; }
.nav-divider { margin: .65rem 0 .2rem; color: #bda99d; font-size: .61rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-discipline { min-width: 230px; display: flex; align-items: flex-start; gap: .62rem; margin-top: auto; padding: .75rem; border: 1px solid rgba(212,175,55,.22); border-radius: 12px; background: rgba(0,0,0,.14); }
.sidebar-discipline strong, .sidebar-discipline small { display: block; }
.sidebar-discipline small { margin-top: .15rem; color: #cdbcb3; font-size: .67rem; line-height: 1.35; }
.pulse-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: .3rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 6px rgba(212,175,55,.12); animation: discipline-pulse 2.2s infinite; }
@keyframes discipline-pulse { 50% { box-shadow: 0 0 0 10px rgba(212,175,55,0); } }
.link-button { min-height: 38px; width: 100%; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #fff; background: rgba(255,255,255,.055); font-weight: 750; }
.sidebar-backdrop { display: none; }
.topbar-start { min-width: 0; display: flex; align-items: center; gap: .8rem; }
.topbar-start h1 { margin: .1rem 0 0; overflow: hidden; font-size: clamp(1rem, 2.2vw, 1.25rem); text-overflow: ellipsis; white-space: nowrap; }
.menu-button { display: none; }
.currency-chip {
    min-width: 48px;
    min-height: 32px;
    display: inline-grid;
    place-items: center;
    padding: .25rem .48rem;
    border: 1px solid color-mix(in srgb,var(--gold),var(--line) 55%);
    border-radius: 9px;
    color: var(--chocolate);
    background: var(--gold-wash);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .05em;
}
html[data-theme="dark"] .currency-chip { color: var(--gold); }
.profile-chip { min-width: 0; display: flex; align-items: center; gap: .6rem; padding: .28rem .55rem .28rem .28rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.profile-chip > span:last-child { min-width: 0; display: grid; }
.profile-chip strong, .profile-chip small { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip strong { font-size: .76rem; }
.profile-chip small { color: var(--muted); font-size: .62rem; }
.profile-chip img { width: 38px; height: 38px; object-fit: cover; border: 2px solid var(--gold); border-radius: 50%; }

.dashboard-hero {
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(0,1.4fr) minmax(210px,.6fr);
    align-items: center;
    gap: 1.4rem;
    margin-bottom: 1rem;
    padding: clamp(1.4rem, 4vw, 2.7rem);
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 86% 22%, rgba(212,175,55,.18), transparent 30%),
        linear-gradient(130deg, #190d0a, var(--chocolate) 62%, #633426);
    box-shadow: 0 24px 55px rgba(45,23,18,.22);
    overflow: hidden;
}
.dashboard-hero h2 { max-width: 850px; min-height: 2.5em; margin: .35rem 0 .6rem; font-size: clamp(1.75rem, 4.4vw, 3.2rem); line-height: 1.02; }
.dashboard-hero p { max-width: 700px; color: #d9c9c1; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.dashboard-hero .button-outline { color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.06); }
.discipline-orbit { width: min(220px, 60vw); aspect-ratio: 1; justify-self: center; display: grid; place-items: center; position: relative; border: 1px solid rgba(212,175,55,.35); border-radius: 50%; }
.discipline-orbit::before, .discipline-orbit::after, .orbit-ring { content: ""; position: absolute; border: 1px solid rgba(212,175,55,.22); border-radius: 50%; }
.discipline-orbit::before { inset: 16%; }
.discipline-orbit::after { inset: 31%; background: rgba(212,175,55,.08); }
.orbit-ring { inset: -12%; border-style: dashed; animation: orbit-spin 18s linear infinite; }
.discipline-orbit strong { z-index: 1; color: var(--gold); font: 850 1.45rem Georgia, serif; letter-spacing: .08em; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.typing-line::after { content: ""; display: inline-block; width: 2px; height: .85em; margin-left: .12em; background: var(--gold); animation: caret-blink .8s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

.positive, .amount-income { color: var(--green); }
.negative, .amount-expense, .danger-text { color: var(--red); }
html[data-theme="dark"] .positive { color: #ead47e; }
.status-pill {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    padding: .25rem .52rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-2);
    font-size: .67rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.success { color: var(--green); border-color: color-mix(in srgb,var(--green),transparent 60%); background: var(--green-soft); }
.status-pill.warning { color: var(--gold-deep); border-color: color-mix(in srgb,var(--gold),transparent 50%); background: var(--gold-wash); }
.status-pill.danger { color: var(--red); border-color: color-mix(in srgb,var(--red),transparent 60%); background: var(--red-soft); }
.guardrail-card, .plan-card { display: flex; flex-direction: column; gap: .8rem; }
.progress-stack { display: grid; gap: .8rem; }
.progress-stack > div { display: grid; gap: .38rem; }
.progress-stack span { display: flex; justify-content: space-between; gap: .7rem; color: var(--muted); font-size: .72rem; }
.loss-progress progress { accent-color: var(--red); }
.compact-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin: 0; }
.compact-facts > div { padding: .58rem; border-radius: 11px; background: var(--surface-2); }
.compact-facts dt { color: var(--muted); font-size: .66rem; }
.compact-facts dd { margin: .2rem 0 0; font-size: .82rem; font-weight: 800; }
.note-block { margin: 0; padding: .75rem; border-left: 3px solid var(--gold); border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: .8rem; line-height: 1.55; }
.check-review { display: flex; justify-content: space-between; gap: .6rem; font-size: .75rem; }
.content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-top: 1rem; }
.compact-records .record-row { padding: .66rem 0; }
.symbol-badge { min-width: 45px; max-width: 72px; height: 34px; display: grid; place-items: center; padding: 0 .45rem; border: 1px solid color-mix(in srgb,var(--gold),var(--line) 60%); border-radius: 10px; color: var(--chocolate); background: var(--gold-wash); font-size: .68rem; font-weight: 900; }
html[data-theme="dark"] .symbol-badge { color: var(--gold); }
.news-list { display: grid; }
.news-list > article { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .72rem 0; border-bottom: 1px solid var(--line); }
.news-list small { display: block; color: var(--muted); }
.impact-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(212,175,55,.12); }
.impact-dot.high { background: var(--red); box-shadow: 0 0 0 5px rgba(127,47,37,.12); }
.top-space { margin-top: 1rem; }

.plan-layout { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(0,1.25fr); gap: 1rem; align-items: start; }
.setup-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0; }
.setup-tabs a { min-width: 120px; display: grid; grid-template-columns: auto 1fr; gap: .12rem .42rem; padding: .58rem .65rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.setup-tabs a.active { border-color: var(--gold); background: var(--gold-wash); }
.setup-tabs a b { grid-row: 1 / 3; align-self: center; color: var(--gold-deep); font-size: 1.15rem; }
.setup-tabs a span { font-size: .76rem; font-weight: 850; }
.setup-tabs a small { color: var(--muted); font-size: .61rem; }
.requirement-list, .checklist-board { display: grid; gap: .55rem; }
.requirement-list > div, .checklist-board label { display: flex; align-items: center; gap: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.requirement-list > div > strong, .checklist-board label > b { flex: 1; }
.requirement-list > div small { color: var(--muted); }
.check-visual { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 7px; color: var(--chocolate); background: var(--gold-wash); font-size: .68rem; font-weight: 900; }
.grow { flex: 1; }
.session-planner { display: grid; gap: 1rem; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }

.filter-drawer { margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.filter-drawer > summary { width: fit-content; padding: .7rem .9rem; color: var(--chocolate); cursor: pointer; font-size: .78rem; font-weight: 850; list-style: none; }
.filter-drawer > summary::-webkit-details-marker { display: none; }
.filter-drawer > summary::before { content: "⌄"; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: .42rem; border-radius: 8px; background: var(--gold-wash); transition: transform .25s; }
.filter-drawer[open] > summary::before { transform: rotate(180deg); }
.filter-grid { display: grid; grid-template-columns: repeat(5,minmax(120px,1fr)); align-items: end; gap: .7rem; padding: 0 .9rem .9rem; }
.journal-layout { display: grid; grid-template-columns: minmax(310px,.83fr) minmax(0,1.17fr); gap: 1rem; align-items: start; }
.trade-form-panel { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; }
.form-section { display: grid; gap: .8rem; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb,var(--surface-2) 72%,transparent); }
.form-section > h3 { margin: 0; font-size: .95rem; }
.form-section > h4 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: .86rem; }
.form-section > h4 span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: var(--chocolate); background: var(--gold-wash); font-size: .68rem; }
.trade-checklist { display: grid; gap: .48rem; }
.trade-checklist label { display: flex; align-items: center; gap: .55rem; padding: .58rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.trade-checklist input { width: 18px; min-height: 18px; accent-color: var(--chocolate); }
.trade-checklist label span { color: var(--gold-deep); font-weight: 900; }
.trade-checklist label b { font-size: .76rem; }
.upload-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.drop-zone { min-height: 132px; display: grid; place-items: center; align-content: center; gap: .22rem; padding: .8rem; border: 1px dashed color-mix(in srgb,var(--gold),var(--line) 38%); border-radius: 14px; background: var(--surface); text-align: center; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--gold); background: var(--gold-wash); transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-zone > span { color: var(--gold-deep); font-size: 1.5rem; }
.drop-zone small, .drop-zone em { color: var(--muted); font-size: .67rem; }
.drop-zone em { max-width: 100%; overflow: hidden; color: var(--chocolate); font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.journal-feed { display: grid; gap: .85rem; }
.feed-header { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.trade-card { display: grid; gap: .75rem; }
.trade-card > header { display: flex; justify-content: space-between; gap: .75rem; }
.trade-card h3 { margin: 0; }
.trade-card header small { color: var(--muted); }
.trade-kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; }
.trade-kpis > span { padding: .55rem; border-radius: 10px; background: var(--surface-2); }
.trade-kpis small, .trade-kpis strong { display: block; }
.trade-kpis small { color: var(--muted); font-size: .64rem; }
.trade-kpis strong { margin-top: .15rem; font-size: .8rem; }
.reflection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem; }
.reflection-grid > div { padding: .65rem; border-left: 3px solid var(--gold); border-radius: 10px; background: var(--surface-2); }
.reflection-grid strong { font-size: .7rem; }
.reflection-grid p { margin: .35rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.evidence-strip { display: flex; gap: .45rem; overflow-x: auto; }
.evidence-strip button { width: 110px; height: 72px; flex: 0 0 110px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #0b0b0d; overflow: hidden; }
.evidence-strip img { width: 100%; height: 100%; display: block; object-fit: cover; }
.evidence-strip button { position: relative; }
.evidence-strip button span { position: absolute; right: .28rem; bottom: .28rem; padding: .18rem .32rem; border-radius: 6px; color: #fff; background: rgba(11,11,13,.75); font-size: .56rem; font-weight: 850; text-transform: uppercase; }
.trade-card > footer { display: flex; flex-wrap: wrap; gap: .42rem; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .42rem; }
.record-actions form { margin: 0; }
.import-panel { margin-top: 1rem; }

.calculator-layout { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 1rem; align-items: start; }
.calculator-results { position: sticky; top: 92px; }
.mode-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .4rem; }
.mode-tabs label input { position: absolute; opacity: 0; pointer-events: none; }
.mode-tabs label span { min-height: 42px; display: grid; place-items: center; padding: .45rem; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); font-size: .72rem; font-weight: 850; text-align: center; cursor: pointer; }
.mode-tabs label.active span { color: var(--chocolate); border-color: var(--gold); background: var(--gold-wash); }
.is-hidden { display: none !important; }
.result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.result-grid > div { padding: .7rem; border-radius: 11px; background: var(--surface-2); }
.result-grid small, .result-grid strong { display: block; }
.result-grid small { color: var(--muted); font-size: .66rem; }
.result-grid strong { margin-top: .25rem; }

.contract-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(290px,.8fr); gap: 1rem; align-items: start; }
.contract-list { display: grid; gap: .8rem; }
.contract-body { min-height: 260px; line-height: 1.65; }
.signature-panel { display: grid; gap: .5rem; }
.signature-panel canvas { width: 100%; height: 180px; touch-action: none; border: 1px dashed color-mix(in srgb,var(--gold),var(--line) 45%); border-radius: 13px; background: #fff; }
.signature-preview { width: 100%; min-height: 80px; padding: .4rem; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.signature-preview img { max-width: 100%; max-height: 100px; object-fit: contain; }
.contract-card { display: grid; gap: .65rem; }
.contract-card > header { display: flex; justify-content: space-between; gap: .7rem; }
.contract-card h3, .contract-card p { margin: 0; }
.contract-card p { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.report-filter { margin-bottom: 1rem; padding: 1rem; }
.report-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); gap: 1rem; margin-top: 1rem; }
.equity-chart { min-height: 260px; display: flex; align-items: stretch; gap: .35rem; padding-top: 1rem; overflow-x: auto; }
.equity-chart > div { min-width: 28px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: .35rem; text-align: center; }
.equity-chart i { width: 100%; min-height: 3px; display: block; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg,var(--gold),var(--chocolate)); }
.equity-chart i.negative-bar { background: linear-gradient(180deg,var(--red),var(--chocolate)); }
.equity-chart small { color: var(--muted); font-size: .58rem; }
.recap-card { border-color: color-mix(in srgb,var(--gold),var(--line) 55%); background: radial-gradient(circle at 100% 0,rgba(212,175,55,.13),transparent 36%),var(--surface); }
.recap-card p { color: var(--muted); line-height: 1.7; }
.best-worst-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
.best-worst-grid > div { padding: .75rem; border-radius: 12px; background: var(--surface-2); }

.symbols-layout { display: grid; grid-template-columns: minmax(260px,.65fr) minmax(0,1.35fr); gap: 1rem; align-items: start; }
.group-list, .group-members { display: grid; gap: .55rem; }
.group-list > details { display: grid; gap: .55rem; padding: .65rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.group-list > details > summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .55rem; cursor: pointer; list-style: none; }
.group-list > details > summary::-webkit-details-marker { display: none; }
.group-list > details > summary div { min-width: 0; display: grid; }
.group-list > details > summary small { color: var(--muted); font-size: .65rem; }
.group-list > details > summary i::after { content: "⌄"; color: var(--gold-deep); }
.group-members { padding: .6rem 0; }
.group-members > span { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 9px; background: var(--surface); font-size: .74rem; font-weight: 800; }
.group-members form, .group-members button { margin: 0; }
.group-members button { width: 25px; height: 25px; border: 0; color: var(--red); background: transparent; }
.instrument-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; }
.instrument-card { display: grid; gap: .45rem; padding: .8rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.instrument-card header { display: flex; justify-content: space-between; gap: .5rem; }
.instrument-card small { color: var(--muted); }
.instrument-card h3, .instrument-card p { margin: 0; }
.instrument-card p { min-height: 2.4em; color: var(--muted); font-size: .7rem; }
.favorite-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--gold-deep); background: var(--gold-wash); }
.add-group { display: flex; gap: .45rem; }

.chat-composer { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: end; gap: .6rem; margin-bottom: 1rem; }
.chat-composer > img { width: 46px; height: 46px; object-fit: cover; border: 2px solid var(--gold); border-radius: 50%; }
.chat-upload { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.chat-upload input, .reply-form input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chat-feed { display: grid; gap: .8rem; }
.chat-message { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .7rem; }
.chat-message { grid-template-columns: 1fr; }
.chat-message header { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .6rem; }
.chat-message header img, .reply-list img { width: 42px; height: 42px; object-fit: cover; border: 2px solid var(--gold); border-radius: 50%; }
.chat-message header > div { min-width: 0; display: grid; }
.chat-message header small { color: var(--muted); }
.chat-message p { white-space: pre-wrap; line-height: 1.55; }
.chat-message > footer { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .55rem; }
.chat-message > footer form { margin: 0; }
.message-editor > summary { cursor: pointer; list-style: none; }
.message-editor > summary::-webkit-details-marker { display: none; }
.message-editor form { min-width: min(520px,calc(100vw - 3rem)); display: grid; gap: .45rem; margin-top: .45rem !important; padding: .6rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.chat-image { max-width: 520px; padding: 0; border: 1px solid var(--line); border-radius: 13px; background: #0b0b0d; overflow: hidden; }
.chat-image img { width: 100%; max-height: 380px; display: block; object-fit: contain; }
.reply-list { display: grid; gap: .5rem; margin: .6rem 0; }
.reply-list > div { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .55rem; padding: .55rem; border-radius: 10px; background: var(--surface-2); }
.reply-list img { width: 30px; height: 30px; }
.reply-list p { display: grid; margin: .2rem 0 0; font-size: .78rem; }
.reply-form { margin-top: .6rem; }
.restricted-state, .read-only-notice { padding: 1rem; border-left: 4px solid var(--gold); border-radius: 12px; background: var(--gold-wash); }
.report-message { margin-top: .5rem; }

.calendar-list { display: grid; gap: 1rem; }
.calendar-day { position: sticky; top: 78px; z-index: 3; margin: 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter: blur(12px); }
.news-event { display: grid; grid-template-columns: 100px 7px minmax(0,1fr) auto; gap: .7rem; align-items: center; padding: .85rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.impact-bar { align-self: stretch; border-radius: 99px; background: var(--gold); }
.impact-bar.high { background: var(--red); }
.impact-bar.low { background: var(--muted); }
.news-main h3, .news-main h4 { margin: .35rem 0 0; font-size: .92rem; }
.news-main p { margin: .28rem 0 0; color: var(--muted); font-size: .76rem; }
.news-event time { display: grid; text-align: center; }
.news-event time small { color: var(--muted); font-size: .62rem; }
.news-event dl { display: grid; grid-template-columns: repeat(3,auto); gap: .5rem; margin: 0; }
.news-event dl div { min-width: 54px; padding: .42rem; border-radius: 9px; background: var(--surface-2); }
.news-event dt { color: var(--muted); font-size: .58rem; }
.news-event dd { margin: .16rem 0 0; font-size: .7rem; font-weight: 850; }
.risk-note { padding: .7rem; border: 1px solid color-mix(in srgb,var(--gold),var(--line) 60%); border-radius: 11px; background: var(--gold-wash); color: var(--chocolate); font-size: .76rem; }

.toggle-list { display: grid; gap: .6rem; }
.toggle-list label { display: flex; align-items: center; gap: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: 11px; }
.toggle-list input { width: 20px; min-height: 20px; }
.secret-once { padding: 1rem; border: 1px solid var(--gold); border-radius: 13px; background: var(--gold-wash); }
.secret-once code { display: block; margin-top: .5rem; overflow-wrap: anywhere; }
.owner-nav { position: sticky; top: 77px; z-index: 10; display: flex; gap: .4rem; margin: -1rem 0 1rem; padding: .65rem 0; overflow-x: auto; background: color-mix(in srgb,var(--cream) 88%,transparent); backdrop-filter: blur(13px); }
.owner-nav a { flex: 0 0 auto; padding: .48rem .65rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: .72rem; font-weight: 800; }
.owner-section { scroll-margin-top: 145px; margin-bottom: 1rem; }
.owner-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.owner-news-tools { display: flex; align-items: end; justify-content: space-between; gap: .8rem; margin: .8rem 0 1rem; }
.owner-news-tools .filter-grid { flex: 1 1 620px; grid-template-columns: repeat(3,minmax(130px,1fr)); padding: 0; }
.owner-news-tools > form:last-child { flex: 0 0 auto; }
.mini-search { width: min(270px,100%); display: flex; align-items: center; gap: .45rem; padding-left: .55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.mini-search input { min-height: 34px; border: 0; box-shadow: none; }
.moderation-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.code-area { min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.row-action { display: flex; flex-wrap: wrap; gap: .35rem; }
.responsive-table { overflow-x: auto; }
.responsive-table td small { display: block; color: var(--muted); }
.news-admin-row { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.news-admin-row > summary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .65rem; cursor: pointer; list-style: none; }
.news-admin-row > summary::-webkit-details-marker { display: none; }
.news-admin-row > summary span:nth-child(2) { min-width: 0; display: grid; }
.news-admin-row > summary small { color: var(--muted); }
.news-admin-row > form { margin-top: .8rem; padding: .8rem; border-radius: 12px; background: var(--surface-2); }
.news-admin-row > .record-actions { margin-top: .6rem; }

.sr-only { width: 1px; height: 1px; position: absolute; margin: -1px; padding: 0; clip: rect(0,0,0,0); border: 0; overflow: hidden; }
.image-modal-backdrop { padding: .65rem; }
.image-modal { width: min(1100px,100%); max-height: calc(100vh - 1.3rem); position: relative; display: grid; place-items: center; padding: 3rem .75rem .75rem; border-radius: 18px; background: #0b0b0d; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.image-modal-close { position: absolute; top: .65rem; right: .65rem; color: #fff; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.image-modal img { max-width: 100%; max-height: calc(100vh - 5.5rem); object-fit: contain; border-radius: 10px; }
.empty-state { max-width: none; margin: .8rem 0; padding: 1rem; }
.empty-state p { color: var(--muted); }

@media (max-width: 1180px) {
    .filter-grid { grid-template-columns: repeat(3,minmax(120px,1fr)); }
    .instrument-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .trade-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .menu-button, .sidebar-close { display: inline-grid; }
    .app-shell { display: block; }
    .sidebar {
        width: min(320px,88vw);
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        transition: transform .28s ease;
    }
    .app-shell.is-mobile-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; display: block; border: 0; background: rgba(11,11,13,.62); backdrop-filter: blur(3px); }
    .plan-layout, .journal-layout, .calculator-layout, .contract-layout, .report-grid, .symbols-layout { grid-template-columns: 1fr; }
    .trade-form-panel, .calculator-results { position: static; max-height: none; }
    .dashboard-hero { grid-template-columns: 1fr; }
    .discipline-orbit { display: none; }
    .owner-grid { grid-template-columns: 1fr; }
    .owner-news-tools { align-items: stretch; flex-direction: column; }
    .owner-news-tools .filter-grid { flex-basis: auto; grid-template-columns: 1fr; }
    .owner-news-tools > form:last-child .button { width: 100%; }
    .news-event { grid-template-columns: 72px 6px minmax(0,1fr); }
    .news-event dl { grid-column: 3; }
}

@media (max-width: 700px) {
    .topbar { padding-inline: .75rem; }
    .profile-chip > span:last-child { display: none; }
    .profile-chip { padding-right: .28rem; }
    .content-grid, .reflection-grid, .best-worst-grid, .moderation-grid { grid-template-columns: 1fr; }
    .filter-grid, .instrument-grid, .upload-grid { grid-template-columns: 1fr; }
    .mode-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .news-event { grid-template-columns: 70px 6px minmax(0,1fr); }
    .news-event > :last-child { grid-column: 3; }
    .chat-composer { grid-template-columns: auto minmax(0,1fr) auto; }
    .chat-composer > .button { grid-column: 2 / -1; }
    .responsive-table table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table thead { display: none; }
    .responsive-table tr { margin-bottom: .7rem; padding: .65rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
    .responsive-table td { display: grid; grid-template-columns: minmax(90px,.42fr) minmax(0,.58fr); gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); text-align: right; }
    .responsive-table td:last-child { border-bottom: 0; }
    .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .66rem; font-weight: 800; text-align: left; text-transform: uppercase; }
}

@media (max-width: 480px) {
    .page { padding: .72rem; }
    .topbar-start .eyebrow { display: none; }
    .currency-chip { display: none; }
    .dashboard-hero { min-height: 220px; padding: 1.2rem; border-radius: 20px; }
    .hero-actions .button, .form-actions .button { flex: 1 1 135px; }
    .metric-grid { grid-template-columns: 1fr; }
    .compact-facts, .result-grid { grid-template-columns: 1fr; }
    .chat-message { grid-template-columns: 34px minmax(0,1fr); }
    .chat-message > img { width: 34px; height: 34px; }
    .news-event { grid-template-columns: 58px 5px minmax(0,1fr); padding: .65rem; }
    .calendar-day { top: 68px; }
}
