/* A file explorer, a reader, and an optional relationship inspector. */
.document-studio {
  --studio-hover: color-mix(in srgb, var(--accent-brief) 5%, var(--bg-surface));
  max-width: none;
  height: calc(100dvh - 52px);
  min-height: 530px;
  padding: 18px 24px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  container: studio / inline-size;
}
.document-studio .case-heading {
  margin-bottom: 14px;
  gap: 14px;
  flex: none;
}
.document-studio .case-heading h1 {
  font-size: 20px;
}
.document-studio .case-folder {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.document-studio .case-eyebrow {
  font-size: 9px;
}
.document-studio .case-nav {
  margin-bottom: 0;
  flex: none;
}
.document-studio .case-nav a {
  padding-bottom: 10px;
}
.studio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
  flex: none;
}
.studio-heading-title,
.studio-heading-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.studio-heading h2 {
  margin: 0;
  font: 600 17px/1.4 inherit;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.studio-heading-title > span {
  font-size: 11px;
  color: var(--text-muted);
}
.studio-heading-actions {
  gap: 8px;
}
.studio-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font:
    500 12px/1.4 Inter,
    sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.12s,
    box-shadow 0.12s,
    border-color 0.12s;
}
@media (hover: hover) {
  .studio-button:hover {
    background: var(--studio-hover, var(--bg-surface-2));
    box-shadow: 0 1px 3px #0001;
    border-color: color-mix(
      in srgb,
      var(--text-muted) 40%,
      var(--border-default)
    );
  }
}
.studio-button-primary {
  background: var(--accent-brief);
  border-color: var(--accent-brief);
  color: var(--on-accent-brief);
  padding: 8px 15px;
  box-shadow: 0 1px 3px #0002;
}
@media (hover: hover) {
  .studio-button-primary:hover {
    color: var(--on-accent-brief);
    background: color-mix(in srgb, var(--accent-brief) 87%, black);
    border-color: transparent;
    box-shadow: 0 2px 6px #0002;
  }
}
.document-studio
  :is(a, button, summary, input, select, [role="separator"]):focus-visible {
  outline: 2px solid var(--accent-brief);
  outline-offset: 2px;
}
.studio-layout {
  --explorer-width: 340px;
  display: grid;
  grid-template-columns: var(--explorer-width) 5px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: 0 2px 8px #00000004;
}
.studio-explorer {
  container: explorer / inline-size;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--bg-surface);
}
.studio-explorer-tools {
  padding: 12px 12px 8px;
  flex: none;
}
.document-studio .document-search {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg-surface-2);
  gap: 8px;
  padding: 3px 10px;
  transition:
    background 0.12s,
    border-color 0.12s,
    box-shadow 0.12s;
}
@media (hover: hover) {
  .document-studio .document-search:hover {
    border-color: var(--border-default);
  }
}
.document-studio .document-search:focus-within {
  background: var(--bg-surface);
  border-color: var(--accent-brief);
  box-shadow: 0 0 0 2px var(--accent-brief-soft);
}
.document-studio .document-search input {
  font-size: 12px;
  padding: 6px 0;
  height: 30px;
}
.document-studio .document-search input:focus-visible {
  outline: none;
}
.studio-search-key {
  font-size: 11px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--text-faint);
}
.studio-filter-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
}
.studio-filter-line > select {
  min-width: 0;
  max-width: 125px;
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font:
    11px Inter,
    sans-serif;
  padding: 7px 18px 7px 7px;
}
@media (hover: hover) {
  .studio-filter-line > select:hover {
    background: var(--bg-surface-2);
  }
}
.studio-category-menu {
  position: relative;
  min-width: 0;
}
.studio-category-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  list-style: none;
}
.studio-category-menu > summary::-webkit-details-marker {
  display: none;
}
.studio-category-menu[open] > summary {
  background: var(--bg-surface-2);
}
@media (hover: hover) {
  .studio-category-menu > summary:hover {
    background: var(--bg-surface-2);
  }
}
.document-studio .document-categories {
  display: flex;
  position: absolute;
  top: 37px;
  left: 0;
  width: 270px;
  max-width: calc(100vw - 50px);
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: 0 6px 25px #0002;
  z-index: 40;
}
.document-studio .document-category {
  padding: 10px;
  font-size: 12px;
}
.studio-library-link {
  font-size: 11px;
  color: var(--text-muted);
  padding: 12px 10px 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border-default);
  text-decoration: none;
  border-radius: 0 0 6px 6px;
}
@media (hover: hover) {
  .studio-library-link:hover {
    background: var(--bg-surface-2);
  }
}
.document-studio .document-list-label {
  background: var(--bg-surface);
  color: var(--text-muted);
  border-top: 1px solid var(--border-default);
  font-size: 11px;
  padding: 9px 14px;
  gap: 12px;
  flex: none;
}
.studio-file-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.document-studio .document-row {
  border-bottom: 1px solid
    color-mix(in srgb, var(--border-default) 60%, transparent);
  background: transparent;
}
.document-studio .document-row-main {
  padding: 10px 10px 10px 14px;
  min-height: 63px;
  gap: 10px;
  flex-wrap: nowrap;
  cursor: pointer;
  border-left: 3px solid transparent;
  padding-left: 11px;
}
@media (hover: hover) {
  .document-studio .document-row-main:hover {
    background: var(--studio-hover);
  }
}
.document-studio .document-row.is-selected > .document-row-main {
  background: color-mix(
    in srgb,
    var(--accent-brief-soft) 75%,
    var(--bg-surface)
  );
}
.document-studio .document-row.is-previewed > .document-row-main {
  border-left-color: var(--accent-brief);
  background: var(--accent-brief-soft);
}
.document-studio .document-row.is-previewed .document-name {
  color: var(--accent-brief);
}
.document-studio .document-row .document-name {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (hover: hover) {
  .document-studio .document-name:hover {
    text-decoration: none;
  }
}
.document-studio .document-row-label {
  flex: 1;
  width: auto;
  min-width: 0;
}
.document-studio .document-meta {
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  display: block;
  margin-top: 3px;
}
.document-studio .document-row .document-icon {
  border: 0;
  background: transparent;
  width: 18px;
  height: 23px;
}
.document-studio .document-date {
  display: none;
}
.document-studio .document-row-menu > summary {
  width: 23px;
  height: 28px;
  border-radius: 6px;
  opacity: 0.45;
}
.document-studio .document-row:focus-within .document-row-menu > summary,
.document-studio .document-row-menu[open] > summary {
  opacity: 1;
}
@media (hover: hover) {
  .document-studio .document-row-main:hover .document-row-menu > summary {
    opacity: 1;
  }
}
.document-studio .document-menu-items {
  position: fixed;
  inset: auto;
  right: auto;
  top: auto;
  transform: translate(-185px, 3px);
  min-width: 210px;
  z-index: 45;
}
.studio-tree-toggle {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--text-muted);
  background: transparent;
  width: 22px;
  height: 28px;
  padding: 0;
  flex: none;
  cursor: pointer;
}
@media (hover: hover) {
  .studio-tree-toggle:hover {
    background: var(--bg-surface-2);
  }
}
.studio-tree-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}
.studio-file-tree {
  margin: 0 10px 10px 39px;
  border-left: 1px solid var(--border-default);
  padding: 3px 0 3px 12px;
}
.studio-tree-version {
  padding: 5px 0;
}
.studio-tree-file {
  display: flex;
  align-items: center;
  gap: 8px;
}
.studio-tree-file > a {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  padding: 6px;
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}
.studio-tree-file > a small {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
}
.studio-file-tree a[data-active-file] {
  background: var(--accent-brief-soft);
  color: var(--accent-brief);
}
@media (hover: hover) {
  .studio-tree-file > a:hover {
    background: var(--accent-brief-soft);
    color: var(--accent-brief);
  }
}
.studio-tree-sources {
  display: inline-block;
  margin: 0 0 0 31px;
  padding: 3px 0;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
}
@media (hover: hover) {
  .studio-tree-sources:hover {
    text-decoration: underline;
    color: var(--accent-brief);
  }
}
.studio-tree-editor {
  font-size: 12px;
  padding: 6px 0;
}
.studio-tree-editor span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}
.studio-extra-files {
  padding: 4px 0 4px 24px;
}
.studio-extra-files > summary {
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
}
.studio-file-tree .document-history-file {
  gap: 7px;
  padding: 7px 0;
}
.studio-file-tree .document-history-file a {
  display: block;
  font-size: 10px;
}
/* Selection is an action toolbar, with a stable place above the files. */
.document-studio .document-selection-bar {
  flex: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 16px;
  min-height: 46px;
  padding: 6px 16px;
  border-block: 1px solid var(--border-default);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 12px;
}
.document-studio .document-selection-bar[hidden] { display: none; }
.studio-selection-title, .studio-selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.studio-selection-title { flex: 0 0 auto; }
.studio-selection-actions { min-width: 0; }
.document-studio .document-selection-bar strong { padding: 0 8px 0 0; font-size: 12px; font-weight: 500; }
.document-studio .document-selection-bar small { color: var(--text-muted); }
.document-studio .document-selection-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.3;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--text-secondary);
  white-space: nowrap;
}
@media (hover: hover) {
  .document-studio .document-selection-bar button:hover { background: var(--bg-surface); color: var(--text-primary); }
}
.document-studio .document-selection-bar button:disabled { opacity: .4; }
.document-studio .document-selection-bar:not([hidden]) ~ .document-list-label { display: none !important; }
.document-studio .document-bot-tools {
  padding: 8px 14px;
  gap: 6px 12px;
  flex: none;
}
.document-studio .document-bot-tools label {
  width: 100%;
}
.document-studio .document-context {
  padding: 4px 12px 10px;
  flex: none;
  border-bottom: 0;
  background: transparent;
}
.studio-explorer-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--text-faint);
  font-size: 10px;
  border-top: 1px solid var(--border-default);
  flex: none;
}
.studio-splitter {
  background: var(--bg-surface-2);
  border-left: 1px solid var(--border-default);
  border-right: 1px solid var(--border-default);
  cursor: col-resize;
  position: relative;
  touch-action: none;
  z-index: 2;
  transition: background 0.12s;
}
.studio-splitter:focus-visible,
.is-resizing .studio-splitter {
  background: var(--accent-brief);
  outline: none;
}
@media (hover: hover) {
  .studio-splitter:hover {
    background: var(--accent-brief);
    outline: none;
  }
}
.is-resizing {
  cursor: col-resize;
  user-select: none;
}
.is-resizing iframe {
  pointer-events: none;
}
.studio-reader {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg-canvas);
}
.studio-reader-welcome {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100%;
  padding: 30px;
  background: radial-gradient(
    ellipse at center,
    var(--bg-surface),
    var(--bg-canvas)
  );
}
.studio-welcome-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--accent-brief-soft);
  color: var(--accent-brief);
  border-radius: 18px;
  margin-bottom: 20px;
}
.studio-reader-welcome h3 {
  font:
    550 21px/1.4 Inter,
    sans-serif;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}
