/* ETHval News Impact v1.1 — styled to match the Valuation .metric-card system
   (same border, radius, padding, heading font, pill badges via --up-bg / --down-bg). */

/* ── Shared atoms ─────────────────────────────────────────── */
.up { color: var(--up); } .down { color: var(--down); }
.ni-ico { flex: none; display: block; }
.ni-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.5; white-space: nowrap; letter-spacing: .02em; }
.ni-pill.up { background: var(--up-bg); color: var(--up); }
.ni-pill.down { background: var(--down-bg); color: var(--down); }
.ni-pill.flat { background: var(--bg-subtle); color: var(--text-muted); }
.ni-dir { font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap; }
.ni-dir.flat, .ni-gauge-val.flat, .ni-chip-n.flat { color: var(--text-muted); }
.ni-seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-subtle); border-radius: var(--radius-sm); }
.ni-seg button { border: 0; background: transparent; color: var(--text-muted); font: var(--weight-medium) var(--text-xs) var(--font-mono); padding: 3px 8px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.ni-seg button.on { background: var(--bg-card); color: var(--accent); box-shadow: var(--shadow-sm); }
.ni-seg button:hover:not(.on) { color: var(--text); }

/* ── Strip (top of Valuation) = one metric-card ───────────── */
#news-impact-strip { margin: 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); display: flex; flex-direction: column; gap: 12px; transition: border-color .2s ease; min-width: 0; }
/* Same padding steps as .summary-valuation-box so the two boxes' text edges line up */
@media (max-width: 1000px) and (min-width: 601px) { #news-impact-strip { padding: 20px; } }
@media (max-width: 600px) { #news-impact-strip { padding: 16px; } }
.summary-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#news-impact-strip:hover { border-color: var(--text-muted); }
.ni-strip-msg { color: var(--text-muted); font-size: var(--text-sm); }
/* v2 strip: verdict → bull/bear tug bar → category drivers → biggest event */
.ni-v-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ni-v-head strong { font-family: var(--font-heading); font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
.ni-v-head span { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ni-v-main { display: flex; align-items: center; gap: 14px; cursor: help; }
.ni-v-score { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 34px; line-height: 1; font-weight: var(--weight-bold); letter-spacing: -1px; min-width: 2ch; }
.ni-v-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ni-v-text b { font-size: var(--text-sm); font-weight: var(--weight-semibold); align-self: flex-start; padding: 2px 9px; border-radius: var(--radius-full); }
.ni-v-text b.up { background: var(--up-bg); } .ni-v-text b.down { background: var(--down-bg); } .ni-v-text b.flat { background: var(--bg-subtle); color: var(--text-muted); }
.ni-v-text span { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.35; }
.ni-v-score.up, .ni-v-text b.up, .ni-tug-k .up, .ni-drv-n.up { color: var(--up); }
.ni-v-score.down, .ni-v-text b.down, .ni-tug-k .down, .ni-drv-n.down { color: var(--down); }
.ni-v-score.flat, .ni-drv-n.flat { color: var(--text-muted); }
.ni-tug { display: flex; flex-direction: column; gap: 5px; }
.ni-tug-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--bg-subtle); }
.ni-tug-bar .bu { background: var(--up); } .ni-tug-bar .be { background: var(--down); }
.ni-tug-k { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.ni-sec-k { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.ni-drvs { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--border-light); }
.ni-drv { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 3ch; align-items: center; gap: 10px; padding: 6px 6px; margin: 0 -6px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ni-drv:hover, .ni-drv.on { background: var(--bg-subtle); }
.ni-drv-name { display: flex; align-items: center; gap: 7px; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-drv-name i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ni-drv-bar { position: relative; display: flex; justify-content: center; height: 8px; }
.ni-drv-bar::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--border); }
.ni-drv-bar span { display: block; height: 100%; }
.ni-drv-bar .be { margin-left: auto; background: var(--down); border-radius: 3px 0 0 3px; }
.ni-drv-bar .bu { margin-right: auto; background: var(--up); border-radius: 0 3px 3px 0; }
.ni-drv-bar { justify-content: flex-start; }
.ni-drv-bar .be, .ni-drv-bar .bu { position: absolute; top: 0; bottom: 0; margin: 0; }
.ni-drv-bar .be { right: 50%; } .ni-drv-bar .bu { left: 50%; }
.ni-drv-n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--text-sm); font-weight: var(--weight-semibold); text-align: right; }
.ni-v-note { font-size: 11px; color: var(--text-muted); }
.ni-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ni-strip-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-strip-title strong { font-family: var(--font-heading); font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
.ni-strip-title span { font-size: var(--text-sm); color: var(--text-muted); }
.ni-gauge { display: grid; grid-template-columns: auto auto; grid-template-areas: "l v" "b c"; column-gap: 12px; row-gap: 4px; align-items: center; cursor: help; }
.ni-gauge-label { grid-area: l; font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.ni-gauge-val { grid-area: v; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: var(--weight-bold); letter-spacing: -.3px; text-align: right; white-space: nowrap; }
.ni-gauge-val small { font-family: var(--font-ui, inherit); font-size: var(--text-xs); font-weight: var(--weight-semibold); margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-full); vertical-align: 3px; letter-spacing: .02em; }
.ni-gauge-val.up small { background: var(--up-bg); } .ni-gauge-val.down small { background: var(--down-bg); } .ni-gauge-val.flat small { background: var(--bg-subtle); }
.ni-gauge-bar { grid-area: b; position: relative; width: 180px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down) 0%, var(--bg-subtle) 50%, var(--up) 100%); }
.ni-gauge-mid { position: absolute; left: 50%; top: -2px; width: 1px; height: 10px; background: var(--text-muted); }
.ni-gauge-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--text-muted); }
.ni-gauge-dot.up { border-color: var(--up); } .ni-gauge-dot.down { border-color: var(--down); }
.ni-gauge-count { grid-area: c; font-size: var(--text-xs); color: var(--text-muted); text-align: right; font-family: var(--font-mono); }

