/* News panel (#39): the live ticker, market board, story feed and story pages; breaking-news takeover and flash. */
.panel-body.news { container-type: inline-size; }
.nw { display: grid; gap: 16px; min-width: 0; }
.nw p, .nw h2, .nw h3, .nw h4, .nw-page p, .nw-page h2, .nw-page h4, .nw-take p, .nw-take h2, .nw-take h4 { margin: 0; }
.nw .up, .nw-page .up { color: var(--good); } .nw .down, .nw-page .down { color: var(--stamp); } .nw .neutral { color: rgba(243,235,216,.7); }
.nw-head { display: flex; align-items: center; gap: 8px; }
.nw-head h3 { font-size: 20px; padding-top: 3px; flex: 1; }
.nw-head .live { background: var(--stamp); color: #fff; font-size: 15px; padding: 3px 7px 1px; border-radius: 4px; }
.nw-head .day { color: rgba(235,235,245,.6); font-size: 15px; }
/* The anchor stands behind the ticker at the header's right end; the tape (drawn after him) crops his shoulders. 16px is .nw's gap. */
.nw-head { position: relative; }
.nw-head .worker.anchor { right: calc(-1 * var(--wk-anchor-outset)); bottom: calc(-1 * (16px + var(--wk-anchor-hide))); width: var(--wk-anchor-width); height: var(--wk-anchor-height);
  clip-path: inset(0 0 var(--wk-anchor-hide) 0); }
html:not(.no-workers) .nw-head.has-worker .day { margin-right: var(--wk-anchor-room); }
/* the crawl */
.nw-tape { position: relative; z-index: 1; height: 34px; overflow: hidden; background: rgba(0,0,0,.55); border-top: 2px solid var(--accent); margin: 0 -16px; }
.nw-crawl { display: flex; width: max-content; animation: nw-crawl var(--dur, 40s) linear infinite; }
.nw-row { display: flex; gap: 22px; padding: 0 11px; align-items: center; height: 32px; flex: none; }
.nw-q { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.nw-q b { font-size: 16px; } .nw-q .num { font-size: 14px; }
@keyframes nw-crawl { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .nw-tape { overflow-x: auto; } .nw-crawl { animation: none; } .nw-crawl .nw-row + .nw-row { display: none; }
}
/* stories */
.nw-story { display: grid; gap: 8px; text-align: left; padding: 14px; border-radius: 10px; background: var(--paper); color: var(--ink); border: 1px solid rgba(243,235,216,.22); --k: var(--stamp); width: 100%; position: relative; overflow: hidden; }
.nw-story.markets { --k: var(--teal); } .nw-story.company { --k: var(--accent); } .nw-story.oddNews { --k: #B38CFF; }
.nw-story.lead::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k); }
.nw-story .hd { display: flex; align-items: center; gap: 8px; }
.nw-story .kind, .nw-meta .kind { font-size: 14px; padding: 3px 7px 1px; border-radius: 4px; color: var(--k); background: color-mix(in srgb, var(--k) 18%, transparent); }
.nw-story.breaking .kind { background: var(--stamp); color: #fff; }
.nw-story .day, .nw-meta .day { font-size: 12px; color: rgba(235,235,245,.6); }
.nw-story .mv { margin-left: auto; font-size: 13px; }
.nw-story .hl { font-size: 20px; line-height: 1.15; } .nw-story.lead .hl { font-size: 26px; }
.nw-story .bd { font: 400 13px/1.35 var(--round); color: rgba(235,235,245,.6); }
.nw-earlier { font-size: 18px; padding-top: 4px; }
/* board */
.nw-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
@container (min-width: 640px) { .nw-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nw-tile { display: grid; gap: 3px; text-align: left; padding: 10px; border-radius: 8px; background: rgba(15,42,73,.6); color: var(--ink); min-width: 0; }
.nw-tile .top { display: flex; justify-content: space-between; align-items: center; } .nw-tile .top b { font-size: 17px; padding-top: 2px; }
.nw-you { font-size: 11px; color: var(--good); }
.nw-tile .nm { font-size: 11px; color: rgba(235,235,245,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-tile .rv { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-tile .px { display: flex; justify-content: space-between; align-items: baseline; } .nw-tile .px b { font-size: 16px; } .nw-tile .px .num { font-size: 13px; }
.nw-tile .tr { display: flex; gap: 4px; align-items: center; font: 600 11px/1 var(--round); color: var(--accent); }
.nw-spark { width: 100%; height: 22px; } .nw-spark polyline { stroke: var(--stamp); } .nw-spark.up polyline { stroke: var(--good); }
.nw-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 12px; line-height: 1; }
.nw-emoji { display: inline-block; line-height: 1; }
/* story page */
.nw-page { display: grid; gap: 16px; min-width: 0; }
.nw-meta { display: flex; align-items: center; gap: 8px; } .nw-meta .kind { color: var(--accent); background: rgba(242,165,65,.2); }
.nw-page .hl { font-size: 32px; line-height: 1.1; } .nw-page .bd { font-size: 16px; line-height: 1.4; }
.nw-page .card h4 { font-size: 17px; } .nw-page .card p { font-size: 14px; }
.nw-mkt { display: flex; justify-content: space-between; align-items: center; } .nw-mkt small { font-size: 12px; } .nw-mkt b { font-size: 20px; }
.nw-open { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; font-size: 14px; justify-self: start; }
.nw-row2 { display: flex; align-items: center; gap: 8px; text-align: left; padding: 10px; border-radius: 10px; background: var(--paper); color: var(--ink); width: 100%; }
.nw-row2 > span:first-child { flex: 1; display: grid; gap: 3px; } .nw-row2 b { font-size: 14px; } .nw-row2 small { font-size: 11px; color: rgba(235,235,245,.6); }
/* breaking news */
.nw-kicker { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--k, var(--stamp)); color: #fff; }
.nw-kicker .din { font-size: 19px; padding-top: 3px; } .nw-kicker .mnn { margin-left: auto; font-size: 16px; padding: 2px 6px 0; background: rgba(255,255,255,.2); border-radius: 4px; }
.nw-kicker .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: nw-pulse 1.4s ease-in-out infinite alternate; }
@keyframes nw-pulse { to { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .nw-kicker .dot { animation: none; } }
.nw-take { --k: var(--stamp); --t: var(--stamp); width: min(560px, 100%); margin: auto; border-radius: 22px; overflow: hidden; border: 2px solid var(--t); box-shadow: 0 10px 40px rgba(0,0,0,.5); background: var(--paper); animation: nw-in .35s ease-out; }
.nw-take.good { --k: #34C759; --t: #34C759; }
@keyframes nw-in { from { opacity: 0; transform: translateY(30px) scale(.9); } }
.nw-tbody { display: grid; gap: 14px; padding: 18px; justify-items: stretch; }
.nw-top { display: flex; gap: 14px; align-items: flex-start; } .nw-top small { font-size: 12px; color: rgba(235,235,245,.6); } .nw-top h2 { font-size: 27px; line-height: 1.1; }
.nw-badge { position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: var(--t); background: color-mix(in srgb, var(--t) 16%, transparent); }
.nw-badge .fac { position: absolute; right: -4px; bottom: -4px; line-height: 0; }
.nw-take .det { font: 400 16px/1.4 var(--round); }
.nw-effects { display: grid; gap: 7px; padding: 12px; border-radius: 10px; background: rgba(15,42,73,.6); } .nw-effects h4 { font-size: 16px; color: var(--accent); }
.nw-fx { display: flex; align-items: center; gap: 8px; font-size: 14px; } .nw-fx .tx { flex: 1; } .nw-fx .pic { width: 20px; display: grid; place-items: center; } .nw-fx b { font-size: 16px; }
.nw-fx.good { color: #34C759; } .nw-fx.bad { color: var(--stamp); }
.nw-rival { display: flex; gap: 10px; align-items: center; color: rgba(235,235,245,.6); } .nw-rival b { display: block; color: var(--ink); font-size: 14px; } .nw-rival small { font-size: 12px; }
.nw-btns { display: flex; gap: 10px; } .nw-btns button { flex: 1; padding: 13px; border-radius: 999px; font-weight: 600; font-size: 16px; }
.nw-btns .secondary { background: rgba(255,255,255,.14); color: var(--accent); } .nw-btns .bigbtn { width: auto; font-size: 16px; padding: 13px; }
.sheetwrap.full .panel-body:has(.nw-take) { display: grid; align-content: center; }
/* The card floats over the game, dimmed black at 60% behind it (iOS NewsTakeover), not on a full-screen sheet. */
.sheetwrap.full:has(.nw-take) { background: rgba(0,0,0,.6); }
.sheetwrap.full .formsheet:has(.nw-take) { background: none; box-shadow: none; }
.nw-flash { position: fixed; z-index: 12; top: calc(env(safe-area-inset-top) + 70px); left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 32px));
  --k: #34C759; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--k); box-shadow: 0 5px 18px rgba(0,0,0,.35); text-align: left; color: #fff; background: var(--paper); animation: nw-drop .4s ease-out; }
.nw-flash.bad { --k: var(--stamp); }
.nw-flash .nw-kicker { padding: 5px 12px; } .nw-flash .nw-kicker .din { font-size: 14px; padding-top: 2px; } .nw-flash .nw-kicker .mnn { font-size: 12px; }
.nw-flash .fb { display: flex; align-items: center; gap: 10px; padding: 9px 12px; } .nw-flash .tx { flex: 1; display: grid; gap: 1px; }
.nw-flash small { font-size: 11px; color: rgba(235,235,245,.6); } .nw-flash b { font-size: 18px; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes nw-drop { from { opacity: 0; transform: translate(-50%, -20px); } }
