/* Feed Mode — one-link-at-a-time triage view. Reuses the app's existing
   glass/panel/chip/pill-btn vocabulary (tokens.css, glass.css) rather than
   introducing a second design system. */

.feed-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.feed-entry-btn:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-muted));
}

.feed-mode {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 120px);
}

.feed-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feed-topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.feed-title {
  font-weight: 650;
  letter-spacing: 0.02em;
}

.feed-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.feed-back span,
.feed-exit span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feed-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.feed-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.feed-empty-state,
.feed-end-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 40px;
}

.feed-end-state h3 {
  margin: 0;
  color: var(--text);
}

.feed-stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: stretch;
}

.feed-preview-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.feed-preview-card {
  border-radius: var(--radius-lg);
  min-height: 320px;
  max-height: 64vh;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.feed-preview-image {
  width: 100%;
  height: 100%;
  max-height: 56vh;
  object-fit: contain;
  background: var(--surface-muted);
}

.feed-preview-live-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  align-self: stretch;
}

.feed-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.feed-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface-muted);
  pointer-events: none;
}

.feed-preview-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: feed-preview-spin 700ms linear infinite;
}

@keyframes feed-preview-spin {
  to { transform: rotate(360deg); }
}

.feed-preview-fallback-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
}

.feed-preview-image-fallback {
  max-height: 56vh;
}

.feed-preview-fallback-badge {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--glass-bg-strong, rgba(0, 0, 0, 0.55));
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.feed-preview-fallback,
.feed-preview-deleted {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-muted);
}

.feed-preview-favicon-shell {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.feed-preview-favicon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.feed-preview-favicon-fallback {
  font-size: 24px;
  font-weight: 650;
  color: var(--text);
}

.feed-preview-domain {
  font-size: 14px;
  color: var(--text-muted);
}

.feed-preview-deleted {
  color: #f28b8b;
}

.feed-meta {
  padding: 4px 4px 0;
}

.feed-meta-deleted {
  opacity: 0.5;
}

.feed-meta-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feed-meta-thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-muted);
}

.feed-meta-head-text {
  min-width: 0;
}

.feed-meta-title {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.3;
}

.feed-meta-domain {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.feed-meta-description {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.feed-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feed-info-panel {
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
  position: sticky;
  top: 12px;
}

.feed-info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.feed-info-label {
  color: var(--text-muted);
}

.feed-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: var(--glass-border);
}

.feed-quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.feed-quick-action:hover {
  background: var(--surface-muted);
}

.feed-quick-action.active {
  color: var(--accent);
}

.feed-quick-action span {
  flex: 1;
}

.feed-quick-action kbd,
.feed-action-bar kbd {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-radius: 4px;
  padding: 2px 5px;
}

.feed-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 2px;
}

.feed-action-bar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feed-action-keep {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 78%, black));
  color: #fff;
  padding: 12px 28px;
  font-weight: 600;
  order: 2;
}

.feed-action-prev {
  order: 1;
}

.feed-action-move {
  order: 3;
}

.feed-action-delete {
  order: 4;
}

.feed-move-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 16px;
}

.feed-move-popover {
  width: min(360px, 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-move-title {
  margin: 0;
  font-weight: 600;
}

.feed-move-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-move-item {
  text-align: left;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}

.feed-move-item:hover {
  background: var(--surface-muted);
}

.feed-move-empty {
  padding: 8px;
  text-align: center;
}

.feed-undo-toast,
.update-toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  color: var(--bg-a);
  border-radius: 999px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 80;
  box-shadow: var(--glass-shadow);
  font-size: 14px;
}

.feed-undo-toast .chip {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 860px) {
  .feed-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .feed-info-panel {
    position: static;
  }

  .feed-preview-card {
    min-height: 220px;
  }

  .feed-action-bar {
    position: sticky;
    bottom: env(safe-area-inset-bottom);
    background: var(--glass-bg-strong);
    backdrop-filter: blur(18px);
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: 0 -14px;
  }

  .feed-action-bar kbd {
    display: none;
  }

  .feed-action-bar button {
    flex: 1;
    justify-content: center;
    padding: 14px 6px;
    font-size: 0.85rem;
  }
}
