:root {
  color-scheme: dark;
  --bg: #101312;
  --side: #131715;
  --panel: #181d1a;
  --inset: #121713;
  --border: #2b342e;
  --text: #f0f5f0;
  --muted: #a3afa6;
  --subtle: #8b9b90;
  --green: #a1eac2;
  --green-strong: #78e8af;
  --red: #f5a5a0;
  --amber: #f1d49a;
  --radius: 15px;
  --numeric: ui-monospace, 'SF Mono', Consolas, monospace;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
::selection { color: #0c1d14; background: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
strong, h1, h2, h3 { font-weight: 640; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 3; top: .5rem; left: .5rem; padding: .55rem .8rem; transform: translateY(-150%); background: var(--green); color: var(--bg); }
.skip:focus { transform: none; }
.muted { color: var(--muted); }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 214px; display: flex; flex-direction: column; padding: 25px 15px 20px; border-right: 1px solid var(--border); background: var(--side); z-index: 2; }
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; margin: 0 0 43px 9px; font-size: 1.04rem; font-weight: 720; letter-spacing: -.02em; }
.brand-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: #0b2819; background: var(--green); font-size: 1.55rem; font-weight: 650; line-height: 1; }
.navigation { display: grid; gap: 5px; }
.navigation a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: .9rem; }
.navigation a:hover { background: #202822; color: var(--text); }
.navigation a[aria-current] { background: #24362b; border-color: #365140; color: #b1efca; font-weight: 620; }
.nav-icon { display: inline-grid; place-items: center; width: 19px; height: 22px; font-size: 1.22rem; line-height: 1; }
.tiles { font-size: 1.17rem; }
.side-end { display: grid; gap: 6px; margin: auto 1px 0; padding: 13px 11px; border: 1px solid var(--border); border-radius: 10px; background: #171d19; }
.side-label { color: var(--subtle); font-size: .75rem; font-weight: 650; letter-spacing: .09em; }
.side-source { display: flex; align-items: center; gap: 7px; font-size: .88rem; }
.side-detail { color: var(--muted); font-size: .76rem; }
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green-strong); box-shadow: 0 0 0 3px #78e8af25; }
.status-dot[data-state="warning"] { background: var(--amber); box-shadow: 0 0 0 3px #f1d49a23; }
.status-dot[data-state="loading"] { background: var(--muted); box-shadow: 0 0 0 3px #a3afa620; }

main { margin-left: 214px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 67px; padding: 0 31px; border-bottom: 1px solid var(--border); background: #141815; }
.market-name, .top-actions { display: flex; align-items: center; gap: 11px; }
.market-name strong { font-size: .93rem; letter-spacing: .02em; }
.market-name .muted { font-size: .87rem; }
.coin { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #594831; border-radius: 50%; color: #f5cb80; background: #322819; font-size: 1.16rem; line-height: 1; }
.top-divider { height: 17px; width: 1px; background: var(--border); }
.feed-status { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.button, select { min-height: 37px; border: 1px solid #3b483e; border-radius: 8px; font-size: .875rem; font-weight: 590; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 5px 12px; }
.secondary, select { background: #202722; color: var(--text); }
.secondary:hover:not(:disabled), select:hover { background: #2a352d; border-color: #536757; }
.action-icon { font-size: 1.06rem; line-height: 1; color: var(--green); }

.workspace { max-width: 1560px; margin: 0 auto; padding: 28px 31px 45px; }
.page-header { margin-bottom: 22px; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.45rem); line-height: 1.14; font-weight: 690; letter-spacing: -.043em; }
.page-header p { margin-top: 6px; color: var(--muted); }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { display: flex; min-height: 113px; flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 16px 13px; }
.stat-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem; }
.stat-icon { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #33443a; border-radius: 6px; color: #9bceaf; background: #222d25; font-size: .95rem; line-height: 1; }
.stat-value { font-family: var(--numeric); font-size: clamp(1.04rem, 2.6vw, 1.56rem); letter-spacing: -.07em; line-height: 1.38; white-space: nowrap; }
.stat-caption { color: var(--subtle); font-size: .81rem; }
[data-tone="up"] { color: var(--green); }
[data-tone="down"] { color: var(--red); }
[data-tone="hold"] { color: var(--amber); }
[data-tone="flat"], [data-tone="muted"] { color: var(--muted); }
.notice { margin: 0 0 14px; padding: 10px 13px; border: 1px solid #655438; border-radius: 8px; color: var(--amber); background: #2e271c; font-size: .9rem; }

.overview { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(270px, 1fr); gap: 15px; margin: 15px 0; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 16px 17px 0; }
.panel-header h2 { font-size: 1.1rem; line-height: 1.3; letter-spacing: -.015em; }
.panel-header p { margin-top: 3px; color: var(--muted); font-size: .88rem; }
.chart-panel { display: flex; flex-direction: column; }
.chart-header { align-items: center; }
.segmented { display: flex; gap: 2px; flex: none; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--inset); }
.segmented button { padding: 4px 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; font-size: .82rem; color: var(--muted); line-height: 1.3; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { color: var(--green); border-color: #3a5344; background: #27372d; }
.chart-wrap { position: relative; min-width: 0; height: clamp(205px, 22vw, 300px); margin: 10px 12px 0; }
#price-chart { display: block; width: 100%; height: 100%; border-radius: 7px; touch-action: pan-y; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: var(--muted); font-size: .875rem; text-align: center; pointer-events: none; }
.chart-tooltip { position: absolute; top: 10px; z-index: 1; display: grid; gap: 2px; padding: 6px 9px; border: 1px solid #4d6355; border-radius: 7px; background: #101713; box-shadow: 0 7px 18px #0004; pointer-events: none; white-space: nowrap; font-size: .8rem; }
.chart-tooltip span { color: var(--muted); }
.chart-tooltip strong { font-family: var(--numeric); }
.chart-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: auto 17px 0; padding: 9px 0 12px; color: var(--subtle); font-size: .81rem; }
.chart-footer > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.legend-line { width: 13px; height: 2px; border-radius: 1px; background: var(--green-strong); }

.signal-panel { display: flex; flex-direction: column; }
.horizon { padding: 2px 7px; border: 1px solid #354239; border-radius: 6px; color: #becdc2; background: #202821; font: .83rem/1.5 var(--numeric); white-space: nowrap; }
.signal-content { padding: 13px 17px 11px; }
.signal-main { display: flex; align-items: center; gap: 11px; min-height: 67px; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--inset); }
.signal-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 8px; background: #a3afa616; color: inherit; font-size: 1.5rem; }
.signal-main[data-tone="up"] { background: #192a20; border-color: #345740; }
.signal-main[data-tone="up"] .signal-icon { background: #304c3a; }
.signal-main[data-tone="down"] { background: #2b201e; border-color: #543a34; }
.signal-main[data-tone="down"] .signal-icon { background: #4a302e; }
.signal-main[data-tone="hold"] { background: #29251b; border-color: #51472e; }
.signal-main[data-tone="hold"] .signal-icon { background: #423923; }
.signal-label { display: block; color: var(--muted); font-size: .79rem; line-height: 1.25; }
.signal-main strong { display: block; font-size: 1.3rem; line-height: 1.25; letter-spacing: -.025em; }
.score { margin-top: 14px; }
.score-title, .score-values { display: flex; justify-content: space-between; gap: 9px; color: var(--muted); font-size: .85rem; }
.score-title { font-weight: 600; color: var(--text); }
#score-direction { color: var(--muted); text-align: right; font-size: .8rem; font-weight: 500; }
.score-values { margin: 7px 0 5px; }
.score-values b { color: var(--text); font: .79rem var(--numeric); }
.score-bar { display: flex; gap: 2px; height: 5px; overflow: hidden; border-radius: 8px; background: #344139; }
.score-bar span:first-child { background: var(--green-strong); }
.score-bar span:last-child { background: #ce807a; }
.signal-context { margin-top: 10px; color: var(--muted); font-size: .82rem; }
.signal-footer { display: flex; align-items: center; gap: 7px; margin: auto 0 0; min-height: 43px; padding: 9px 17px; border-top: 1px solid var(--border); color: var(--amber); font-size: .85rem; }
.mode-mark { font-size: .95rem; }

.history-panel, .model-panel, .faq-panel { scroll-margin-top: 14px; }
.history-header { padding-bottom: 12px; align-items: center; }
.select-wrap { position: relative; }
.select-wrap::after { position: absolute; top: 14px; right: 12px; width: 7px; height: 7px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); pointer-events: none; content: ''; }
select { appearance: none; padding: 5px 31px 5px 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 655px; border-collapse: collapse; font-size: .88rem; text-align: left; white-space: nowrap; }
th, td { padding: 8px 17px; border-top: 1px solid var(--border); }
th { background: #151a17; color: var(--muted); font-size: .83rem; font-weight: 560; }
td { font-variant-numeric: tabular-nums; }
td:nth-child(3), td:nth-child(4) { font-family: var(--numeric); font-size: .81rem; }
tbody tr:hover { background: #1d2520; }
.empty-cell { padding-block: 17px; color: var(--muted); text-align: center; }
.signal-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; font-weight: 610; font-size: .79rem; }
.signal-pill[data-tone="up"] { background: #233c2c; }
.signal-pill[data-tone="down"] { background: #3c2b27; }
.signal-pill[data-tone="hold"] { background: #3a3323; }
.history-footer { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 10px 17px; border-top: 1px solid var(--border); color: var(--muted); font-size: .83rem; }
.pagination { display: flex; gap: 6px; }
.pagination .button { min-height: 32px; }
.model-panel { margin-top: 15px; }
.text-link { color: var(--green); font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 13px 17px 17px; }
.model-grid h3 { margin-bottom: 4px; font-size: .94rem; }
.model-grid p { color: var(--muted); font-size: .875rem; }
.learning { border-top: 1px solid var(--border); padding: 13px 17px 17px; }
.learning-header { display: flex; align-items: center; gap: 10px; }
.learning-header h3 { font-size: .94rem; }
.learning p { color: var(--muted); font-size: .875rem; margin-top: 5px; }

.faq-panel { margin-top: 15px; }
.faq-list { display: grid; gap: 6px; padding: 13px 17px 17px; }
.faq-list details { min-width: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--inset); }
.faq-list details[open] { border-color: #3a5344; }
.faq-list summary { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border-radius: 8px; font-weight: 600; list-style: none; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--green); }
.faq-list summary::after { flex: none; width: 7px; height: 7px; margin-right: 2px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: translateY(-2px) rotate(45deg); content: ''; }
.faq-list details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.faq-list p { max-width: 74ch; padding: 0 13px 12px; color: var(--muted); }
.faq-list .text-link { font-size: inherit; }

.site-footer { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; margin-top: 15px; padding: 13px 2px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; scroll-margin-top: 14px; }
.cookie-details { flex: 1 1 355px; max-width: 72ch; }
.cookie-details summary { width: fit-content; padding: 5px 0; color: var(--text); cursor: pointer; }
.cookie-details p + p { margin-top: 6px; }
.cookie-details code { color: var(--text); font-family: var(--numeric); }
.cookie-controls { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.cookie-notice { position: fixed; z-index: 5; right: 16px; bottom: 16px; left: 16px; display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; max-width: 680px; max-height: 70dvh; overflow-y: auto; margin-inline: auto; padding: 15px 17px; border: 1px solid #44574a; border-radius: var(--radius); background: var(--panel); box-shadow: 0 10px 40px #0008; }
.cookie-notice h2 { margin-bottom: 3px; font-size: 1rem; }
.cookie-notice p { margin-bottom: 4px; color: var(--muted); font-size: .875rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions .button { justify-content: center; min-height: 42px; }
body:has(.cookie-notice:not([hidden])) .workspace { padding-bottom: 225px; }

@media (max-width: 1110px) {
  .sidebar { width: 180px; padding-inline: 12px; }
  main { margin-left: 180px; }
  .topbar { padding-inline: 22px; }
  .workspace { padding-inline: 22px; }
}
@media (max-width: 920px) {
  .sidebar { position: static; width: auto; display: flex; flex-direction: row; justify-content: space-between; gap: 12px; align-items: center; padding: 7px 15px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { flex: none; margin: 0; }
  .brand-icon { width: 33px; height: 33px; }
  .navigation { display: flex; }
  .side-end { display: none; }
  main { margin-left: 0; }
  .topbar { min-height: 54px; }
}
@media (max-width: 690px) {
  .topbar, .workspace { padding-inline: 14px; }
  .workspace { padding-top: 20px; }
  .overview { grid-template-columns: minmax(0, 1fr); }
  .signal-panel { grid-row: 1; }
  .model-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-grid { gap: 7px; }
  .stat-card { padding-inline: 8px; }
  .stat-caption { font-size: .75rem; }
}
@media (max-width: 490px) {
  .sidebar { display: block; padding-inline: 11px; }
  .brand { margin: 2px 0 6px 3px; }
  .navigation { gap: 4px; }
  .navigation a { min-height: 37px; gap: 5px; padding: 4px 7px; font-size: .83rem; }
  .nav-icon { width: 15px; }
  .topbar { gap: 5px; }
  .top-actions { gap: 3px; }
  .top-actions .button { padding-inline: 7px; }
  .top-divider, .market-name .muted, .stat-icon { display: none; }
  .feed-status { font-size: .78rem; gap: 5px; padding-inline: 5px; }
  .page-header { margin-bottom: 13px; }
  .stat-card { gap: 4px; min-height: 90px; }
  .stat-label { align-items: start; min-height: 37px; font-size: .81rem; line-height: 1.25; }
  .stat-value { white-space: normal; overflow-wrap: anywhere; font-size: .93rem; }
  .stat-caption { display: none; }
  .panel-header { padding-inline: 12px; }
  .faq-list { padding-inline: 12px; }
  .history-header { align-items: flex-start; }
  .history-header select { max-width: 112px; }
}

.sentiment-panel { margin-bottom: 15px; scroll-margin-top: 14px; }
.sentiment-header { padding-bottom: 13px; }
.sentiment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 17px 16px; }
.sentiment-card { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--inset); }
.sentiment-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sentiment-card-head h3 { font-size: 1rem; }
.sentiment-card-head p, .sentiment-checked { color: var(--subtle); font-size: .8rem; }
.sentiment-status { flex: none; padding: 2px 7px; border: 1px solid #45403a; border-radius: 6px; color: var(--amber); font-size: .8rem; }
.sentiment-status[data-status="ok"] { border-color: #395744; color: var(--green); }
.sentiment-status[data-status="loading"] { border-color: var(--border); color: var(--muted); }
.sentiment-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 11px 0 8px; }
.sentiment-values dt { color: var(--muted); font-size: .81rem; }
.sentiment-values dd { margin: 1px 0 0; font: .94rem/1.35 var(--numeric); }
.sentiment-coverage { color: var(--muted); font-size: .82rem; }
.sentiment-checked:not(:empty) { margin-top: 2px; }
.sentiment-comparison { margin: 0 17px 14px; padding: 8px 10px; border-left: 2px solid #5b9772; color: var(--muted); font-size: .875rem; }
.history-panel table { min-width: 790px; }
@media (max-width: 690px) {
  .sentiment-grid { grid-template-columns: 1fr; padding-inline: 12px; }
  .sentiment-comparison { margin-inline: 12px; }
}
@media (max-width: 690px) {
  .sidebar { display: block; }
  .brand { margin: 2px 0 6px 3px; }
  .navigation { overflow-x: auto; scrollbar-width: thin; }
  .navigation a { flex: none; }
}

.live-card .stat-label { min-height: 23px; }
.live-card .status-dot { margin: 0 4px; }
.live-card .stat-value { color: var(--green); }
@media (max-width: 1110px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 490px) {
  .live-card .stat-caption { display: inline; }
}
