/* NotebookLM-style 3-column shell */

:root {
  --nb-bg: #131314;
  --nb-surface: #1e1f20;
  --nb-surface-2: #282a2c;
  --nb-line: rgba(255, 255, 255, 0.08);
  --nb-text: #e3e3e3;
  --nb-muted: #9aa0a6;
  --nb-subtle: #6b7280;
}

.shell--notebook {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  background: var(--nb-bg);
}

.shell--notebook .sources-panel { grid-row: 2; grid-column: 1; }
.shell--notebook .notebook-main { grid-row: 2; grid-column: 2; }
.shell--notebook .studio-panel { grid-row: 2; grid-column: 3; }

/* Top nav */
.topnav--notebook {
  background: var(--nb-bg);
  border-bottom-color: var(--nb-line);
  height: 52px;
  padding: 0 20px;
}

.topnav--notebook .topnav__logo {
  display: flex;
  color: #8ab4f8;
  flex-shrink: 0;
}

.topnav--notebook .topnav__page {
  font-size: 15px;
  font-weight: 400;
  color: var(--nb-muted);
}

.topnav__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--nb-line);
  background: transparent;
  color: var(--nb-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.topnav__pill:hover {
  background: var(--nb-surface-2);
  text-decoration: none;
}

.topnav__pill--solid {
  background: #e8eaed;
  color: #202124;
  border-color: transparent;
}

.topnav__pill--solid:hover {
  background: #f1f3f4;
  filter: none;
}

/* Panel chrome */
.nb-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--nb-bg);
}

.nb-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  flex-shrink: 0;
}

.nb-panel__title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--nb-text);
}

.nb-panel__toggle {
  display: flex;
  color: var(--nb-subtle);
  opacity: 0.6;
  padding: 4px;
}

.sources-panel {
  border-right: 1px solid var(--nb-line);
}

.studio-panel {
  border-left: 1px solid var(--nb-line);
}

.sources-panel__body,
.studio-panel__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sources-panel__add {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 16px 12px;
  padding: 10px 16px;
  width: calc(100% - 32px);
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  border: none;
  background: #e8eaed;
  color: #202124;
  cursor: pointer;
  transition: background 0.12s;
}

.sources-panel__add:hover { background: #f1f3f4; }

.sources-panel__search {
  padding: 0 16px 12px;
}

.source-search--inline {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.source-search--inline .source-search__field {
  flex: 1;
  border-radius: 12px 0 0 12px;
  border: 1px solid var(--nb-line);
  background: var(--nb-surface);
}

.source-search--inline .source-search__go {
  border-radius: 0 12px 12px 0;
  border: 1px solid var(--nb-line);
  border-left: 0;
  background: var(--nb-surface);
  color: var(--nb-muted);
  width: 44px;
}

.source-search__go--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.source-search__go--icon:hover { color: var(--nb-text); background: var(--nb-surface-2); }

.sources-empty__drop {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--nb-subtle);
}

.sources-empty__icon svg { color: var(--nb-muted); }

.sources-panel__foot {
  flex-shrink: 0;
  padding: 10px 16px;
  margin: 0;
  font-size: 0.68rem;
  color: var(--nb-subtle);
  border-top: 1px solid var(--nb-line);
}

/* Main workspace */
.notebook-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--nb-bg);
  border-left: 1px solid var(--nb-line);
  border-right: 1px solid var(--nb-line);
}

.notebook-main__head {
  border-bottom: none;
  padding-bottom: 0;
}

.notebook-main__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.notebook-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.notebook-welcome[hidden] { display: none !important; }

.notebook-welcome__wave {
  font-size: 2.25rem;
  margin: 0 0 0.75rem;
}

.notebook-welcome__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--nb-text);
}

.notebook-status {
  flex-shrink: 0;
  margin: 0.75rem 1rem 0;
}

.notebook-results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 1rem 1rem;
}

/* Composer — NotebookLM chat bar */
.notebook-composer {
  flex-shrink: 0;
  padding: 12px 20px 16px;
  background: var(--nb-bg);
}

.notebook-composer__box {
  border-radius: 16px;
  border: 1px solid var(--nb-line);
  background: var(--nb-surface);
  overflow: hidden;
}

.notebook-composer__input {
  width: 100%;
  padding: 14px 16px 8px;
  font-size: 14px;
  border: 0;
  background: transparent;
  color: var(--nb-text);
  outline: none;
}

.notebook-composer__input::placeholder { color: var(--nb-subtle); }

.notebook-composer__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 10px 16px;
}

.notebook-composer__count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--nb-subtle);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--nb-line);
  background: var(--nb-surface-2);
}

.notebook-composer__hint {
  flex: 1;
  font-size: 12px;
  color: var(--nb-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notebook-composer__send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--nb-line);
  background: var(--nb-surface-2);
  color: var(--nb-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.notebook-composer__send:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(129, 140, 248, 0.35);
}

.notebook-composer__disclaimer {
  margin: 8px 4px 0;
  font-size: 11px;
  color: var(--nb-subtle);
  text-align: center;
}

/* Studio */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 14px;
}

