/* Drive uses the shell's palette, controls and spacing in both themes. */
.drive { min-width: 0; display: grid; gap: 18px; color: var(--ink); }
.drive-content { min-width: 0; display: grid; gap: 18px; }
.drive[hidden] { display: none; }
.drive *, .drive *::before, .drive *::after { box-sizing: border-box; }
.drive :is(h1,h2,p) { margin: 0; }
.drive h1 { font-size: clamp(24px,3vw,34px); line-height: 1.3; }
.drive h2 { font-size: 20px; overflow-wrap: anywhere; }
.drive-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.drive-muted { color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.drive-spaces, .drive-actions, .drive-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.drive .fc-btn { min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.drive-spaces [aria-current="page"] { background: var(--bg-selected); border-color: var(--primary); color: var(--ink); }
.drive .fc-input { min-height: 44px; max-width: 100%; min-width: 0; width: 100%; }
.drive-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.drive-notice, .drive-error, .drive-empty { padding: 16px 20px; border-radius: var(--radius-md); background: var(--bg-sunken); border: 1px solid var(--line); line-height: 1.6; overflow-wrap: anywhere; }
.drive-error { border-left: 3px solid var(--danger, #dc5252); }
.drive-notice { border-left: 3px solid var(--primary); }
.drive-empty { min-height: 140px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.drive-items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-raised, var(--bg)); }
.drive-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.drive-item:last-child { border-bottom: 0; }
.drive-item__info { min-width: 0; flex: 1 1 180px; overflow-wrap: anywhere; }
.drive-item > .drive-actions { justify-content: flex-end; flex: 0 0 auto; }
.drive-item__info > .fc-btn { text-align: left; justify-content: flex-start; font-weight: 650; background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
.drive :is(button,input,select):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.drive-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.drive-dialog { width: min(600px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); background: var(--bg-raised, var(--bg)); padding: 24px; }
.drive-dialog::backdrop { background: rgb(0 0 0 / .48); }
.drive-dialog form, .drive-dialog__body, .drive-access { display: grid; gap: 16px; }
.drive-dialog label { display: grid; gap: 6px; font-size: 13px; }
.drive-dialog .drive-error:empty { display: none; }
.drive-dialog > form > .drive-actions { justify-content: flex-end; }
.drive-access__row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 8px; align-items: end; }
.drive-picker { display: grid; gap: 8px; }
@media(max-width: 700px) {
  .drive-item { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 8px 12px; align-items: start; }
  .drive-item__info { flex-basis: auto; }
  .drive-item > .drive-actions { grid-column: 2; justify-content: flex-start; }
  .drive-access__row { grid-template-columns: minmax(0,1fr); }
  .drive-dialog { padding: 18px; }
  .drive-heading { align-items: flex-start; }
}

.drive-item__icon { flex: 0 0 28px; display: grid; place-items: center; color: var(--muted); }
.drive-item__icon .icn, .drive-item__icon svg { width: 24px; height: 24px; }
.drive-menu { position: relative; }
.drive-menu > summary { list-style: none; cursor: pointer; gap: 8px; }
.drive-menu > summary::-webkit-details-marker { display: none; }
.drive-menu > summary .icn, .drive-menu > summary svg { width: 14px; height: 14px; }
.drive-menu__popup { position: absolute; z-index: 50; right: 0; top: calc(100% + 6px); min-width: 190px; width: max-content; max-width: calc(100vw - 56px); padding: 6px; display: grid; gap: 4px; background: var(--bg-panel, var(--bg)); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.drive-menu__popup .fc-btn { width: 100%; justify-content: flex-start; }
.drive summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media(max-width:700px) { .drive-menu__popup { right: auto; left: 0; } }
