:root { --digest-width: 390px; }

.digest-drawer {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  width: var(--digest-width);
  z-index: 54;
  background: var(--surface-card);
  border-left: 1px solid var(--border-neutral);
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
}

body.has-digest-open .digest-drawer { transform: translateX(0); }

body.has-digest-open .tracker-main { margin-right: var(--digest-width); }

.digest-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  flex: 0 0 auto;
}

.digest-drawer-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-main); }

.digest-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint);
  display: flex;
  padding: 4px;
  border-radius: 6px;
}

.digest-drawer-close:hover { background: var(--surface-sunken); color: var(--text-main); }
.digest-drawer-close:focus-visible { outline: 2px solid var(--text-accent); outline-offset: 1px; }

.digest-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; }

.digest-axes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.digest-axis-link {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-neutral);
  color: var(--text-light);
  text-decoration: none;
}

.digest-axis-link:hover { background: var(--surface-sunken); color: var(--text-main); }

.digest-axis-link.is-current {
  background: var(--accent-quiet);
  border-color: var(--accent);
  color: var(--text-accent);
  font-weight: 600;
}

.digest-card {
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.digest-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.digest-card-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
}

.digest-card-subtitle { margin: 4px 0 0; font-size: 12px; color: var(--text-faint); }

.digest-card-rows { list-style: none; margin: 12px 0 0; padding: 0; }

.digest-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border-light);
}

.digest-card-row-label {
  font-size: 12.5px;
  color: var(--text-main);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.digest-card-row-label:hover { color: var(--text-accent); text-decoration: underline; }

.digest-card-row-meta { font-size: 11.5px; color: var(--text-faint); flex: 0 0 auto; }

.digest-card-empty,
.digest-panel-empty { margin: 10px 0 0; font-size: 12.5px; color: var(--text-faint); }

.digest-card-footnote { margin: 8px 0 0; font-size: 11px; color: var(--text-faint); }

.digest-card-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
  text-decoration: none;
}

.digest-card-link:hover { text-decoration: underline; }

.digest-drawer-scrim { display: none; }

@media (max-width: 900px) {
  :root { --digest-width: 100vw; }

  body.has-digest-open .tracker-main { margin-right: 0; }

  .digest-drawer { border-left: none; }

  .digest-drawer-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    z-index: 53;
  }

  body.has-digest-open .digest-drawer-scrim { opacity: 1; pointer-events: auto; }
}
