/* Unified theme tokens: the light palette remains default; dark mode remaps shared surfaces. */
:root{color-scheme:light;--theme-motion:background-color .2s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease}
html[data-theme="dark"]{color-scheme:dark;--ink:#e8eef7;--navy:#0a1423;--blue:#80b1ff;--muted:#aab8cb;--line:#2a3d56;--surface:#132238;--soft:#0c1727;--ot-red-soft:#321924;--app-bg:#0c1625;--app-surface:#132238;--app-ink:#eaf0f8;--app-muted:#a7b4c8;--app-line:#2a3d56;--app-navy:#0a1423;--app-blue:#80b1ff;--app-ruby-soft:#321924;--auth-soft:#0c1727;--auth-ink:#e8eef7}
html{scroll-behavior:smooth}body,.app-topbar,.app-card,.app-content .app-card,.app-sidebar,.mobile-bottom-nav,.ot-nav,.ot-public main,.ot-footer,.flow-card,.belief-card,.testimonial-mini,.widget-card,.investment-plan,.investment-terms>div,.accordion-item,.accordion-button,.accordion-body,.form-control,.form-select,.input-group-text,.modal-content,.modal-header,.modal-footer,.list-group-item,.settings-panel,.transactions-panel,.profile-panel,.dashboard-panel{transition:var(--theme-motion)}
html.theme-changing{scroll-behavior:auto}html.theme-changing body,html.theme-changing main{transition:var(--theme-motion)}

/* Public pages */
html[data-theme="dark"] body.ot-public{background:#0c1727;color:var(--ink)}
html[data-theme="dark"] .ot-nav{background:rgba(17,31,49,.96)!important;border-color:var(--line);box-shadow:0 6px 24px rgba(0,0,0,.2)}
html[data-theme="dark"] .ot-nav .navbar-brand,html[data-theme="dark"] .ot-nav .nav-link{color:var(--ink)!important}
html[data-theme="dark"] .ot-nav .nav-link:hover{color:var(--blue)!important;background:rgba(128,177,255,.08)}
html[data-theme="dark"] .ot-hero{background:radial-gradient(circle at 82% 12%,rgba(75,120,185,.2),transparent 29%),linear-gradient(180deg,#101e31,#0c1727)!important;color:var(--ink)}
html[data-theme="dark"] .ot-section,html[data-theme="dark"] .ot-section.muted{background:#0c1727;color:var(--ink)}
html[data-theme="dark"] .ot-section.muted{background:#101d30;color:var(--ink)}
html[data-theme="dark"] .hero-copy,html[data-theme="dark"] .ot-section p,html[data-theme="dark"] .section-heading p,html[data-theme="dark"] .about-copy p{color:#b4c1d2}
html[data-theme="dark"] .ticker-wrap{border-color:var(--line);background:#101d30}
html[data-theme="dark"] .ot-public .widget-card,html[data-theme="dark"] .ot-public .flow-card,html[data-theme="dark"] .ot-public .belief-card,html[data-theme="dark"] .testimonial-mini,html[data-theme="dark"] .investment-plan,html[data-theme="dark"] .ecosystem-flow span{border-color:var(--line);background:#14243a;color:var(--ink)}
html[data-theme="dark"] .investment-plan h3,html[data-theme="dark"] .testimonial-mini strong,html[data-theme="dark"] .flow-card h3,html[data-theme="dark"] .belief-card h3{color:var(--ink)}
html[data-theme="dark"] .investment-terms>div{border-color:var(--line);background:#0e1b2e;color:var(--ink)}
html[data-theme="dark"] .investment-terms small,html[data-theme="dark"] .investment-plan p,html[data-theme="dark"] .testimonial-mini small,html[data-theme="dark"] .belief-card p{color:var(--muted)}
html[data-theme="dark"] .investment-disclaimer,html[data-theme="dark"] .final-cta{border-color:#49313a;background:#211b29;color:#e8dfe4}
html[data-theme="dark"] .investment-disclaimer{color:#c6b9c0}
html[data-theme="dark"] .ot-accordion .accordion-item{border-color:var(--line);background:#14243a}
html[data-theme="dark"] .ot-accordion .accordion-button,html[data-theme="dark"] .ot-accordion .accordion-body{background:#14243a;color:var(--ink)}
html[data-theme="dark"] .ot-accordion .accordion-button:not(.collapsed){background:#192c45;color:#fff}
html[data-theme="dark"] .ot-accordion .accordion-button:after{filter:invert(1) grayscale(1)}
html[data-theme="dark"] .widget-placeholder{background:linear-gradient(110deg,rgba(20,36,58,.9) 8%,rgba(31,50,76,.96) 18%,rgba(20,36,58,.9) 33%);color:#b7c6d8}
html[data-theme="dark"] .hero-panel .widget-placeholder{background:linear-gradient(110deg,rgba(18,33,52,.95) 8%,rgba(31,51,75,.98) 18%,rgba(18,33,52,.95) 33%);color:#c9d7e8}
html[data-theme="dark"] .ot-footer{background:#07111f;color:#d4deea}
html[data-theme="dark"] .ot-footer p,html[data-theme="dark"] .footer-links a{color:#b5c3d4}
html[data-theme="dark"] .about-page .about-hero{background:radial-gradient(circle at 87% 13%,rgba(75,120,185,.18),transparent 29%),linear-gradient(180deg,#101e31,#0c1727)!important}
html[data-theme="dark"] .about-page .about-hero .ot-image-frame{border-color:#1e3047;background:#14243a}
html[data-theme="dark"] .about-page .about-editorial .ot-image-frame{background:#14243a}
html[data-theme="dark"] .about-page .final-cta p{color:#c2cedd}
html[data-theme="dark"] .about-page .ecosystem-flow span{background:#14243a}

/* Authenticated workspace and forms */
html[data-theme="dark"] body.app-body{background:#0c1625;color:var(--app-ink)}
html[data-theme="dark"] .app-topbar{background:rgba(16,30,48,.94);border-color:var(--app-line);backdrop-filter:blur(16px)}
html[data-theme="dark"] .app-topbar h1,html[data-theme="dark"] .app-section-title,html[data-theme="dark"] .app-welcome h2{color:var(--app-ink)}
html[data-theme="dark"] .app-topbar p,html[data-theme="dark"] .app-welcome p,html[data-theme="dark"] .app-section-note{color:var(--app-muted)}
html[data-theme="dark"] .app-card,html[data-theme="dark"] .dashboard-panel,html[data-theme="dark"] .settings-panel,html[data-theme="dark"] .transactions-panel,html[data-theme="dark"] .profile-panel,html[data-theme="dark"] .withdrawal-guidance,html[data-theme="dark"] .wallet-activity-panel{border-color:var(--app-line);background:var(--app-surface);box-shadow:0 10px 28px rgba(0,0,0,.18)}
html[data-theme="dark"] .app-content .app-card{background:var(--app-surface);color:var(--app-ink)}
html[data-theme="dark"] .app-body .form-control,html[data-theme="dark"] .app-body .form-select,html[data-theme="dark"] .app-body textarea,html[data-theme="dark"] .app-body .input-group-text{border-color:#344963;background-color:#0e1b2d;color:var(--app-ink)}
html[data-theme="dark"] .app-body .form-control::placeholder,html[data-theme="dark"] .app-body textarea::placeholder{color:#8292a8}
html[data-theme="dark"] .app-body .form-control:disabled{background-color:#17283e;color:#9aabc0}
html[data-theme="dark"] .app-body .form-select option{background:#132238;color:var(--app-ink)}
html[data-theme="dark"] .app-body .form-label{color:#d7e1ec}
html[data-theme="dark"] .app-body .text-muted,html[data-theme="dark"] .app-body .text-secondary{color:var(--app-muted)!important}
html[data-theme="dark"] .app-body .text-dark{color:var(--app-ink)!important}
html[data-theme="dark"] .app-body .bg-white{background-color:var(--app-surface)!important}
html[data-theme="dark"] .app-body .list-group-item{border-color:var(--app-line);background:transparent;color:var(--app-ink)}
html[data-theme="dark"] .app-body .table{--bs-table-color:var(--app-ink);--bs-table-bg:transparent;--bs-table-border-color:var(--app-line);--bs-table-striped-color:var(--app-ink);--bs-table-hover-color:var(--app-ink)}
html[data-theme="dark"] .app-body .table thead th{background:#17283d;color:#b7c5d6}
html[data-theme="dark"] .app-body .table-hover tbody tr:hover>*{--bs-table-bg-state:rgba(128,177,255,.07)}
html[data-theme="dark"] .app-body .modal-content{border-color:var(--app-line);background:var(--app-surface);color:var(--app-ink)}
html[data-theme="dark"] .app-body .btn-close{filter:invert(1) grayscale(1)}
html[data-theme="dark"] .app-body .btn-outline-secondary{border-color:#50627a;color:#d4dfeb}
html[data-theme="dark"] .app-body .btn-outline-secondary:hover{border-color:#8093aa;background:#23354b;color:#fff}
html[data-theme="dark"] .app-body .quick-action{background:#17283e;color:var(--app-ink)}
html[data-theme="dark"] .app-body .review-caution{border:1px solid #5a482a;background:#30291d;color:#f0d9a8}
html[data-theme="dark"] .app-body .theme-toggle{border-color:var(--app-line);background:#17283e;color:var(--app-ink)}
html[data-theme="dark"] .app-body .dashboard-safety-note,html[data-theme="dark"] .app-body .safebox-reminder,html[data-theme="dark"] .app-body .profile-security-card,html[data-theme="dark"] .app-body .settings-side-note,html[data-theme="dark"] .app-body .withdrawal-guidance-foot,html[data-theme="dark"] .app-body .withdrawal-guidance{border-color:var(--app-line);background:#17283e;color:var(--app-ink)}
html[data-theme="dark"] .app-body .dashboard-safety-note p,html[data-theme="dark"] .app-body .safebox-reminder p,html[data-theme="dark"] .app-body .profile-security-card p,html[data-theme="dark"] .app-body .settings-side-note p{color:var(--app-muted)}
html[data-theme="dark"] .app-body .transactions-mobile-list .card{border-color:var(--app-line);background:#17283e;color:var(--app-ink)}
html[data-theme="dark"] .app-body .theme-preview-light{border-color:#52637a}
html[data-theme="dark"] .app-body .theme-preview-light .theme-preview-main i,html[data-theme="dark"] .app-body .theme-preview-light .theme-preview-main b{border-color:#dce3ec;background:#fff}

/* Sign-in surfaces use the same saved preference. */
html[data-theme="dark"] body.auth-page{background:#0c1727;color:#e8eef7}
html[data-theme="dark"] .auth-form-area{background:#111f32;color:#e8eef7}
html[data-theme="dark"] .auth-form h2,html[data-theme="dark"] .auth-label{color:#e8eef7}
html[data-theme="dark"] .auth-form .intro,html[data-theme="dark"] .auth-footnote{color:#aab8cb}
html[data-theme="dark"] .auth-field .form-control{border-color:#344963;background:#0c1727;color:#e8eef7}
html[data-theme="dark"] .auth-field .form-control::placeholder{color:#8191a7}
html[data-theme="dark"] .auth-field i{color:#9aabc0}

@media(prefers-reduced-motion:reduce){body,.app-topbar,.app-card,.app-sidebar,.ot-nav,.form-control,.form-select{transition:none!important}html{scroll-behavior:auto}}
