:root { color-scheme: light; font-family: Arial, sans-serif; color: #000; background: #fff; }
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 650px; margin: auto; padding: 12px; }
button, a, input { font: inherit; color: #000; }
button { min-height: 44px; border: 2px solid #000; border-radius: 4px; background: #fff; padding: 7px 10px; cursor: pointer; }
button:disabled { border-style: dashed; cursor: default; }
button[aria-pressed="true"], button.on { background: #000; color: #fff; }
button:focus-visible, a:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
[hidden] { display: none !important; }
header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
header strong { font-size: 19px; letter-spacing: .04em; }
header small { display: block; margin-top: 5px; }
small { font-size: 11px; }
nav { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; margin: 12px 0 4px; }
nav button { padding: 6px 2px; font-size: 14px; font-weight: bold; }
section { border-bottom: 2px solid #000; padding: 10px 0; }
h1, h2 { margin: 0; font-size: 18px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 9px; }
.heading > small { text-align: right; }
.all-controls { display: flex; gap: 5px; }
.all-controls button { min-height: 36px; font-size: 12px; padding: 5px 8px; }
.light-groups { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.light-group .group-power { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px; font-weight: bold; padding: 8px 2px; }
.group-power img { width: 34px; height: 27px; object-fit: contain; }
.group-power.on img { filter: invert(1); }
.group-power small { font-weight: normal; }
.individuals { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; margin-top: 5px; }
.individuals button { min-height: 39px; padding: 2px; font-size: 12px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; }
.metrics article { min-width: 0; }
.metrics small { display: block; }
.metrics strong { display: block; font-size: clamp(18px,5.6vw,26px); margin-top: 3px; font-variant-numeric: tabular-nums; }
.note { font-size: 10px; line-height: 1.4; margin: 8px 0 0; }
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.service { border: 1px solid #000; padding: 6px; display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: 12px; }
.service strong { font-size: 10px; }
.service.down { border: 3px solid #000; padding: 4px; }
footer { display: flex; justify-content: space-between; margin-top: 11px; gap: 8px; font-size: 11px; }
.detail-lamp { border-top: 1px solid #000; padding: 12px 0; }
.detail-lamp .heading { margin-bottom: 8px; }
.presets { display: flex; gap: 5px; flex-wrap: wrap; }
.presets button { font-size: 13px; }
#trader-details { font-size: 13px; line-height: 1.5; }
#trader-details p { border-top: 1px solid #000; padding-top: 9px; }
#trader-details .holding-row p { border-top: 0; padding-top: 0; }
body[data-view="services"] .services { grid-template-columns: 1fr; }
body[data-view="services"] .service { min-height: 60px; font-size: 16px; }
@media (max-height: 650px) { main { padding: 8px; } nav { margin-top: 8px; } section { padding: 7px 0; } .heading { margin-bottom: 6px; } .metrics { gap: 7px; } .note { margin-top: 5px; } footer { margin-top: 8px; } }
@media (max-height: 700px) {
  body[data-view="home"] .group-power { padding: 6px 2px; gap: 3px; }
  body[data-view="home"] .group-power img { height: 25px; }
  body[data-view="home"] .services { gap: 5px; }
  body[data-view="home"] .service { padding: 4px; }
  body[data-view="home"] .service.down { padding: 2px; }
  body[data-view="home"] #refresh-note { display: none; }
  body[data-view="home"] .metrics strong { font-size: clamp(18px,5.3vw,24px); }
}
body[data-view="home"] .light-groups { grid-template-columns: repeat(4, 1fr); }
body[data-view="home"] .individuals { display: none; }
body[data-view="home"] .group-power { font-size: 14px; }
body[data-view="lights"] .light-groups { grid-template-columns: repeat(2, 1fr); }
body[data-view="lights"] .individuals button { min-height: 44px; }
nav { margin-top: 0; }
.timeline-figure { margin: 12px 0 4px; }
.timeline-figure figcaption { font-size: 10px; margin-bottom: 3px; }
#trader-chart { display: block; width: 100%; height: 110px; }
#trader-chart .axis { stroke: #000; stroke-width: 1; }
#trader-chart .zero { stroke-dasharray: 4 4; }
#trader-chart .performance-line { fill: none; stroke: #000; stroke-width: 2.5; stroke-linejoin: round; }
#trader-chart text { font: 10px Arial, sans-serif; fill: #000; }
body[data-view="trader"] #trader-chart { height: 190px; }
.service.off, .service.paused { border-style: dashed; }
#services-summary { font-size: 11px; text-align: right; }
body[data-view="services"] .service { flex-wrap: wrap; }
body[data-view="services"] .service small { width: 100%; font-size: 11px; }

#news-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#news-sources button { font-size: 13px; }
.news-item { border-top: 1px solid #000; padding: 12px 0; }
.news-item a { display: block; font-size: 17px; font-weight: bold; line-height: 1.35; padding: 5px 0; }
.news-item p { font-size: 13px; line-height: 1.5; margin: 6px 0; }
.news-item small { display: block; }
.news-paging { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }

.disclosure-filters { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 13px; }
select { min-height: 44px; font: inherit; background: white; color: black; border: 2px solid black; }
.disclosure { border-left: 3px solid black; padding: 10px 10px 12px; margin: 12px 0; }
.disclosure h3 { font-size: 16px; margin: 6px 0; }
.disclosure p, .transaction p { font-size: 13px; line-height: 1.4; margin: 5px 0; }
.disclosure button { width: 100%; margin-top: 6px; }
#pelosi-detail h2 { margin: 14px 0; }
.transaction { border-top: 1px solid black; padding: 10px 0; }
#pelosi-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
details { margin: 16px 0; } summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.holdings-title { margin: 18px 0 8px; }
.holding-row { border-top: 1px solid black; padding: 12px 0; font-size: 14px; }
.holding-row .heading { margin-bottom: 4px; }
.holding-row p { margin: 5px 0 0; font-size: 12px; }
.position-row { border-top: 1px dashed #000; margin-top: 9px; padding-top: 9px; }
.position-row small { display: block; margin-bottom: 7px; }
.danger-button { width: 100%; margin-top: 6px; font-weight: bold; }
.danger-button.armed { background: #000; color: #fff; }

.disclosure p { white-space: pre-line; }

.document-scroll { overflow: auto; max-height: 75vh; margin: 12px 0; border: 1px solid black; }
#pelosi-doc-image { display: block; width: 100%; }
#pelosi-doc-image.zoomed { width: 250%; max-width: none; }
#pelosi-source { display: block; margin-top: 12px; font-size: 12px; }

.group-power { touch-action: none; user-select: none; -webkit-user-select: none; }
.group-power.dragging { outline: 3px solid black; outline-offset: 2px; }
a.service { text-decoration: none; cursor: pointer; min-height: 30px; }
a.service > span::after { content: " ↗"; font-size: 10px; }

.view-options { display: flex; gap: 8px; }
.view-options button { flex: 1; }
.cinema-film { border-top: 1px solid #000; padding: 12px 0; }
.cinema-film h3 { font-size: 18px; margin: 0 0 6px; }
.cinema-film p { font-size: 13px; line-height: 1.5; }
.cinema-film a { display: block; padding: 12px 0; min-height: 44px; font-weight: bold; }
.cinema-film details { margin: 4px 0; }
.showtime { font-size: 13px; padding: 8px 0; border-top: 1px dashed #000; }
.forecast-day { border-top: 1px solid #000; padding: 14px 0; }
.forecast-day p { margin: 6px 0 0; font-size: 14px; }

.disclosure-items { padding-left: 22px; margin: 10px 0; }
.disclosure-items li { padding: 6px 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }

.holding-earnings { margin: 10px 0 7px; }
.holding-earnings small { display: block; font-size: 12px; }
.holding-earnings strong { display: block; font-size: 22px; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Footer utilities must not make a compact BOOX view scroll. */
footer, #refresh-note { display: none; }
@media (max-height: 700px) {
  main { padding: 3px 8px; }
  body[data-view="home"] section { padding: 4px 0; }
  body[data-view="home"] .group-power { padding: 4px 2px; gap: 2px; }
  body[data-view="home"] .group-power img { height: 20px; }
  body[data-view="home"] .timeline-figure { margin-top: 6px; }
  body[data-view="home"] #trader-chart { height: clamp(55px, calc(100vh - 540px), 110px); }
  body[data-view="services"] .services { gap: 5px; }
  body[data-view="services"] .service { min-height: 48px; padding: 5px 6px; font-size: 14px; }
  body[data-view="services"] .service.down { padding: 3px 4px; }
  body[data-view="weather"] .holdings-title { margin-top: 12px; }
  body[data-view="weather"] .metrics strong { font-size: 22px; }
  body[data-view="weather"] #weather-panel { padding: 5px 0; }
  body[data-view="weather"] .forecast-day { padding: 3px 0; }
  body[data-view="weather"] .forecast-day > strong { font-size: 14px; }
  body[data-view="weather"] .forecast-day p { margin-top: 3px; font-size: 13px; line-height: 16px; }
}

#wallet-overview { display: block; color: black; text-decoration: none; border-top: 1px solid black; padding-top: 4px; margin-top: 4px; min-height: 44px; }
#wallet-summary { display: block; font-size: 11px; }
#wallet-mini { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 3px; font-size: 10px; line-height: 14px; }
#wallet-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wallet-holdings p { overflow-wrap: anywhere; }
#wallet-holdings a, #wallet-explorer { display: block; min-height: 44px; padding: 12px 0; }
body[data-view="home"] #trader-panel > .metrics article:nth-child(n+3) { display: none; }
body[data-view="home"] #wallet-overview { padding: 6px 4px; border: 1px solid black; background: white; }
@media (max-height: 700px) {
  body[data-view="home"] #light-status { display: none; }
  body[data-view="home"] #trader-chart { height: clamp(40px, calc(100vh - 570px), 90px); }
  body[data-view="home"] .services { gap: 3px 5px; }
}

@media (max-height: 600px) {
  body[data-view="home"] #wallet-mini { line-height: 12px; row-gap: 1px; }
  body[data-view="home"] .metrics strong { font-size: 20px; }
  body[data-view="home"] #trader-note { font-size: 9px; line-height: 12px; }
  body[data-view="home"] .group-power img { height: 18px; }
  body[data-view="home"] .service { min-height: 28px; padding: 3px; font-size: 11px; }
  body[data-view="home"] .service.down { padding: 1px; }
}
