/* Weekly market stories (MK-03): article page, Weekly cards, master "News" tab. Prefix ws-.
   Tokens = components/pages/theme.py: panels rgba(0,0,0,0.6), chips rgba(255,255,255,0.06), radius 10px,
   text #e8e8e8, muted #9fb3c8, headings #cfefff, accent #f0a030. */

.ws-article { max-width: 860px; margin: 0 auto; padding: 8px 0 32px; color: #e8e8e8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.62; box-sizing: border-box; }
.ws-article *, .ws-weekly * { box-sizing: border-box; }
.ws-kicker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: #9fb3c8; }
.ws-brand { color: #f0a030; font-weight: 700; }
.ws-dot { opacity: .5; }
.ws-title { font-size: 34px; line-height: 1.18; font-weight: 750; color: #cfefff; margin: 10px 0 12px; letter-spacing: -.01em; }
.ws-lede { font-size: 18px; line-height: 1.6; color: #e8e8e8; margin: 0 0 18px; }
.ws-card { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.ws-h2 { font-size: 21px; color: #cfefff; margin: 26px 0 8px; font-weight: 700; }
.ws-h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: #9fb3c8; margin-bottom: 10px; font-weight: 600; }
.ws-p { font-size: 16px; margin: 0 0 12px; }
.ws-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.ws-kpi { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 10px 12px; cursor: default; }
.ws-kv { font-size: 21px; font-weight: 700; color: #e8e8e8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-kv.up { color: #5fbf6a; }
.ws-kv.down { color: #e66767; }
.ws-kl { font-size: 12px; color: #9fb3c8; margin-top: 2px; }
.ws-chart { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 8px 10px 10px; margin: 14px 0; }
.ws-chart figcaption { font-size: 13px; color: #9fb3c8; padding: 4px 4px 0; display: flex; flex-direction: column; gap: 2px; }
.ws-src { font-size: 11px; opacity: .8; }
.ws-graph { width: 100%; }
.ws-explore { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-explore-btn { background: rgba(255,255,255,0.06); color: #e8e8e8; border: 1px solid rgba(240,160,48,0.45); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; cursor: pointer; }
.ws-explore-btn:hover:not([disabled]) { background: rgba(240,160,48,0.16); }
.ws-explore-btn[disabled] { cursor: default; opacity: .75; }
.ws-explore-btn i { color: #f0a030; }
.ws-mut { color: #9fb3c8; }
.ws-sources { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: #e8e8e8; }
.ws-sources li { margin: 3px 0; }
.ws-link { color: #f0a030; text-decoration: none; }
.ws-method { font-size: 12.5px; color: #9fb3c8; margin: 8px 0 6px; }
.ws-disclaimer { font-size: 12.5px; color: #9fb3c8; margin: 0; border-left: 3px solid #f0a030; padding-left: 10px; }

/* Weekly card (Home, welcome page) */
.ws-weekly { display: flex; flex-direction: column; gap: 8px; }
.ws-card-title { font-size: 20px; font-weight: 700; color: #cfefff; line-height: 1.25; }
.ws-card-lede { font-size: 14px; color: #e8e8e8; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ws-weekly .ws-kv { font-size: 17px; }
.ws-read-btn { align-self: flex-start; background: #f0a030; color: #111; border: 0; border-radius: 10px; padding: 7px 14px;
  font-weight: 700; font-size: 14px; cursor: pointer; }
.ws-weekly.compact .ws-card-title { font-size: 16px; }

/* Home: the news bar (components/stories/home.py, hn-): tabs AlgoLab Weekly / AlgoLab updates, the newest item,
   "History" folds the list open. The box's className carries the tab (tab-weekly | tab-updates) and the fold (open). */
.hn-box { margin: 2px 0 12px; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  color: #e8e8e8; font-size: .82rem; }
.hn-box *, .hn-box *::before { box-sizing: border-box; }
.hn-bar { display: flex; align-items: center; gap: 12px; padding: 5px 6px 5px 8px; min-height: 42px; }
.hn-tabs { display: flex; gap: 4px; flex: 0 0 auto; }
.hn-tabs label { display: inline-flex !important; align-items: center; margin: 0 !important; padding: 3px 10px; cursor: pointer;
  border-radius: 8px; border: 1px solid transparent; color: #9fb3c8; font-size: .72rem; font-weight: 600; letter-spacing: .03em;
  white-space: nowrap; transition: color .15s, background .15s; }
.hn-tabs label:hover { color: #cfefff; background: rgba(255,255,255,0.05); }
.hn-tabs label:has(input:checked) { color: #f0a030; border-color: rgba(240,160,48,0.45); background: rgba(240,160,48,0.10); }
.hn-tabs input { display: none; }
.hn-tabs i { margin-right: 2px; }
.hn-now { flex: 1; min-width: 0; }
.hn-latest { display: none; align-items: center; gap: 10px; min-width: 0; }
.hn-box.tab-weekly .hn-latest.p-weekly, .hn-box.tab-updates .hn-latest.p-updates { display: flex; }
.hn-kick { display: inline-flex; gap: 5px; align-items: center; flex: 0 0 auto; color: #9fb3c8; font-size: .66rem;
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.hn-title { flex: 1; min-width: 0; color: #cfefff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hn-none { color: #7f93a8; font-style: italic; }
.hn-read { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; padding: 3px 11px;
  background: #f0a030; color: #111; font-weight: 700; font-size: .74rem; cursor: pointer; white-space: nowrap; }
.hn-read:hover { filter: brightness(1.08); }
.hn-read.ghost { background: rgba(255,255,255,0.05); color: #f5d6a3; border: 1px solid rgba(240,160,48,0.45); }
.hn-read.ghost:hover { background: rgba(240,160,48,0.16); }
.hn-more { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; cursor: pointer;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); color: #cfdcea;
  font-size: .72rem; white-space: nowrap; }
.hn-more:hover { border-color: rgba(240,160,48,0.6); color: #f5d6a3; }
.hn-more i { transition: transform .2s; }
.hn-more-c { display: none; }
.hn-box.open .hn-more-o { display: none; }
.hn-box.open .hn-more-c { display: inline; }
.hn-box.open .hn-more i { transform: rotate(180deg); }
.hn-body { display: none; border-top: 1px solid rgba(255,255,255,0.07); padding: 8px 10px 10px; max-height: 46vh; overflow-y: auto; }
.hn-box.open .hn-body { display: block; }
.hn-list { display: none; flex-direction: column; gap: 4px; }
.hn-empty { display: none; color: #7f93a8; padding: 10px; text-align: center; }
.hn-box.tab-weekly .p-weekly.hn-list, .hn-box.tab-updates .p-updates.hn-list { display: flex; }
.hn-box.tab-weekly .p-weekly.hn-empty, .hn-box.tab-updates .p-updates.hn-empty { display: block; }
.hn-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; }
.hn-row:hover { background: rgba(255,255,255,0.04); }
.hn-date { flex: 0 0 92px; color: #9fb3c8; font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hn-tag { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: .64rem; line-height: 1.7; padding: 0 7px;
  border-radius: 8px; white-space: nowrap; color: var(--c, #9fb3c8); border: 1px solid color-mix(in srgb, var(--c, #9fb3c8) 45%, transparent);
  background: color-mix(in srgb, var(--c, #9fb3c8) 8%, transparent); }
.hn-tag.t-app { --c: #f0a030; }
.hn-tag.t-platform { --c: #4be9fa; }
.hn-tag.t-learn { --c: #b89cf0; }
.hn-tag.t-data { --c: #5b8def; }
.hn-tag.t-mobile { --c: #5fbf6a; }
.hn-tag.s-progress { --c: #f0a030; }
.hn-tag.s-planned { --c: #9fb3c8; }
.hn-sec { color: #9fb3c8; font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin: 6px 8px 2px; }
.hn-box.tab-updates .p-updates.hn-two { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(250px, 1fr); gap: 16px;
  align-items: start; }
.hn-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hn-col.side { border-left: 1px solid rgba(255,255,255,0.07); padding-left: 12px; position: sticky; top: 0; }
.hn-col.side .hn-text { padding-left: 10px; }
.hn-soon { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.hn-up { border-radius: 8px; }
.hn-up > summary { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; cursor: pointer; list-style: none; }
.hn-up > summary::-webkit-details-marker { display: none; }
.hn-up > summary:hover { background: rgba(255,255,255,0.04); }
.hn-up[open] { background: rgba(255,255,255,0.03); }
.hn-up.next .hn-title { color: #cfdcea; font-weight: 500; }
.hn-chev { flex: 0 0 auto; color: #7f93a8; font-size: .7rem; transition: transform .2s; }
.hn-up[open] .hn-chev { transform: rotate(180deg); }
.hn-text { padding: 0 10px 8px 110px; }
.hn-up.next .hn-text { padding-left: 10px; }
.hn-text p { margin: 0 0 6px; color: #e8e8e8; line-height: 1.55; font-size: .8rem; }
.hn-apps { display: flex; flex-wrap: wrap; gap: 6px; }
.hn-app { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,0.05); color: #e8e8e8; border: 1px solid rgba(240,160,48,0.40); font-size: .74rem; }
.hn-app:hover { background: rgba(240,160,48,0.16); }
.hn-app i { color: #f0a030; }
.ws-drawer.offcanvas { width: min(940px, 100vw) !important; }
.ws-drawer .offcanvas-body { padding: 8px 22px 24px; }
.ws-drawer .offcanvas-title { color: #f0a030; font-weight: 700; letter-spacing: .04em; }

@media (max-width: 760px) {
  .hn-bar { flex-wrap: wrap; }
  .hn-box.tab-updates .p-updates.hn-two { grid-template-columns: 1fr; }
  .hn-col.side { border-left: 0; padding-left: 0; position: static; }
  .hn-now { order: 3; flex-basis: 100%; }
  .hn-text { padding-left: 10px; }
  .hn-date { flex-basis: auto; }
  .ws-drawer .offcanvas-body { padding: 6px 14px 20px; }
  .ws-title { font-size: 26px; }
  .ws-lede { font-size: 16px; }
  .ws-h2 { font-size: 19px; }
  .ws-p { font-size: 15px; }
  .ws-article { padding: 4px 0 24px; }
  .ws-chart { padding: 6px 4px 8px; }
}
