/* ── Adding knowledge ─────────────────────────────────────
   The dropzone, the accepted-formats disclosure and the list of sources it
   produces. Split from builder.css because the dashboard's Knowledge section
   renders exactly the same surface -- it was never builder-specific, and the
   builder file had grown past the size budget carrying it. */

.dropzone {
  border: 1.5px dashed var(--line-hi);
  border-radius: var(--r-md);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 14.5px;
  transition: all 0.2s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone strong { color: var(--text); font-weight: 600; }

/* Accepted formats, folded away. The dropzone says "drop files"; the exact
   forty extensions are for the one person in twenty who needs to check. */
.formats { font-size: 13px; color: var(--subtle); }

.formats > summary {
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
  transition: color 0.16s var(--ease);
}
.formats > summary::-webkit-details-marker { display: none; }
.formats > summary::after { content: "›"; display: inline-block; margin-left: 6px; transition: transform 0.16s var(--ease); }
.formats[open] > summary::after { transform: rotate(90deg); }
.formats > summary:hover { color: var(--text); }
.formats > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.formats-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.formats-group { display: flex; gap: 12px; align-items: baseline; }
.formats-label { flex: none; width: 108px; color: var(--text); font-weight: 500; }
/* word-spacing does the separating: HTML collapses the runs of spaces the
   markup would otherwise use, and a wrapped list needs the air to stay legible. */
.formats-exts { font-family: var(--font-mono); font-size: 12px; line-height: 1.75; word-spacing: 0.5em; }
.formats-foot { margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.55; }

@media (max-width: 560px) {
  .formats-group { flex-direction: column; gap: 2px; }
  .formats-label { width: auto; }
}

.source-list { display: flex; flex-direction: column; gap: 9px; }

.source-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  animation: rise 0.35s var(--ease);
}

.source-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.source-icon svg { width: 15px; height: 15px; }

.source-main { flex: 1; min-width: 0; }
.source-name { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-meta { font-size: 12.5px; color: var(--subtle); }

.icon-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.16s var(--ease);
  flex: none;
}
.icon-btn:hover { color: var(--danger); background: rgba(217, 128, 128, 0.1); }
.icon-btn svg { width: 14px; height: 14px; }

/* The schedule's interval select sits at the end of the toggle row. */
.freshness-interval { max-width: 160px; }

/* ── Phones ───────────────────────────────────────────────
   A url source's row has five inline members (icon, name, freshness, group
   chips, delete) needing ~450px — far past a 360px screen, and only the name
   could shrink. Let the row wrap into a small card instead: identity line
   first (icon · name · delete), then the freshness controls, then the group
   chips, each on its own full-width line. `order` keeps the delete button on
   the identity line even though it renders last in the DOM. */
@media (max-width: 700px) {
  .source-row { flex-wrap: wrap; row-gap: 10px; }
  .source-main { order: 1; }
  .source-row > .icon-btn { order: 2; }
  .source-row > .row { order: 3; flex-basis: 100%; justify-content: space-between; }
  .source-groups { order: 4; flex-basis: 100%; }

  /* Click-to-browse is the real affordance on touch; less "drop" theatre. */
  .dropzone { padding: 24px 16px; }

  /* 30px squares are below any comfortable touch target. */
  .icon-btn { width: 38px; height: 38px; }

  /* Upload / Paste / Website read as one even strip, not a ragged wrap. */
  .source-tabs .tab { flex: 1 1 auto; text-align: center; padding: 9px 10px; }

  /* The schedule: switch + copy on the first line, the interval select on its
     own line beneath the copy (56px = switch width + row gap). */
  .callout .toggle-row { flex-wrap: wrap; }
  .freshness-interval { max-width: none; flex: 1 1 100%; margin-left: 56px; width: auto; }
}
