.credit-dashboard {
  --danger: #ad3f45;
  --danger-soft: color-mix(in srgb, var(--danger) 9%, var(--panel));
  --priority: #d06a35;
  --priority-soft: color-mix(in srgb, var(--priority) 12%, var(--panel));
}

:root[data-theme="dark"] .credit-dashboard {
  --danger: #f08086;
  --priority: #ff9a63;
}

.credit-dashboard .topbar {
  margin-bottom: 18px;
}

.text-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.text-button:hover,
.vote-button:hover {
  border-color: var(--line-strong);
}

.sidebar-privacy {
  position: absolute;
  inset: auto 14px 18px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--sidebar-panel);
}

.sidebar-privacy strong,
.sidebar-privacy span {
  display: block;
}

.sidebar-privacy strong {
  color: #f4f7f4;
  font-size: 12px;
}

.sidebar-privacy span {
  margin-top: 5px;
  color: var(--sidebar-muted);
  font-size: 11px;
  line-height: 1.45;
}

.access-state {
  min-height: 470px;
}

.skeleton {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--soft) 20%, var(--panel) 45%, var(--soft) 70%);
  background-size: 200% 100%;
}

.skeleton-wide {
  min-height: 250px;
  margin-bottom: 10px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: skeleton-shift 1.4s ease-in-out infinite; }
}

