/* =====================================================================
   Tiltless — News page (live feed + economic calendar)
   ===================================================================== */
.nr { display: flex; flex-direction: column; gap: 14px; }

/* ---------- top bar ---------- */
.nr-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nr-live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: rgba(242, 54, 69, 0.1); border: 1px solid rgba(242, 54, 69, 0.3); font-size: 12px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nr-live b { color: #f87171; letter-spacing: .08em; font-size: 11.5px; }
.nr-live.stale { background: var(--surface-2); border-color: var(--border); }
.nr-live.stale b { color: var(--text-muted); }
.nr-live.stale .nr-dot { background: var(--text-muted); }
.nr-live.stale .nr-dot::after { display: none; }
.nr-dot { width: 8px; height: 8px; border-radius: 50%; background: #f23645; position: relative; flex: none; }
.nr-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: ping 1.6s ease-out infinite; }
.nr-dot.sm { width: 7px; height: 7px; margin-right: 8px; display: inline-block; vertical-align: middle; }
.nr-search { flex: 1; min-width: 200px; }
.nr-ff { text-decoration: none; white-space: nowrap; }
#nr-refresh.spinning { animation: spin .6s linear infinite; }

/* ---------- currency filters ---------- */
.nr-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nr-filters .fchip .flag { font-size: 13px; margin-right: 2px; }
.nr-filters .fchip.mine:not(.on) { border-color: rgba(251, 191, 36, 0.35); }
.nr-my.on { background: rgba(251, 191, 36, 0.14); color: var(--amber); border-color: rgba(251, 191, 36, 0.45); }
.nr-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }

/* ---------- next high-impact ---------- */
.nr-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 22px; align-items: center; padding: 16px 20px;
  border-color: rgba(242, 54, 69, 0.35); background: linear-gradient(110deg, rgba(242, 54, 69, 0.13), var(--glass, var(--surface)) 55%); animation: rise .45s var(--ease-out) both; }
