.site-flashes { width: min(1180px, calc(100% - 32px)); margin: 16px auto 0; }
.site-flashes .notice { margin: 0; border: 1px solid; border-radius: 12px; padding: 13px 15px; font-weight: 750; }
.nav-username { align-self: center; padding: 9px 10px; color: var(--ink); font-size: .78rem; font-weight: 850; white-space: nowrap; }
.nav-logout { margin: 0; display: flex; }
.nav-logout input { display: none; }
.nav-logout button { min-height: 36px; border: 1px solid rgba(255,98,109,.32); border-radius: 9px; padding: 0 11px; color: #ffadb3; background: rgba(255,98,109,.08); font: inherit; font-size: .76rem; font-weight: 850; cursor: pointer; }
.nav-logout button:hover { background: rgba(255,98,109,.15); }

.account-shell { width: min(1040px, calc(100% - 32px)); min-height: calc(100vh - 150px); margin: 54px auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 24px; align-items: start; }
.account-card, .account-aside, .watchlist-add, .watchlist-table-card, .watchlist-alert-log { border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #0d1928, #09131f); box-shadow: var(--shadow); }
.account-card { padding: clamp(24px, 5vw, 46px); }
.account-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.055em; line-height: 1; }
.account-heading > p:last-child { margin: 15px 0 0; color: var(--muted); line-height: 1.6; }
.account-form { margin-top: 28px; display: grid; gap: 17px; }
.account-form label { display: grid; gap: 8px; }
.account-form label > span { font-size: .84rem; font-weight: 850; }
.account-form label > span small { color: var(--muted); font-weight: 650; }
.account-form label > small { color: var(--muted); line-height: 1.4; }
.account-form input { width: 100%; }
.account-primary { min-height: 49px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #226de9, #378dff); font-weight: 900; cursor: pointer; }
.account-primary:hover { background: linear-gradient(135deg, #307cf4, #4a98ff); }
.account-switch { margin: 22px 0 0; color: var(--muted); }
.account-switch a { color: #85b2fa; font-weight: 850; }
.account-message { margin-top: 20px; border: 1px solid; border-radius: 12px; padding: 13px 15px; line-height: 1.5; }
.account-message ul { margin: 8px 0 0; padding-left: 20px; }
.account-message-error { color: #ffadb3; border-color: rgba(255,98,109,.3); background: rgba(255,98,109,.08); }
.account-aside { padding: 30px; }
.account-aside h2 { margin-bottom: 14px; font-size: 1.7rem; }
.account-aside p, .account-aside li { color: var(--muted); line-height: 1.6; }
.account-aside ul { margin: 22px 0 0; padding-left: 20px; }

.watchlist-shell { width: min(1220px, calc(100% - 32px)); margin: 48px auto 72px; }
.watchlist-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.watchlist-heading h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4.8rem); letter-spacing: -.065em; line-height: .95; }
.watchlist-heading div > p:last-child { max-width: 720px; color: var(--muted); line-height: 1.6; }
.watchlist-count { flex: 0 0 auto; border-radius: 999px; padding: 9px 14px; color: #65deb0; background: rgba(41,211,145,.09); }
.watchlist-alert-log { margin-bottom: 18px; padding: 20px 22px; }
.watchlist-alert-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.watchlist-alert-heading h2 { margin: 1px 0 0; }
.watchlist-alert-heading > span { color: var(--muted); font-size: .78rem; }
.watchlist-alert-controls { display: grid; justify-items: end; gap: 7px; text-align: right; }
.watchlist-alert-controls > span, .watchlist-alert-controls > small { color: var(--muted); font-size: .78rem; }
.watchlist-alert-controls button { min-height: 40px; border: 1px solid rgba(72,143,255,.42); border-radius: 10px; padding: 0 13px; color: #c7dcff; background: rgba(47,125,255,.12); font: inherit; font-size: .78rem; font-weight: 850; cursor: pointer; }
.watchlist-alert-controls button[data-enabled="true"] { color: #84e8bf; border-color: rgba(41,211,145,.36); background: rgba(41,211,145,.1); }
.watchlist-alert-controls button:disabled { opacity: .58; cursor: not-allowed; }
.watchlist-alert-items { margin-top: 15px; display: grid; gap: 9px; }
.watchlist-alert-card { border: 1px solid rgba(255,184,72,.28); border-radius: 12px; padding: 13px 15px; display: grid; gap: 5px; color: #ffd58e; background: rgba(255,165,35,.08); }
.watchlist-alert-card.buy { border-color: rgba(255,89,104,.38); color: #ffb6bd; background: rgba(255,72,88,.1); }
.watchlist-alert-card span, .watchlist-alert-empty { color: var(--muted); font-size: .82rem; }
.watchlist-alert-empty { margin: 0; }
.watchlist-add { position: relative; padding: 22px; display: grid; grid-template-columns: minmax(220px, .6fr) minmax(300px, 1fr); gap: 22px; align-items: end; }
.watchlist-add h2 { margin: 0 0 5px; }
.watchlist-add p { margin: 0; color: var(--muted); }
.watchlist-search-wrap { position: relative; display: grid; gap: 7px; }
.watchlist-search-results { position: absolute; z-index: 12; top: 76px; left: 0; right: 0; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #0b1725; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.watchlist-search-result { width: 100%; border: 0; border-bottom: 1px solid #1c2b40; padding: 12px 14px; display: flex; justify-content: space-between; gap: 14px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.watchlist-search-result:hover { background: #102036; }
.watchlist-search-result span, .watchlist-search-result small { display: block; }
.watchlist-search-result small { color: var(--muted); }
.watchlist-search-result > small { flex: 0 0 auto; align-self: center; color: #84b4ff; font-weight: 850; }
.watchlist-status { grid-column: 1 / -1; min-height: 20px; }
.watchlist-status.success { color: #72e1b7; }
.watchlist-status.error { color: #ffadb3; }
.watchlist-toolbar { margin: 18px 0; display: grid; grid-template-columns: 1fr 240px auto; gap: 12px; align-items: end; }
.watchlist-toolbar label { display: grid; gap: 7px; }
.watchlist-toolbar button { min-height: 48px; border: 0; border-radius: 11px; padding: 0 22px; color: #fff; background: #216ce8; font-weight: 850; cursor: pointer; }
.watchlist-filterbar { margin: -4px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.watchlist-filterbar button { min-height: 36px; border: 1px solid #2a3b52; border-radius: 999px; padding: 0 12px; color: var(--muted); background: rgba(16,29,45,.8); font: inherit; font-size: .74rem; font-weight: 850; cursor: pointer; }
.watchlist-filterbar button.is-active { color: #dceaff; border-color: #347fe9; background: rgba(47,125,255,.18); }
.watchlist-filterbar label { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.watchlist-filterbar input { width: 94px; min-height: 36px; padding: 6px 9px; }
.watchlist-table-card { overflow: hidden; }
.watchlist-table-wrap { overflow-x: auto; }
.watchlist-table { width: 100%; border-collapse: collapse; min-width: 1900px; }
.watchlist-table th, .watchlist-table td { padding: 15px 14px; border-bottom: 1px solid #1d2d42; text-align: left; vertical-align: middle; }
.watchlist-table tbody tr:last-child td { border-bottom: 0; }
.watchlist-table td > small, .watchlist-table td strong + small { display: block; margin-top: 4px; color: var(--muted); }
.watchlist-positive { color: var(--success); }
.watchlist-negative { color: var(--danger); }
.watchlist-rvat { font-size: 1.05rem; font-weight: 950; letter-spacing: -.02em; }
.watchlist-rvat.is-high { color: #6af0b9; text-shadow: 0 0 20px rgba(54,231,162,.2); }
.watchlist-rvat small { display: block; margin-top: 4px; color: var(--muted); font-size: .66rem; font-weight: 750; white-space: nowrap; }
.watchlist-status-cell { min-width: 290px; }
.watchlist-signal { display: inline-flex; width: max-content; border-radius: 999px; padding: 6px 9px; color: #aab9ca; background: rgba(150,170,195,.1); font-size: .72rem; font-weight: 900; white-space: nowrap; }
.watchlist-signal-entry_ready { color: #ffd58e; background: rgba(255,165,35,.12); }
.watchlist-signal-buy_triggered { color: #ffb2ba; background: rgba(255,72,88,.14); }
.watchlist-signal-near_previous_high { color: #b6d4ff; background: rgba(72,143,255,.12); }
.watchlist-signal-watching { color: #82dfbd; background: rgba(41,211,145,.09); }
.watchlist-signal-not_qualified { color: #98a8b9; }
.watchlist-signal-not_gap_up, .watchlist-signal-no_alert, .watchlist-signal-paused { color: #98a8b9; }
.watchlist-signal-rvat_weak { color: #ffc875; background: rgba(255,165,35,.11); }
.watchlist-signal-gap_up { color: #91baff; background: rgba(72,143,255,.11); }
.watchlist-condition-progress { margin-top: 9px; display: grid; gap: 4px; }
.watchlist-condition-progress span { display: flex; gap: 5px; align-items: baseline; color: var(--muted); font-size: .68rem; white-space: nowrap; }
.watchlist-condition-progress b { width: 12px; }
.watchlist-condition-progress em { margin-left: auto; color: inherit; font-style: normal; font-weight: 850; }
.watchlist-condition-progress .is-met { color: #73dfb7; }
.watchlist-condition-progress .is-unmet { color: #b2becc; }
.watchlist-freshness { display: block; margin-top: 9px !important; font-weight: 850; }
.watchlist-freshness-live { color: #67deb0 !important; }
.watchlist-freshness-delayed { color: #ffc875 !important; }
.watchlist-freshness-no_recent_data { color: #ff9da6 !important; }
.watchlist-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.watchlist-actions a, .watchlist-actions button { border: 1px solid #2a3b52; border-radius: 8px; padding: 7px 9px; color: #a9c9ff; background: #101d2d; text-decoration: none; font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
.watchlist-actions button { color: #a9c9ff; }
.watchlist-actions .watchlist-add-alert { color: #76e3b9; border-color: rgba(41,211,145,.38); background: rgba(41,211,145,.1); }
.watchlist-actions [data-remove-watchlist], .watchlist-actions [data-alert-delete] { color: #ffadb3; border-color: rgba(255,98,109,.28); }
.watchlist-empty { padding: 42px !important; color: var(--muted); text-align: center !important; }
.watchlist-inline-button { width: fit-content; min-height: 38px; margin-top: 10px; border: 1px solid rgba(72,143,255,.38); border-radius: 9px; padding: 0 12px; color: #a9c9ff; background: rgba(47,125,255,.08); font-weight: 850; cursor: pointer; }
.watchlist-inline-button.in-watchlist { color: #72e1b7; border-color: rgba(41,211,145,.3); background: rgba(41,211,145,.08); }
.watchlist-auth-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(2,8,18,.78); backdrop-filter: blur(7px); }
.watchlist-auth-card { width: min(440px, 100%); border: 1px solid var(--line); border-radius: 18px; padding: 26px; background: #0b1725; box-shadow: 0 26px 80px rgba(0,0,0,.5); }
.watchlist-auth-card h2 { margin-bottom: 10px; }
.watchlist-auth-card p { color: var(--muted); line-height: 1.55; }
.watchlist-auth-actions { display: flex; gap: 10px; margin-top: 20px; }
.watchlist-auth-actions a, .watchlist-auth-actions button { flex: 1; min-height: 44px; border: 1px solid #2f7dff; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #216ce8; text-decoration: none; font-weight: 850; cursor: pointer; }
.watchlist-auth-actions button { color: var(--muted); border-color: var(--line); background: transparent; }
.alert-settings-dialog { width: min(720px, calc(100% - 28px)); max-height: calc(100vh - 40px); border: 1px solid var(--line); border-radius: 20px; padding: 0; color: var(--ink); background: #0b1725; box-shadow: 0 30px 90px rgba(0,0,0,.65); }
.alert-settings-dialog::backdrop { background: rgba(2,8,18,.78); backdrop-filter: blur(7px); }
.alert-settings-form { padding: 26px; }
.alert-settings-heading { display: flex; justify-content: space-between; gap: 20px; }
.alert-settings-heading h2 { margin: 0; font-size: 2rem; }
.alert-settings-heading p:last-child { margin: 7px 0 0; color: var(--muted); }
.alert-settings-heading > button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 1.5rem; cursor: pointer; }
.alert-settings-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.alert-settings-grid > label { display: grid; gap: 7px; color: var(--ink); font-size: .82rem; font-weight: 850; }
.alert-settings-grid label > span { display: flex; align-items: center; gap: 8px; }
.alert-settings-grid label > span input { flex: 1; }
.alert-active-field { grid-column: 1 / -1; display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.alert-active-field input { width: 18px; height: 18px; }
.alert-settings-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
.alert-settings-actions button { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 17px; color: var(--muted); background: transparent; font: inherit; font-weight: 850; cursor: pointer; }
.alert-settings-actions .account-primary { color: #fff; border-color: transparent; }

[data-theme="light"] .account-card, [data-theme="light"] .account-aside, [data-theme="light"] .watchlist-add, [data-theme="light"] .watchlist-table-card, [data-theme="light"] .watchlist-alert-log { background: #fff; }
[data-theme="light"] .watchlist-search-results, [data-theme="light"] .watchlist-auth-card, [data-theme="light"] .alert-settings-dialog { background: #fff; }
[data-theme="light"] .watchlist-search-result { border-color: #e3e9f0; }
[data-theme="light"] .watchlist-search-result:hover { background: #f3f7fc; }
[data-theme="light"] .nav-username { color: #31506e; }
[data-theme="light"] .watchlist-actions a, [data-theme="light"] .watchlist-actions button { background: #f3f7fc; }

@media (max-width: 900px) {
    .account-shell { grid-template-columns: 1fr; }
    .account-aside { order: -1; }
    .watchlist-add { grid-template-columns: 1fr; }
    .watchlist-status { grid-column: auto; }
}
@media (max-width: 760px) {
    .nav-username { padding: 12px; }
    .nav-logout button { width: 100%; min-height: 44px; }
    .watchlist-heading { align-items: flex-start; flex-direction: column; }
    .watchlist-alert-heading { align-items: flex-start; flex-direction: column; }
    .watchlist-alert-controls { width: 100%; justify-items: start; text-align: left; }
    .watchlist-toolbar { grid-template-columns: 1fr; }
    .watchlist-toolbar button { width: 100%; }
    .watchlist-filterbar label { width: 100%; margin-left: 0; }
    .alert-settings-grid { grid-template-columns: 1fr; }
    .account-shell, .watchlist-shell { margin-top: 28px; }
}