/* Category chips — same pill language as .metric-badge */
.ni-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ni-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--bg-card); color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.4; cursor: pointer; white-space: nowrap; font-family: inherit; transition: border-color .15s ease; }
.ni-chip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.ni-chip.empty { opacity: .5; }
.ni-chip.on { border-color: var(--accent); color: var(--text); background: var(--primary-light); }
.ni-chip:hover { border-color: var(--text-muted); }
.ni-chip-n { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-semibold); display: inline-flex; gap: 4px; }

/* Biggest event — reads like a card row, not a quote */
.ni-top { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 3px; align-items: center; text-align: left; padding: 9px 10px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-subtle); cursor: pointer; font-family: inherit; color: var(--text); width: 100%; }
.ni-top:hover { border-color: var(--text-muted); }
.ni-top-k { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.ni-top-t { grid-column: 1 / -1; font-family: var(--font-heading); font-size: var(--text-md); font-weight: var(--weight-semibold); line-height: 1.4; }
.ni-top-m { grid-column: 1 / -1; font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; }

/* ── Panel ────────────────────────────────────────────────── */
#news-impact-panel { margin: 0 0 26px; }
.ni-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ni-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ni-hint { font-size: var(--text-sm); color: var(--text-muted); margin: 0; flex: 1 1 320px; line-height: 1.5; }
.ni-panel-chips { margin-bottom: 10px; }
.ni-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.ni-chart-box { position: relative; height: 400px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); padding: 10px 8px 6px; }
.ni-list { height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; scroll-padding-top: 44px; }
.ni-empty { color: var(--text-muted); font-size: var(--text-sm); padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius-sm); text-align: center; }

/* Selected-bucket header (after tapping a chart marker) */
.ni-sel { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-card); font: var(--weight-semibold) var(--text-sm) var(--font-mono); color: var(--text); flex: none; }
.ni-sel-clear { border: 0; background: var(--bg-subtle); color: var(--text-secondary); font: var(--weight-medium) var(--text-xs) inherit; padding: 3px 8px; border-radius: var(--radius-full); cursor: pointer; }
.ni-sel-clear:hover { color: var(--text); }

