/* CRATA file hub: one start surface, then project → files → detail. */
body.mac-theme .next-shell .library-page {
  --library-ink: #1a2c28;
  --library-muted: #71877b;
  --library-line: #dce7de;
  --library-lime: #d7f46a;
  display: flex;
  flex-direction: column;
  gap: 17px;
  width: 100%;
  height: auto;
  min-height: 100%;
  padding: clamp(18px, 2.7vw, 38px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #f3f6f2;
  color: var(--library-ink);
  box-shadow: none;
}

body.mac-theme .next-shell .library-page .library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  min-height: 126px;
  margin: 0;
  padding: 25px clamp(22px, 2.5vw, 36px);
  overflow: hidden;
  border: 1px solid #26524d;
  border-radius: 18px;
  background: radial-gradient(circle at 91% -62%, #d7f46a38, transparent 43%), linear-gradient(112deg, #102b34, #0e212c 71%, #123d34);
  color: #f4faf5;
  box-shadow: 0 18px 39px #09212118;
}
body.mac-theme .next-shell .library-page .library-heading h1 { margin: 0 0 5px; color: #f4faf5; font-size: clamp(26px, 2.3vw, 36px); font-weight: 740; letter-spacing: -.055em; }
body.mac-theme .next-shell .library-page .library-heading p { margin: 0; color: #abc9c0; font-size: 12px; line-height: 1.6; }
body.mac-theme .next-shell .library-page .next-library-kicker { display: block; margin-bottom: 5px; color: #cdeba0; font-size: 10px; font-weight: 760; letter-spacing: .18em; }
body.mac-theme .next-shell .library-page .library-heading > button { min-height: 38px; padding: 8px 14px; border: 1px solid #d7f46a; border-radius: 9px; background: #d7f46a; color: #1d302b; font-size: 12px; font-weight: 730; white-space: nowrap; }
body.mac-theme .next-shell .library-page .library-heading > button:hover { background: #e6ff8b; }
body.mac-theme .next-shell .library-sync-notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0; padding: 11px 15px; border: 1px solid #d5e4d3; border-radius: 10px; background: #edf5e6; color: #526b4e; font-size: 12px; }

/* Empty account: no fake columns or blank preview. */
body.mac-theme .next-shell .library-page.is-empty .library-layout { display: grid; place-items: center; flex: 1 0 auto; width: 100%; min-height: min(520px, calc(100dvh - 250px)); margin: 0; padding: 0; grid-template-columns: minmax(0, 1fr); background: transparent; }
body.mac-theme .next-shell .next-library-start {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: min(100%, 1050px);
  min-height: 370px;
  padding: clamp(30px, 4vw, 58px);
  overflow: hidden;
  border: 1px solid #d6e4d7;
  border-radius: 20px;
  background: radial-gradient(circle at 89% 48%, #c5e58b5c, transparent 31%), linear-gradient(116deg, #fff 15%, #f3f9ed 100%);
  color: #1d3329;
  box-shadow: 0 20px 50px #1b3c2a0a;
}
body.mac-theme .next-shell .next-library-start::after { content: ''; position: absolute; z-index: -1; top: -110px; right: -95px; width: 475px; height: 475px; border: 1px solid #7aa99747; border-radius: 50%; box-shadow: 0 0 0 55px #b1d48c18, 0 0 0 110px #85b89e0b; pointer-events: none; }
body.mac-theme .next-shell .next-library-start-mark { display: grid; place-items: center; width: 59px; height: 59px; margin-bottom: 21px; border: 1px solid #beda9c; border-radius: 16px; background: #e8f4d7; color: #416e46; font-size: 28px; }
body.mac-theme .next-shell .next-library-start-mark i { display: none; }
body.mac-theme .next-shell .next-library-start-kicker { color: #69945c; font-size: 10px; font-weight: 760; letter-spacing: .18em; }
body.mac-theme .next-shell .next-library-start h2 { max-width: 18ch; margin: 8px 0 11px; color: #18392b; font-size: clamp(25px, 2.8vw, 36px); font-weight: 760; line-height: 1.35; letter-spacing: -.055em; word-break: keep-all; }
body.mac-theme .next-shell .next-library-start p { max-width: 51ch; margin: 0; color: #67806d; font-size: 13px; line-height: 1.75; word-break: keep-all; }
body.mac-theme .next-shell .next-library-start-action { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin-top: 22px; padding: 9px 17px; border: 1px solid #244d3c; border-radius: 9px; background: #244d3c; color: #f5fbf5; font-size: 12px; font-weight: 750; }
body.mac-theme .next-shell .next-library-start-action:hover { background: #1b3d30; }
body.mac-theme .next-shell .next-library-start > small { margin-top: 13px; color: #8ba394; font-size: 10px; }

/* Populated account: a calm file index expands until a document is selected. */
body.mac-theme .next-shell .library-page:not(.is-empty) .library-layout {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  flex: 1 0 auto;
  width: 100%;
  min-height: max(560px, calc(100dvh - 288px));
  margin: 0;
  background: transparent;
}
body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-layout { grid-template-columns: 226px minmax(320px, .91fr) minmax(360px, 1.09fr); }
body.mac-theme .next-shell .library-page[data-preview-open="false"] .library-preview { display: none; }
body.mac-theme .next-shell .library-page :is(.library-sidebar, .library-main, .library-preview) { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--library-line); border-radius: 14px; box-shadow: 0 8px 23px #223f2a0b; }
body.mac-theme .next-shell .library-page .library-sidebar { padding: 18px 11px; overflow-y: auto; border-color: #24423e; background: linear-gradient(#162f37, #10252e); color: #d7e9dc; }
body.mac-theme .next-shell .library-sidebar .library-project-group > h2 { margin: 1px 10px 18px; color: #93c3ad; font-size: 10px; font-weight: 780; letter-spacing: .14em; }
body.mac-theme .next-shell .library-sidebar .library-category-heading .library-category-title { color: #b9d7c7; font-size: 11px; font-weight: 730; }
body.mac-theme .next-shell .library-sidebar .library-category-group { margin-bottom: 15px; }
body.mac-theme .next-shell .library-sidebar .library-category-projects,
body.mac-theme .next-shell .library-sidebar .library-project-folders { border-left-color: #8ebaa126; }
body.mac-theme .next-shell .library-sidebar .library-project-node::before,
body.mac-theme .next-shell .library-sidebar .library-project-folders .library-folder-button::before { border-top-color: #8ebaa137; }
body.mac-theme .next-shell .library-sidebar .library-tree-toggle { color: #8cacaa; }
body.mac-theme .next-shell .library-sidebar .library-project-heading > .library-collection-button { flex-direction: row; align-items: center; color: #e1eee7; font-size: 12px; font-weight: 660; }
body.mac-theme .next-shell .library-sidebar .library-project-heading > .library-collection-button .library-tree-folder { color: #8bc3a4; }
body.mac-theme .next-shell .library-sidebar .library-project-heading > .library-collection-button.is-ancestor { border-color: #c8ee7e31; background: #d7f46a20; color: #e6f7b7; box-shadow: inset 2px 0 #d7f46a; }
body.mac-theme .next-shell .library-sidebar .library-project-heading > .library-collection-button:hover,
body.mac-theme .next-shell .library-sidebar .library-project-folders .library-folder-button:hover { background: #ffffff13; color: #fff; }
body.mac-theme .next-shell .library-sidebar .library-project-folders .library-folder-button { color: #9bbbad; font-size: 11px; }
body.mac-theme .next-shell .library-sidebar .library-project-folders .library-folder-button.is-active { background: #d7f46a1c; color: #d7f46a; box-shadow: inset 2px 0 #d7f46a; font-weight: 730; }
body.mac-theme .next-shell .library-sidebar .library-category-heading .library-group-add,
body.mac-theme .next-shell .library-sidebar .library-folder-add { color: #a6c2ad; }
body.mac-theme .next-shell .library-sidebar .library-category-heading .library-group-add:hover,
body.mac-theme .next-shell .library-sidebar .library-folder-add:hover { color: #d7f46a; }

body.mac-theme .next-shell .library-page .library-main { display: flex; flex-direction: column; background: #fff; }
body.mac-theme .next-shell .library-page .library-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 13px 11px; flex: 0 0 auto; padding: 22px; border-bottom: 1px solid var(--library-line); background: #fff; }
body.mac-theme .next-shell .library-toolbar > div:first-child { min-width: 0; }
body.mac-theme .next-shell .library-toolbar .library-breadcrumb { display: block; margin: 0 0 7px; color: #759983; font-size: 10px; font-weight: 730; letter-spacing: .03em; }
body.mac-theme .next-shell .library-toolbar .library-title-row { gap: 7px; }
body.mac-theme .next-shell .library-toolbar h2 { margin: 0; color: #1b332a; font-size: clamp(19px, 1.6vw, 24px); font-weight: 750; letter-spacing: -.045em; }
body.mac-theme .next-shell .library-toolbar > div:first-child > span:last-child { margin-top: 5px; color: #87988c; font-size: 11px; }
body.mac-theme .next-shell .library-toolbar .library-sharing-label { display: inline-flex; padding: 2px 6px; border: 1px solid #d5e5d5; border-radius: 5px; background: #f1f7ef; color: #6e9076; font-size: 9px; font-weight: 650; vertical-align: 3px; white-space: nowrap; }
body.mac-theme .next-shell .library-toolbar .library-rename-button { color: #6c8b76; }
body.mac-theme .next-shell .library-toolbar > div:nth-child(2) { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
body.mac-theme .next-shell .library-toolbar > div:nth-child(2) > a { color: #50745c; font-size: 11px; font-weight: 680; white-space: nowrap; }
body.mac-theme .next-shell .library-toolbar > div:nth-child(2) > .secondary { min-height: 34px; padding: 6px 10px; border-color: #244d3c; background: #244d3c; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
body.mac-theme .next-shell .library-toolbar > div:nth-child(2) > .secondary:hover { background: #1d3e32; }
body.mac-theme .next-shell .library-toolbar .library-search { grid-column: 1; width: 100%; min-width: 0; margin: 0; }
body.mac-theme .next-shell .library-toolbar .library-search input { width: 100%; min-height: 36px; padding: 8px 11px; border: 1px solid #d8e5d9; border-radius: 8px; background: #f8faf7; color: #294233; font-size: 11px; }
body.mac-theme .next-shell .library-toolbar .library-sort { grid-column: 2; margin: 0; }
body.mac-theme .next-shell .library-toolbar .library-sort select { min-height: 36px; padding: 7px 10px; border: 1px solid #d8e5d9; border-radius: 8px; background: #fff; color: #607867; font-size: 11px; }
body.mac-theme .next-shell .library-toolbar .library-type-tabs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px; }
body.mac-theme .next-shell .library-toolbar .library-type-tab { min-height: 30px; padding: 5px 10px; border: 1px solid #e0e9e0; border-radius: 7px; background: #f7faf5; color: #617968; font-size: 10px; }
body.mac-theme .next-shell .library-toolbar .library-type-tab[aria-pressed="true"] { border-color: #c7df8c; background: #eaf5d2; color: #365932; }
body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-toolbar > div:first-child,
body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-toolbar > div:nth-child(2) { grid-column: 1 / -1; }
body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-toolbar > div:nth-child(2) { justify-content: flex-start; flex-wrap: wrap; }
body.mac-theme .next-shell .library-page .library-file-list { flex: 1; min-height: 0; padding: 5px 12px 17px; overflow-y: auto; background: #fff; }
body.mac-theme .next-shell .library-page .library-document-row { border-bottom: 1px solid #ebf0eb; }
body.mac-theme .next-shell .library-page .library-list-row { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 66px; padding: 11px 8px; border: 0; border-radius: 7px; background: transparent; color: #294137; }
body.mac-theme .next-shell .library-page .library-list-row:hover { background: #f4f9f1; }
body.mac-theme .next-shell .library-page .library-list-row.is-selected { background: #eff8db; color: #294137; box-shadow: inset 3px 0 #b9d961; }
body.mac-theme .next-shell .library-page .library-item-kind { min-width: 42px; padding: 6px 5px; border: 1px solid #dce9dd; border-radius: 6px; background: #edf4ee; color: #4d795c; font-size: 9px; font-weight: 760; }
body.mac-theme .next-shell .library-page .library-item-title { color: #25392d; font-size: 12px; font-weight: 740; line-height: 1.5; }
body.mac-theme .next-shell .library-page .library-item-meta { margin-top: 3px; color: #8a9b8e; font-size: 10px; line-height: 1.5; }
body.mac-theme .next-shell .library-page .library-item-date { flex: 0 0 auto; margin-left: auto; color: #8c9d91; font-size: 10px; white-space: nowrap; }
body.mac-theme .next-shell .library-page .library-format-options { padding: 0 0 9px 61px; }
body.mac-theme .next-shell .library-page .library-format-button { border-color: #dce8dc; background: #f6faf5; color: #658570; }
body.mac-theme .next-shell .library-page .library-format-button[aria-pressed="true"] { border-color: #b6d6a0; background: #e5f3de; color: #315e3d; }
body.mac-theme .next-shell .library-page .library-file-list > .library-empty { margin: 30px auto; padding: 37px 25px; color: #7e9485; }
body.mac-theme .next-shell .library-page .library-file-list > .library-empty h3 { color: #2d4a37; font-size: 16px; }
body.mac-theme .next-shell .library-page .library-file-list > .library-empty p { color: #788f7d; font-size: 12px; }
body.mac-theme .next-shell .library-page .library-file-list > .library-empty .secondary { border-color: #244d3c; background: #244d3c; color: #fff; }

body.mac-theme .next-shell .library-page .library-preview { display: flex; flex-direction: column; background: #eef3ee; }
body.mac-theme .next-shell .library-page[data-preview-open="false"] .library-preview { display: none; }
body.mac-theme .next-shell .library-page .library-preview-heading { gap: 9px; min-height: 58px; padding: 12px 15px; border-bottom: 1px solid var(--library-line); background: #fff; }
body.mac-theme .next-shell .library-page .library-preview-heading h2 { color: #274133; font-size: 12px; font-weight: 720; }
body.mac-theme .next-shell .library-page .library-preview-heading > a,
body.mac-theme .next-shell .library-page .library-preview-source button { color: #507860; font-size: 11px; }
body.mac-theme .next-shell .library-page .library-preview-body { min-height: 0; background: #f5f8f3; }
body.mac-theme .next-shell .library-page .library-preview-body > .library-empty { color: #688272; }
body.mac-theme .next-shell .library-page .library-preview-body > .library-empty > span { display: block; color: #4c8061; font-size: 11px; font-weight: 740; }
body.mac-theme .next-shell .library-page .library-preview-body > .library-empty p { color: #65816e; font-size: 12px; }
body.mac-theme .next-shell .library-page .library-preview-body > .library-empty > a { border-color: #cbded1; background: #fff; color: #315d3e; font-size: 11px; }
body.mac-theme .next-shell .library-page .library-preview-feedback { background: #f5f8f3ed; }
body.mac-theme .next-shell .library-page .library-preview-feedback strong { color: #37604b; }
body.mac-theme .next-shell .library-page .library-preview-spinner { border-top-color: #81aa5f; }

@media (max-width: 1220px) {
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-layout { grid-template-columns: 200px minmax(270px, .9fr) minmax(300px, 1.1fr); }
  body.mac-theme .next-shell .library-page .library-toolbar { padding: 17px; }
}
@media (max-width: 1060px) {
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-layout { grid-template-columns: minmax(230px, .9fr) minmax(0, 1.1fr); grid-template-rows: auto minmax(0, 1fr); }
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-sidebar { grid-column: 1 / -1; max-height: 160px; }
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-sidebar .library-project-group { display: flex; flex-wrap: wrap; gap: 9px; }
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-sidebar .library-project-group > h2 { flex: 0 0 100%; margin-bottom: 2px; }
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-sidebar .library-category-group { flex: 1 1 180px; }
}
@media (max-width: 760px) {
  body.mac-theme .next-shell .library-page { gap: 12px; padding: 14px; }
  body.mac-theme .next-shell .library-page .library-heading { min-height: 110px; padding: 20px; border-radius: 14px; }
  body.mac-theme .next-shell .library-page .library-heading h1 { font-size: 27px; }
  body.mac-theme .next-shell .library-page .library-heading p { font-size: 11px; }
  body.mac-theme .next-shell .library-page.is-empty .library-layout { min-height: calc(100dvh - 230px); }
  body.mac-theme .next-shell .next-library-start { min-height: 350px; padding: 28px; }
  body.mac-theme .next-shell .next-library-start::after { right: -230px; opacity: .7; }
  body.mac-theme .next-shell .next-library-start h2 { font-size: 25px; }
  body.mac-theme .next-shell .library-page:not(.is-empty) .library-layout,
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(350px, 1fr); min-height: 600px; }
  body.mac-theme .next-shell .library-page .library-sidebar { grid-column: 1; max-height: 175px; }
  body.mac-theme .next-shell .library-page .library-sidebar .library-project-group { display: flex; flex-wrap: wrap; gap: 7px; }
  body.mac-theme .next-shell .library-page .library-sidebar .library-project-group > h2 { flex: 0 0 100%; margin-bottom: 2px; }
  body.mac-theme .next-shell .library-page .library-sidebar .library-category-group { flex: 1 1 140px; }
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-sidebar,
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-main { display: none; }
  body.mac-theme .next-shell .library-page[data-preview-open="true"] .library-preview { display: flex; grid-row: 1 / -1; min-height: 600px; }
  body.mac-theme .next-shell .library-page .library-preview-back { display: inline-flex !important; }
  body.mac-theme .next-shell .library-page .library-toolbar { padding: 16px; }
}
@media (max-width: 500px) {
  body.mac-theme .next-shell .library-page .library-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  body.mac-theme .next-shell .library-page .library-heading > div { flex: 0 0 100%; }
  body.mac-theme .next-shell .library-page .library-heading > button { align-self: flex-start; padding: 7px 10px; font-size: 10px; }
  body.mac-theme .next-shell .library-page .library-toolbar { grid-template-columns: minmax(0, 1fr); }
  body.mac-theme .next-shell .library-page .library-toolbar > div:first-child,
  body.mac-theme .next-shell .library-page .library-toolbar > div:nth-child(2) { grid-column: 1; }
  body.mac-theme .next-shell .library-page .library-toolbar h2 { font-size: 20px; word-break: keep-all; }
  body.mac-theme .next-shell .library-toolbar > div:nth-child(2) { justify-content: flex-start; flex-wrap: wrap; }
  body.mac-theme .next-shell .library-toolbar .library-search,
  body.mac-theme .next-shell .library-toolbar .library-sort,
  body.mac-theme .next-shell .library-toolbar .library-type-tabs { grid-column: 1; }
  body.mac-theme .next-shell .library-toolbar .library-sort { width: 100%; }
  body.mac-theme .next-shell .library-toolbar .library-sort select { width: 100%; }
  body.mac-theme .next-shell .library-page .library-item-date { display: none; }
  body.mac-theme .next-shell .next-library-start { min-height: 360px; padding: 23px; }
  body.mac-theme .next-shell .next-library-start p { font-size: 12px; }
}