@keyframes skeleton-shift {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.unlock-panel {
  width: min(560px, 100%);
  margin: 54px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.unlock-panel h2 {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.unlock-panel > p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.unlock-form {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.unlock-form label {
  font-size: 12px;
  font-weight: 800;
}

.unlock-form input {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--soft);
  color: var(--ink);
}

.unlock-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  margin-top: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 850;
}

.unlock-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.news-panel {
  margin-bottom: 24px;
}

.news-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.news-heading h2 {
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.news-heading p {
  max-width: 62ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.news-meta {
  flex: 0 0 auto;
  text-align: right;
}

.news-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.story-card {
  min-width: 0;
  min-height: 230px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: 10px;
  padding: 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.story-card[data-priority="act-now"] {
  border-top-color: var(--danger);
  background: linear-gradient(180deg, var(--danger-soft), var(--panel) 48%);
}

.story-card[data-priority="high"] {
  border-top-color: var(--priority);
  background: linear-gradient(180deg, var(--priority-soft), var(--panel) 48%);
}

.story-card[data-priority="watch"] {
  border-top-color: var(--accent);
}

.story-card > header,
.story-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-rank {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.priority-label {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.015em;
}

[data-priority="act-now"] .priority-label {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--danger);
}

[data-priority="high"] .priority-label {
  border-color: color-mix(in srgb, var(--priority) 50%, var(--line));
  color: var(--priority);
}

.story-category {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.story-copy h3 {
  font-size: clamp(17px, 1.55vw, 23px);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.story-source {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-underline-offset: 3px;
}

.story-source:hover { color: var(--accent-strong); }

.vote-group {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}

.vote-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
}

.vote-button[data-vote="neutral"] {
  font-size: 21px;
  line-height: 0;
}

.vote-button[aria-pressed="true"][data-vote="up"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.vote-button[aria-pressed="true"][data-vote="neutral"] {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--muted) 12%, var(--panel));
  color: var(--ink);
}

.vote-button[aria-pressed="true"][data-vote="down"] {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.vote-button:disabled { cursor: wait; opacity: 0.55; }

.vote-status {
  min-height: 18px;
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.story-empty {
  grid-column: 1 / -1;
  min-height: 160px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.stats-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.snapshot-strip {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.9fr 0.9fr;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.snapshot-strip > div {
  min-width: 0;
  min-height: 112px;
  padding: 15px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: space-between;
}

.snapshot-strip > div:last-child { border-right: 0; }

.snapshot-strip span,
.snapshot-strip small {
  color: var(--muted);
  font-size: 11px;
}

.snapshot-strip span { font-weight: 800; }

.snapshot-strip strong {
  margin: 9px 0 6px;
  font-size: clamp(27px, 3vw, 42px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.rewards-panel,
.dashboard-split,
.history-panel { margin-bottom: 10px; }

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(125px, auto);
  gap: 8px;
}

.reward-card {
  min-width: 0;
  grid-column: span 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
  display: grid;
  align-content: space-between;
}

.reward-card.featured {
  grid-column: span 3;
  min-height: 150px;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: var(--accent-soft);
}

.reward-card span,
.reward-card small { color: var(--muted); }

.reward-card span { font-size: 11px; font-weight: 800; }

.reward-card strong {
  display: block;
  margin: 16px 0 7px;
  font-size: clamp(29px, 4vw, 54px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.reward-card:not(.featured) strong { font-size: clamp(26px, 3vw, 39px); }
.reward-card small { font-size: 10px; line-height: 1.4; }

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
}

.fee-list { display: grid; gap: 8px; }

.fee-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--soft);
}

.fee-row[data-intent="close"] {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: var(--danger-soft);
}

.fee-date {
  border-right: 1px solid var(--line);
  padding-right: 11px;
  text-align: center;
}

.fee-date strong,
.fee-date span,
.fee-copy strong,
.fee-copy small,
.fee-amount strong,
.fee-amount span { display: block; }

.fee-date strong { font-size: 25px; line-height: 1; }
.fee-date span { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.fee-copy > strong { font-size: 13px; }
.fee-copy p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.fee-copy small { margin-top: 5px; color: var(--ink); font-size: 10px; }
.fee-amount { text-align: right; white-space: nowrap; }
.fee-amount strong { font-size: 18px; }
.fee-amount span { margin-top: 4px; color: var(--muted); font-size: 10px; }

.compact-health {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 8px;
}

.score-block {
  min-height: 180px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  padding: 14px;
  background: var(--accent-soft);
  display: grid;
  align-content: space-between;
}

.score-block span,
.score-block small { color: var(--muted); }
.score-block span { font-size: 11px; font-weight: 800; }
.score-block strong { font-size: clamp(50px, 6vw, 76px); line-height: 0.82; letter-spacing: -0.065em; }
.score-block small { font-size: 11px; line-height: 1.4; }

.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.health-stat {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--soft);
}

.health-stat span,
.health-stat small { display: block; color: var(--muted); }
.health-stat span { font-size: 10px; }
.health-stat strong { display: block; margin: 8px 0 4px; font-size: 20px; line-height: 1.05; letter-spacing: -0.03em; }
.health-stat small { font-size: 9px; line-height: 1.35; }

.credit-table { min-width: 900px; }

.privacy-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding: 18px 2px 2px;
  color: var(--muted);
  font-size: 11px;
}

.privacy-footer strong { color: var(--ink); }

@media (max-width: 1180px) {
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot-strip > div:nth-child(2) { border-right: 0; }
  .snapshot-strip > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 1020px) {
  .sidebar-privacy { position: static; margin-top: 10px; }
  .dashboard-split { grid-template-columns: 1fr; }
  .rewards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reward-card,
  .reward-card.featured { grid-column: span 1; }
}

@media (max-width: 720px) {
  .credit-dashboard .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .credit-dashboard .status-pill { grid-column: 1 / -1; justify-content: center; }
  .credit-dashboard .text-button { width: 100%; }
  .news-heading { align-items: flex-start; flex-direction: column; }
  .news-meta { text-align: left; }
  .story-grid,
  .skeleton-grid,
  .snapshot-strip,
  .rewards-grid,
  .compact-health,
  .health-grid { grid-template-columns: 1fr; }
  .story-card { min-height: 210px; }
  .snapshot-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .snapshot-strip > div:last-child { border-bottom: 0; }
  .fee-row { grid-template-columns: 58px minmax(0, 1fr); }
  .fee-amount { grid-column: 2; text-align: left; }
  .privacy-footer { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