/* Event card = .metric-card (1px border, 4px radius, 10/12 padding). Category shown as a dot, not a thick bar. */
.ni-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); padding: 10px 12px; cursor: pointer; flex: none; transition: border-color .2s ease, box-shadow .2s ease; }
.ni-card:hover { border-color: var(--text-muted); }
.ni-card.hl { border-color: var(--accent); }
.ni-card.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ni-card-top { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: var(--text-xs); color: var(--text-muted); }
.ni-date { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--text-secondary); }
.ni-cat { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.ni-cat i { width: 7px; height: 7px; border-radius: 50%; background: var(--cat); flex: none; }
.ni-hz { margin-left: auto; font-size: var(--text-xs); color: var(--text-muted); }
.ni-card-title { margin-top: 6px; font-family: var(--font-heading); font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); line-height: 1.45; }
.ni-card-mech { margin-top: 4px; font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.55; }
.ni-card-more { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: var(--text-sm); color: var(--text-body); line-height: 1.55; }
.ni-card.open .ni-card-more { display: block; }
.ni-card-more p { margin: 0 0 8px; }
.ni-metrics { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ni-metrics span { font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--radius-full); background: var(--primary-light); color: var(--primary); font-weight: var(--weight-medium); }
.ni-rxs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-family: var(--font-mono); font-size: var(--text-xs); }
.ni-rx-k { font-family: var(--font-ui, inherit); color: var(--text-muted); margin-right: 2px; }
.ni-rx { font-weight: var(--weight-semibold); padding: 2px 7px; border-radius: var(--radius-full); }
.ni-rx.up { background: var(--up-bg); } .ni-rx.down { background: var(--down-bg); }
.ni-src { font-size: var(--text-xs); color: var(--text-muted); }
.ni-src a { color: var(--accent); text-decoration: none; }
.ni-src a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .ni-grid { grid-template-columns: 1fr; }
  .ni-chart-box { height: 300px; }
  .ni-list { height: auto; max-height: 560px; }
}
@media (max-width: 520px) {
  .ni-strip-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .ni-gauge { grid-template-columns: 1fr auto; }
  .ni-gauge-bar { width: 100%; }
  .ni-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .ni-chips::-webkit-scrollbar { display: none; }
  .ni-tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .ni-chart-box { height: 270px; }
  .ni-hz { margin-left: 0; }
}

/* Touch targets (UX pass 2026-10-13): keep visuals, enlarge tap area on touch screens */
@media (pointer: coarse) {
  .ni-seg button { min-height: 32px; padding: 6px 12px; }
  .ni-chip { min-height: 32px; padding: 5px 12px; }
  .ni-drv { min-height: 36px; }
}

/* 영향 매트릭스 (카테고리 8 × 최근 4주) */
.ni-matrix { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm, 4px); background: var(--bg-card); padding: 14px; }
.ni-mx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.ni-mx-title { font-size: 13px; font-weight: 700; color: var(--text); }
.ni-mx-hint { font-size: 11.5px; color: var(--text-muted); flex: 1 1 260px; min-width: 0; }
.ni-wk-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--bg-card); color: var(--text); border-radius: 999px; padding: 4px 10px; font: 600 11px var(--font-mono); cursor: pointer; white-space: nowrap; min-height: 28px; }
.ni-wk-pill span { color: var(--text-secondary); }
.ni-mx-grid { display: grid; grid-template-columns: minmax(124px, 1.1fr) repeat(4, minmax(0, 1fr)); gap: 4px; }
.ni-mx-corner { min-height: 1px; }
.ni-mx-wk { display: flex; justify-content: center; flex-wrap: wrap; font: 600 11px var(--font-mono); color: var(--text-muted); text-align: center; padding: 2px 0 4px; line-height: 1.3; }
.ni-mx-wk.on { color: var(--text); }
.ni-mx-cat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); min-width: 0; line-height: 1.25; }
.ni-mx-cat i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ni-mx-cat span { min-width: 0; overflow-wrap: anywhere; }
.ni-mx-cell { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 4px; border: 1px solid var(--border-light); border-radius: 3px; background: var(--bg-subtle); color: var(--text); font-family: var(--font-mono); cursor: pointer; min-width: 0; }
.ni-mx-cell b { font-size: 13px; font-weight: 700; }
.ni-mx-cell b { color: var(--text); }
.ni-mx-cell small { font-size: 11px; color: var(--text); font-weight: 600; }
.ni-mx-cell.empty { cursor: default; color: var(--text-muted); opacity: .55; background: transparent; border-style: dashed; }
.ni-mx-cell.empty small { display: none; }
.ni-mx-cell:not(.empty):hover { border-color: var(--text-muted); }
.ni-mx-cell.on { outline: 2px solid var(--text); outline-offset: -1px; }
.ni-mx-big { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--text); opacity: .7; }
@media (max-width: 520px) {
  .ni-matrix { padding: 12px 8px; }
  .ni-wk-pill { margin-left: 0; }
  .ni-mx-grid { grid-template-columns: minmax(78px, 1fr) repeat(4, minmax(0, 1fr)); gap: 3px; }
  .ni-mx-wk { flex-direction: column; font-size: 11px; }
  .ni-mx-cat { font-size: 11px; gap: 4px; }
  .ni-mx-cell { flex-direction: column; gap: 0; min-height: 44px; padding: 3px 2px; }
  .ni-mx-cell b { font-size: 12.5px; }
}