.nr-next[hidden] { display: none; }
.nr-next-lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f87171; }
.nr-next-ev { font-size: 19px; font-weight: 700; margin: 6px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nr-next-ev .flag { font-size: 20px; }
.nr-next-ev span:last-child { font-weight: 600; }
.nr-next-meta { font-size: 12.5px; color: var(--text-dim); }
.nr-next.calm { border-color: var(--glass-border, var(--border)); background: var(--glass, var(--surface)); padding: 12px 18px; }
.nr-next.calm .nr-next-lbl { color: var(--text-muted); }
.nr-next.calm .nr-next-meta { margin-top: 4px; }
.nr-next-meta b { color: var(--text); }
.nr-next-cd { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #f87171; text-shadow: 0 0 24px rgba(242, 54, 69, .35); }
.nr-next-then { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim); }
.nr-next-then > span { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); align-self: center; }
.nr-next-then .flag { margin-right: 4px; }
.nr-next-then small { color: var(--text-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.nr-switch { display: none; }
.nr-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.nr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.nr-head h3 { font-size: 16px; display: flex; align-items: center; }
.nr-src { margin-top: 12px; line-height: 1.45; }

/* ---------- live feed ---------- */
.nr-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.nr-tabbtn { padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, color .15s, border-color .15s; }
.nr-tabbtn small { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.nr-tabbtn:hover { color: var(--text); }
.nr-tabbtn.on { background: var(--purple-soft); color: var(--purple); border-color: rgba(var(--ac-rgb), .45); }
.nr-tabbtn.on small { color: inherit; opacity: .8; }
.nr-scroll { position: relative; overflow-y: auto; margin: 0 -8px; padding: 0 8px; overscroll-behavior: contain; }
.nr-newpill { position: sticky; top: 6px; z-index: 3; display: block; margin: 0 auto 6px; padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--purple), var(--accent-deep)); box-shadow: 0 8px 20px -8px rgba(var(--ac-rgb), .9); animation: pop .3s var(--ease-out) both; }
.nr-newpill[hidden] { display: none; }
.nr-bucket { position: sticky; top: 0; z-index: 2; padding: 8px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  background: linear-gradient(var(--surface) 70%, transparent); }
[data-theme="light"] .nr-bucket { background: linear-gradient(#fff 70%, transparent); }
.nr-sq { display: grid; grid-template-columns: 44px auto minmax(0, 1fr) auto; align-items: baseline; gap: 4px 10px; padding: 8px 8px; margin: 0 -8px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13.5px; line-height: 1.4; border-bottom: 1px solid var(--border); transition: background-color .15s; }
.nr-sq:hover { background: rgba(255, 255, 255, 0.035); }
[data-theme="light"] .nr-sq:hover { background: rgba(15, 23, 42, 0.035); }
.nr-sq time { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.nr-sq .nr-sq-t { grid-column: 3; font-weight: 500; }
.nr-sq:not(.live) .nr-sq-t { grid-column: 2 / 4; }
.nr-sq .nr-tag { grid-column: 4; }
.nr-sq.live .nr-sq-t { font-weight: 650; }
.nr-livetag { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: #fff; background: #f23645; padding: 1px 5px; border-radius: 4px; align-self: center; }
.nr-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); margin-left: 4px; white-space: nowrap; }
.nr-art { display: flex; gap: 14px; padding: 12px 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border); transition: background-color .15s; }
.nr-art:hover { background: rgba(255, 255, 255, 0.03); }
[data-theme="light"] .nr-art:hover { background: rgba(15, 23, 42, 0.03); }
.nr-art-body { flex: 1; min-width: 0; }
.nr-art h4 { font-size: 14.5px; line-height: 1.38; margin: 4px 0 4px; color: var(--text); }
.nr-art p { font-size: 12.5px; line-height: 1.5; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nr-art img { width: 108px; height: 72px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.nr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.nr-pub { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 5px; color: var(--text-dim); background: var(--surface-2); }
.nr-meta .nr-pub { margin: 0; }
.nr-pub.fx { color: #22D3EE; background: rgba(var(--ac2-rgb), .12); }
.nr-pub.mk { color: #a78bfa; background: rgba(167, 139, 250, .14); }
.nr-pub.an { color: #34d399; background: rgba(52, 211, 153, .12); }
.nr-pub.cb { color: #fbbf24; background: rgba(251, 191, 36, .13); }
.nr-sq.fresh, .nr-art.fresh { animation: nrFresh 3.5s ease-out both; }
@keyframes nrFresh { 0% { background: rgba(var(--ac-rgb), .22); box-shadow: inset 3px 0 0 var(--accent-2); } 100% { background: transparent; box-shadow: inset 3px 0 0 transparent; } }

/* ---------- calendar ---------- */
.nr-imps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.nr-impbtn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); opacity: .6; transition: opacity .15s, color .15s; }
.nr-impbtn.on { opacity: 1; color: var(--text); }
.nr-imp { display: inline-block; width: 9px; height: 13px; border-radius: 2px; flex: none; background: var(--text-muted); }
.nr-imp.high { background: #f23645; box-shadow: 0 0 8px rgba(242, 54, 69, .45); }
.nr-imp.medium { background: #ff9800; }
.nr-imp.low { background: #fbd34d; }
.nr-imp.holiday { background: #9ca3af; }
.nr-imp.pulse { animation: nrPulse 1.6s ease-in-out infinite; }
@keyframes nrPulse { 50% { opacity: .45; } }
.nr-days { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.nr-days-row { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.nr-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11px; color: var(--text-dim); transition: border-color .15s, background-color .15s, transform .12s; }
.nr-day b { font-size: 15px; color: var(--text); }
.nr-day i { font-style: normal; color: #f23645; font-size: 8px; letter-spacing: 1px; min-height: 11px; line-height: 11px; }
.nr-day i em { font-style: normal; color: var(--text-muted); font-size: 9.5px; letter-spacing: 0; }
.nr-day.empty { opacity: .45; }
.nr-day.today { border-color: rgba(var(--ac-rgb), .55); }
.nr-day.on { background: var(--purple-soft); border-color: var(--purple); }
.nr-day:active { transform: scale(.96); }
.nr-wk { flex: none; }
.nr-events { display: flex; flex-direction: column; }
.nr-dayhead { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 2px 6px; font-size: 12px; font-weight: 700; color: var(--text-dim); border-bottom: 1px solid var(--border-strong); background: var(--surface); z-index: 1; }
.nr-dayhead.today { color: var(--purple); }
.nr-dayhead span { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-weight: 600; }
.nr-ev { display: grid; grid-template-columns: 56px 62px 12px minmax(0, 1fr) 64px 64px; align-items: center; gap: 8px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13px; animation: rise .35s var(--ease-out) both; }
.nr-ev.past { opacity: .5; }
.nr-ev.soon { background: linear-gradient(90deg, rgba(var(--ac-rgb), .09), transparent 70%); }
.nr-ev.soon.imp-high { background: linear-gradient(90deg, rgba(242, 54, 69, .12), transparent 70%); }
.nr-ev.mine { box-shadow: inset 2px 0 0 var(--amber); }
.nr-ev.imp-holiday { background: rgba(156, 163, 175, .07); }
.nr-ev-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; color: var(--text-dim); line-height: 1.2; }
.nr-ev-time small { font-size: 10.5px; font-weight: 700; color: var(--accent-2); }
.nr-ev.imp-high .nr-ev-time small { color: #f87171; }
.nr-ev-ccy { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 5px; }
.nr-ev-ccy .flag { font-size: 13px; }
.nr-ev-name { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.nr-ev.imp-high .nr-ev-name { font-weight: 650; }
.nr-ev-num { font-size: 12px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nr-ev-num small { color: var(--text-muted); margin-right: 4px; font-size: 10px; }
/* When the calendar column itself is narrow (side-by-side layout on ~1100–1400px screens),
   use the compact row (forecast/previous under the name) instead of squeezing the name
   until it spills into the forecast column. (Must come after the base .nr-ev-num rule.) */
.nr-cal { container: nrcal / inline-size; }
@container nrcal (max-width: 470px) {
  .nr-ev { grid-template-columns: 48px 54px 10px minmax(0, 1fr); row-gap: 2px; }
  .nr-ev-num { grid-column: 4; text-align: left; display: inline; }
}
.nr-nowline { position: relative; display: flex; align-items: center; margin: 4px 0; height: 18px; }
.nr-nowline::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, var(--accent-2), transparent); }
.nr-nowline span { position: relative; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--accent-2); background: var(--surface); padding-right: 8px; text-transform: uppercase; }

/* ---------- mobile ---------- */
@media (max-width: 1100px) {
  .nr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nr-switch { display: flex; align-self: stretch; }
  .nr-switch button { flex: 1; padding: 8px; }
  .nr-grid[data-mv="news"] .nr-cal, .nr-grid[data-mv="cal"] .nr-feed { display: none; }
  .nr-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .nr-filters::-webkit-scrollbar { display: none; }
  .nr-filters .fchip { flex: none; }
  .nr-search { flex: 1 1 100%; order: 3; }
  .nr-next { grid-template-columns: 1fr; padding: 14px 16px; }
  .nr-next-cd { font-size: 28px; }
  .nr-ev { grid-template-columns: 48px 54px 10px minmax(0, 1fr); row-gap: 2px; }
  .nr-ev-num { grid-column: 4; text-align: left; display: inline; }

  .nr-art img { width: 84px; height: 60px; }
  .nr-sq { grid-template-columns: 40px auto minmax(0, 1fr); }
  .nr-sq .nr-tag { display: none; }
}
