/* /intel as a ledger (js/modules/IntelFeed.js): the dashboard's ranked list applied to intel,
   with tiles that filter, one row per update and a reading pane. Tokens and components come
   from tpm/tokens.css, tpm/bundle.css and tpm/site.css, as on the dashboard. */
body { margin: 0; min-height: 100vh; }
/* Zero-specificity resets, so every component rule wins over them. */
:where(.tpm) :where(h1, h2, h3, p, ul, dl, dd) { margin: 0; }
:where(.tpm) :where(ul) { padding: 0; list-style: none; }
:where(.tpm) :where(a) { color: inherit; }
html.d-locked { overflow: hidden; }

/* Earth tones mark the kind of update on its icon only; the words stay neutral, like the
   dashboard's airdrop status. */
:root, [data-theme="dark"], [data-theme="light"] {
  --tone-safety: var(--status-live); --tone-act: var(--status-speculative);
  --tone-rewards: var(--status-confirmed); --tone-info: var(--ink-3);
}
.ic { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; color: var(--tone-info); }
.ic svg { width: 16px; height: 16px; }
.ic--safety { color: var(--tone-safety); }
.ic--act { color: var(--tone-act); }
.ic--rewards { color: var(--tone-rewards); }

.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.x-follow svg { width: 13px; height: 13px; }
.site-footer .footer-nav a:last-child { color: var(--ink); }
/* The page also loads the dashboard's styles.css and sheet.css, so protocol links open the
   dashboard's own modal with its styling. These undo the few rules from those files that reach
   this page's own elements; revert drops only those, since tpm sets none of these properties. */
.site-footer { text-align: revert; color: revert; font-size: revert; letter-spacing: revert; }
.footer-nav { margin-bottom: revert; }
.footer-nav a { letter-spacing: revert; text-transform: revert; transition: revert; }
.footer-meta { letter-spacing: revert; text-transform: revert; opacity: revert; }
.footer-meta a { text-decoration: revert; }
.site-search input { padding: revert; }
.d-app .tpm-deadline time { white-space: nowrap; }
.num { font: 400 13px/20px var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.new-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; animation: none; }
.empty { padding: var(--space-7) var(--space-4); text-align: center; color: var(--ink-2); }
.empty b { display: block; font: 500 15px/22px var(--font-sans); color: var(--ink); }
.empty a { text-decoration: underline; text-underline-offset: 3px; }
.empty .tpm-btn { margin-top: var(--space-3); }

.d-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.d-tiles:empty, .d-pane:empty { display: none; }

/* Breaking: a strip above everything, shown only while a security incident is breaking. */
.d-breaking { display: grid; border: 1px solid color-mix(in srgb, var(--tone-safety) 55%, transparent); border-radius: var(--radius-2); background: color-mix(in srgb, var(--tone-safety) 12%, var(--surface-1)); overflow: hidden; }
.d-breaking:empty { display: none; }
.d-alert { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 2px var(--space-4); padding: var(--space-3) var(--space-5); color: var(--ink); text-decoration: none; }
.d-alert + .d-alert { border-top: 1px solid color-mix(in srgb, var(--tone-safety) 35%, transparent); }
.d-alert:hover { background: color-mix(in srgb, var(--tone-safety) 8%, transparent); }
.d-alert:focus-visible { outline-offset: -2px; }
.d-alert-tag { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/20px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--tone-safety); }
.d-alert-tag svg { width: 14px; height: 14px; }
.d-alert-text { font: 400 15px/20px var(--font-sans); }
.d-alert-text b { font-weight: 600; }
.d-alert-do { grid-column: 2; font: 400 13px/19px var(--font-sans); color: var(--ink-2); }
.d-group[data-tier="0"] .tpm-label { color: var(--tone-safety); }
.d-row--breaking { background: color-mix(in srgb, var(--tone-safety) 7%, transparent); }

/* Tiles: every update, then one per ranking tier. Each is also a filter. */
.d-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; }
.d-tile { position: relative; display: grid; gap: 4px; padding: var(--space-4) var(--space-5); border: 0; border-left: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.d-tile:first-child { border-left: 0; }
.d-tile:hover, .d-tile[aria-pressed="true"] { background: var(--surface-2); }
.d-tile:focus-visible { outline-offset: -2px; }
.d-tile .tpm-label { display: flex; align-items: center; gap: 6px; }
.d-tile strong { font: 300 32px/36px var(--font-sans); letter-spacing: -0.02em; }
.d-tile small { font: 400 12px/16px var(--font-sans); color: var(--ink-3); }
.d-tile[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent-line); }