/* 2026-10-13 matrix cell clarity: score big, count as "N건" muted, explicit legend */
.ni-mx-cell b { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.1; letter-spacing: -0.01em; }
.ni-mx-cell small { font-family: var(--font-ui); font-size: 11px; font-weight: 500; color: var(--text); opacity: .62; line-height: 1.2; }
.ni-mx-cell.empty b { font-weight: 400; }
.ni-mx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: 11.5px; color: var(--text-muted); }
.ni-lg-key { display: inline-flex; align-items: center; gap: 8px; }
.ni-lg-cell { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; padding: 3px 6px; border-radius: 3px; border: 1px solid var(--border-light); background: color-mix(in srgb, var(--up) 25%, var(--bg-card)); color: var(--text); }
.ni-lg-cell b { font-size: 13px; font-weight: 700; line-height: 1.1; }
.ni-lg-cell small { font-size: 10.5px; opacity: .62; }
.ni-lg-txt { display: inline-flex; flex-direction: column; gap: 1px; line-height: 1.35; }
.ni-lg-txt b { color: var(--text); font-weight: 700; }
.ni-lg-txt small { color: var(--text); opacity: .62; font-size: 11px; }
.ni-lg-row { display: inline-flex; align-items: center; gap: 6px; }
.ni-lg-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text); opacity: .7; }
.ni-lg-scale { width: 56px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, color-mix(in srgb, var(--down) 40%, var(--bg-card)), var(--bg-subtle), color-mix(in srgb, var(--up) 40%, var(--bg-card))); }
@media (max-width: 640px) {
  .ni-mx-cell b { font-size: 14px; }
  .ni-mx-cell small { font-size: 11px; }
  .ni-mx-legend { gap: 8px 14px; }
}

/* Metric card badge: news that moved this metric (last 30 days) */
.metric-info .ni-mbadge { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 3px 9px; min-height: 24px; border: 1px solid var(--border, rgba(100,116,139,.3)); border-radius: 999px; background: var(--bg-subtle, transparent); color: var(--text-secondary); font-size: 11px; font-weight: 600; line-height: 1.2; font-family: inherit; cursor: pointer; white-space: nowrap; max-width: 100%; }
.metric-info .ni-mbadge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent, #6366f1); flex: none; }
.metric-info .ni-mbadge:hover, .metric-info .ni-mbadge.on { border-color: var(--accent, #6366f1); color: var(--text); }
.metric-info .ni-mbadge:focus-visible { outline: 2px solid var(--accent, #6366f1); outline-offset: 2px; }

/* ── Upcoming scheduled events (FOMC · CPI · mainnet upgrade; first-party schedules only) ── */
.ni-up { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-light); }
.ni-up-i { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 4px 2px; color: var(--text); text-decoration: none; border-radius: 4px; }
.ni-up-i:hover { background: var(--bg-subtle); }
.ni-up-d { font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); }
.ni-up-d.soon { color: #d97706; }
.ni-up-n { font-size: var(--text-sm); line-height: 1.35; min-width: 0; }
.ni-up-n small { margin-left: 6px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ni-up-w { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ni-up-none { font-size: var(--text-sm); color: var(--text-muted); }
@media (max-width: 480px) {
  .ni-up { gap: 0; }
  .ni-up-i { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px; padding: 3px 0; }
  .ni-up-w { font-size: 11px; }
}