.studio-reader-welcome p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.9;
  max-width: 380px;
  margin: 0;
}
.studio-welcome-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 28px;
}
.studio-welcome-hints kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 21px;
  border: 1px solid var(--border-default);
  border-radius: 5px;
  background: var(--bg-surface);
  font: inherit;
  color: var(--text-secondary);
  margin-right: 3px;
}
.document-studio .file-reader-toolbar {
  gap: 5px;
  min-height: 60px;
  padding: 9px 12px;
}
.document-studio .file-reader-title strong {
  font-size: 12px;
  font-weight: 550;
}
.document-studio .file-reader-title {
  margin-right: 8px;
}
.document-studio .file-reader-paging {
  gap: 0;
}
.document-studio .file-reader-icon,
.document-studio .file-reader-paging a,
.document-studio .file-reader-paging button {
  width: 29px;
  height: 30px;
  border-radius: 6px;
}
.document-studio .file-reader-info {
  width: 280px;
  padding: 18px;
  background: var(--bg-surface);
}
.file-info-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 18px;
}
.file-info-heading h2 {
  margin: 0;
  font-size: 13px;
}
.document-studio .file-reader-paper {
  margin: 18px;
  padding: 30px 32px;
  min-height: calc(100% - 36px);
  max-width: 920px;
}
.document-studio .file-reader-paper pre {
  font-size: 13px;
  line-height: 1.85;
}
.document-studio .file-reader-page {
  scrollbar-width: thin;
}
.document-studio .file-reader-notice {
  font-size: 10px;
  padding: 7px 10px;
}
.document-studio .file-reader-info h3 {
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-top: 24px;
}
.file-reader-info a {
  border-radius: 3px;
}
@media (hover: hover) {
  .file-reader-info a:hover {
    color: var(--text-primary);
    text-decoration: underline;
  }
}
.file-reader-info .file-usage > div a {
  padding: 4px 7px;
  border: 1px solid var(--border-default);
  border-radius: 5px;
  text-decoration: none;
  background: var(--bg-surface);
}
@media (hover: hover) {
  .file-reader-info .file-usage > div a:hover {
    background: var(--accent-brief-soft);
    border-color: var(--accent-brief);
  }
}
.file-reader-loading {
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
}
.file-reader-loading > button:not([data-reader-close]) {
  display: inline-flex;
  margin: 12px auto;
  font-size: 12px;
}
.file-reader-loading h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-top: 80px;
}
.studio-skeleton {
  max-width: 500px;
  height: 180px;
  margin: 60px auto 30px;
  padding: 25px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-surface);
}
.studio-skeleton i {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-surface-2);
  margin: 16px 0;
  animation: studio-pulse 1.2s ease-in-out infinite alternate;
}
.studio-skeleton i:first-child {
  width: 65%;
  height: 12px;
}
.studio-skeleton i:last-child {
  width: 80%;
}
@keyframes studio-pulse {
  to {
    opacity: 0.35;
  }
}
.document-studio.is-reader-focused {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--bg-canvas);
  height: auto;
  padding: 0;
}
.document-studio.has-reader .studio-heading [data-studio-focus],
.document-studio.is-reader-focused > .studio-heading {
  display: none;
}
.document-studio.is-reader-focused .studio-reader {
  border-radius: 0;
}
.document-studio.is-reader-focused > .case-heading,
.document-studio.is-reader-focused > .case-nav,
.document-studio.is-reader-focused .studio-explorer,
.document-studio.is-reader-focused .studio-splitter {
  display: none;
}
.document-studio.is-reader-focused .studio-layout {
  grid-template-columns: minmax(0, 1fr);
}
.document-studio.is-reader-focused .file-reader-paper {
  margin: 24px auto;
  width: calc(100% - 48px);
  padding: 48px;
}
.document-studio
  :is(
    [data-file-tree],
    [data-reader-welcome],
    .document-selection-bar,
    .document-context,
    .document-bot-tools
  )[hidden] {
  display: none;
}
@container studio (max-width: 1040px) {
  .document-studio .file-reader-info {
    position: absolute;
    z-index: 4;
    top: 60px;
    bottom: 0;
    right: 0;
    box-shadow: -8px 0 28px #0002;
  }
  .document-studio .file-reader-paging span {
    display: none;
  }
}
@container studio (max-width: 760px) {
  .studio-layout {
    grid-template-columns: minmax(250px, 40%) 4px minmax(0, 1fr);
  }
  .document-studio .file-reader-toolbar {
    flex-wrap: wrap;
  }
  .document-studio .file-reader-title {
    flex-basis: calc(100% - 65px);
  }
  .document-studio .file-reader-info {
    top: 92px;
    width: min(280px, 100%);
  }
  .studio-heading-title > span {
    display: none;
  }
}
@media (max-width: 650px) {
  .document-studio {
    padding: 14px 10px 10px;
    min-height: 500px;
  }
  .document-studio .case-heading-actions {
    gap: 8px;
  }
  .document-studio .case-nav {
    gap: 20px;
  }
  .studio-heading {
    padding: 12px 0;
  }
  .studio-heading-actions {
    gap: 5px;
  }
  .studio-heading-actions .studio-button {
    padding: 6px 8px;
    font-size: 11px;
  }
  .studio-layout {
    display: flex;
  }
  .studio-explorer {
    flex: 1;
  }
  .studio-splitter {
    display: none;
  }
  .studio-reader {
    display: none;
    flex: 1;
  }
  .document-studio.has-reader .studio-reader {
    display: block;
  }
  .document-studio.has-reader .studio-explorer {
    display: none;
  }
  .document-studio.is-reader-focused .studio-reader {
    display: block;
  }
  .document-studio .file-reader-toolbar {
    flex-wrap: nowrap;
  }
  .document-studio .file-reader-title {
    flex-basis: auto;
  }
  .document-studio .file-reader-info {
    top: 60px;
  }
  .document-studio .file-reader-paper {
    padding: 22px;
    margin: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .studio-skeleton i {
    animation: none;
  }
}
.studio-button:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}
@media (hover: hover) {
  .studio-button:disabled:hover {
    background: var(--bg-surface);
    border-color: var(--border-default);
  }
}
.document-studio input[type="checkbox"] {
  border-radius: 3px;
}
@media (max-width: 650px) {
  .document-studio.has-reader.is-browsing-files .studio-explorer {
    display: flex;
  }
  .document-studio.has-reader.is-browsing-files .studio-reader {
    display: none;
  }
}
.studio-filter-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  flex: none;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}
.studio-filter-notice button {
  border: 0;
  border-radius: 4px;
  padding: 3px 5px;
  margin-left: auto;
  color: var(--accent-brief);
  background: var(--accent-brief-soft);
  font: inherit;
  cursor: pointer;
}
@media (hover: hover) {
  .studio-filter-notice button:hover {
    text-decoration: underline;
  }
}
.studio-filter-notice[hidden],
[data-selection-hidden][hidden] {
  display: none;
}
[data-selection-hidden] {
  color: var(--text-muted);
  font-size: 9px;
  margin-right: 8px;
}
.document-studio .document-dialog .cl-btn {
  border-radius: 8px;
  min-height: 34px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 500;
  transition:
    background 0.12s,
    box-shadow 0.12s;
}
@media (hover: hover) {
  .document-studio .document-dialog .cl-btn:hover {
    box-shadow: 0 1px 4px #0002;
  }
}
.document-studio .document-dialog .cl-btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}
.document-studio .document-create-doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.document-studio .document-create-doors a {
  padding: 11px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
  transition: background 0.12s;
}
@media (hover: hover) {
  .document-studio .document-create-doors a:hover {
    background: var(--accent-brief-soft);
    color: var(--accent-brief);
    border-color: var(--accent-brief);
  }
}
@media (max-width: 650px) {
  body:has(.document-studio) #cl-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    z-index: 60;
    box-shadow: 0 0 0 100vmax #11182766;
  }
  body:has(.document-studio) .cl-shell-col > header .case-crumb {
    display: none;
  }
  body:has(.document-studio) #cl-topbar-brand span {
    display: none;
  }
  .document-studio .case-heading-title {
    gap: 9px;
  }
  .document-studio .case-eyebrow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 145px;
  }
}
.file-reader-empty .studio-button {
  margin-top: 16px;
}