/* Title bar: count, sort and layout */
.d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5); }
.d-bar h1 { font: 500 24px/30px var(--font-sans); letter-spacing: -0.01em; }
.d-bar .count { font: 400 12px/16px var(--font-mono); color: var(--ink-3); }
.d-stale { font-weight: 500; color: var(--tone-safety); }
.d-bar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-left: auto; }
.d-bar .tpm-select select, .d-bar .tpm-seg { height: 36px; }
.d-bar .tpm-seg { padding: 2px; }
.d-bar .tpm-seg button { height: 30px; }
.d-bar .tpm-seg button:disabled { opacity: .5; cursor: default; }
.d-how { flex: 1 1 100%; }
.d-how summary { width: max-content; max-width: 100%; font: 400 13px/20px var(--font-sans); color: var(--ink-2); cursor: pointer; }
.d-how summary:hover { color: var(--ink); }
.d-how p { max-width: 80ch; margin-top: var(--space-2); font: 400 14px/21px var(--font-sans); color: var(--ink-2); }

/* Ledger: one row per update */
.d-split { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: var(--space-4); align-items: start; }
.d-list { min-width: 0; }
.d-group { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-2); border-top: 1px solid var(--line); font: inherit; }
.d-group .count { font: 400 11px/16px var(--font-mono); color: var(--ink-3); }
.d-group + .d-row { border-top: 0; }
.d-row { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) 118px 112px; align-items: center; column-gap: var(--space-3); min-height: 64px; padding: var(--space-2) var(--space-4); border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer; }
.d-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.d-row:focus-visible { outline-offset: -2px; }
.d-row[aria-current="true"] { background: var(--surface-2); }
.d-row[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent-line); }
.d-rank { font: 400 12px/20px var(--font-mono); color: var(--ink-3); text-align: right; }
.d-what { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: var(--space-3); min-width: 0; }
.d-what .tpm-logo-slot { grid-row: span 2; }
.d-name { display: flex; align-items: center; gap: 6px; min-width: 0; font: 500 14px/20px var(--font-sans); }
.d-name b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-title { font: 400 13px/18px var(--font-sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-row[aria-current="true"] .d-title { color: var(--ink); }
.d-when { justify-self: start; }
.d-when .tpm-deadline { height: 26px; font-size: 12px; }
.d-row .none { font: 400 12px/16px var(--font-mono); color: var(--ink-4); }
.d-vol { display: grid; justify-items: end; gap: 4px; }
.d-vol .num { font-size: 12px; line-height: 16px; }
.d-vol .tpm-ev { gap: 2px; }
.d-vol .tpm-ev span:nth-child(1) { width: 3px; height: 3px; }
.d-vol .tpm-ev span:nth-child(2) { width: 4px; height: 4px; }
.d-vol .tpm-ev span:nth-child(3) { width: 5px; height: 5px; }
.d-vol .tpm-ev span:nth-child(4) { width: 6px; height: 6px; }
.d-vol .tpm-ev span:nth-child(5) { width: 7px; height: 7px; }
.d-head { min-height: 36px; border-top: 0; cursor: default; }
.d-head:hover { background: none; }
.d-head > span { font: 500 11px/16px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.d-head > span:last-child { justify-self: end; }
.d-legend { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); font: 400 12px/18px var(--font-sans); color: var(--ink-3); }

/* Reading pane: the full record, its source and its post */
.d-pane { position: sticky; top: var(--space-4); max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
.d-detail { display: grid; gap: var(--space-4); padding: var(--space-5); }
.d-detail h2 { font: 400 26px/32px var(--font-sans); letter-spacing: -0.015em; }
.d-detail h2:focus { outline: none; }
.d-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 11px/16px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.d-kicker .tag-new { margin-left: 0; }
.d-who { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.d-who b { display: block; font: 500 15px/20px var(--font-sans); }
.d-who small { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font: 400 12px/16px var(--font-sans); color: var(--ink-3); }
.d-who small .tpm-status { font-size: 12px; line-height: 16px; }
.d-who:hover b { text-decoration: underline; text-underline-offset: 3px; }
.d-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-2); }
.d-facts > div { display: grid; align-content: start; gap: 4px; padding: var(--space-3); min-width: 0; }
.d-facts > div + div { border-left: 1px solid var(--line); }
.d-facts dt { font: 500 10px/14px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.d-facts dd { font: 400 14px/20px var(--font-mono); color: var(--ink); }
.d-facts dd small { display: block; font: 400 11px/15px var(--font-sans); color: var(--ink-3); }
.d-countdown { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.d-countdown small { font: 400 12px/16px var(--font-sans); color: var(--ink-3); }
.d-sum { font: 400 15px/23px var(--font-sans); color: var(--ink-2); }
.d-todo { display: grid; gap: 6px; padding: var(--space-4); border-radius: var(--radius-2); background: var(--ink); color: var(--on-ink); }
.d-todo .tpm-label { color: inherit; opacity: .62; }
.d-todo p:last-child { font: 500 15px/22px var(--font-sans); }
.d-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.d-actions .tpm-btn svg { width: 13px; height: 13px; }
.d-sub { display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.d-sub li a { display: grid; gap: 2px; padding: var(--space-2) 0; text-decoration: none; }
.d-sub li a b { font: 500 13px/18px var(--font-sans); }
.d-sub li a span { font: 400 12px/16px var(--font-sans); color: var(--ink-3); }
.d-sub li a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.d-post { padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-2); background: var(--ground); white-space: pre-wrap; overflow-wrap: anywhere; font: 400 13px/19px var(--font-sans); color: var(--ink-2); }
.d-post-link { color: var(--accent-text); }
.d-close { display: none; }

@media (max-width: 1180px) {
  .d-split { grid-template-columns: minmax(0, 1fr) 400px; }
  .d-row { grid-template-columns: 22px minmax(0, 1fr) 112px; }
  .d-row .d-vol, .d-head > span:last-child { display: none; }
}
@media (max-width: 900px) {
  /* Five tiles as three over two */
  .d-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .d-tile { grid-column: span 2; }
  .d-tile:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--line); }
  .d-tile:nth-child(4) { border-left: 0; }
  .d-split { grid-template-columns: minmax(0, 1fr); }
  /* The pane becomes a bottom sheet. Closed, it leaves the tab order once it has slid away. */
  .d-pane { position: fixed; inset: auto 0 0 0; z-index: 50; max-height: 88vh; border-radius: var(--radius-2) var(--radius-2) 0 0; background: var(--surface-1); box-shadow: var(--shadow-overlay); transform: translateY(105%); visibility: hidden; transition: transform .22s ease-out, visibility 0s linear .22s; }
  .d-pane.is-open { transform: none; visibility: visible; transition: transform .22s ease-out; }
  .d-close { display: inline-flex; position: sticky; top: var(--space-3); z-index: 1; justify-self: end; margin-bottom: -48px; background: var(--surface-1); }
  .d-kicker { padding-right: 44px; }
  .d-scrim { position: fixed; inset: 0; z-index: 49; background: var(--scrim); }
  .d-row[aria-current="true"], .d-row[aria-current="true"]:hover { background: none; }
  .d-row[aria-current="true"]::before { display: none; }
  .d-row[aria-current="true"] .d-title { color: var(--ink-2); }
}
@media (max-width: 760px) {
  .d-alert { grid-template-columns: minmax(0, 1fr); padding: var(--space-3) var(--space-4); }
  .d-alert-do { grid-column: 1; }
  .d-tile { padding: var(--space-3); }
  .d-tile small { display: none; }
  .d-tile strong { font-size: 24px; line-height: 28px; }
  .d-tile .tpm-label { font-size: 10px; letter-spacing: .08em; }
  .d-tile .tpm-label .ic { display: none; }
  .d-bar { padding: var(--space-3) var(--space-4); }
  .d-bar-controls { margin-left: 0; width: 100%; }
  .d-bar .tpm-select { flex: 1; }
  .d-bar .tpm-select select { width: 100%; }
  .d-row { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-3) var(--space-4); }
  .d-rank, .d-head { display: none; }
  .d-what { align-items: start; }
  .d-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .d-when .none { display: none; }
  .d-detail h2 { font-size: 22px; line-height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-pane, .d-pane.is-open { transition: none; }
}
