/* The Data extraction page: extraction jobs, datasets and their versions, and the access tokens other systems use. */

#data-body { display: grid; gap: 18px; }
/* min-width 0: a wide table scrolls inside its frame instead of widening the card past the page. */
.data-card { padding: 18px 20px; min-width: 0; }
.data-card .section-heading { margin-bottom: 12px; }
.data-card .section-heading h2 { margin: 0; font-size: 16px; }
.data-card .section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.data-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
.data-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 12px 16px; }
.data-row + .data-row { border-top: 1px solid var(--border); }
.data-copy { display: grid; gap: 3px; flex: 1 1 320px; min-width: 0; font-size: 13px; line-height: 1.5; }
.data-copy > * { overflow-wrap: anywhere; }
.data-copy strong, .data-name { font-size: 14px; font-weight: 600; }
.data-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.data-actions select { min-height: 32px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 8px; font: inherit; font-size: 13px; }
.data-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.data-expired { color: var(--warn-ink); }
#data-held-note { margin: 0 0 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.data-back { display: inline-block; font-size: 13px; }
.data-dataset-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.data-dataset-heading > div:first-child { flex: 1 1 320px; min-width: 0; }
.data-dataset-heading p { overflow-wrap: anywhere; }
.data-table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--border); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.data-table th { position: sticky; top: 0; background: var(--surface-muted); color: var(--text-2); font-weight: 600; }
.data-table tbody tr:hover { background: var(--surface-hover); }
#data-more { margin-top: 12px; }
.data-endpoints, .data-sources-places { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 13px; }
.data-endpoints dt, .data-sources-places dt { color: var(--text-2); font-weight: 600; }
.data-endpoints dd, .data-sources-places dd { margin: 0; overflow-wrap: anywhere; }
.data-card-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.data-form { display: grid; gap: 12px; font-size: 13px; }
.data-form > label { display: grid; gap: 6px; font-weight: 600; }
.data-form input:not([type="checkbox"]):not([type="radio"]) { min-height: 36px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; }
.data-scope { display: grid; gap: 6px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.data-scope legend { padding: 0 4px; font-weight: 600; }
.data-scope-pick { padding-left: 22px; }
.project-form .data-scope .data-job-pick { margin: 3px 0; font-size: 13px; }
.data-job-pick input { flex: none; width: 16px; height: 16px; margin: 0; }
.data-job-pick small { margin-left: auto; }
.data-token { width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.data-config { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--log-bg); color: var(--log-text); font-size: 12px; overflow: auto; }
/* The Google Drive card on a dataset's page. */
#data-drive-account { margin: 0 0 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#data-drive-account p { margin: 0 0 6px; }
#data-drive-account p:last-child { margin-bottom: 0; }
.data-drive-error { color: var(--fail-ink); }
/* The sources card: a status line of chips, then one compact row per source with its details on demand. */
.data-ok { color: var(--pass); }
.data-missing { color: var(--fail-ink); }
.data-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.data-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; line-height: 1.5; white-space: nowrap; }
button.data-chip { cursor: pointer; }
button.data-chip:hover { background: var(--surface-hover); }
.data-chip-label { color: var(--muted); }
.data-chip.ok { border-color: var(--pass-soft); background: var(--pass-soft); color: var(--pass-ink); }
.data-chip.warn { border-color: var(--warn-soft); background: var(--warn-soft); color: var(--warn-ink); }
.data-src-list { border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
/* Every row has the same fixed action column, so the columns line up whether a row offers Save login, Run or neither. */
.data-src-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 70px minmax(0, 1.2fr) minmax(0, 1.4fr) 136px; align-items: center; gap: 6px 14px; padding: 8px 14px; border-top: 1px solid var(--border-subtle); }
.data-src-head { border-top: 0; color: var(--muted); font-size: 12px; font-weight: 600; padding-block: 7px; }
.data-src-group { padding: 10px 14px 4px; border-top: 1px solid var(--border); font-weight: 600; color: var(--text); }
.data-src-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
.data-src-name a { font-size: 12px; color: var(--muted); }
.data-src-latest { overflow-wrap: anywhere; }
.data-src-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.data-src-toggle { min-width: 32px; }
.data-src-details { grid-column: 1 / -1; display: grid; gap: 4px; padding: 6px 0 4px; }
.data-src-detail { display: grid; grid-template-columns: 92px 1fr; gap: 10px; overflow-wrap: anywhere; }
.data-src-detail .btn-link { margin-left: 8px; font-size: 13px; }
.data-src-details a, .data-src-latest a { color: var(--accent); }
.data-sources-other { margin: 10px 0 0; font-size: 12.5px; }
/* The page's tabs: the sources, the jobs and datasets, and the settings. */
.data-tabs { padding: 0; background: none; }
/* Data extraction › Settings: one row per connection, then the MCP connection's steps and keys. */
.data-setting-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.data-steps { display: grid; gap: 12px; margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.data-steps li::marker { color: var(--muted); font-weight: 600; }
.data-steps .data-endpoints { margin: 8px 0 0; align-items: center; }
.data-steps code { overflow-wrap: anywhere; }
.data-subheading { margin: 18px 0 8px; font-size: 14px; }
.data-mcp-note { margin: 0 0 12px; font-size: 12.5px; }
.data-mcp-note:last-child { margin: 12px 0 0; }
.data-external-add { margin: 0 0 12px; }
.data-chip.bad { border-color: var(--fail-soft); background: var(--fail-soft); color: var(--fail-ink); }
.data-form textarea { min-height: 80px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 8px 10px; font: 12.5px/1.5 var(--mono, monospace); resize: vertical; }
.data-field-help { margin: 0; font-weight: 400; font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.data-auth-part[hidden] { display: none; }
.data-form select { min-height: 36px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 8px; font: inherit; }
.data-unmatched { margin: 0 0 14px; }
.data-unmatched h3 { margin: 0 0 6px; font-size: 14px; color: var(--warn-ink); }
.data-intake-log { margin: 0 0 12px; font-size: 13px; }
.data-intake-log summary { cursor: pointer; color: var(--text-2); }
.data-intake-log pre { margin-top: 6px; white-space: pre-wrap; }
.data-hand-upload { font-size: 12.5px; }

@media (max-width: 760px) {
  .data-card { padding: 14px; }
  .data-row { padding: 10px 12px; }
  .data-actions { width: 100%; }
  .data-endpoints { grid-template-columns: 1fr; }
  /* On a phone a source is two lines: its name and action, then how it connects, its status and its latest data. */
  .data-src-head { display: none; }
  .data-src-row { grid-template-columns: auto 1fr auto; padding: 10px 12px; }
  .data-src-name { grid-area: 1 / 1 / 2 / 3; }
  .data-src-actions { grid-area: 1 / 3; }
  .data-src-how { grid-area: 2 / 1; }
  .data-src-status { grid-area: 2 / 2; }
  .data-src-latest { grid-area: 2 / 3; text-align: right; }
  .data-src-details { grid-row: 3; }
  .data-src-group { padding-inline: 12px; }
}

/* An extraction job that publishes nothing yet (no Extract step, or a download read into no dataset): said above its steps in the editor. */
.extract-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--warn-border); border-left: 3px solid var(--warn); border-radius: 8px; background: var(--warn-soft); color: var(--warn-ink); }
.extract-callout[hidden] { display: none; }
.extract-callout-copy { flex: 1 1 260px; min-width: 0; }
.extract-callout-copy p { margin: 4px 0 0; }
.extract-callout-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* A download read into no dataset: the name it goes into, beside Read into dataset. */
.extract-callout-field { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.extract-callout-field input { width: min(260px, 100%); font-weight: 400; }
/* Read: the next run that passes publishes, beside Run. */
.extract-callout.is-done { border-color: var(--pass-border); border-left-color: var(--pass); background: var(--pass-soft); color: var(--pass-ink); }
/* The Extract this table dialog: what was found, then its fields one under another. */
.extract-form { display: grid; gap: 6px; }
.extract-form label { margin-top: 6px; font-weight: 600; }
.extract-form input { width: 100%; }
.extract-form .muted { margin: 0; }
.extract-form .btn-link { justify-self: start; margin-top: 6px; }
