:root {
  --bg: #07100e;
  --panel: #0d1815;
  --panel-2: #111f1b;
  --line: #20342d;
  --text: #ecf4f0;
  --muted: #8fa69c;
  --green: #47e6a1;
  --green-dark: #123d2e;
  --amber: #f6b84a;
  --blue: #65a5ff;
  --red: #ff6b75;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 45% -20%, #14372c 0, var(--bg) 42%); color: var(--text); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -.045em; }
h2 { font-size: 1.12rem; margin-bottom: 0; }
h3 { font-size: .95rem; }

.eyebrow { margin: 0 0 6px; color: var(--green); font-size: .66rem; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); }
.tiny { font-size: .74rem; }
.brand-mark { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--green), #b9ffdf); color: #062017; font-weight: 900; letter-spacing: -.06em; box-shadow: 0 12px 40px rgba(71, 230, 161, .2); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: .8rem; }

.auth-page { display: grid; place-items: center; padding: 32px 18px; }
.auth-card { width: min(430px, 100%); background: rgba(13, 24, 21, .94); border: 1px solid var(--line); padding: 38px; border-radius: 28px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 18px 0 14px; font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: .96; }
.auth-card form { display: grid; gap: 16px; margin-top: 24px; }
.auth-links { margin: 18px 0 8px; text-align: center; }
.auth-card label, .admin-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--line); color: var(--text); background: #08120f; border-radius: 12px; padding: 12px 13px; outline: none; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(71, 230, 161, .08); }
textarea { resize: none; min-height: 70px; }
.button { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-weight: 800; cursor: pointer; color: var(--text); background: var(--panel-2); }
.button.primary { color: #061b13; background: var(--green); border-color: var(--green); }
.button.secondary { background: var(--green-dark); color: var(--green); }
.button.ghost { background: transparent; }
.button.full { width: 100%; padding: 13px; }
.error-box, .success-box { border-radius: 12px; padding: 12px; font-size: .83rem; }
.error-box { color: #ffd5d8; background: rgba(255, 107, 117, .12); border: 1px solid rgba(255, 107, 117, .28); }
.success-box { color: #caffE6; background: rgba(71, 230, 161, .1); border: 1px solid rgba(71, 230, 161, .3); }
.checks { margin: 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; color: var(--muted); font-size: .78rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.status-dot.ok { background: var(--green); }.status-dot.bad { background: var(--red); }

.topbar { height: 68px; position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 0 22px; background: rgba(7, 16, 14, .88); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong, .brand small { display: block; }.brand small { color: var(--muted); font-size: .55rem; letter-spacing: .16em; margin-top: 2px; }
.top-status { color: var(--muted); font-size: .75rem; display: flex; align-items: center; gap: 8px; }
.top-center { display: grid; justify-items: center; gap: 5px; }
.market-links { display: flex; align-items: center; gap: 12px; font-size: .62rem; }
.market-links a { color: #b9cbc3; }
.market-links a:hover { color: var(--green); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(71, 230, 161, .1); }
.user-menu { justify-self: end; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .75rem; }
.text-button { border: 0; color: var(--green); background: none; padding: 0; cursor: pointer; }

.dashboard-grid { display: grid; grid-template-columns: minmax(235px, 285px) minmax(590px, 1fr) minmax(260px, 330px); gap: 14px; max-width: 1800px; margin: 0 auto; padding: 16px; align-items: start; }
.panel, .data-card, .summary-card { border: 1px solid var(--line); background: rgba(13, 24, 21, .92); border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.panel { padding: 17px; }
.news-panel, .community-panel { position: sticky; top: 84px; height: calc(100vh - 102px); display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
.center-column { min-width: 0; }
.hero-row, .panel-heading, .table-tools, .dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.hero-row { padding: 14px 4px 16px; }
.hero-row h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.dashboard-actions { display: flex; align-items: center; gap: 7px; }
.side-toggle { min-width: 112px; }
.panel-note { color: var(--muted); font-size: .76rem; line-height: 1.55; margin: 12px 0; }
.pill { border-radius: 999px; padding: 5px 8px; font-size: .57rem; letter-spacing: .08em; font-weight: 900; }
.pill.green { background: rgba(71,230,161,.12); color: var(--green); }.pill.amber { background: rgba(246,184,74,.12); color: var(--amber); }.pill.blue { background: rgba(101,165,255,.12); color: var(--blue); }

.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.summary-card { padding: 15px; min-width: 0; }
.summary-card.clickable { display: block; width: 100%; color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: transform .15s, border-color .15s; }
.summary-card.clickable:hover { transform: translateY(-2px); border-color: rgba(71,230,161,.5); }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-card strong { display: block; font-size: 1rem; margin: 7px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-card.accent { border-color: rgba(71,230,161,.45); background: linear-gradient(135deg, rgba(71,230,161,.09), rgba(13,24,21,.92)); }
.market-lines { display: grid; gap: 3px; margin: 6px 0 5px; }
.market-lines strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: .72rem; }
.market-lines span { color: #dce9e3; font-size: .67rem; }
.market-lines em { min-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: .63rem; font-style: normal; }
.market-lines em.bullish { color: var(--green); }.market-lines em.bearish { color: var(--red); }.market-lines em.neutral { color: var(--amber); }

.dashboard-grid.left-collapsed { grid-template-columns: minmax(590px, 1fr) minmax(260px, 330px); }
.dashboard-grid.left-collapsed .news-panel { display: none; }
.dashboard-grid.right-collapsed { grid-template-columns: minmax(235px, 285px) minmax(590px, 1fr); }
.dashboard-grid.right-collapsed .community-panel { display: none; }
.dashboard-grid.left-collapsed.right-collapsed { grid-template-columns: minmax(590px, 1fr); }

.data-card { overflow: hidden; }
.earnings-panel { margin-bottom: 12px; }
.earnings-panel.collapsed { display: none; }
.earnings-list { max-height: 310px; overflow-y: auto; padding: 9px; display: grid; gap: 6px; }
.earnings-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; min-width: 0; border: 1px solid var(--line); background: #0a1411; border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.earnings-item:hover { border-color: rgba(71,230,161,.4); }.earnings-item.options { border-color: rgba(246,184,74,.35); }.earnings-item.critical { border-color: rgba(255,107,117,.5); }.earnings-item.snapshot { border-color: rgba(101,165,255,.32); }
.earnings-icon { font-size: 1.1rem; }.earnings-item strong, .earnings-item small { display: block; }.earnings-item small { color: var(--muted); font-size: .62rem; margin-top: 2px; }.earnings-price { text-align: right; }.earnings-price small { color: var(--amber); font-size: .56rem; font-weight: 800; letter-spacing: .04em; }
.history-card { margin-top: 12px; }
.history-details > summary { cursor: pointer; list-style: none; }
.history-details > summary::-webkit-details-marker { display: none; }
.history-details > summary::after { content: "＋"; color: var(--green); font-size: 1.15rem; }
.history-details[open] > summary::after { content: "−"; }
.long-term-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 14px 14px 0; }
.long-term-summary article, .long-term-summary > p { border: 1px solid var(--line); border-radius: 12px; background: #0a1411; padding: 11px; }
.long-term-summary h4 { color: var(--green); margin: 0 0 7px; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.long-term-summary ul { margin: 0; padding-left: 17px; color: #d6e4de; font-size: .67rem; line-height: 1.45; }
.long-term-summary li { margin: 4px 0; }
.history-chart { min-height: 170px; padding: 16px; overflow-x: auto; }
.history-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.history-title strong { color: var(--green); font-size: 1.15rem; }.history-title span { color: var(--muted); font-size: .68rem; }
.history-bars { min-width: max-content; height: 120px; display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.history-point { width: 44px; height: 116px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.history-point i { display: block; width: 25px; min-height: 4px; border-radius: 5px 5px 2px 2px; }.history-point i.positive { background: linear-gradient(to top, #1a7651, var(--green)); }.history-point i.negative { background: linear-gradient(to top, #702a31, var(--red)); }
.history-point i.h-1 { height: 9px; }.history-point i.h-2 { height: 18px; }.history-point i.h-3 { height: 27px; }.history-point i.h-4 { height: 36px; }.history-point i.h-5 { height: 45px; }.history-point i.h-6 { height: 54px; }.history-point i.h-7 { height: 63px; }.history-point i.h-8 { height: 72px; }.history-point i.h-9 { height: 81px; }.history-point i.h-10 { height: 90px; }
.history-point small { color: var(--muted); font-size: .53rem; }.bar-value { font-size: .5rem; font-style: normal; }.bar-value.positive { color: var(--green); }.bar-value.negative { color: var(--red); }
.table-tools { padding: 16px; border-bottom: 1px solid var(--line); }
.table-tools p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.table-tools input { max-width: 220px; padding: 9px 11px; }
.table-wrap { overflow: auto; max-height: 54vh; }
table { width: 100%; border-collapse: collapse; font-size: .72rem; }
th { position: sticky; top: 0; z-index: 2; text-align: left; color: var(--muted); background: #0b1512; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: 11px 10px; border-bottom: 1px solid rgba(32,52,45,.7); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .15s; } tbody tr:hover, tbody tr.selected { background: rgba(71,230,161,.07); }
.loading-cell { text-align: center; color: var(--muted); padding: 40px; }
.sector-label, .signal-text { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { display: inline-block; border-radius: 8px; padding: 4px 7px; font-weight: 900; }.score.high { color: var(--green); background: rgba(71,230,161,.12); }.score.mid { color: var(--amber); background: rgba(246,184,74,.12); }.score.low { color: #aebdb7; background: rgba(143,166,156,.1); }
.delta { margin-left: 5px; }.delta.up { color: var(--green); }.delta.down { color: var(--red); }
.pivots { font-variant-numeric: tabular-nums; color: #b7c9c1; }
.stock-dialog { width: min(1120px, calc(100% - 28px)); }
.stock-dialog-content { margin-top: 18px; display: grid; gap: 14px; }
.stock-metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.stock-metric-grid article { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #09130f; }
.stock-metric-grid span, .stock-signal span { display: block; color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .08em; }
.stock-metric-grid strong { display: block; margin-top: 5px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.high-text { color: var(--green); }.mid-text { color: var(--amber); }.low-text { color: #aebdb7; }
.stock-signal { padding: 14px; border: 1px solid rgba(71,230,161,.3); border-radius: 13px; background: rgba(71,230,161,.055); }
.stock-signal strong { display: block; margin: 6px 0; font-size: .9rem; }.stock-signal small { color: var(--muted); }
.pivot-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.pivot-table { min-width: 900px; font-size: .68rem; }.pivot-table th { position: static; }.pivot-table tbody th { color: var(--green); background: #0a1411; font-size: .68rem; }.pivot-table td { font-variant-numeric: tabular-nums; color: #d6e4de; white-space: nowrap; }.pivot-table .pivot-main { color: var(--amber); font-weight: 800; }.pivot-table .reach-count { color: #e9ef52; font-weight: 900; }

.analyst-panel { margin-top: 12px; }
.quick-list { display: grid; gap: 7px; margin: 12px 0; }
.quick-list.horizontal { display: flex; flex-wrap: wrap; }
.quick-list button { text-align: left; color: #bed0c8; background: #0a1411; border: 1px solid var(--line); padding: 9px 10px; border-radius: 10px; font-size: .7rem; cursor: pointer; }
.quick-list button:hover { color: var(--green); border-color: rgba(71,230,161,.4); }
.insights-stack { display: grid; gap: 8px; margin: 4px 0 12px; }
.insight-card { border: 1px solid var(--line); border-radius: 12px; background: #0a1411; overflow: hidden; }
.insight-card summary { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 7px; padding: 10px; cursor: pointer; list-style: none; }.insight-card summary::-webkit-details-marker { display: none; }.insight-card summary strong { font-size: .72rem; }.insight-card summary small { color: var(--muted); font-size: .54rem; }
.insight-content { border-top: 1px solid var(--line); padding: 9px 10px; max-height: 250px; overflow-y: auto; color: #d6e4de; font-size: .66rem; line-height: 1.45; }
.insight-content h4 { color: var(--green); font-size: .61rem; text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 5px; }.insight-content h4:first-child { margin-top: 0; }.insight-content ul { margin: 0; padding-left: 17px; }.insight-content li { margin: 4px 0; }.insight-content li small { display: block; color: var(--muted); margin-top: 2px; }.insight-empty { color: var(--muted); margin: 0; }.market-sentence { color: var(--amber); margin: 0 0 7px; font-weight: 700; }
.ai-thread, .chat-list { overflow-y: auto; min-height: 180px; max-height: 390px; display: flex; flex-direction: column; gap: 9px; padding: 4px 3px 8px; }
.ai-thread.compact { flex: 1; max-height: none; min-height: 120px; }
.empty-state { margin: auto; color: var(--muted); font-size: .75rem; line-height: 1.5; text-align: center; padding: 22px; }
.ai-message { max-width: 92%; border: 1px solid var(--line); border-radius: 13px; padding: 10px; background: #0a1411; }
.ai-message.user { align-self: flex-end; background: var(--green-dark); border-color: rgba(71,230,161,.25); }
.ai-message > span { display: block; color: var(--green); font-size: .57rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.ai-message p { margin: 0; color: #d8e5df; font-size: .76rem; line-height: 1.55; }
.ai-message.waiting { opacity: .55; animation: pulse 1.2s infinite; }
.source-list { display: grid; gap: 5px; margin-top: 9px; }.source-list a { font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pulse { 50% { opacity: .25; } }
.composer { display: grid; grid-template-columns: 1fr 38px; align-items: end; gap: 7px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.composer textarea { min-height: 58px; max-height: 130px; font-size: .74rem; padding: 10px; }
.composer.wide textarea { min-height: 68px; }
.send-button { width: 38px; height: 38px; border: 0; border-radius: 11px; color: #062017; background: var(--green); font-size: 1.1rem; font-weight: 900; cursor: pointer; }

.chat-list { flex: 1; max-height: none; min-height: 140px; }
.chat-message { padding: 10px; background: #0a1411; border: 1px solid var(--line); border-radius: 12px; }
.chat-message div { display: flex; justify-content: space-between; gap: 8px; }.chat-message strong { color: var(--green); font-size: .7rem; }.chat-message time { color: var(--muted); font-size: .55rem; }.chat-message p { margin: 7px 0 0; font-size: .73rem; line-height: 1.45; }
.video-box { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.video-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }.video-head h3 { margin: 0; }.video-head p { margin: 2px 0 0; color: var(--muted); font-size: .58rem; }
.video-list { display: grid; gap: 9px; margin-top: 10px; }.video-list iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 11px; background: #050907; }.video-box.collapsed .video-list { display: none; }

.footer-note { max-width: 1800px; margin: 0 auto; padding: 0 18px 18px; color: #61766d; font-size: .64rem; text-align: center; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: 360px; padding: 12px 15px; border-radius: 12px; background: #133d2f; color: #caffE6; border: 1px solid rgba(71,230,161,.35); box-shadow: var(--shadow); font-size: .76rem; }.toast.error { background: #3b171a; color: #ffd5d8; border-color: rgba(255,107,117,.35); }

.admin-dialog { width: min(900px, calc(100% - 28px)); max-height: 86vh; border: 1px solid var(--line); border-radius: 22px; background: #0c1714; color: var(--text); padding: 20px; box-shadow: var(--shadow); }
.admin-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(7px); }
.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 1.7rem; cursor: pointer; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }.admin-grid form { display: grid; gap: 10px; }.admin-subtitle { margin: 22px 0 0; }.admin-list { display: grid; gap: 7px; margin-top: 10px; max-height: 360px; overflow: auto; }.admin-list article { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 10px; }.admin-list strong, .admin-list small { display: block; }.admin-list small { color: var(--muted); font-size: .65rem; margin-top: 3px; }.tiny-button { padding: 6px 8px; font-size: .62rem; }.tiny-button.danger { color: #ffd5d8; border-color: rgba(255,107,117,.35); background: rgba(255,107,117,.08); }.user-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }.review-buttons { display: flex; gap: 5px; }.review-buttons button { border: 1px solid var(--line); background: #101f1a; color: var(--text); border-radius: 8px; cursor: pointer; }
.ticker-dialog { width: min(520px, calc(100% - 28px)); }.ticker-dialog form { display: grid; gap: 13px; margin-top: 16px; }
.password-dialog { width: min(520px, calc(100% - 28px)); }
.password-dialog form { display: grid; gap: 13px; margin-top: 18px; }
.crypto-dialog-content { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.crypto-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #09130f; }
.crypto-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crypto-card-head span, .crypto-card-head strong { display: block; }
.crypto-card-head span { color: var(--green); font-size: .72rem; font-weight: 900; }
.crypto-card-head strong { margin-top: 5px; font-size: 1.35rem; }
.crypto-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 15px 0; }
.crypto-metrics span { border: 1px solid var(--line); border-radius: 9px; padding: 8px; color: var(--muted); font-size: .65rem; }
.crypto-metrics strong { display: block; color: var(--text); margin-top: 3px; }
.crypto-card p { color: #d6e4de; font-size: .72rem; line-height: 1.5; margin: 0; }

@media (max-width: 1180px) {
  .dashboard-grid { grid-template-columns: 240px minmax(520px, 1fr); }
  .community-panel { position: static; height: 620px; grid-column: 1 / -1; }
  .chat-list { min-height: 300px; }
}
@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; }.top-center { display: none; }.user-menu span { display: none; }
  .dashboard-grid, .dashboard-grid.left-collapsed, .dashboard-grid.right-collapsed, .dashboard-grid.left-collapsed.right-collapsed { display: flex; flex-direction: column; padding: 10px; }.news-panel, .community-panel { position: static; width: 100%; height: auto; min-height: 560px; }.center-column { width: 100%; order: -1; }
  .dashboard-grid.left-collapsed .news-panel, .dashboard-grid.right-collapsed .community-panel { display: none; }
  .summary-cards { grid-template-columns: 1fr 1fr; }.table-wrap { max-height: 65vh; }.news-panel { order: 2; }.community-panel { order: 3; }
  .admin-grid { grid-template-columns: 1fr; }
  .stock-metric-grid { grid-template-columns: repeat(3, 1fr); }.crypto-dialog-content { grid-template-columns: 1fr; }
  .long-term-summary { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar { padding: 0 12px; }.user-menu { gap: 8px; }.hero-row { align-items: stretch; flex-direction: column; }.dashboard-actions { flex-wrap: wrap; }.summary-cards { grid-template-columns: 1fr; }.table-tools { align-items: stretch; flex-direction: column; }.table-tools input { max-width: none; }.auth-card { padding: 26px 20px; }.checks { grid-template-columns: 1fr; }.stock-metric-grid { grid-template-columns: repeat(2, 1fr); }
}
