/* Scroll feed — professional card layout */

body.page-scroll main.scroll-main {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.page-scroll:has(.header--tools) main.scroll-main {
  padding: 0 !important;
}

.scroll-loading[hidden],
.scroll-empty[hidden],
.scroll-card[hidden],
.scroll-dock[hidden] {
  display: none !important;
}

.scroll-loading:not([hidden]) {
  display: grid;
}

.page-scroll {
  background: var(--bg-muted);
  color: var(--text);
  overflow: hidden;
  height: 100dvh;
}

.page-scroll .scroll-toolbar {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.scroll-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.scroll-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.scroll-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.scroll-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.scroll-main {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-muted);
}

.scroll-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  touch-action: pan-y;
}

.scroll-card {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.scroll-card.is-exit-up {
  transform: translateY(-8%);
  opacity: 0;
}

.scroll-card.is-exit-down {
  transform: translateY(8%);
  opacity: 0;
}

.scroll-card.is-enter-from-bottom {
  transform: translateY(8%);
  opacity: 0;
}

.scroll-card.is-enter-from-top {
  transform: translateY(-8%);
  opacity: 0;
}

/* Tool panel card */
.scroll-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.scroll-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.scroll-panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-pricing {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.scroll-pricing[data-label="free"] {
  color: #15803d;
  background: rgba(21, 128, 61, 0.1);
}

.scroll-pricing[data-label="free-tier"] {
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
}

.scroll-pricing[data-label="limited"] {
  color: #c2410c;
  background: rgba(194, 65, 12, 0.1);
}

.scroll-pricing[data-label="paid"] {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.scroll-panel-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--border);
}

.scroll-icon-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-sizing: border-box;
}

.page-scroll .scroll-icon-wrap img.scroll-icon,
.scroll-icon-wrap .scroll-icon {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 4px;
  box-sizing: border-box;
  aspect-ratio: auto;
}

.scroll-panel-identity {
  min-width: 0;
  flex: 1;
}

.scroll-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 4px;
  word-break: break-word;
}

.scroll-domain {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.scroll-domain:hover {
  text-decoration: underline;
}

.scroll-panel-body {
  padding: 16px 18px;
}

.scroll-about {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.scroll-panel-actions {
  display: flex;
  gap: 10px;
  padding: 0 18px 18px;
}

.scroll-panel-actions .btn-primary {
  flex: 1;
  min-height: 46px;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
}

.scroll-panel-actions .btn-primary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.scroll-save {
  appearance: none;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.scroll-save:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-muted);
}

.scroll-save.is-saved {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}

.scroll-save svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.scroll-save-label {
  display: none;
}

/* Bottom dock — progress + navigation */
.scroll-dock {
  flex-shrink: 0;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.scroll-dock-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.scroll-dock-progress {
  flex: 1;
  height: 4px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.scroll-dock-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.scroll-dock-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scroll-dock-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.scroll-dock-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.scroll-dock-btn:first-child {
  justify-self: start;
}

.scroll-dock-btn:last-child {
  justify-self: end;
}

.scroll-dock-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-muted);
}

.scroll-dock-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.scroll-dock-btn svg {
  width: 16px;
  height: 16px;
}

.scroll-dock-hint {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

/* Loading & empty */
.scroll-loading,
.scroll-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: var(--bg-muted);
  z-index: 5;
}

.scroll-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: scroll-spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

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

.scroll-loading p,
.scroll-empty p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  max-width: 32ch;
  margin: 0 auto;
}

.scroll-empty h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text);
}

.scroll-empty-inner .btn-primary {
  margin-top: 18px;
}

.scroll-tabs--mobile {
  display: none;
}

@media (max-width: 768px) {
  .page-scroll .header--tools .logo {
    display: none !important;
  }

  .page-scroll .scroll-toolbar {
    display: flex !important;
    flex: 1;
    justify-content: center;
    min-width: 0;
    order: 1;
  }

  .page-scroll .header--tools .scroll-tabs {
    display: flex;
    width: min(100%, 260px);
  }

  .page-scroll .scroll-tab {
    flex: 1;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 13px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }

  .page-scroll .scroll-tabs--mobile {
    display: none !important;
  }

  .scroll-stage {
    padding-top: 12px;
  }

  .scroll-save-label {
    display: inline;
  }

  .scroll-dock-hint {
    display: none;
  }

  .scroll-dock-nav {
    grid-template-columns: 1fr 1fr;
  }

  .scroll-dock-btn span {
    display: none;
  }
}

@media (min-width: 721px) {
  .scroll-stage {
    padding-top: 24px;
  }
}