.studio-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 12px 12px;
  min-height: 76px;
  border-radius: 14px;
  border: 1px solid var(--nb-line);
  background: var(--nb-surface);
  color: var(--nb-text);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: background 0.12s, border-color 0.12s;
}

.studio-tile:hover:not(:disabled) {
  background: var(--nb-surface-2);
  border-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.studio-tile:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.studio-tile__icon {
  color: var(--nb-muted);
}

.studio-tile__label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  padding-right: 16px;
  color: var(--nb-text);
}

.studio-tile__chev {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 14px;
  color: var(--nb-subtle);
}

.studio-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.studio-empty[hidden] { display: none !important; }

.studio-empty__text {
  margin: 0.75rem 0 0;
  font-size: 12px;
  color: var(--nb-subtle);
  line-height: 1.5;
  max-width: 220px;
}

.shell.has-results .studio-empty { display: none; }
.shell.has-results .sources-empty { display: none; }

/* Source modal */
.source-modal__dialog {
  width: min(680px, 100%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e1f20;
}

.source-card__title {
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.35;
}

.source-card__accent {
  background: linear-gradient(90deg, #818cf8 0%, #4ade80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.source-card__lede { display: none; }

.source-drop {
  margin-top: 16px;
  padding: 2rem 1.25rem 1.25rem;
  border-radius: 16px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.source-drop__label {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--nb-text);
}

.source-drop__sub {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  color: var(--nb-subtle);
}

.source-drop__input {
  text-align: left;
  background: var(--nb-surface);
  border: 1px solid var(--nb-line);
  border-radius: 10px;
}

.source-action {
  border-color: var(--nb-line);
  background: var(--nb-surface);
  color: var(--nb-text);
}

.source-action__icon {
  display: flex;
  align-items: center;
  opacity: 0.85;
}

.source-action__icon svg { display: block; }

.shell--notebook .flow-drawer {
  top: 52px;
  right: 0;
  width: min(420px, 100vw);
  z-index: 60;
}

@media (max-width: 960px) {
  .shell--notebook {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .shell--notebook .sources-panel { grid-row: 2; grid-column: 1; }
  .shell--notebook .notebook-main { grid-row: 2; grid-column: 2; border-right: 0; }
  .shell--notebook .studio-panel {
    grid-row: 3;
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--nb-line);
    max-height: 240px;
  }
}

@media (max-width: 640px) {
  .shell--notebook { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; }
  .shell--notebook .sources-panel {
    grid-row: 2;
    max-height: 180px;
    border-right: 0;
    border-bottom: 1px solid var(--nb-line);
  }
  .shell--notebook .notebook-main { grid-row: 3; border-left: 0; border-right: 0; }
  .topnav__stats { display: none; }
}


.sources-list {
  list-style: none;
  margin: 0;
  padding: 0 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.sources-list[hidden] { display: none !important; }

.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.source-item:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.source-item__thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}

.source-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-item__meta {
  min-width: 0;
  flex: 1;
}

.source-item__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-item__sub {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: var(--subtle);
}

.sources-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.sources-empty[hidden] { display: none !important; }

.sources-empty__icon {
  font-size: 1.75rem;
  opacity: 0.5;
  margin-bottom: 0.75rem;
}

.sources-empty__title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.sources-empty__sub {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  color: var(--subtle);
  line-height: 1.45;
  max-width: 220px;
}

.sources-empty__link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.sources-empty__link:hover { text-decoration: underline; }

/* Source modal (continued) */
.source-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.source-modal[hidden] { display: none !important; }

.source-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
}

.source-modal__dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.source-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
}

.source-modal__close:hover { color: var(--text); }

.source-card--modal {
  padding: 1.75rem 1.5rem 1.25rem;
  border: 0;
  background: transparent;
}

.source-card--modal .source-card__form {
  max-width: none;
  margin: 0;
}

.shell--notebook .work-panel--flow {
  display: none;
}

.shell--flow {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

.shell--flow .work-panel--flow {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}

/* Source card — capture (modal + legacy) */
.source-card {
  flex-shrink: 0;
  padding: clamp(2rem, 6vh, 3.5rem) 1.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.source-card--modal {
  padding: 1.75rem 1.5rem 1.25rem;
  border: 0;
  background: transparent;
}

.source-card__form {
  max-width: 720px;
  margin: 0 auto;
}

.source-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text);
}

.source-card__lede {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.source-search {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.source-search__field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.source-search__field:focus-within {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.source-search__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: default;
  user-select: none;
}

.source-pill--static {
  color: var(--text);
}

.source-pill--toggle {
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.source-pill--toggle:has(input:checked) {
  color: var(--accent);
  border-color: rgba(129, 140, 248, 0.4);
  background: var(--accent-soft);
}

.source-pill--toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.source-pill__icon {
  opacity: 0.7;
}

.source-search__input {
  width: 100%;
  padding: 0.85rem 1rem 1rem;
  font-size: 0.95rem;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.source-search__go {
  flex-shrink: 0;
  width: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.source-drop {
  margin-top: 12px;
  padding: 1.25rem 1rem 1rem;
  border-radius: var(--radius);
  border: 1.5px dashed rgba(129, 140, 248, 0.25);
  background: rgba(129, 140, 248, 0.03);
  transition: border-color 0.15s, background 0.15s;
}

.source-drop.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.source-drop__label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}

.source-drop__input {
  width: 100%;
  min-height: 4.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  outline: none;
}

.source-drop__input:focus {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.source-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.source-action:hover {
  background: var(--surface-2);
  border-color: rgba(129, 140, 248, 0.35);
}

.source-action__icon {
  font-size: 0.85rem;
  opacity: 0.85;
}

.source-card__count {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--subtle);
  text-align: center;
}

.source-card__count[hidden] { display: none !important; }

.source-more {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.source-more__toggle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.source-more__toggle::-webkit-details-marker { display: none; }

.source-more__body {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.source-more__input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.source-more__body .url-hero__tags {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.source-more__body .url-hero__tags .dl-label {
  margin: 0;
  width: auto;
}

.source-card__storage {
  max-width: 720px;
  margin: 12px auto 0;
  text-align: center;
}

.url-hero__empty {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
}

.url-hero__empty[hidden] { display: none !important; }

.shell--flow .work-panel--flow {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}

.shell--notebook .flow-drawer {
  top: 48px;
  right: var(--studio-w);
  width: min(420px, calc(100vw - var(--sources-w) - var(--studio-w) - 24px));
}

.shell--notebook.has-savebar .notebook-main {
  padding-bottom: 0;
}

.shell.is-pulling .notebook-welcome,
.shell.is-pulling .notebook-results,
.shell.is-pulling .source-actions {
  display: none !important;
}

@media (max-width: 960px) {
  .shell--notebook {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }
  .shell--notebook .studio-panel {
    grid-row: 3;
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 220px;
  }
  .shell--notebook .studio-empty { display: none; }
  .shell--notebook .flow-drawer {
    right: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .shell--notebook {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }
  .shell--notebook .sources-panel {
    grid-row: 2;
    grid-column: 1;
    max-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .shell--notebook .notebook-main {
    grid-row: 3;
    grid-column: 1;
  }
  .source-search { flex-direction: row; }
  .source-search__go { width: 44px; }
  .shell--notebook .flow-drawer { width: 100%; top: 48px; }
}

.results-block[hidden] { display: none !important; }

/* Drawer — harvest preview-pane as overlay */
.shell--flow .flow-drawer {
  position: fixed;
  top: 48px;
  right: 0;
  bottom: 0;
  width: var(--drawer-w);
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.shell--flow .flow-drawer:not([hidden]) {
  transform: translateX(0);
}

.shell--flow .flow-drawer[hidden] {
  display: flex !important;
  pointer-events: none;
}

.flow-drawer__close {
  margin-left: auto;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}

.flow-drawer__close:hover { color: var(--text); }

.flow-drawer-backdrop {
  position: fixed;
  inset: 48px 0 0 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}

.flow-drawer-backdrop[hidden] { display: none !important; }

.flow-savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 16px;
  height: 52px;
  background: rgba(28, 25, 23, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

.flow-savebar[hidden] { display: none !important; }

.flow-savebar__text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.shell--flow.has-savebar .work-panel--flow {
  padding-bottom: 52px;
}

.url-hero__drop--stack {
  flex-direction: column;
  align-items: stretch;
}

.batch-section {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0.25rem;
  padding: 0.5rem 0 0.25rem;
  border-top: 1px solid var(--line);
}

.batch-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.batch-section__title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.batch-section__sub {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--subtle);
  word-break: break-all;
}

.batch-section__sub a { color: var(--accent); }

@media (max-width: 720px) {
  .source-search { flex-direction: row; }
  .source-search__go { width: 44px; }
  .shell--flow .flow-drawer { width: 100%; top: 48px; }
}

/* Pull loader / stream progress */
.pull-loader {
  padding: 1rem 1.25rem 1.5rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.pull-loader[hidden] { display: none !important; }

.pull-loader__panel {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.pull-loader__head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.pull-loader__spinner {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(129, 140, 248, 0.2);
  border-top-color: var(--accent);
  animation: pull-spin 0.75s linear infinite;
}

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

.pull-loader__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.pull-loader__message {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.pull-loader__bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 1rem;
}

.pull-loader__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #a5b4fc);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.pull-loader__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.pull-loader__step {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--subtle);
  background: var(--surface-2);
}

.pull-loader__step.is-active {
  color: var(--accent);
  border-color: rgba(129, 140, 248, 0.35);
  background: var(--accent-soft);
}

.pull-loader__step.is-done {
  color: var(--muted);
}

.pull-loader__grid {
  min-height: 0;
}

.pull-loader__grid .media-card.is-skeleton {
  pointer-events: none;
  opacity: 0.55;
}

.pull-loader__grid .media-card.is-skeleton .media-card__thumb {
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    rgba(129, 140, 248, 0.08) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: pull-shimmer 1.2s ease-in-out infinite;
}

.pull-loader__grid .media-card.is-skeleton .media-card__thumb img {
  opacity: 0;
}

@keyframes pull-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