/* Calm file identity: name, related object, one location and a modified date. */
.document-studio .document-row-main {
  min-height: 72px;
  align-items: center;
  padding-block: 12px;
}
.document-studio .document-row-main > input {
  margin-top: 0;
  flex: none;
}
.document-file-tile {
  width: 28px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--accent-brief);
  background: color-mix(in srgb, var(--accent-brief) 6%, var(--bg-surface));
}
.document-file-tile small {
  display: none;
}
.document-file-tile-source {
  color: var(--accent-source);
}
.document-file-tile-brief {
  color: var(--accent-brief);
}
.document-file-tile-complaint {
  color: var(--accent-complaint, #785a87);
}
.document-studio .document-row .document-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.document-authority,
.document-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 4px;
  color: var(--text-secondary);
}
.document-authority {
  color: var(--accent-source);
}
.document-authority > svg,
.document-location > svg {
  flex: none;
}
.document-authority > span,
.document-location > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.document-studio .document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  font-size: 10px;
  white-space: normal;
}
.document-studio .document-meta > *::before {
  content: none;
}
.document-version-tag {
  color: var(--accent-brief);
}
.studio-version-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 5px 13px 10px;
  border-bottom: 1px solid var(--border-default);
  font-size: 10px;
  color: var(--text-muted);
}
.studio-version-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.studio-version-options input {
  accent-color: var(--accent-brief);
}
.file-export-note {
  margin-block: 16px;
  padding: 12px;
  border-radius: 7px;
  background: var(--bg-surface-2);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.file-technical-details {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}
.file-technical-details summary {
  cursor: pointer;
}
.file-technical-details code {
  overflow-wrap: anywhere;
  font-size: 10px;
}

/* Object references use the same registry accents and chip anatomy site-wide. */
a.cl-object-link {
  max-width: 100%;
  vertical-align: middle;
  text-decoration: none;
}
a.cl-object-link .cl-echip__label {
  min-width: 0;
}
a.cl-object-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.document-related {
  min-width: 0;
  margin-top: 4px;
}
/* A relationship stays a typed registry object, including its kind badge. */
.document-related .cl-object-link { max-width: 100%; min-width: 0; }
.document-related .cl-echip__label { max-width: none; }
.document-case-link { display: flex; align-items: center; min-width: 0; }
.document-modified {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}
.document-preview-status {
  color: var(--text-secondary);
  font-size: 10px;
}
.document-identity {
  min-width: 0;
}
.document-thumbnail {
  display: none;
}
.studio-list-location,
.studio-list-modified,
.studio-grid-name {
  display: none;
}
.document-view-switch {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--border-default);
  border-radius: 18px;
  overflow: hidden;
  margin-left: 8px;
}
.document-view-switch button {
  display: grid;
  place-items: center;
  width: 37px;
  height: 29px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.document-view-switch button + button {
  border-left: 1px solid var(--border-default);
}
@media (hover: hover) {
  .document-view-switch button:hover {
    background: var(--bg-surface-2);
  }
}
.document-view-switch button[aria-pressed="true"] {
  background: var(--accent-brief-soft);
  color: var(--accent-brief);
}
.document-view-switch button:focus-visible {
  outline-offset: -3px;
}
.document-studio:not(.has-reader) .studio-layout {
  grid-template-columns: minmax(0, 1fr);
}
.document-studio:not(.has-reader) .studio-splitter,
.document-studio:not(.has-reader) .studio-reader {
  display: none;
}
.document-studio .document-row:focus-visible {
  outline: 2px solid var(--accent-brief);
  outline-offset: -2px;
}

@container studio (min-width: 780px) {
  .document-studio:not(.has-reader) .studio-explorer-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px 12px;
  }
  .document-studio:not(.has-reader) .document-search {
    flex: 1;
    max-width: 620px;
    border-radius: 24px;
    padding-inline: 16px;
  }
  .document-studio:not(.has-reader) .studio-filter-line {
    gap: 20px;
  }
  .document-studio:not(.has-reader) .studio-version-options {
    padding-inline: 22px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .document-row-main {
    display: grid;
    grid-template-columns: 18px 28px minmax(0, 1fr) 28px;
    gap: 14px;
    min-height: 72px;
    padding: 12px 20px 12px 17px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .document-row-label {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 100px;
    gap: 28px;
    align-items: center;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .document-list-label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 28px;
    gap: 14px;
    padding: 12px 20px;
    min-height: 44px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .studio-column-labels {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 100px;
    gap: 28px;
    padding-left: 42px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    :is(.studio-list-location, .studio-list-modified) {
    display: block;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .document-result-count {
    /* Preserve live result announcements without another visible column. */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .document-location {
    margin: 0;
    font-size: 12px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader) .document-meta {
    margin: 0;
  }
}

/* The same file nodes become cards; the reader keeps a compact explorer. */
.document-studio[data-document-view="grid"]:not(.has-reader)
  .studio-file-scroll {
  padding: 4px 18px 20px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 16px;
  align-content: start;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-row {
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg-surface-2);
  min-width: 0;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
@media (hover: hover) {
  .document-studio[data-document-view="grid"]:not(.has-reader)
    .document-row:hover {
    border-color: color-mix(
      in srgb,
      var(--text-muted) 50%,
      var(--border-default)
    );
    box-shadow: 0 3px 12px #0000000a;
  }
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-row.is-selected {
  border-color: var(--accent-brief);
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-row-main {
  display: grid;
  grid-template-columns: 17px 23px minmax(0, 1fr) 25px;
  grid-template-rows: 40px 180px auto auto auto;
  align-items: center;
  gap: 8px 7px;
  padding: 10px 12px 12px;
  border-left: 0;
  border-radius: 11px;
  height: 100%;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-row-main
  > input {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-file-tile {
  grid-column: 2;
  grid-row: 1;
  width: 23px;
  min-height: 28px;
  border: 0;
  background: transparent;
  gap: 0;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-file-tile
  small {
  font-size: 7px;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-row-label,
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-identity {
  display: contents;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-name {
  grid-column: 3;
  grid-row: 1;
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-row-menu {
  grid-column: 4;
  grid-row: 1;
  align-self: center;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-row-menu
  > summary {
  opacity: 0.8;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-related {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 2px 0 0;
  min-height: 18px;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-location {
  grid-column: 1 / -1;
  grid-row: 4;
  margin-top: 0;
  font-size: 10px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-meta {
  grid-column: 1 / -1;
  grid-row: 5;
  margin-top: 0;
  font-size: 10px;
  gap: 3px 7px;
  min-height: 14px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-mode {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block {
  display: block;
  grid-column: 1 / -1;
  grid-row: 4;
  min-width: 0;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-identity > .document-related { display: none; }
/* The footer's case chip is location, not a related line: it stays on the card
   (Bennett 2026-09-18: forty saved versions of one brief "almost look like
   duplicates" — nothing on the card said which case or which version). */
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block .document-case-link { display: flex; flex-wrap: wrap; gap: 4px 6px; row-gap: 4px; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-contributor { margin-top: 5px; }
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-thumbnail {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  position: relative;
  align-items: flex-start;
  justify-content: center;
  align-self: stretch;
  overflow: hidden;
  padding: 14px 25px 0;
  border: 1px solid color-mix(in srgb, var(--border-default) 65%, transparent);
  border-radius: 6px;
  background: color-mix(
    in srgb,
    var(--bg-surface-2) 80%,
    var(--border-default)
  );
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}
.document-paper {
  display: block;
  width: 100%;
  max-width: 250px;
  min-height: 240px;
  padding: 20px 18px;
  background: var(--bg-surface);
  box-shadow: 0 1px 8px #00000010;
  overflow: hidden;
  transform-origin: center top;
  transition: transform 0.15s;
}
@media (hover: hover) {
  .document-thumbnail:hover .document-paper {
    transform: translateY(-3px);
  }
}
.document-paper-title {
  display: block;
  margin-bottom: 14px;
  font:
    600 7px/1.5 Georgia,
    serif;
  text-align: center;
  overflow-wrap: anywhere;
}
.document-paper-text {
  display: block;
  font:
    6px/1.75 Georgia,
    serif;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
}
.document-thumbnail-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 8px 6px;
  background: linear-gradient(transparent, var(--bg-surface-2) 70%);
  text-align: center;
  font:
    500 9px/1.4 Inter,
    sans-serif;
  color: var(--text-muted);
}
.document-thumbnail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  align-self: center;
  padding-bottom: 14px;
  color: var(--text-muted);
  font-size: 10px;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-list-label {
  padding-inline: 22px;
  border-top: 0;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .studio-list-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-secondary);
}
@media (prefers-reduced-motion: reduce) {
  .document-paper {
    transition: none;
  }
}

/* Drive is the workspace itself: no enclosing card or outer gutter. */
.drive-studio {
  width: 100%;
  gap: 0;
  margin: 0;
  padding: 0;
  height: calc(100dvh - 52px);
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg-surface);
}
.drive-studio .studio-heading { padding: 30px 32px 8px; gap: 20px; }
.drive-studio .studio-heading h1 { font: 500 32px/1.2 var(--font-serif, Georgia, serif); letter-spacing: -.6px; margin: 0; }
.drive-heading-copy { min-width: 0; }
.drive-heading-copy p { margin: 7px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.drive-studio .studio-heading-actions { flex: none; gap: 8px; }
.drive-studio .studio-heading-actions .cl-btn { min-height: 38px; padding-inline: 16px; font-size: 13px; gap: 7px; }
.drive-connections { position: relative; }
.drive-connections summary { list-style: none; }
.drive-connections summary::-webkit-details-marker { display: none; }
.drive-connections .document-menu-items { left: auto; right: 0; top: calc(100% + 6px); min-width: 180px; }
.studio-button-quiet { background: transparent; border-color: transparent; box-shadow: none; }
.drive-studio .studio-layout { box-shadow: none; border: 0; border-radius: 0; }
.drive-view-toolbar { display: flex; align-items: center; justify-content: space-between; flex: none; gap: 16px; padding: 4px 32px 0; }
.drive-tabs { display: flex; align-items: center; gap: 26px; min-width: 0; overflow: auto; flex: 1; padding: 0; }
.drive-tabs a { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 13px 0 12px; border-bottom: 2px solid transparent; color: var(--text-muted); text-decoration: none; font-size: 13px; line-height: 1.4; }
@media (hover: hover) {
  .drive-tabs a:hover { color: var(--text-primary); }
}
.drive-tabs a[aria-current] { color: var(--accent-brief); border-bottom-color: var(--accent-brief); font-weight: 600; }
.drive-shortcuts { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.drive-shortcuts kbd { font: inherit; padding: 1px 4px; margin-right: 3px; border: 1px solid var(--border-default); border-radius: 4px; }
.drive-search-form {
  padding: 18px 18px 8px;
  flex-shrink: 0;
}
.drive-search-form .document-search {
  background: var(--color-surface-2, #f2f5f9);
  min-height: 50px;
  border-radius: 26px;
  border: 0;
  padding: 5px 8px 5px 18px;
}
.drive-search-form .document-search input {
  width: 100%;
  background: transparent;
  font-size: 15px;
}
.drive-search-form .document-search .studio-button {
  padding: 7px 15px;
  border: 0;
  border-radius: 20px;
}
.drive-filter-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
  padding: 0 0 8px;
}
.drive-filter-line select {
  font-size: 12px;
  max-width: 230px;
  border: 1px solid var(--color-border, #dfe5ed);
  background: var(--color-surface-1, #fff);
  padding: 7px 26px 7px 11px;
  border-radius: 8px;
}
.drive-filter-line label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary, #526070);
}
.drive-pagination {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border, #e6ebf1);
  color: var(--color-text-secondary, #526070);
  font-size: 12px;
}
.drive-pagination div {
  display: flex;
  gap: 18px;
}
.document-location-block {
  min-width: 0;
}
.document-case-link {
  margin: 0;
}
.document-case-link .cl-object-link {
  max-width: 100%;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .document-location-block {
  grid-column: 1 / -1;
  grid-row: 4;
}
.document-permission {
  font-size: 10px;
  color: var(--color-text-tertiary, #657488);
}
.document-row-menu form {
  margin: 0;
}
.drive-form-page { max-width:820px; margin:34px auto 80px; padding:0 28px; color:var(--color-text-primary,#263448); }
.drive-form-page h1 { font-size:28px; font-weight:600; letter-spacing:-.6px; margin:18px 0 8px; }
.drive-form-page h2 { font-size:18px; font-weight:600; margin:0 0 8px; }
.drive-form-page p { color:var(--color-text-secondary,#596878); font-size:14px; line-height:1.6; margin:8px 0 22px; }
.drive-form-page form { margin:24px 0; }
.drive-form-page .document-form-field, .drive-box-preview .document-form-field, .file-reader-info .document-form-field { display:flex; flex-direction:column; gap:8px; margin:18px 0; font-size:13px; }
.drive-form-page .document-form-field :is(input,textarea,select), .drive-box-preview .document-form-field :is(input,textarea,select), .file-reader-info .document-form-field :is(input,textarea,select) { width:100%; box-sizing:border-box; border:1px solid var(--border-default); border-radius:8px; background:var(--bg-surface); color:var(--text-primary); padding:10px 12px; }
.drive-form-page .document-form-field :is(input,textarea,select):focus-visible { outline:2px solid var(--accent-brief); outline-offset:2px; }
.drive-class-options { border:0; padding:0; margin:26px 0; }
.drive-class-options legend { font-size:13px; font-weight:600; margin-bottom:10px; }
.drive-class-options > label { display:flex; align-items:start; gap:12px; padding:17px; border:1px solid var(--color-border,#dce3ee); border-radius:12px; margin:9px 0; cursor:pointer; }
.drive-class-options > label:has(input:checked) { border-color:#6b9fd7; background:var(--color-surface-2,#f1f6fc); }
.drive-class-options input { margin-top:4px; }
.drive-class-options strong, .drive-class-options small { display:block; }
.drive-class-options strong { font-size:14px; font-weight:600; }
.drive-class-options small { font-size:12px; line-height:1.55; color:var(--color-text-secondary,#596878); margin-top:5px; }
.drive-tag { margin-left:auto; white-space:nowrap; padding:3px 7px; background:var(--color-surface-2,#f0f3f8); font-size:10px; border-radius:5px; }
.drive-form-section { padding-top:26px; margin-top:32px; border-top:1px solid var(--color-border,#e0e6ee); }
.drive-form-section .studio-button { margin:0 8px 8px 0; }
.drive-text-editor { min-height:48vh; font-family:ui-monospace,SFMono-Regular,monospace; font-size:14px; line-height:1.7; resize:vertical; tab-size:2; }
.drive-history { list-style:none; padding:0; margin:10px 0; }
.drive-history li { padding:10px 0; border-bottom:1px solid var(--color-border,#e0e6ee); }
.drive-history small { display:block; margin-top:4px; color:var(--color-text-secondary,#657488); }
.drive-history form { margin-top:5px; }
.drive-box-logo { color:#0875cf; font-family:Arial,sans-serif; font-size:42px; font-weight:700; letter-spacing:-3px; }
.drive-provider-heading { display:flex; align-items:center; gap:22px; margin:18px 0; }
.drive-provider-heading h1 { margin:0; }
.drive-provider-heading p { margin:4px 0; }
.drive-box-preview { width:min(100%,620px); margin:50px auto; padding:28px; text-align:center; }
.drive-box-preview h2 { font-size:21px; overflow-wrap:anywhere; font-weight:600; margin:18px 0 10px; }
.drive-box-preview p { color:var(--color-text-secondary,#596878); font-size:13px; line-height:1.6; margin:20px 0; }
.drive-box-preview form { border-top:1px solid var(--color-border,#e0e6ee); margin-top:28px; padding-top:15px; text-align:left; }
.drive-permission-list { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin:20px 0; font-size:12px; }
.drive-permission-list span { border-radius:20px; background:var(--color-surface-2,#eef3fa); padding:6px 11px; }
.drive-setup-card { padding:22px; border:1px solid var(--color-border,#dce3ee); border-radius:14px; background:var(--color-surface-2,#f6f8fb); }
.drive-setup-card form, .drive-setup-card p:last-child { margin-bottom:0; }
.drive-copy-options { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.drive-copy-options article { padding:20px; border-radius:12px; border:1px solid var(--color-border,#dce3ee); }
.drive-copy-options h3 { font-weight:600; font-size:15px; }
.drive-copy-options p { font-size:13px; margin:8px 0 0; }
.drive-download-list { list-style:none; padding:0; }
.drive-download-list li { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:15px 0; border-bottom:1px solid var(--color-border,#dce3ee); }
@media(max-width:650px) { .drive-form-page { padding:0 18px; margin-top:20px; } .drive-copy-options { grid-template-columns:1fr; } .drive-filter-line select { max-width:100%; flex:1; min-width:120px; } .drive-class-options > label { flex-wrap:wrap; } .drive-tag { display:none; } .drive-studio .studio-heading { flex-wrap:wrap; } .drive-pagination { font-size:11px; } }

/* Search stays compact until focus, then opens over the file grid. */
.studio-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  flex: none;
}
.studio-search-toolbar .drive-search-form {
  position: relative;
  z-index: 12;
  padding: 0;
  flex: 1;
  min-width: 0;
  max-width: 760px;
}
.studio-search-toolbar .document-view-switch {
  margin: 0;
}
.drive-applied-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 12px;
  flex: none;
  min-width: 0;
  font-size: 11px;
}
.drive-applied-filters[hidden] { display: none; }
[data-applied-filter-list] {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
}
[data-applied-filter-list] a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  max-width: 240px;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--accent-brief-soft);
  color: var(--text-primary);
  text-decoration: none;
}
[data-applied-filter-list] a > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-applied-filter-list] a > span:last-child { color: var(--text-muted); font-size: 16px; }
[data-applied-filter-clear] { flex: none; color: var(--text-secondary); white-space: nowrap; }
@media (hover: hover) {
  .drive-applied-filters a:hover { color: var(--accent-brief); }
}
.drive-applied-filters a:focus-visible { outline: 2px solid var(--accent-brief); outline-offset: 1px; }
.document-studio.has-reader .drive-applied-filters { padding-inline: 10px; gap: 8px; }
@container studio (max-width:779px) { .drive-applied-filters { padding-inline: 12px; } }

.studio-column-labels {
  flex: 1;
  min-width: 0;
}
.document-studio .document-result-count {
  font-size: 11px;
  font-weight: 400;
}
.document-studio.has-reader .document-list-label {
  padding-block: 8px;
}
.document-studio.has-reader .document-location-block {
  margin-top: 3px;
}
.document-studio.has-reader .document-meta {
  display: none;
}
.document-studio.has-reader .document-view-switch { display: none; }
.document-studio.has-reader .studio-search-toolbar {
  gap: 10px;
  padding: 12px;
}
.document-studio.has-reader .file-search-bar {
  padding-left: 12px;
  gap: 7px;
}
.document-studio.has-reader .file-search-bar > input {
  font-size: 12px;
}
.document-studio.has-reader .document-file-tile {
  width: 22px;
  background: transparent;
}
.document-studio.has-reader .document-row-main {
  gap: 8px;
}
.document-studio[data-document-view="grid"]:not(.has-reader)
  .studio-column-name {
  display: none;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .studio-grid-name {
  display: inline;
}
@container studio (max-width:779px) {
  .studio-search-toolbar {
    gap: 12px;
    padding: 14px;
  }
  .document-studio:not(.has-reader) .document-row-main {
    padding-right: 14px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader)
    .document-location-block {
    margin-top: 4px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader) .document-meta {
    display: none;
  }
}

.case-file-search { flex:1; min-width:0; max-width:760px; position:relative; z-index:12; }
.file-search-shell { position:relative; width:100%; }
.file-search-bar { display:flex; align-items:center; gap:12px; min-height:50px; border-radius:26px; padding:5px 12px 5px 18px; background:var(--bg-surface-2); border:1px solid transparent; color:var(--text-secondary); }
.file-search-bar > input { flex:1; min-width:0; width:100%; border:0; background:transparent; outline:none; box-shadow:none; color:var(--text-primary); padding:8px 0; font-size:15px; }
.file-search-bar input::-webkit-search-cancel-button { display:none; }
.file-search-icon { display:flex; align-items:center; justify-content:center; gap:3px; flex-shrink:0; min-width:34px; height:34px; border:0; border-radius:50%; background:transparent; cursor:pointer; color:var(--text-secondary); }
@media (hover: hover) {
  .file-search-icon:hover { background:var(--bg-surface-3,var(--bg-surface-2)); }
}
.file-search-icon [data-filter-count] { font-size:10px; font-weight:700; color:var(--accent-brief); }
.file-search-icon:focus-visible,.file-search-footer button:focus-visible { outline:2px solid var(--accent-brief); outline-offset:2px; }
.is-open > .file-search-shell { border-radius:24px 24px 0 0; background:var(--bg-surface); box-shadow:0 6px 26px #0002,0 0 0 1px var(--border-default); }
.is-open .file-search-bar { background:var(--bg-surface); border-radius:24px 24px 0 0; }
.file-search-panel { position:absolute; top:100%; left:0; right:0; border-radius:0 0 24px 24px; background:var(--bg-surface); box-shadow:0 14px 22px #0002,0 1px 0 1px var(--border-default); overflow:auto; max-height:min(620px,calc(100dvh - 270px)); overscroll-behavior:contain; }
.file-search-quick { display:flex; gap:10px; flex-wrap:wrap; padding:12px 18px 16px; }
.file-search-quick select,.file-search-advanced select { border:1px solid var(--border-default); border-radius:9px; background:var(--bg-surface); padding:8px 26px 8px 12px; font-size:12px; color:var(--text-primary); max-width:100%; min-width:0; }
.file-search-advanced { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:0 18px 15px; padding-top:14px; border-top:1px solid var(--border-default); }
.file-search-advanced label { display:flex; flex-direction:column; gap:6px; font-size:11px; color:var(--text-secondary); }
.file-search-advanced .file-search-history { grid-column:1/-1; flex-direction:row; align-items:center; }
.file-search-status { padding:10px 19px; border-top:1px solid var(--border-default); font-size:11px; color:var(--text-muted); }
.file-search-status button { color:var(--accent-brief); background:none; border:0; cursor:pointer; }
.file-search-results { padding:0 7px; }
.file-search-result { display:flex; align-items:center; gap:13px; padding:13px 12px; border-radius:9px; color:var(--text-primary); text-decoration:none; min-width:0; }
.file-search-result[aria-selected=true],
.file-search-result:focus-visible { background:var(--accent-brief-soft); outline:0; }
@media (hover: hover) {
  .file-search-result:hover { background:var(--accent-brief-soft); outline:0; }
}
.file-search-format { display:grid; place-items:center; width:34px; height:38px; flex:none; border:1px solid var(--border-default); border-radius:5px; font-size:8px; font-weight:700; color:var(--accent-brief); background:var(--bg-surface-2); text-transform:uppercase; overflow:hidden; }
.file-search-result-copy { flex:1; min-width:0; }
.file-search-result-copy strong { display:block; font-size:13px; line-height:1.45; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-search-result-copy small { display:block; margin-top:3px; font-size:11px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-search-date { flex:none; font-size:11px; color:var(--text-secondary); }
.file-search-footer { display:flex; align-items:center; gap:18px; padding:15px 20px; border-top:1px solid var(--border-default); position:sticky; bottom:0; background:var(--bg-surface); font-size:11px; }
.file-search-footer button { border:0; padding:4px 0; background:none; color:var(--accent-brief); font-size:12px; cursor:pointer; }
.file-search-footer [data-search-all] { margin-left:auto; white-space:nowrap; font-weight:600; }
.file-search-footer [data-search-reset] { color:var(--text-muted); font-size:11px; }
.file-search-footer > span { color:var(--text-muted); }
.file-search-submit { border:0; padding:7px; background:transparent; color:var(--accent-brief); }
[data-file-search] [hidden] { display:none!important; }
@container studio (max-width:650px) {
  .studio-explorer-tools { position:relative; }
  .case-file-search { max-width:none; width:100%; }
  .drive-search-form { padding:12px; }
  .studio-search-toolbar:has(.drive-search-form.is-open) .document-view-switch { display:none; }
  .studio-search-toolbar:has(.drive-search-form.is-open) .drive-search-form { max-width:none; }
  .file-search-bar { gap:8px; padding-left:14px; }
  .file-search-panel { max-height:calc(100dvh - 235px); }
  .file-search-quick { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:10px 12px; }
  .file-search-quick select:first-child { grid-column:1/-1; }
  .file-search-quick select { flex:1; padding-left:8px; font-size:11px; }
  .file-search-advanced { grid-template-columns:1fr; margin-inline:12px; }
  .file-search-date { display:none; }
  .file-search-footer { gap:10px; padding:12px; }
  .file-search-result { padding:11px 8px; gap:9px; }
  .file-search-footer > span { font-size:10px; }
}

.file-search-bar > input:focus-visible { outline:none !important; box-shadow:none; }
.file-search-shell:focus-within { border-color:var(--accent-brief); }

/* Keep footer actions clear of the app’s floating assistant button. */
.drive-pagination { padding-right:72px; }
@container studio (max-width:650px) { .file-search-footer { padding-right:66px; flex-wrap:wrap; } }

/* File action geometry is shared by Drive and case Documents. */
.document-studio .document-row-main { position: relative; }
.document-row-discuss { position: absolute; right: 42px; top: 14px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 6px; color: var(--text-muted); background: transparent; cursor: pointer; opacity: 0; }
.document-row-discuss span { display: none; }
@media (hover: hover) {
  .document-studio .document-row:is(:hover,:focus-within,.is-discussing) .document-row-discuss { opacity: 1; }
  .document-studio .document-row-discuss:hover { color: var(--accent-brief); background: var(--bg-surface-2); }
}
.document-studio .document-menu-items :is(button,a) { display: flex; align-items: center; gap: 9px; }
.document-studio .document-row.is-selected { background: color-mix(in srgb, var(--accent-brief) 7%, var(--bg-surface)); }
.document-row.is-discussing .document-row-discuss { color: var(--accent-brief); background: var(--accent-brief-soft); }
/* In a reader's narrow file list, actions occupy space instead of covering text. */
.document-studio.has-reader .document-row-discuss {
  position: static;
  flex: 0 0 28px;
  transform: none;
}
.document-studio.has-reader .document-row-label { padding-right: 0; }
.document-studio.has-reader .document-row-menu { flex: none; }
.drive-studio .studio-search-toolbar { padding: 20px 32px 6px; }
.drive-studio .studio-search-toolbar .drive-search-form { max-width: none; }
.drive-studio .file-search-shell { max-width: 860px; }
.drive-studio .file-search-bar { min-height: 52px; border-radius: 28px; padding: 4px 14px 4px 20px; }
.drive-studio .file-search-bar > input { font-size: 16px; padding-block: 8px; }
.drive-studio .is-open > .file-search-shell, .drive-studio .is-open .file-search-bar { border-radius: 24px 24px 0 0; }
.drive-studio .file-search-quick { padding: 16px 0 6px; gap: 10px; }
/* Native selects keep keyboard and screen-reader behavior inside shared soft controls. */
.drive-filter-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 22px; background: var(--bg-surface-2); color: var(--text-secondary); min-width: 0; padding-left: 14px; }
.drive-filter-chip > svg { flex: none; pointer-events: none; }
.drive-filter-chip > svg:last-child { position: absolute; right: 12px; }
.drive-studio .file-search-quick .drive-filter-chip select { appearance: none; width: 112px; max-width: 190px; min-height: 36px; border: 0; padding: 6px 30px 6px 0; border-radius: 22px; background: transparent; background-image: none; color: inherit; font: 500 12px/1.5 var(--font-sans, Inter, sans-serif); text-overflow: ellipsis; cursor: pointer; }
.drive-studio .file-search-quick .drive-filter-case select { width: 165px; }
@media (hover: hover) {
  .drive-filter-chip:hover { background: var(--bg-hover, var(--bg-surface-2)); }
}
.drive-filter-chip:focus-within { outline: 2px solid var(--accent-brief); outline-offset: 2px; }
.drive-filter-chip select:focus-visible { outline: none; }
.drive-filter-chip:has(option:checked:not([value=""])) { color: var(--accent-brief); border-color: color-mix(in srgb,var(--accent-brief) 25%,transparent); }
.drive-studio .studio-file-scroll { padding: 0 24px 16px; }
.drive-studio .document-list-label { margin-inline: 24px; border-top: 0; border-bottom: 1px solid var(--border-default); }
.drive-studio .document-selection-bar { margin: 4px 24px; border: 0; border-radius: 10px; }
.drive-studio[data-document-view="list"] .document-row { border-radius: 10px; }
.drive-studio[data-document-view="list"] .document-row-main { border-radius: 10px; }
.drive-studio .document-row.is-discussing { box-shadow: inset 3px 0 var(--accent-brief); }
.drive-studio .document-row .document-name { font-size: 14px; line-height: 1.5; }
.drive-studio .document-related .cl-object-link { font-size: 12px; max-width: 100%; }
.drive-studio .document-related .cl-echip__kind { font-size: 9px; }
.drive-studio .document-modified { font-size: 12px; }
.drive-studio .document-name .cl-echip__kind { font-size: 9px; }
.drive-studio .document-mode, .drive-studio .document-usage { font-size: 11px; }
.drive-studio[data-document-view="list"]:not(.has-reader) .document-row-main { min-height: 64px; padding-inline: 10px; }
.drive-studio[data-document-view="list"]:not(.has-reader) .document-list-label { padding-inline: 10px; min-height: 46px; }
.drive-studio[data-document-view="grid"]:not(.has-reader) .studio-file-scroll { padding: 12px 32px 24px; }
.drive-studio .drive-pagination { border-top: 0; }

.drive-studio .file-search-quick .drive-applied-filters { padding: 0; margin: 0; min-height: 30px; gap: 8px; }
.drive-studio [data-applied-filter-list]:empty { display: none; }
.drive-studio .document-view-switch { flex: none; margin: 0; border-radius: 7px; }
.drive-studio .document-view-switch button { width: 38px; height: 32px; }
.drive-studio .document-list-label { font-size: 12px; background: var(--bg-surface); color: var(--text-muted); }
.drive-studio .document-selection-bar { padding-inline: 16px; }
.drive-studio .drive-pagination { padding: 14px 76px 14px 34px; font-size: 12px; background: var(--bg-surface); }
.drive-studio .drive-pagination > div { display: flex; align-items: center; gap: 20px; }
@container studio (min-width: 780px) {
  .document-studio[data-document-view="list"]:not(.has-reader) .document-row-main {
    grid-template-columns: 16px 26px minmax(0, 1fr) 30px 28px;
    gap: 12px;
    min-height: 56px;
    padding: 10px 20px 10px 21px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader) .document-row-label,
  .document-studio[data-document-view="list"]:not(.has-reader) .studio-column-labels {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 90px;
    gap: 22px;
  }
  .document-studio[data-document-view="list"]:not(.has-reader) .document-list-label { grid-template-columns: 16px minmax(0, 1fr) 70px; gap: 12px; padding: 10px 20px 10px 21px; min-height: 42px; }
  .document-studio[data-document-view="list"]:not(.has-reader) .studio-column-labels { padding-left: 38px; }
  .document-studio[data-document-view="list"]:not(.has-reader) .document-row-discuss {
    position: static; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 6px; color: var(--text-muted); cursor: pointer; background: transparent; opacity: 0;
  }
  .document-studio[data-document-view="list"]:not(.has-reader) .document-row-discuss span { display: none; }
  @media (hover: hover) {
    .document-studio .document-row:is(:hover,:focus-within,.is-discussing) .document-row-discuss { opacity: 1; }
    .document-studio .document-row-discuss:hover { background: var(--bg-surface-2); color: var(--accent-brief); }
  }
}
.drive-studio .document-file-tile { width: 26px; height: 30px; border-radius: 4px; background: transparent; color: var(--text-muted); }



.drive-studio .document-row.is-discussing { box-shadow: inset 3px 0 var(--accent-brief); }
@container studio (max-width: 779px) {
  .drive-studio .studio-heading { padding: 18px 16px 2px; }
  .drive-studio .studio-search-toolbar { padding: 14px 16px 2px; }
  .drive-view-toolbar { padding-inline: 16px; gap: 12px; }
  .drive-tabs { gap: 17px; }
  .drive-studio .document-row-main { min-height: 60px; padding-block: 10px; }
  .drive-studio .document-selection-bar { gap: 2px 6px; padding: 5px 10px; }
  .drive-studio .document-selection-bar button { padding-inline: 7px; font-size: 11px; }
  .drive-studio .drive-pagination { padding-left: 16px; }
  .drive-shortcuts { display: none; }
}
@container studio (max-width: 560px) {
  .drive-heading-copy p { display: none; }
  .drive-studio .studio-heading h1 { font-size: 28px; }
  .drive-studio .studio-heading-actions .cl-btn { padding-inline: 10px; font-size: 11px; }
  .drive-connections summary span { display: none; }
  .drive-studio .file-search-quick { display: flex; flex-wrap: wrap; }
  .drive-studio .file-search-quick select { flex: 0 1 auto; min-width: 0; max-width: 100%; }
  .drive-studio .document-selection-bar { align-items: flex-start; }
  .drive-studio .studio-selection-actions { flex: 1 1 100%; padding-left: 3px; gap: 0; }
  .drive-studio .studio-selection-actions button { gap: 4px; font-size: 10px; }
  .drive-studio .drive-pagination > div { gap: 12px; }
}
@media (max-width: 650px) {
  .drive-studio { width: 100%; margin: 0; height: calc(100dvh - 52px); border-radius: 0; }
  .drive-studio .studio-heading { flex-wrap: nowrap; }
}

.drive-studio .document-file-tile[data-format="pdf"] { color: var(--status-danger, #a94b4b); }
.drive-studio .document-file-tile:is([data-format="docx"],[data-format="doc"],[data-format="gdoc"]) { color: var(--accent-brief); }

@container studio (max-width: 779px) {
  .document-studio[data-document-view="list"] .document-row-label,
  .document-studio.has-reader .document-row-label { padding-right: 0; }
  .document-studio[data-document-view="list"] .document-row-discuss {
    position: static;
    flex: 0 0 28px;
    transform: none;
  }
  .drive-studio .file-search-quick { display: flex; flex-wrap: wrap; padding: 10px 0 5px; }
  .drive-studio .file-search-quick select { flex: 0 1 auto; max-width: 100%; }
}

.document-name .cl-object-badge { display: inline-flex; vertical-align: 1px; margin-right: 7px; }
.document-name .cl-echip__kind { font-size: 8px; line-height: 1.3; }
.document-usage { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 10px; color: var(--text-muted); }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-name { padding-right: 24px; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-usage { grid-column: 1 / -1; grid-row: 6; }
.drive-studio.has-reader .file-search-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 8px 0 2px; }
.drive-studio.has-reader .file-search-quick select { width: 100%; padding-inline: 8px 20px; font-size: 11px; }
.drive-studio.has-reader .file-search-quick select:first-child,
.drive-studio.has-reader .file-search-quick .drive-applied-filters { grid-column: 1 / -1; }
.drive-studio.has-reader .file-search-quick .drive-applied-filters { min-height: 22px; }
.drive-studio.has-reader .drive-view-toolbar { padding: 0 10px; }
.drive-studio.has-reader .drive-tabs { gap: 10px; }
.drive-studio.has-reader .drive-tabs a { font-size: 10px; padding-block: 10px; }
.drive-studio.has-reader .drive-tabs svg { display: none; }
.drive-studio.has-reader .drive-pagination { padding: 10px 12px; gap: 8px; font-size: 10px; }
.drive-studio.has-reader .drive-pagination > span { white-space: nowrap; }
.drive-studio.has-reader .drive-pagination > div { gap: 10px; }
.drive-studio.has-reader .drive-shortcuts { display: none; }

/* Interior gutters survive every panel state; the full page has no enclosing border. */
@container studio (max-width: 999px) {
  .drive-studio[data-document-view="list"]:not(.has-reader) .document-row-label { display: block; }
  .drive-studio[data-document-view="list"]:not(.has-reader) .document-location-block { margin-top: 5px; }
  .drive-studio[data-document-view="list"]:not(.has-reader) .document-meta,
  .drive-studio[data-document-view="list"]:not(.has-reader) .studio-list-location,
  .drive-studio[data-document-view="list"]:not(.has-reader) .studio-list-modified { display: none; }
}
@container studio (max-width: 560px) {
  .drive-studio .studio-file-scroll { padding-inline: 8px; }
  .drive-studio .document-list-label { margin-inline: 8px; }
  .drive-studio .document-selection-bar { margin-inline: 8px; }
  .drive-studio .file-search-quick { gap: 8px; }
  .drive-studio .file-search-quick .drive-filter-chip select { width: 98px; }
  .drive-studio .file-search-quick .drive-filter-case select { width: 98px; }
}
.drive-studio.has-reader .studio-file-scroll { padding-inline: 6px; }
.drive-studio.has-reader .document-list-label { margin-inline: 6px; }
.drive-studio.has-reader .drive-filter-chip { padding-left: 10px; }
.drive-studio.has-reader .file-search-quick .drive-filter-chip select { width: 100%; min-width: 0; }

/* Restrained color follows existing document/Comms tokens, with neutral page chrome. */
.drive-studio .file-search-bar { background: color-mix(in srgb, var(--accent-brief) 5%, var(--bg-surface)); }
.drive-studio .drive-filter-chip { background: color-mix(in srgb, var(--accent-brief) 4%, var(--bg-surface)); }
.drive-studio .document-file-tile { --file-ink: var(--text-muted); color: var(--file-ink); background: color-mix(in srgb, var(--file-ink) 9%, var(--bg-surface)); border-radius: 7px; }
.drive-studio .document-file-tile[data-format="pdf"] { --file-ink: var(--status-danger, #a94b4b); }
.drive-studio .document-file-tile:is([data-format="docx"],[data-format="doc"],[data-format="brief"]) { --file-ink: var(--accent-brief); }
.drive-studio .document-file-tile:is([data-format="gdoc"],[data-format="txt"],[data-format="rtf"]) { --file-ink: var(--label-3, #37796e); color: var(--file-ink); }
.drive-studio .document-file-tile:is([data-format="html"],[data-format="htm"]) { --file-ink: var(--label-5, #8b5881); }
.drive-studio .document-row.is-discussing > .document-row-main { background: color-mix(in srgb, var(--accent-brief) 4%, var(--bg-surface)); }
.drive-studio .document-row.is-selected > .document-row-main { background: color-mix(in srgb, var(--accent-brief) 8%, var(--bg-surface)); }
.document-contributor { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 6px; padding: 2px 4px 2px 0; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); text-align: left; font: 11px/1.5 var(--font-sans, Inter, sans-serif); cursor: pointer; }
.document-contributor > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-contributor .cl-avatar { flex: none; }
.document-contributor-name { color: var(--text-secondary); }
@media (hover: hover) {
  .document-contributor:hover .document-contributor-name { color: var(--accent-brief); text-decoration: underline; }
}
.document-contributor:focus-visible { outline: 2px solid var(--accent-brief); outline-offset: 3px; }
@container studio (min-width: 780px) {
  .drive-studio[data-document-view="list"]:not(.has-reader) .document-row-main { min-height: 68px; }
}

/* A narrow list is still a list: keep secondary context out of the filename lane. */
.drive-studio .document-row:has(.document-name .cl-echip--k-room_version) .document-related { display: none; }
/* The narrow list (name lane only) starts where three columns no longer fit —
   the navigation pane takes 248px, so a desktop explorer sits near 950px. */
@container explorer (max-width: 760px) {
  .document-studio.drive-studio[data-document-view="list"] .document-row-main {
    display: grid;
    grid-template-columns: 16px 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 12px 10px;
  }
  .document-studio.drive-studio[data-document-view="list"] .document-row-label { display: block; min-width: 0; padding-right: 64px; }
  .document-studio.drive-studio[data-document-view="list"] .document-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .document-studio.drive-studio[data-document-view="list"] .document-related,
  .document-studio.drive-studio[data-document-view="list"] .document-location,
  .document-studio.drive-studio[data-document-view="list"] .document-usage,
  .document-studio.drive-studio[data-document-view="list"] .document-meta { display: none; }
  .document-studio.drive-studio[data-document-view="list"] .document-location-block { display: contents; }
  .document-studio.drive-studio[data-document-view="list"] .document-contributor { position: absolute; right: 76px; top: 50%; transform: translateY(-50%); padding: 3px; margin: 0; width: 28px; height: 28px; }
  .document-studio.drive-studio[data-document-view="list"] .document-contributor > span:last-child { display: none; }
  .document-studio.drive-studio[data-document-view="list"] .document-contributor .cl-avatar { width: 22px; height: 22px; font-size: 9px; }
  .document-studio.drive-studio[data-document-view="list"] .document-row-discuss { position: absolute; right: 43px; top: 50%; transform: translateY(-50%); }
  .document-studio.drive-studio[data-document-view="list"] .document-row-menu { grid-column: 4; }
  .document-studio.drive-studio[data-document-view="list"] .document-list-label { padding: 10px; grid-template-columns: 16px minmax(0,1fr) auto; gap: 12px; }
  .document-studio.drive-studio[data-document-view="list"] .studio-column-labels { display: block; padding-left: 40px; }
  .document-studio.drive-studio[data-document-view="list"] .document-result-count { position: static; width: auto; height: auto; clip-path: none; margin: 0; overflow: visible; }
  .document-studio.drive-studio[data-document-view="list"] .document-mode { margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
@container studio (max-width: 560px) {
  .drive-studio .studio-heading { align-items: center; gap: 10px; }
  .drive-studio .studio-heading h1 { font-size: 26px; white-space: nowrap; }
  .drive-studio .studio-heading-actions { gap: 6px; }
  .drive-studio .studio-heading-actions .cl-btn { min-height: 34px; }
}
@container explorer (max-width: 560px) {
  .document-studio.has-reader .document-name .cl-object-badge { display: none; }
  .drive-studio .file-search-bar { min-height: 46px; padding-left: 14px; }
  .drive-studio .file-search-bar > input { min-width: 0; font-size: 14px; }
  .drive-studio .file-search-quick { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .drive-studio .drive-filter-chip { min-width: 0; width: auto; }
  .drive-studio .file-search-quick .drive-filter-chip select { width: 100%; min-width: 0; max-width: none; }
  .drive-studio .drive-view-toolbar { align-items: center; gap: 10px; }
  .drive-studio .drive-tabs { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 18px; }
  .drive-studio .drive-tabs a { flex: none; }
  .drive-studio .document-view-switch { flex: none; }
  .document-studio.drive-studio[data-document-view="list"] .document-row-main { gap: 8px; min-height: 64px; }
  .document-studio.drive-studio[data-document-view="list"] .document-row-label { padding-right: 30px; }
  .document-studio.drive-studio[data-document-view="list"] .document-contributor { right: 43px; }
  .document-studio.drive-studio[data-document-view="list"] .document-row-discuss { display: none; }
  .document-studio.drive-studio[data-document-view="list"] .studio-column-labels { padding-left: 36px; }
  .document-studio.drive-studio[data-document-view="list"] .document-name .cl-object-badge { display: none; }
  .drive-studio .document-selection-bar { flex-wrap: wrap; }
  .drive-studio .studio-selection-actions { flex-wrap: wrap; }
}

@container explorer (max-width: 320px) {
  .document-studio.drive-studio[data-document-view="list"] .document-contributor { display: none; }
  .document-studio.drive-studio[data-document-view="list"] .document-row-label { padding-right: 0; }
  .document-studio.drive-studio[data-document-view="list"] .document-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.4; }
}

/* Real page-1 thumbnails on file cards (INV-967). The image stays hidden
   until the lazy loader has the bytes; the caption paper and format icon
   remain the honest default for files with nothing renderable. */
.document-thumbnail-image {
  display: none;
}
.document-row.has-thumbnail .document-thumbnail .document-thumbnail-image {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--border-default) 60%, transparent);
  box-shadow: 0 1px 8px #00000018;
  transform-origin: center top;
  transition: transform 0.15s;
}
@media (hover: hover) {
  .document-row.has-thumbnail .document-thumbnail:hover .document-thumbnail-image {
    transform: translateY(-3px);
  }
}
.document-row.has-thumbnail .document-thumbnail .document-paper,
.document-row.has-thumbnail .document-thumbnail .document-thumbnail-empty {
  display: none;
}
/* List rows and the compact explorer beside a reader: the format tile
   becomes a page-1 miniature of the same render. */
.document-studio:not([data-document-view="grid"]) .document-row.has-thumbnail .document-file-tile,
.document-studio.has-reader .document-row.has-thumbnail .document-file-tile {
  background: #fff var(--file-thumb) top center / cover no-repeat;
  border: 1px solid color-mix(in srgb, var(--border-default) 70%, transparent);
}
.document-studio:not([data-document-view="grid"]) .document-row.has-thumbnail .document-file-tile > *,
.document-studio.has-reader .document-row.has-thumbnail .document-file-tile > * {
  visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .document-thumbnail-image {
    transition: none;
  }
}

/* Files with nothing renderable (Box links, Google Docs, drafts without a
   PDF) still present as a sheet of paper carrying their format, so the
   grid reads as one shelf of documents rather than glyphs beside pages. */
.document-studio[data-document-view="grid"]:not(.has-reader) .document-thumbnail-empty {
  width: 100%;
  max-width: 250px;
  min-height: 240px;
  align-self: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 0 18px 28px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--border-default) 60%, transparent);
  border-radius: 2px;
  box-shadow: 0 1px 8px #00000010;
  color: var(--text-muted);
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-thumbnail-empty > span {
  font: 600 9px/1.2 Inter, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-thumbnail-empty > svg {
  opacity: 0.55;
}

/* Native selects wear kaices's control skin across Drive and the file
   forms: no browser-default chrome, one chevron, the app's radius and
   focus ring. Filter chips keep their own transparent treatment (their
   rule is more specific than these :where() selectors). */
:where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23797570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 14px 14px;
  color: var(--text-primary);
  font: 500 13px/1.4 var(--font-sans, Inter, sans-serif);
  cursor: pointer;
}
@media (hover: hover) {
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select:hover {
    border-color: color-mix(in srgb, var(--text-muted) 45%, var(--border-default));
  }
}
:where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select:focus-visible {
  outline: 2px solid var(--accent-brief);
  outline-offset: -1px;
  border-color: transparent;
}
:where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select:disabled {
  opacity: 0.55;
  cursor: default;
}
.file-search-advanced select { padding-right: 32px; }
/* Form pages and the advanced-search panel set a background shorthand on
   their selects (older rules, higher specificity), which wiped the chevron
   above; restate the skin at matching specificity so every select agrees. */
:is(.drive-form-page, .drive-create-page, .drive-box-preview) .document-form-field select,
:is(.drive-form-page, .drive-create-page) select,
.drive-member-row select,
.file-search-advanced select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23797570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  border-radius: 10px;
  cursor: pointer;
}
/* The file input on Add a file: the browser's picker button becomes the
   app's quiet button, and the chosen-file text sits beside it. */
.drive-form-page input[type="file"] {
  padding: 8px 12px;
  font: 400 13px/1.4 var(--font-sans, Inter, sans-serif);
  color: var(--text-secondary);
}
.drive-form-page input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font: 500 13px/1.2 var(--font-sans, Inter, sans-serif);
  cursor: pointer;
}
@media (hover: hover) {
  .drive-form-page input[type="file"]::file-selector-button:hover {
    background: var(--bg-hover, var(--bg-surface-2));
  }
}

/* Condensing header: as the Drive explorer scrolls, its top matter compresses
   in two stages (data-condense set by case-workspace.js). Stage 1 shrinks the
   title and folds the subtitle; stage 2 slims the search bar and collapses
   the filter chips so the list gets the screen. Every change is a transition
   on a property that has a resting value, so nothing jumps. */
.drive-studio .studio-heading,
.drive-studio .studio-heading h1,
.drive-studio .studio-heading-actions .cl-btn,
.drive-studio .studio-search-toolbar,
.drive-studio .file-search-bar,
.drive-studio .file-search-bar > input,
.drive-studio .file-search-quick,
.drive-studio .drive-tabs a {
  transition:
    padding 0.22s ease,
    font-size 0.22s ease,
    min-height 0.22s ease,
    max-height 0.25s ease,
    margin 0.22s ease,
    opacity 0.18s ease;
}
.drive-heading-copy p {
  max-height: 48px;
  overflow: hidden;
  transition:
    max-height 0.22s ease,
    margin 0.22s ease,
    opacity 0.16s ease;
}
.drive-studio .file-search-quick {
  max-height: 200px;
}
.drive-studio[data-condense="1"] .studio-heading,
.drive-studio[data-condense="2"] .studio-heading {
  padding: 14px 32px 4px;
}
.drive-studio[data-condense="1"] .studio-heading h1,
.drive-studio[data-condense="2"] .studio-heading h1 {
  font-size: 22px;
}
.drive-studio[data-condense="1"] .drive-heading-copy p,
.drive-studio[data-condense="2"] .drive-heading-copy p {
  max-height: 0;
  margin: 0;
  opacity: 0;
}
.drive-studio[data-condense="1"] .studio-heading-actions .cl-btn,
.drive-studio[data-condense="2"] .studio-heading-actions .cl-btn {
  min-height: 32px;
}
.drive-studio[data-condense="1"] .studio-search-toolbar,
.drive-studio[data-condense="2"] .studio-search-toolbar {
  padding: 8px 32px 2px;
}
.drive-studio[data-condense="1"] .file-search-bar,
.drive-studio[data-condense="2"] .file-search-bar {
  min-height: 42px;
  padding: 2px 10px 2px 16px;
}
.drive-studio[data-condense="1"] .file-search-bar > input,
.drive-studio[data-condense="2"] .file-search-bar > input {
  font-size: 14px;
  padding-block: 5px;
}
.drive-studio[data-condense="1"] .file-search-quick {
  padding: 10px 0 4px;
}
.drive-studio[data-condense="2"] .file-search-quick {
  max-height: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.drive-studio[data-condense="2"] .studio-heading {
  padding: 10px 32px 0;
}
.drive-studio[data-condense="2"] .studio-heading h1 {
  font-size: 20px;
}
.drive-studio[data-condense="2"] .drive-tabs a {
  padding: 9px 0 8px;
}
@media (prefers-reduced-motion: reduce) {
  .drive-studio .studio-heading,
  .drive-studio .studio-heading h1,
  .drive-studio .studio-heading-actions .cl-btn,
  .drive-studio .studio-search-toolbar,
  .drive-studio .file-search-bar,
  .drive-studio .file-search-bar > input,
  .drive-studio .file-search-quick,
  .drive-studio .drive-tabs a,
  .drive-heading-copy p {
    transition: none;
  }
}
/* The case-files explorer shares the mechanism with a lighter touch: its
   heading is already compact, so scrolling only tightens the heading and the
   tools row. */
.document-studio:not(.drive-studio) .studio-heading,
.document-studio:not(.drive-studio) .studio-explorer-tools {
  transition: padding 0.22s ease;
}
.document-studio:not(.drive-studio)[data-condense="1"] .studio-heading,
.document-studio:not(.drive-studio)[data-condense="2"] .studio-heading {
  padding-block: 6px;
}
.document-studio:not(.drive-studio):not(.has-reader)[data-condense="1"] .studio-explorer-tools,
.document-studio:not(.drive-studio):not(.has-reader)[data-condense="2"] .studio-explorer-tools {
  padding-block: 8px 6px;
}
@media (prefers-reduced-motion: reduce) {
  .document-studio:not(.drive-studio) .studio-heading,
  .document-studio:not(.drive-studio) .studio-explorer-tools {
    transition: none;
  }
}

/* Card polish (Bennett, 2026-09-11): the preview fills its box edge to
   edge with no caption; the format tile says the type in colour; the
   generic kind badge goes; the contributor is an avatar; the location is
   a chip. Grid rules carry the same specificity as the ones they refine. */
.document-studio[data-document-view="grid"]:not(.has-reader) .document-row-main {
  grid-template-rows: 40px 200px auto auto auto;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-thumbnail {
  padding: 0;
  background: #fff;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-thumbnail-caption {
  display: none;
}
.document-row.has-thumbnail .document-thumbnail .document-thumbnail-image {
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.25s ease;
}
@media (hover: hover) {
  .document-row.has-thumbnail .document-thumbnail:hover .document-thumbnail-image {
    transform: scale(1.02);
  }
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-paper {
  margin-top: 14px;
}
/* Type tiles: a coloured glyph naming the format, the way a Docs, Sheets or
   PDF mark does; formats without a colour keep the generic icon. */
.document-file-tile[data-format] {
  position: relative;
  width: 26px;
  height: 30px;
  border-radius: 7px;
  font: 700 8px/1 var(--font-sans, Inter, sans-serif);
  letter-spacing: 0.04em;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-file-tile[data-format] {
  width: 26px;
  min-height: 30px;
}
.document-file-tile[data-format="pdf"] { --tile-bg: #d3423a; }
.document-file-tile[data-format="docx"], .document-file-tile[data-format="doc"], .document-file-tile[data-format="word"], .document-file-tile[data-format="brief"], .document-file-tile[data-format="rtf"] { --tile-bg: #2b62c9; }
.document-file-tile[data-format="xlsx"], .document-file-tile[data-format="csv"] { --tile-bg: #1e8e5a; }
.document-file-tile[data-format="pptx"] { --tile-bg: #d9772b; }
.document-file-tile[data-format="png"], .document-file-tile[data-format="jpg"], .document-file-tile[data-format="jpeg"], .document-file-tile[data-format="gif"], .document-file-tile[data-format="webp"], .document-file-tile[data-format="image"] { --tile-bg: #7a4fb6; }
.document-file-tile[data-format="txt"], .document-file-tile[data-format="text"], .document-file-tile[data-format="md"], .document-file-tile[data-format="markdown"] { --tile-bg: #5f6b7a; }
.document-file-tile[data-format="json"], .document-file-tile[data-format="html"], .document-file-tile[data-format="xml"], .document-file-tile[data-format="yaml"] { --tile-bg: #1f8a8a; }
.document-file-tile[data-format="gdoc"] { --tile-bg: #4285f4; }
.document-file-tile[data-format="box"] { --tile-bg: #0061d5; }
.document-file-tile[data-format="pdf"] > svg, .document-file-tile[data-format="docx"] > svg, .document-file-tile[data-format="doc"] > svg, .document-file-tile[data-format="word"] > svg, .document-file-tile[data-format="brief"] > svg, .document-file-tile[data-format="rtf"] > svg, .document-file-tile[data-format="xlsx"] > svg, .document-file-tile[data-format="csv"] > svg, .document-file-tile[data-format="pptx"] > svg, .document-file-tile[data-format="png"] > svg, .document-file-tile[data-format="jpg"] > svg, .document-file-tile[data-format="jpeg"] > svg, .document-file-tile[data-format="gif"] > svg, .document-file-tile[data-format="webp"] > svg, .document-file-tile[data-format="image"] > svg, .document-file-tile[data-format="txt"] > svg, .document-file-tile[data-format="text"] > svg, .document-file-tile[data-format="md"] > svg, .document-file-tile[data-format="markdown"] > svg, .document-file-tile[data-format="json"] > svg, .document-file-tile[data-format="html"] > svg, .document-file-tile[data-format="xml"] > svg, .document-file-tile[data-format="yaml"] > svg, .document-file-tile[data-format="gdoc"] > svg, .document-file-tile[data-format="box"] > svg { display: none; }
.document-file-tile[data-format="pdf"]::after { content: "PDF"; }
.document-file-tile[data-format="docx"]::after, .document-file-tile[data-format="doc"]::after, .document-file-tile[data-format="word"]::after { content: "DOC"; }
.document-file-tile[data-format="brief"]::after { content: "BRF"; }
.document-file-tile[data-format="rtf"]::after { content: "RTF"; }
.document-file-tile[data-format="xlsx"]::after { content: "XLS"; }
.document-file-tile[data-format="csv"]::after { content: "CSV"; }
.document-file-tile[data-format="pptx"]::after { content: "PPT"; }
.document-file-tile[data-format="png"]::after, .document-file-tile[data-format="jpg"]::after, .document-file-tile[data-format="jpeg"]::after, .document-file-tile[data-format="gif"]::after, .document-file-tile[data-format="webp"]::after, .document-file-tile[data-format="image"]::after { content: "IMG"; }
.document-file-tile[data-format="txt"]::after, .document-file-tile[data-format="text"]::after { content: "TXT"; }
.document-file-tile[data-format="md"]::after, .document-file-tile[data-format="markdown"]::after { content: "MD"; }
.document-file-tile[data-format="json"]::after { content: "{ }"; }
.document-file-tile[data-format="html"]::after { content: "</>"; }
.document-file-tile[data-format="xml"]::after, .document-file-tile[data-format="yaml"]::after { content: "XML"; }
.document-file-tile[data-format="gdoc"]::after { content: "G"; }
.document-file-tile[data-format="box"]::after { content: "box"; text-transform: none; letter-spacing: -0.02em; }
.document-file-tile[data-format]::after { position: absolute; inset: 0; display: grid; place-items: center; }
/* The colour rides a variable so it outranks the grid's transparent tile. */
.document-file-tile[data-format],
.document-studio[data-document-view="grid"]:not(.has-reader) .document-file-tile[data-format] {
  background: var(--tile-bg, color-mix(in srgb, var(--accent-brief) 6%, var(--bg-surface)));
  color: var(--tile-fg, var(--accent-brief));
}
.document-file-tile[data-format="pdf"], .document-file-tile[data-format="docx"], .document-file-tile[data-format="doc"], .document-file-tile[data-format="word"], .document-file-tile[data-format="brief"], .document-file-tile[data-format="rtf"], .document-file-tile[data-format="xlsx"], .document-file-tile[data-format="csv"], .document-file-tile[data-format="pptx"], .document-file-tile[data-format="png"], .document-file-tile[data-format="jpg"], .document-file-tile[data-format="jpeg"], .document-file-tile[data-format="gif"], .document-file-tile[data-format="webp"], .document-file-tile[data-format="image"], .document-file-tile[data-format="txt"], .document-file-tile[data-format="text"], .document-file-tile[data-format="md"], .document-file-tile[data-format="markdown"], .document-file-tile[data-format="json"], .document-file-tile[data-format="html"], .document-file-tile[data-format="xml"], .document-file-tile[data-format="yaml"], .document-file-tile[data-format="gdoc"], .document-file-tile[data-format="box"] { --tile-fg: #fff; }
/* A list row's tile that carries a thumbnail miniature shows only that;
   the grid keeps its lettered tile beside the name. */
.document-studio:not([data-document-view="grid"]) .document-row.has-thumbnail .document-file-tile::after,
.document-studio.has-reader .document-row.has-thumbnail .document-file-tile::after { display: none; }
.document-studio:not([data-document-view="grid"]) .document-row.has-thumbnail .document-file-tile,
.document-studio.has-reader .document-row.has-thumbnail .document-file-tile { background-color: #fff; }
/* The generic kind badge says nothing the tile does not; typed kinds stay. */
.document-row .cl-object-badge[data-object-kind="drive_file"],
.document-row .cl-object-badge[data-object-kind="room_file"],
.document-row .cl-object-badge[data-object-kind="document"] { display: none; }
/* The contributor is an avatar in the grid, avatar + name in the list. */
.document-contributor-label { display: none; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-contributor { margin-top: 6px; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-contributor-text { display: none; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-contributor .cl-avatar { width: 22px; height: 22px; font-size: 9px; }
/* The location is a chip: folder glyph, one line, clickable when it links. */
.document-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.document-location > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-location > svg { flex: none; color: var(--text-muted); }
@media (hover: hover) {
  a.document-location:hover { background: var(--bg-hover, var(--bg-surface-2)); color: var(--text-primary); }
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location { font-size: 10.5px; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block .document-contributor { margin-top: 0; }

/* The card is the preview (Bennett, 2026-09-11): a slim title row, the
   sheet, and one footer line — location chip on the left, avatar and date
   on the right. The policy line is list-only; the grid says it with the
   tile and the menu. */
.document-studio[data-document-view="grid"]:not(.has-reader) .document-row-main {
  grid-template-rows: 34px 232px auto;
  gap: 6px 7px;
  padding: 8px 10px 9px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-mode,
.document-studio[data-document-view="grid"]:not(.has-reader) .document-related,
.document-studio[data-document-view="grid"]:not(.has-reader) .document-usage {
  display: none;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-file-tile[data-format] {
  width: 24px;
  min-height: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 7.5px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block {
  grid-row: 3;
  grid-column: 1 / -1;
  justify-self: start;
  max-width: calc(100% - 96px);
  min-width: 0;
  gap: 6px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block .document-contributor {
  order: 2;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-meta {
  grid-row: 3;
  grid-column: 1 / -1;
  justify-self: end;
  align-self: center;
  margin: 0;
  min-height: 0;
  font-size: 10.5px;
  color: var(--text-muted);
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location {
  padding: 2px 8px 2px 6px;
  font-size: 10.5px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-contributor .cl-avatar {
  width: 20px;
  height: 20px;
  font-size: 8.5px;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-name {
  font-size: 12.5px;
}
/* The footer is one line: the chip yields (ellipsis), the avatar never wraps. */
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block {
  flex-wrap: nowrap;
  align-items: center;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block .document-location {
  flex: 0 1 auto;
  min-width: 0;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block .document-contributor {
  flex: none;
  margin: 0;
}

/* The open list of a select (Chrome 135+ customizable select): drawn by
   the page instead of the operating system, so it matches the dialog it
   sits in. Browsers without base-select keep the native list. */
@supports (appearance: base-select) {
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select,
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select::picker(select) {
    appearance: base-select;
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select {
    background-image: none;
    padding-right: 12px;
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select::picker-icon {
    content: "";
    width: 14px;
    height: 14px;
    margin-left: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23797570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select:open::picker-icon {
    transform: rotate(180deg);
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select::picker(select) {
    margin: 6px 0 0;
    padding: 6px;
    border: 1px solid var(--border-default);
    border-radius: 12px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-pop);
    min-width: anchor-size(width);
    max-height: 320px;
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 10px;
    border-radius: 8px;
    font: 500 13px/1.4 var(--font-sans, Inter, sans-serif);
    color: var(--text-primary);
    cursor: pointer;
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select option:focus-visible {
    background: var(--bg-surface-2);
    outline: none;
  }
  @media (hover: hover) {
    :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select option:hover {
      background: var(--bg-surface-2);
      outline: none;
    }
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select option:checked {
    background: color-mix(in srgb, var(--accent-brief) 8%, var(--bg-surface));
    color: var(--accent-brief);
  }
  :where(.document-studio, .drive-form-page, .drive-create-page, .drive-member-row, .drive-box-preview, .drive-dialog-form) select option::checkmark {
    order: 2;
    margin-left: auto;
    content: "✓";
    font-size: 12px;
    color: var(--accent-brief);
  }
}

/* The file page's details, in Drive's shape: faces first, then a two-column list. */
.drive-details h3 { margin:0 0 10px; font-size:13px; font-weight:600; color:var(--text-primary); }
.drive-details-people { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin-bottom:8px; }
.drive-details-people .cl-avatar { box-shadow:0 0 0 2px var(--bg-surface); }
.drive-details-people .cl-avatar:nth-child(n+7) { display:none; }
.drive-details-more { font-size:12px; color:var(--text-muted); margin-left:4px; }
.drive-details-audience { margin:0 0 10px; font-size:12.5px; color:var(--text-muted); line-height:1.5; }
.drive-details .studio-button { display:inline-flex; align-items:center; gap:7px; }
.drive-details-list { display:grid; gap:10px; margin:0; }
.drive-details-list > div { display:grid; grid-template-columns:76px minmax(0,1fr); gap:10px; align-items:baseline; }
.drive-details-list dt { font-size:12px; color:var(--text-muted); }
.drive-details-list dd { margin:0; font-size:13px; color:var(--text-primary); overflow-wrap:anywhere; }
.drive-details-list dd a { color:inherit; text-decoration:underline; text-decoration-color:var(--border-default); text-underline-offset:3px; }
/* A Drive file's panel lists its details once: the reader's fixed trio steps
   aside when the Drive details are present. */
.file-reader-info:has(.drive-details) > dl:first-of-type { display:none; }
.file-reader-info:has(.drive-details) .file-info-heading h2 { font-size:0; }
.file-reader-info:has(.drive-details) .file-info-heading h2::before { content:"Details"; font-size:15px; }

/* ---- "Sources of…" scope + the brief map (2026-09-17, the brief-navigation
   wave). The scope line is the Brief → Corpus cascade the new-audit picker
   speaks; the banner names the pick with registry chips; the map is the
   usage-table grammar (cases/_usage_table_style.html) applied to one brief:
   versions as rows, audits nested under them, every count a door. */
/* The cascade lives in the filter line, right after the root dropdown
   (2026-09-17 late): compact inline selects that appear level by level,
   then the kind toggles. */
.studio-filter-line { flex-wrap: wrap; row-gap: 6px; }
.studio-scope-level { display: inline-flex; min-width: 0; }
.studio-scope-level .cl-dd { min-width: 0; }
.studio-scope-level .cl-dd__trigger { height: 28px; min-height: 28px; max-width: 170px; font-size: 11.5px; padding-inline: 9px 26px; }
.document-studio:not(.drive-studio) .studio-explorer-tools .document-search { min-width: 200px; }
.studio-scope-kinds { display: inline-flex; align-items: center; gap: 10px; margin-left: 2px; font-size: 11px; color: var(--text-secondary); }
.studio-scope-kinds label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.studio-scope-kinds input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent-brief); }
.studio-filter-line > select { margin-left: auto; }
.document-history-toggle {
  border: 0; background: transparent; padding: 0;
  font: inherit; font-size: 11.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.bm-history { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 8px; font-size: 11px; color: var(--text-faint); }
@media (hover: hover) {
  .document-history-toggle:hover { color: var(--text-primary); text-decoration: underline; }
}
.document-history-toggle[aria-pressed="true"] { color: var(--accent-brief); }

.studio-scope-banner {
  flex: none;
  margin: 6px 12px 4px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent-brief) 35%, var(--border-default));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-brief) 6%, var(--bg-surface));
}
.scope-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.scope-card__chips { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; flex: none; max-width: 100%; }
.scope-card__summary { flex: 1 1 220px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--text-secondary); }
.scope-card__summary strong { color: var(--text-primary); font-weight: 600; }
.scope-card__summary a { color: var(--accent-brief); text-decoration: none; font-weight: 500; }
@media (hover: hover) {
  .scope-card__summary a:hover { text-decoration: underline; }
}
.scope-card__drift { color: var(--status-warning); }
.scope-card__actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-left: auto; font-size: 11.5px; white-space: nowrap; }
.scope-card__actions a { color: var(--accent-brief); text-decoration: none; font-weight: 500; }
@media (hover: hover) {
  .scope-card__actions a:hover { text-decoration: underline; }
}
.scope-card__actions button { border: 0; background: transparent; padding: 0; font: inherit; font-size: 11.5px; color: var(--text-muted); cursor: pointer; }
@media (hover: hover) {
  .scope-card__actions button:hover { color: var(--text-primary); text-decoration: underline; }
}
.scope-card__actions button.scope-card__link { color: var(--accent-brief); font-weight: 500; }
@media (hover: hover) {
  .scope-card__actions button.scope-card__link:hover { color: var(--accent-brief); }
}
.bm-act button { border: 0; background: transparent; padding: 0; font: inherit; font-size: 11.5px; color: var(--accent-brief); font-weight: 500; cursor: pointer; }
@media (hover: hover) {
  .bm-act button:hover { text-decoration: underline; }
}

/* The case's Documents tab condenses like Drive (2026-09-17 late — Bennett:
   "review scrolling on the actual drive page and mimic that here … a scroll
   DOWN hides some stuff"). case-workspace.js already stamps data-condense on
   every studio; these rules give the case header its two stages: the stage
   bar, vitals and meta fold, the title shrinks, and the list gets the screen. */
.document-studio:not(.drive-studio) .case-hero,
.document-studio:not(.drive-studio) .case-hero-title-row h1,
.document-studio:not(.drive-studio) .case-nav,
.document-studio:not(.drive-studio) .studio-heading,
.document-studio:not(.drive-studio) .case-dot {
  transition: margin 0.22s ease, padding 0.22s ease, font-size 0.22s ease, opacity 0.18s ease;
}
.document-studio:not(.drive-studio) .case-strip,
.document-studio:not(.drive-studio) .case-hero-meta,
.document-studio:not(.drive-studio) .case-hero-desc,
.document-studio:not(.drive-studio) .case-eyebrow {
  max-height: 240px;
  overflow: hidden;
  transition: max-height 0.24s ease, margin 0.22s ease, opacity 0.16s ease, border-width 0.1s ease;
}
.document-studio:not(.drive-studio)[data-condense="1"] .case-strip,
.document-studio:not(.drive-studio)[data-condense="2"] .case-strip,
.document-studio:not(.drive-studio)[data-condense="1"] .case-hero-meta,
.document-studio:not(.drive-studio)[data-condense="2"] .case-hero-meta,
.document-studio:not(.drive-studio)[data-condense="1"] .case-hero-desc,
.document-studio:not(.drive-studio)[data-condense="2"] .case-hero-desc,
.document-studio:not(.drive-studio)[data-condense="1"] .case-eyebrow,
.document-studio:not(.drive-studio)[data-condense="2"] .case-eyebrow {
  max-height: 0;
  margin: 0;
  opacity: 0;
  border-width: 0;
  box-shadow: none;
}
.document-studio:not(.drive-studio)[data-condense="1"] .case-hero,
.document-studio:not(.drive-studio)[data-condense="2"] .case-hero { margin-bottom: 6px; }
.document-studio:not(.drive-studio)[data-condense="1"] .case-hero-title-row h1,
.document-studio:not(.drive-studio)[data-condense="2"] .case-hero-title-row h1 { font-size: 20px; }
.document-studio:not(.drive-studio)[data-condense="1"] .case-dot,
.document-studio:not(.drive-studio)[data-condense="2"] .case-dot { margin-top: 8px; }
.document-studio:not(.drive-studio)[data-condense="1"] .case-hero-actions,
.document-studio:not(.drive-studio)[data-condense="2"] .case-hero-actions { padding-top: 0; }
.document-studio:not(.drive-studio)[data-condense="1"] .case-nav,
.document-studio:not(.drive-studio)[data-condense="2"] .case-nav { margin-bottom: 10px; }
.document-studio:not(.drive-studio)[data-condense="2"] .studio-heading { padding: 4px 0 8px; }
.document-studio:not(.drive-studio)[data-condense="2"] .studio-heading-title > span { display: none; }

/* A source's location as OBJECTS: the brief and the versions whose corpus holds it. */
.document-location--chips { display: flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; margin-top: 4px; background: none !important; padding: 0 !important; border: 0 !important; }
.document-location--chips .cl-echip { height: 18px; font-size: 10px; padding: 0 6px 0 3px; gap: 4px; vertical-align: 0; }
.document-location--chips .cl-echip__kind { font-size: 8px; padding: 1px 4px; }
.document-location--chips .cl-echip__label { max-width: 16ch; }
.document-location-more { flex: none; align-self: center; font-size: 10px; color: var(--text-muted); }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location--chips { grid-column: 1 / -1; grid-row: 4; margin-top: 0; }

/* The brief map. */
.studio-brief-map { padding: 10px 12px 2px; }
.bm { margin-bottom: 14px; }
.bm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 2px 7px; }
.bm-title { font-weight: 600; color: var(--text-primary); text-decoration: none; }
.bm-meta { font-size: 11.5px; color: var(--text-muted); }
.bm-actions { margin-left: auto; display: flex; gap: 14px; font-size: 11.5px; }
.bm-actions a { color: var(--accent-brief); text-decoration: none; font-weight: 500; white-space: nowrap; }
@media (hover: hover) {
  .bm-actions a:hover { text-decoration: underline; }
}
.bm-table .ug-head, .bm-table .ug-row { grid-template-columns: minmax(0, 1fr) 128px 68px 52px 96px 96px; }
.bm-table .ug-head { height: 30px; }
.ug-row--version { font-weight: 500; }
.ug-row--version.is-current { background: color-mix(in srgb, var(--accent-brief) 5%, transparent); }
.bm-current { display: inline-flex; align-items: center; flex: none; height: 16px; padding: 0 6px; border-radius: 999px; background: var(--accent-brief-soft); color: var(--accent-brief); font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.bm-name { font-size: 12px; font-weight: 400; color: var(--text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-state { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 11px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.bm-state > span { font-size: 8px; }
.bm-state--verified { color: var(--status-verified); }
.bm-state--warning { color: var(--status-warning); }
.bm-state--brief { color: var(--accent-brief); }
.bm-count { color: var(--accent-brief); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
@media (hover: hover) {
  .bm-count:hover { text-decoration: underline; }
}
.bm-drift { display: block; font-size: 10px; line-height: 1.2; color: var(--status-warning); white-space: nowrap; font-weight: 400; }
.bm-act { display: flex; gap: 10px; justify-content: flex-end; font-size: 11.5px; font-weight: 400; white-space: nowrap; }
.bm-act a { color: var(--text-muted); text-decoration: none; }
@media (hover: hover) {
  .bm-act a:hover { color: var(--text-primary); text-decoration: underline; }
}
.bm-empty { margin: 0; padding: 4px 2px; font-size: 11.5px; color: var(--text-faint); }
@media (max-width: 900px) {
  .bm-table .ug-head, .bm-table .ug-row { grid-template-columns: minmax(0, 1fr) 84px 52px 44px 76px 70px; }
  .bm-table .ug-head > span:nth-child(2), .bm-table .ug-row > .ug-cell:nth-child(2) { display: none; }
}


/* Grid cards say everything (2026-09-17 late — Bennett: "tags aren't showing
   all … the authority/hash tag on source files are most important"): the
   AUTHORITY chip gets its own footer line with the whole card width, the
   location chips wrap instead of truncating, and the content key rides the
   meta line beside the date. */
.document-studio[data-document-view="grid"]:not(.has-reader) .document-row-main {
  grid-template-rows: 34px 232px auto auto auto;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-related[aria-label="Mapped authority"] {
  display: flex;
  grid-row: 3;
  grid-column: 1 / -1;
  margin: 0;
  min-height: 0;
  min-width: 0;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-related[aria-label="Mapped authority"] .cl-echip { max-width: 100%; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-related[aria-label="Mapped authority"] .cl-echip__label { max-width: none; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location-block {
  grid-row: 4;
  max-width: 100%;
}
.document-studio[data-document-view="grid"]:not(.has-reader) .document-meta { grid-row: 5; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-row-main:not(:has(.document-location--chips)) .document-location-block { grid-row: 4; max-width: calc(100% - 96px); }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-row-main:not(:has(.document-location--chips)) .document-meta { grid-row: 4; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location--chips { flex-wrap: wrap; overflow: visible; row-gap: 3px; }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-location--chips .cl-echip__label { max-width: 12ch; }
.document-key { font-family: var(--font-mono); color: var(--text-faint); }
.document-studio[data-document-view="grid"]:not(.has-reader) .document-key { font-size: 10px; }

/* Condensed stage 2 on the case tab: the heading and the search slim down too,
   so the list gets the screen the way Drive's does. */
.document-studio:not(.drive-studio)[data-condense="2"] .studio-heading h2 { font-size: 15px; }
.document-studio:not(.drive-studio)[data-condense="2"] .studio-heading-actions .studio-button { min-height: 30px; padding-block: 0; }
.document-studio:not(.drive-studio)[data-condense="2"] .studio-explorer-tools { padding: 6px 12px 4px; }
.document-studio:not(.drive-studio)[data-condense="2"] .document-search input { height: 26px; padding: 3px 0; }
.document-studio:not(.drive-studio)[data-condense="2"] .studio-filter-line { padding-top: 5px; }
.document-studio:not(.drive-studio) .studio-explorer-tools,
.document-studio:not(.drive-studio) .document-search input,
.document-studio:not(.drive-studio) .studio-heading h2 { transition: padding 0.2s ease, height 0.2s ease, font-size 0.2s ease; }


/* ---- The search-and-filter bar (specs/134): Google Drive's grammar on both
   file surfaces. Chips are pills with an icon, a label and a caret; a set chip
   wears its value in the selected style and gains its own ×; menus list the
   options with icons and a check on the chosen one; People menus carry a
   search field. ---- */
.cl-filters { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; }
.cl-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.cl-fchip { position: relative; display: inline-flex; align-items: stretch; min-width: 0; }
.cl-fchip[hidden] { display: none; }
.cl-fchip__details { position: relative; min-width: 0; }
.cl-fchip__details > summary { list-style: none; }
.cl-fchip__details > summary::-webkit-details-marker { display: none; }
.cl-fchip__pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 12px;
  border: 1px solid var(--border-default); border-radius: 8px; background: var(--bg-surface);
  color: var(--text-secondary); font: 500 12.5px/1 var(--font-sans, Inter, sans-serif);
  cursor: pointer; white-space: nowrap; max-width: 260px; min-width: 0;
}
@media (hover: hover) {
  .cl-fchip__pill:hover { background: var(--bg-surface-2); color: var(--text-primary); }
}
.cl-fchip__details[open] > .cl-fchip__pill { background: var(--bg-surface-2); color: var(--text-primary); }
.cl-fchip__pill:focus-visible { outline: 2px solid var(--accent-brief); outline-offset: 2px; }
.cl-fchip__icon, .cl-fchip__caret { display: inline-flex; flex: none; color: var(--text-muted); }
.cl-fchip__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-fchip.is-set .cl-fchip__pill {
  background: var(--accent-brief-soft); border-color: color-mix(in srgb, var(--accent-brief) 40%, var(--border-default));
  color: var(--accent-brief); border-top-right-radius: 0; border-bottom-right-radius: 0;
}
.cl-fchip.is-set .cl-fchip__icon, .cl-fchip.is-set .cl-fchip__caret { color: var(--accent-brief); }
.cl-fchip__clear {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 32px;
  border: 1px solid color-mix(in srgb, var(--accent-brief) 40%, var(--border-default)); border-left: 0;
  border-radius: 0 8px 8px 0; background: var(--accent-brief-soft); color: var(--accent-brief); cursor: pointer; padding: 0;
}
@media (hover: hover) {
  .cl-fchip__clear:hover { background: color-mix(in srgb, var(--accent-brief) 22%, var(--bg-surface)); }
}
.cl-fchip__clear[hidden] { display: none; }
.cl-fchip--toggle .cl-fchip__pill { padding-inline: 12px; }
.cl-fchip--toggle.is-set .cl-fchip__pill { border-radius: 8px; }
.cl-fchip__menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 240px; max-width: 340px;
  max-height: min(420px, calc(100dvh - 200px)); overflow: auto; padding: 6px;
  border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); box-shadow: 0 10px 30px #0003;
}
.cl-fchip__search { display: flex; align-items: center; gap: 8px; margin: 2px 2px 6px; padding: 0 10px; height: 36px; border: 1px solid var(--border-default); border-radius: 8px; color: var(--text-muted); }
.cl-fchip__search:focus-within { border-color: var(--accent-brief); box-shadow: 0 0 0 2px var(--accent-brief-soft); }
.cl-fchip__search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13px; color: var(--text-primary); }
.cl-fchip__search input::-webkit-search-cancel-button { display: none; }
.cl-fchip__option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-primary); font: 400 13px/1.3 var(--font-sans, Inter, sans-serif); text-align: left; text-decoration: none; cursor: pointer;
}
.cl-fchip__option:focus-visible { background: var(--bg-surface-2); outline: none; }
@media (hover: hover) {
  .cl-fchip__option:hover { background: var(--bg-surface-2); outline: none; }
}
.cl-fchip__option[aria-checked="true"] { background: var(--accent-brief-soft); }
.cl-fchip__option[hidden] { display: none; }
.cl-fchip__option-icon { display: inline-flex; flex: none; width: 20px; justify-content: center; color: var(--text-secondary); }
.cl-fchip__option[aria-checked="true"] .cl-fchip__option-icon,
.cl-fchip__option[aria-checked="true"] .cl-fchip__avatar { display: none; }
.cl-fchip__check { display: none; flex: none; width: 20px; justify-content: center; color: var(--accent-brief); }
.cl-fchip__option[aria-checked="true"] .cl-fchip__check { display: inline-flex; order: -1; }
.cl-fchip__option-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cl-fchip__option-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-fchip__option-text > small { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-fchip__count { flex: none; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.cl-fchip__avatar { flex: none; }
.cl-fchip__empty { padding: 10px 12px; font-size: 12px; color: var(--text-muted); }
.cl-fchip__menu .document-categories { position: static; display: flex; flex-direction: column; width: auto; max-width: none; padding: 0; gap: 2px; border: 0; background: transparent; box-shadow: none; }
.cl-fchip__menu .document-category { padding: 6px 10px; font-size: 13px; }
.cl-filters__clear { flex: none; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); text-decoration: none; padding: 0 6px; white-space: nowrap; }
@media (hover: hover) {
  .cl-filters__clear:hover { color: var(--accent-brief); text-decoration: underline; }
}
.cl-filters__clear[hidden] { display: none; }
.cl-filters [data-fchip-kind="sort"] { margin-left: auto; }
.cl-filters [data-fchip-kind="sort"] .cl-fchip__pill { border-color: transparent; background: transparent; }
@media (hover: hover) {
  .cl-filters [data-fchip-kind="sort"]:not(.is-set) .cl-fchip__pill:hover { background: var(--bg-surface-2); }
}
.studio-scope-kinds { display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-secondary); }
.studio-scope-kinds[hidden] { display: none; }
.studio-scope-kinds label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.studio-scope-kinds input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent-brief); }

/* The Documents tab's toolbar: the search on its own line, the chips under it (Drive home). */
.document-studio:not(.drive-studio) .studio-filter-line { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 8px; padding-top: 10px; }
.document-studio:not(.drive-studio) .studio-filter-line .cl-filters { flex: 1 1 auto; min-width: 0; }
/* Drive's toolbar shape on the Documents tab: the search field with the view
   switch beside it, the chips on the row beneath. */
.studio-tools-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.studio-tools-row .case-file-search { flex: 1 1 auto; max-width: 860px; }
.studio-tools-row .document-view-switch { margin: 0 0 0 auto; flex: none; }
.document-studio:not(.drive-studio) .studio-explorer-tools { flex-direction: column; align-items: stretch; }
.document-studio:not(.drive-studio) .studio-tools-row .case-file-search { flex: 1 1 auto; max-width: 860px; }
/* Drive: the chips under the search field, centred like Drive's home. */
.drive-studio .file-search-quick { padding: 12px 0 4px; }
.drive-studio .file-search-quick .cl-filters__row { gap: 8px; }
/* The chip row docked inside the open search panel (S5). */
.file-search-panel [data-search-chips-slot]:not(:empty) { padding: 10px 18px 6px; border-bottom: 1px solid var(--border-default); }
.file-search-panel [data-search-chips-slot] .cl-filters__clear, .file-search-panel [data-search-chips-slot] [data-fchip-kind="sort"] { display: none; }
/* Recent searches (S6). */
.file-search-recent { display: flex; flex-direction: column; padding: 4px 7px 0; }
.file-search-recent__item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-primary); font-size: 13px; text-align: left; cursor: pointer; }
.file-search-recent__item::before { content: ""; width: 16px; height: 16px; flex: none; background: currentColor; opacity: .55; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'><circle cx='7' cy='7' r='4.5'/><path d='M10.5 10.5L14 14'/></svg>") center/contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'><circle cx='7' cy='7' r='4.5'/><path d='M10.5 10.5L14 14'/></svg>") center/contain no-repeat; }
@media (hover: hover) {
  .file-search-recent__item:hover { background: var(--accent-brief-soft); }
}
/* The view switch shows a check on the active view (F14). */
/* The check sits BESIDE the icon (Drive): the button is a row, never a grid. */
.document-view-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 9px; width: auto; min-width: 37px; }
.document-view-switch button[aria-pressed="true"]::before { content: "✓"; font-size: 12px; line-height: 1; }
/* Advanced search dialog (S9). */
.cl-search-dialog { position: fixed; inset: 0; margin: auto; width: min(680px, 94vw); max-height: min(92vh, 720px); overflow: auto; border: 1px solid var(--border-default); border-radius: 16px; padding: 0; background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 24px 60px #0004; }
.cl-search-dialog::backdrop { background: #0006; }
.cl-search-dialog__form { display: flex; flex-direction: column; }
.cl-search-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.cl-search-dialog__head h2 { margin: 0; font: 500 20px/1.3 var(--font-sans, Inter, sans-serif); }
.cl-search-dialog__close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; }
@media (hover: hover) {
  .cl-search-dialog__close:hover { background: var(--bg-surface-2); }
}
.cl-search-dialog__rows { display: flex; flex-direction: column; gap: 12px; padding: 6px 22px 14px; }
.cl-search-dialog__row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 13px; }
.cl-search-dialog__row > span:first-child { font-weight: 500; color: var(--text-secondary); }
.cl-search-dialog__row .cl-select, .cl-search-dialog__row .cl-input { width: 100%; }
.cl-search-dialog__check { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.cl-search-dialog__cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cl-search-dialog__cell .cl-select { flex: 1 1 auto; width: auto; min-width: 0; }
.cl-search-dialog__cell .cl-search-dialog__check { margin-right: 0; }
.cl-search-dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; }
/* Sources grouped under their authority on the audit page (2026-09-17 late). */
.doc-list .doc-group { display: flex; align-items: center; gap: 8px; padding: 6px 2px 2px; list-style: none; }
.doc-list .doc-group + .doc-row--under, .doc-list .doc-row--under + .doc-row--under { margin-left: 14px; }
.doc-list .doc-group__none { font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 720px) { .cl-search-dialog__row { grid-template-columns: 1fr; } .cl-fchip__pill { max-width: 200px; } }

/* The Documents tab is Drive's embedded view of the case (2026-09-17 late): the door out. */
.studio-drive-door { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-default); font-size: 11.5px; font-weight: 500; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
@media (hover: hover) {
  .studio-drive-door:hover { color: var(--accent-brief); border-color: color-mix(in srgb, var(--accent-brief) 40%, var(--border-default)); background: var(--accent-brief-soft); }
}

/* KAICES · the Drive's filter panel grows with its chips: the desktop 200px cap let the stacked chips spill
   over the list header below ("Title only" sat on top of "All files"; the K9 overlap of the settled gate). */
body.cl-kaices .drive-studio .file-search-quick { max-height: none; }
