.project-library-section { margin: 14px 0 22px; }
.project-library-datasets { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line, #d7dfeb); border-radius: 10px; background: var(--panel, #fff); color: var(--ink, #203047); }
.project-library-datasets-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-library-datasets-heading h3 { margin: 0; font-size: 15px; }
.project-library-datasets-heading p { margin: 3px 0 0; color: var(--muted, #65758b); font-size: 12px; }
.project-library-datasets .project-library-status { margin-bottom: 0; }
.project-library-datasets-table-wrap { margin-top: 8px; }
.project-library-datasets .project-library-datasets-table { min-width: 680px; table-layout: auto; }
.project-library-datasets .project-library-datasets-table th { padding: 8px 10px; }
.project-library-datasets .project-library-datasets-table th { width: auto; }
.project-library-datasets .project-library-datasets-table th:first-child { min-width: 220px; }
.project-library-datasets .project-library-datasets-table th[data-column="rows"] { text-align: right; }
.project-library-dataset-actions { display: flex; align-items: center; gap: 6px; }
.project-library-column-chooser { position: relative; }
.project-library-column-chooser > summary { cursor: pointer; list-style: none; white-space: nowrap; }
.project-library-column-chooser > summary::-webkit-details-marker { display: none; }
.project-library-column-chooser > summary:focus-visible { outline: 2px solid var(--brand, #526b93); outline-offset: 2px; }
.project-library-column-chooser fieldset { box-sizing: border-box; position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; display: grid; gap: 8px; width: 230px; max-height: min(65vh, 480px); overflow-y: auto; margin: 0; padding: 12px; border: 1px solid var(--line, #d7dfeb); border-radius: 8px; background: var(--panel, #fff); box-shadow: 0 8px 24px rgb(0 0 0 / 22%); }
.project-library-column-chooser legend { font-weight: 700; }
.project-library-column-chooser label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.project-library-column-chooser input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; flex: 0 0 16px; margin: 0; padding: 0; }
.project-library-dataset-metadata { min-width: 130px; max-width: 260px; overflow-wrap: anywhere; }
.project-library-datasets .project-library-datasets-table tbody[aria-busy="true"] { opacity: .72; }
.project-library-dataset-scope { display: inline-block; padding: 4px 8px; border-radius: 999px; background: var(--brand-soft, #edf2fa); color: var(--muted, #526b93); font-size: 10px; font-weight: 700; white-space: nowrap; }
.project-library-dataset-frequency,
.project-library-dataset-observations { color: var(--muted, #65758b); white-space: nowrap; }
.project-library-dataset-observations { font-variant-numeric: tabular-nums; text-align: right; }
.project-library-datasets .project-library-datasets-table .project-library-datasets-empty-cell { padding: 12px; color: var(--muted, #65758b); text-align: center; }
.project-library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.project-library-heading h2 { margin: 2px 0; }
.project-library-heading p:not(.eyebrow) { max-width: 760px; margin: 0; color: var(--muted, #65758b); }
.project-library-heading-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 6px; }
.project-library-heading-actions button { white-space: nowrap; }
.project-library-icon-action { box-sizing: border-box; display: inline-grid; flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; margin: 0; padding: 0; place-items: center; font-size: 19px; line-height: 1; vertical-align: middle; }
.project-library-more-actions { position: relative; display: grid; flex: 0 0 36px; width: 36px; height: 36px; margin: 0; padding: 0; }
.project-library-more-actions > summary { box-sizing: border-box; display: inline-grid; width: 36px; height: 36px; margin: 0; padding: 0; place-items: center; list-style: none; cursor: pointer; line-height: 1; }
.project-library-more-actions > summary::-webkit-details-marker { display: none; }
.project-library-more-actions > summary::marker { content: ""; }
.project-library-more-actions > summary:focus-visible { outline: 2px solid var(--brand, #526b93); outline-offset: 2px; }
.project-library-more-menu { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; display: grid; min-width: 205px; padding: 5px; border: 1px solid var(--line, #d7dfeb); border-radius: 8px; background: var(--panel, #fff); box-shadow: 0 8px 24px rgb(0 0 0 / 20%); }
.project-library-more-menu button { padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink, #203047); cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.project-library-more-menu button:hover:not(:disabled),
.project-library-more-menu button:focus-visible { background: var(--brand-soft, #edf2fa); }
.project-library-more-menu button:disabled { color: var(--muted, #65758b); cursor: not-allowed; opacity: .65; }
.project-library-panel {
  padding: 12px;
  border: 1px solid var(--line, #d7dfeb);
  border-radius: 12px;
  background: var(--panel, #fff);
  color: var(--ink, #203047);
}
.project-library-toolbar {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(220px, 2fr) repeat(3, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}
.project-library-toolbar label,
.project-library-organize-form label {
  display: grid;
  gap: 5px;
  color: var(--ink, #203047);
  font-size: 12px;
  font-weight: 650;
}
.project-library-toolbar :is(input, select),
.project-library-organize-form input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line, #d7dfeb);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: var(--ink, #203047);
  font: inherit;
}
.project-library-status {
  min-height: 18px;
  margin: 8px 0 6px;
  color: var(--muted, #65758b);
  font-size: 12px;
}
.project-library-status[data-state="error"] { color: var(--danger, #ae3944); }
.project-library-notice {
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--line, #d7dfeb);
  border-radius: 7px;
  background: var(--brand-soft, #edf2fa);
  color: var(--muted, #65758b);
  font-size: 12px;
  line-height: 1.45;
}
.project-library-notice[hidden] { display: none; }
.project-library-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line, #d7dfeb); border-radius: 9px; background: var(--panel, #fff); overscroll-behavior-x: contain; }
.project-library-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; table-layout: fixed; color: var(--ink, #203047); font-size: 12px; }
.project-library-table th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid var(--line, #d7dfeb); background: var(--bg, #fff); color: var(--muted, #65758b); font-size: 11px; font-weight: 700; text-align: left; white-space: nowrap; }
.project-library-table th:first-child { width: 28%; }
.project-library-table th:nth-child(2) { width: 12%; }
.project-library-table th:nth-child(3) { width: 18%; }
.project-library-table th:nth-child(4) { width: 12%; }
.project-library-table th:nth-child(5) { width: 16%; }
.project-library-table th:last-child { width: 112px; }
.project-library-table th > button { display: flex; width: 100%; min-height: 36px; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 10px; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-align: left; }
.project-library-table th > button:hover { background: var(--brand-soft, #edf2fa); color: var(--ink, #203047); }
.project-library-table th > button:focus-visible { position: relative; z-index: 2; outline: 2px solid var(--brand, #526b93); outline-offset: -2px; }
.project-library-table th > button span { min-width: 9px; color: var(--brand-strong, #526b93); font-size: 13px; }
.project-library-table .project-library-actions-heading { padding: 8px 10px; text-align: center; }
.project-library-item td { padding: 9px 10px; border-bottom: 1px solid var(--line, #d7dfeb); vertical-align: middle; }
.project-library-item:last-child td { border-bottom: 0; }
.project-library-item:hover td { background: var(--brand-soft, #edf2fa); }
.project-library-item:has(.project-library-item-actions details[open]) td { position: relative; z-index: 2; }
.project-library-name-cell { min-width: 0; }
.project-library-item-main { display: flex; min-width: 0; align-items: center; gap: 9px; }
.project-library-item-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 7px; background: var(--brand-soft, #edf2fa); color: var(--brand-strong, #526b93); }
.project-library-item-heading { min-width: 0; }
.project-library-open {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink, #203047);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}
.project-library-open:hover { color: var(--brand-strong, #526b93); text-decoration: underline; }
.project-library-open:focus-visible,
.project-library-organize summary:focus-visible { outline: 2px solid var(--brand, #526b93); outline-offset: 3px; }
.project-library-item-path { margin: 2px 0 0; color: var(--muted, #65758b); font-size: 11px; overflow-wrap: anywhere; }
.project-library-kind { color: var(--ink, #203047); font-weight: 650; text-transform: capitalize; }
.project-library-folder-cell { color: var(--muted, #65758b); overflow-wrap: anywhere; }
.project-library-revision-cell,
.project-library-updated-cell { color: var(--muted, #65758b); white-space: nowrap; }
.project-library-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 0 37px; padding: 0; list-style: none; }
.project-library-tags li { padding: 3px 7px; border: 1px solid var(--line, #d7dfeb); border-radius: 999px; color: var(--muted, #65758b); font-size: 10px; }
.project-library-actions-cell { position: relative; overflow: visible; }
.project-library-item-actions { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 0; color: var(--muted, #65758b); font-size: 11px; }
.project-library-item-share { box-sizing: border-box; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid var(--line, #d7dfeb); border-radius: 6px; background: var(--bg, #fff); color: var(--muted, #65758b); cursor: pointer; font-size: 16px; }
.project-library-item-share:hover { border-color: var(--brand, #526b93); color: var(--brand-strong, #526b93); }
.project-library-item-share:focus-visible { outline: 2px solid var(--brand, #526b93); outline-offset: 2px; }
.project-library-menu-icon { display: inline-block; width: 22px; font-size: 15px; text-align: center; }
.project-library-organize,
.project-library-file-details { position: relative; color: var(--muted, #65758b); font-size: 11px; }
.project-library-organize > summary,
.project-library-file-details > summary { box-sizing: border-box; display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid var(--line, #d7dfeb); border-radius: 6px; background: var(--bg, #fff); color: var(--muted, #65758b); cursor: pointer; font-size: 15px; line-height: 1; list-style: none; }
.project-library-organize > summary::-webkit-details-marker,
.project-library-file-details > summary::-webkit-details-marker { display: none; }
.project-library-organize > summary::marker,
.project-library-file-details > summary::marker { content: ""; }
.project-library-organize > summary:hover,
.project-library-file-details > summary:hover { border-color: var(--brand, #526b93); color: var(--brand-strong, #526b93); }
.project-library-organize > summary:focus-visible,
.project-library-file-details > summary:focus-visible { outline: 2px solid var(--brand, #526b93); outline-offset: 2px; }
.project-library-file-details-body { box-sizing: border-box; position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; display: grid; width: min(560px, calc(100vw - 36px)); max-height: min(60vh, 380px); gap: 5px; overflow: auto; padding: 12px; border: 1px solid var(--line, #d7dfeb); border-radius: 8px; background: var(--panel, #fff); box-shadow: 0 8px 24px rgb(0 0 0 / 22%); overflow-wrap: anywhere; }
.project-library-file-details-body p { margin: 0; }
.project-library-sha256 { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; user-select: text; }
.project-library-organize-form { box-sizing: border-box; position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; display: grid; width: min(560px, calc(100vw - 36px)); grid-template-columns: minmax(140px, 1fr) minmax(140px, 1.4fr) auto; gap: 9px; align-items: end; padding: 12px; border: 1px solid var(--line, #d7dfeb); border-radius: 8px; background: var(--panel, #fff); box-shadow: 0 8px 24px rgb(0 0 0 / 22%); }
.project-library-organize-form :is(button, small) { grid-column: 1 / -1; justify-self: start; }
.project-library-organize-form small { color: var(--muted, #65758b); }
.project-library-organize-form :disabled { opacity: .65; }
.project-library-footnote { margin: 8px 0 0; color: var(--muted, #65758b); font-size: 11px; line-height: 1.5; }
.project-library-panel [aria-busy="true"] { cursor: progress; }

@media (max-width: 900px) {
  .project-library-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-library-toolbar label:nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .project-library-heading { align-items: flex-start; flex-direction: column; }
  .project-library-heading-actions { width: 100%; }
  .project-library-toolbar { grid-template-columns: minmax(0, 1fr); }
  .project-library-toolbar label:nth-child(2) { grid-column: auto; }
  .project-library-file-details-body,
  .project-library-organize-form { right: auto; left: 0; width: min(560px, calc(100vw - 56px)); }
  .project-library-organize-form { grid-template-columns: minmax(0, 1fr); }
  .project-library-organize-form :is(button, small) { grid-column: auto; }
}

/* A hosted Studio tab shares file navigation with Home. Keep project tools that
   are unique to Studio, but remove its duplicate project picker and file list. */
body[data-workspace-view="true"] #tab-studio .studio-explorer-file-browser { display: none !important; }
body[data-workspace-view="true"] #tab-studio #studioOpenProjectFiles { display: inline-flex; }
body:not([data-workspace-view="true"]) #tab-studio #studioOpenProjectFiles { display: none; }

.project-library-dataset-heading-controls { display: flex; align-items: center; gap: 3px; }
.project-library-dataset-heading-controls button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.project-library-dataset-sort { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; white-space: nowrap; }
.project-library-dataset-sort span, .project-library-dataset-filter-toggle.active { color: var(--brand-strong, #526b93); }
.project-library-dataset-filter-toggle { padding: 2px 4px; font-size: 16px !important; line-height: 1; }
.project-library-dataset-heading-controls button:focus-visible, .project-library-dataset-filter:focus-visible { outline: 2px solid var(--brand, #526b93); outline-offset: 1px; }
.project-library-dataset-filter { box-sizing: border-box; display: block; width: 100%; min-width: 100px; margin-top: 4px; padding: 4px; font: inherit; }
.project-library-dataset-filter[hidden], .project-library-dataset[hidden] { display: none; }

.project-library-dataset-folders { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.project-library-dataset-folders select { max-width: 280px; }
.project-library-datasets .project-library-name-cell { position: relative; }
.project-library-dataset-row-actions { display: inline-block; margin-left: 8px; position: relative; vertical-align: middle; }
.project-library-dataset-row-actions summary { cursor: pointer; list-style: none; padding: 3px 7px; border-radius: 4px; }
.project-library-dataset-row-actions summary::-webkit-details-marker { display: none; }
.project-library-dataset-row-actions > div { position: static; min-width: 120px; padding: 4px; border: 1px solid var(--line, #d7dfeb); border-radius: 6px; background: var(--panel, #fff); box-shadow: 0 5px 15px rgb(0 0 0 / 20%); }
.project-library-dataset-row-actions button { display: block; width: 100%; padding: 7px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.project-library-dataset-row-actions button:hover { background: var(--brand-soft, #edf2fa); }

.project-library-dataset-subtitle { display: block; margin-top: 2px; color: var(--muted, #65758b); overflow-wrap: anywhere; }
.project-library-table-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.project-library-dataset-folders { flex-wrap: wrap; }
#projectLibraryFileHeadings .project-library-dataset-heading-controls { padding: 8px 10px; }
#projectLibraryFileHeadings .project-library-dataset-heading-controls [data-project-library-sort] { flex: 1; text-align: left; }
.project-library-description-cell, [data-dataset-column="description"] { white-space: pre-wrap; overflow-wrap: anywhere; }
.project-library-table .project-library-group-row th { position: static; width: auto; padding: 7px 10px; background: var(--brand-soft, #edf2fa); white-space: normal; }
.project-library-table [hidden] { display: none; }
.project-library-table:has(#projectLibraryFileHeadings) { table-layout: auto; min-width: 980px; }
#projectLibraryFileHeadings th { width: auto; }
#projectLibraryFileHeadings [data-file-column="name"] { min-width: 200px; }
#projectLibraryFileHeadings [data-file-column="description"] { min-width: 180px; }
#projectLibraryFileHeadings [data-file-column="updated"] { min-width: 145px; }
#projectLibraryFileHeadings .project-library-actions-heading { min-width: 150px; }
#projectLibraryFileColumns fieldset { right: auto; left: 0; }
.project-library-table-controls [hidden], .project-library-dataset-actions [hidden] { display: none; }
