/* =========================================================================
   DRIVE (drive.js): the places row, the folder path and sort, the rows, the + and the upload tray. Built from the app's
   own parts (.seg, .glist rows, .tasks-chip, .tasks-fab, .tag, sheets) and its tokens only.
   ========================================================================= */

/* ---- Drive on the kit: token overrides (kit classes sit beside the Drive's own: .verser-row-list/-card beside .glist,
   .verser-sec-head, .verser-empty, .verser-btn, .verser-chip, .verser-pill, .verser-badge). ---- */
/* Section heads (.verser-sec-head): no kit margin; .drive-sec keeps its 14px above. */
#driveScreen .drive-sec{--verser-section-head-margin-block:0}
/* Kit gap: .verser-row-card-icon sets a 22px glyph (not a token); the Drive's sheet rows keep the app's 24px icon. */
:is(.drive-add,.drive-sheet,.drive-move,.drive-share) .verser-row-card-icon .icon{inline-size:24px;block-size:24px}
/* Buttons (.verser-btn beside .btn): a press as the app's .btn gives it, a .97 scale on the neutral and danger buttons
   (tasks-page.css sets the kit's press scale to 1 on every .btn.verser-btn) and the pressed tint on a primary one. */
:is(#driveScreen,.drive-sheet,.drive-add,.drive-move,.drive-share) .verser-btn.btn:not([data-variant="primary"]){--verser-button-press-scale:.97}
:is(#driveScreen,.drive-sheet,.drive-add,.drive-move,.drive-share) .verser-btn[data-variant="primary"]:active:not(:disabled):not([aria-disabled="true"]){box-shadow:inset 0 0 0 100px var(--pressed)}
/* Fields (.verser-input beside .field): focused, the rim stays the field's own and the app's ring goes round it. */
:is(#driveSearch,#driveFolderName,#driveRename,#driveShareFind,.drive-pick-search){--verser-field-focus-border:var(--field-edge)}
/* The small icon buttons (.verser-icon-btn data-variant="square": ⋯, close, remove, cancel): the Drive's hover fill and
   press (⋯ gives to .94 with no fill; close and cancel do not move). Their size, radius and colour stay in the rules below. */
:is(.drive-more,.drive-tray-close,.drive-up-x).verser-icon-btn{--verser-icon-button-fill-hover:var(--fill-1)}
.drive-more.verser-icon-btn:active:not(:disabled):not([aria-disabled="true"]){transform:scale(.94);background:none}
:is(.drive-tray-close,.drive-up-x).verser-icon-btn:active:not(:disabled):not([aria-disabled="true"]){transform:none;background:none}
@media (hover:hover) and (pointer:fine){:is(.drive-more,.drive-tray-close,.drive-up-x).verser-icon-btn:active:not(:disabled):not([aria-disabled="true"]){background:var(--fill-1)}}

/* Arabic: JetBrains Mono has no Arabic, and its wide space opened gaps between Arabic words in mono labels (live
   review C15). In an Arabic page the screen's mono labels take the kit's Arabic-first mono stack and no tracking,
   the same swap the row card and chip make. */
#driveScreen:dir(rtl){--mono:var(--font-mono-rtl);--font-mono:var(--font-mono-rtl)}

/* The last row and the tray clear the round +: the bottom gap, the button, a gap, and the tray when it shows. */
body:not(.agent-fab-on) #driveScreen.active{padding-bottom:calc(var(--verser-fab-reserve) + var(--drive-tray-h,0px))}
body.agent-fab-on #driveScreen.active{padding-bottom:var(--drive-tray-h,0px)}
#driveScreen .title .drive-search-open{margin-inline-start:auto}
/* Sort and the list/tiles switch follow Search in the title row (drive.js driveHeadSync), the kit page head's end slot. */
/* A long folder name stays on one line and ends in … rather than breaking mid-word beside them. */
#driveScreen .title .title-with-icon{flex:0 1 auto}
#driveScreen .title #driveTitle{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---- Places: the kit's underline tabs (.tabs-line.scrolls.sticks), a glyph per place, stuck under the title while the
   list scrolls; the edge fades while there is more to scroll to. ---- */
.drive-places{--verser-tabs-line-margin-top:10px;overscroll-behavior-x:contain}
.drive-places.hidden{display:none}
/* Inside a folder on a phone the folder is the page: its name is the title, Back goes up, the place tabs step aside. */
body:not(.desk) .drive-places.in-folder{display:none}
.drive-places .tab-line{gap:7px;padding:0 var(--vx-sp-3h)}
.drive-places .tab-line:first-child{padding-inline-start:var(--vx-sp-3)}
.drive-places .tab-line>.icon{width:17px;height:17px;opacity:.82;transition:opacity 140ms ease}
.drive-places .tab-line[aria-selected="true"]>.icon{opacity:1}
.drive-places .tab-line .drive-places-chev{width:13px;height:13px;margin-inline-start:calc(-1 * var(--vx-sp-0h));transform:rotate(90deg);opacity:.7}

/* ---- The folder path as a pill of crumbs with chevrons, then the sort chip (and List / Tiles on a desktop). A long path
   scrolls, its end (the folder open) in view. ---- */
.drive-bar{display:flex;align-items:center;gap:var(--vx-sp-2);margin-top:var(--vx-sp-3);min-height:44px}
.drive-bar.hidden{display:none}
.drive-crumbs{display:flex;align-items:center;flex:0 1 auto;min-width:0;max-width:100%;height:40px;margin-inline-end:auto;padding:0 var(--vx-sp-1);overflow-x:auto;border:1px solid var(--hairline);border-radius:var(--r-pill);background:var(--fill-1);scrollbar-width:none;white-space:nowrap}
.drive-crumbs::-webkit-scrollbar{display:none}
/* At a place's top the path is one name, the place the tab already names: no label (live review C26); its room stays,
   so the sort and view buttons do not move. A sub-folder shows the path. */
.drive-crumbs:has(>.drive-crumb:only-child){padding:0;border-color:transparent;background:none;visibility:hidden}
/* No path yet (the Drive still loading): no empty pill; its room stays, so the sort and view buttons do not move. */
.drive-crumbs:empty{visibility:hidden}
.drive-crumb{flex:none;min-height:32px;max-width:14em;padding:0 var(--vx-sp-2h);border:0;border-radius:var(--r-pill);background:none;color:var(--text-2);font:inherit;font-size:var(--font-size-small);font-weight:500;overflow:hidden;text-overflow:ellipsis;transition:background-color 140ms ease,color 140ms ease}
.drive-crumb[aria-current="page"]{background:var(--fill-2);color:var(--text);font-weight:600;cursor:default}
.drive-crumb:active:not([aria-current]){transform:scale(.97)}
.drive-crumb-sep{flex:none;width:14px;height:14px;opacity:.55;color:var(--text-2)}
.drive-move-crumbs .drive-crumb{min-height:40px}
/* A finger: the path bar and its crumbs are 44 tall (the kit's reach); the path fades at the side that has more (data-scroll-cue). */
@media (pointer:coarse){.drive-crumbs{block-size:var(--vx-h)}.drive-crumb,.drive-move-crumbs .drive-crumb{min-block-size:var(--vx-h)}}
.drive-sort{flex:none}
.drive-view{display:none;flex:none}
/* The open switch (tiles on, search open) sits on the kit's well, as a pressed ghost button. */
:is(.drive-view[aria-pressed="true"],.drive-search-open[aria-expanded="true"]){background:var(--vx-well)}
.drive-review-note{margin:var(--vx-sp-2) var(--vx-sp-1) 0}

/* ---- Section heads over the folders and the files. ---- */
.drive-sec{margin-top:var(--vx-sp-3h);min-height:32px}
.drive-list>.drive-sec:first-child{margin-top:var(--vx-sp-1h)}

/* ---- Quick access: the files from here opened or changed last, small glass tiles in a row that scrolls sideways. ---- */
.drive-quick{margin-top:var(--vx-sp-1)}
.drive-quick.hidden{display:none}
.drive-quick-row{display:flex;gap:var(--vx-sp-2h);margin:var(--vx-sp-0h) calc(-1 * var(--vx-sp-4)) 0;padding:var(--vx-sp-0h) var(--vx-sp-4) var(--vx-sp-1h);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:var(--vx-sp-4);scrollbar-width:none;-webkit-overflow-scrolling:touch}
.drive-quick-row::-webkit-scrollbar{display:none}
.drive-quick-tile{display:grid;align-content:start;gap:var(--vx-sp-1);flex:0 0 132px;min-height:112px;padding:var(--vx-sp-3);border:1px solid var(--hairline);border-radius:var(--r-compact);background:var(--gloss),var(--glass-panel);background-origin:border-box;-webkit-backdrop-filter:var(--blur);backdrop-filter:var(--blur);box-shadow:var(--shadow);color:var(--text);font:inherit;text-align:start;scroll-snap-align:start;transition:transform 160ms var(--ease-out),border-color 140ms ease}
.drive-quick-tile b{margin-top:var(--vx-sp-2);font-size:var(--font-size-small);font-weight:600;line-height:1.3;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.drive-quick-tile small{font-family:var(--mono);font-size:var(--font-size-meta);color:var(--text-2);font-variant-numeric:tabular-nums}
.drive-quick-tile:active{transform:scale(.97)}
.drive-quick-tile:focus-visible{outline:var(--ring-width) solid var(--ring);outline-offset:var(--ring-offset)}

/* ---- The type glyph: one rounded square, one glass fill and rim for every type; the drawn shape says which. ---- */
.drive-glyph{position:relative;display:grid;place-items:center;flex:none;border-radius:var(--r-avatar);background:var(--gloss),var(--fill-2);box-shadow:inset 0 0 0 1px var(--icon-edge);color:var(--text)}
.drive-glyph[data-type="folder"]{background:var(--gloss),var(--fill-3)}
.drive-quick-glyph{width:36px;height:36px}
.drive-quick-glyph .icon{width:20px;height:20px}

/* ---- Folders: glass tiles, two across on a phone, as many as fit on a desktop; ⋯ in the corner. ---- */
.drive-folders,.drive-files.is-grid{margin-top:var(--vx-sp-1)}
.drive-item.drive-tile{display:block;position:relative;min-width:0}
.drive-tile>.tile{width:100%;height:100%;min-height:108px;gap:var(--vx-sp-3h);padding:var(--vx-sp-3h) var(--vx-sp-3h) 13px}
.drive-tile .tile-icon{width:40px;height:40px}
.drive-tile .tile-text{width:100%}
.drive-tile .drive-name{padding-inline-end:var(--vx-sp-7)}
.drive-tile .drive-name b{font-size:var(--font-size-body)}
.drive-tile .drive-meta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drive-tile>.drive-more{position:absolute;top:var(--vx-sp-1h);inset-inline-end:var(--vx-sp-1);z-index:1}
.drive-tile .drive-badges{margin-top:var(--vx-sp-1)}
.drive-tile.is-drop>.tile{border-color:var(--vx-hair-2);background:var(--gloss),radial-gradient(120% 100% at 0% 0%,color-mix(in srgb,var(--a) 30%,transparent) 0%,transparent 70%),var(--fill-1);box-shadow:var(--shadow),inset 0 0 0 1px var(--vx-hair-2)}
.drive-tile.is-new>.tile{animation:drive-new 1.6s var(--ease-out)}
.drive-tile.is-open>.tile{border-color:var(--vx-hair-2)}

/* ---- Files: rows in one glass card; the meta line in mono, on a wide list split into who | when · size. ---- */
.drive-list{position:relative;margin-top:var(--vx-sp-3);container-type:inline-size}
.drive-list>.glist{margin-top:var(--vx-sp-1);transition:box-shadow .16s ease,background-color .16s ease}
.drive-item{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:var(--vx-sp-1)}
.drive-row.glist-row{min-height:64px;padding:var(--vx-sp-2h) 0}
.drive-item{--drive-row-glyph:42px}
.drive-row .glist-icon{width:var(--drive-row-glyph);height:var(--drive-row-glyph)}
.drive-name{display:flex;align-items:center;gap:var(--vx-sp-1h);min-width:0}
.drive-name b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal}
.drive-name .drive-star{flex:none;width:14px;height:14px;fill:var(--warn);stroke:var(--warn)}
.drive-meta{font-family:var(--mono);font-size:var(--font-size-meta);color:var(--text-2)}
.drive-row .drive-meta{display:block;margin-top:3px;line-height:1.45}
.drive-meta>span,.drive-lead>span,.drive-facts>span{display:inline}
.drive-meta>span+span::before,.drive-lead>span+span::before,.drive-facts>span+span::before{content:"·";margin:0 var(--vx-sp-1h);color:var(--text-2)}
.drive-facts{font-variant-numeric:tabular-nums}
.drive-badges{display:flex;flex-wrap:wrap;gap:var(--vx-sp-1h);margin-top:var(--vx-sp-1h)}
.drive-badges:empty{display:none}
.drive-more{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:var(--r-small);background:none;color:var(--text-2);transition:background-color 140ms ease,color 140ms ease}
.drive-more:active{transform:scale(.94)}
.drive-more .icon{width:20px;height:20px}
/* Paint the whole row, including More, within the list card's padded bounds. */
.drive-item:not(.drive-tile).is-open{border-radius:var(--r-row);background:var(--fill-1)}
#driveScreen .drive-item:not(.drive-tile):is(.is-open,.is-selected)>.drive-row.glist-row{background:none;box-shadow:none}
.drive-count{margin:var(--vx-sp-3) var(--vx-sp-1) 0;font-family:var(--mono);font-size:var(--font-size-meta);font-variant-numeric:tabular-nums}
/* A wide list (a window of 520px and more gives the column its full width) splits the meta line in two: who on the
   left, the date and size on the right, so they line up down the list. */
@container (min-width:410px){
  .glist-row.drive-row .drive-meta{display:flex;align-items:center;justify-content:space-between;gap:var(--vx-sp-3)}
  .glist-row.drive-row .drive-meta>span+span::before{content:none}
  .glist-row.drive-row .drive-lead{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .glist-row.drive-row .drive-facts{flex:none;margin-inline-start:auto}
}

/* ---- Empty: the kit's empty state on a glass card; where files can go, its rim is dashed (it is also the drop target). ---- */
.drive-empty{margin-block-start:var(--vx-sp-1)}
.drive-empty.is-droppable{outline:1.5px dashed var(--vx-hair);outline-offset:calc(-1 * var(--vx-sp-3))}
.drive-empty .drive-empty-add{display:none}
.drive-empty-icon{display:grid;place-items:center;color:var(--vx-ink-3)}
.drive-empty-icon>.icon{inline-size:28px;block-size:28px}

/* ---- Drag and drop: while files are held over the list it turns into one glass drop target, a dashed rim with the
   brand's sheen and the words; a folder tile under the pointer lights instead. ---- */
.drive-list::after{content:attr(data-drop);position:absolute;inset:0;z-index:2;display:grid;justify-items:center;align-content:start;padding-top:72px;min-height:160px;border:1.5px dashed var(--vx-hair-2);border-radius:var(--r-panel);background:var(--gloss),radial-gradient(90% 80% at 0% 0%,color-mix(in srgb,var(--a) 30%,transparent) 0%,transparent 70%),radial-gradient(80% 70% at 100% 100%,color-mix(in srgb,var(--b) 14%,transparent) 0%,transparent 70%),var(--glass-modal);-webkit-backdrop-filter:var(--blur);backdrop-filter:var(--blur);color:var(--text);font-size:var(--font-size-body);font-weight:600;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 160ms var(--ease-out),visibility 0s linear 160ms}
.drive-list.is-drop{min-height:160px}
.drive-list.is-drop::after{opacity:1;visibility:visible;transition:opacity 160ms var(--ease-out)}
.drive-list:has(.drive-item.is-drop)::after{opacity:0;visibility:hidden}
.drive-item:not(.drive-tile).is-drop{border-radius:var(--r-row);background:var(--pressed);box-shadow:inset 0 0 0 2px var(--selected-edge)}
/* A row just made or just uploaded: lit for a moment where it landed (targetFlash). */
.drive-item:not(.drive-tile).is-new{animation:drive-new 1.6s var(--ease-out)}
@keyframes drive-new{from{background:var(--pressed)}}

/* The brain's couldn't-read list (drive-add drive-brain-failed-list): glist rows. (The + sheet's rows are kit rows.) */
.drive-add .glist{margin-top:var(--vx-sp-1);padding:0 var(--vx-sp-1);background:none;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.drive-add .glist-row{min-height:56px;padding:var(--vx-sp-2) 0}
.drive-add .glist-icon{width:38px;height:38px}
.drive-add .glist-row small{margin-top:1px}
.drive-details{display:grid;grid-template-columns:auto minmax(0,1fr);gap:var(--vx-sp-2) var(--vx-sp-3h);margin:var(--vx-sp-1) 0 var(--vx-sp-3h);font-size:var(--font-size-small)}
.drive-details dt{color:var(--text-2)}
.drive-details dd{margin:0;min-width:0;overflow-wrap:anywhere}
.drive-sheet-acts{margin-top:var(--vx-sp-3h)}
.drive-sheet-acts .btn .icon{width:18px;height:18px}
.drive-sheet-acts .btn[aria-pressed="true"] .icon{fill:var(--warn);stroke:var(--warn)}

/* Trash and Waiting answer on the row: Restore / Delete forever, Decline / Approve, under the name (no ⋯ there), on the
   name's start line (the glyph and the row card's gap before it); 40 tall with a mouse, a finger's 44 on touch (--vx-h). */
.drive-row-acts{grid-column:1/-1;margin-block:calc(-1 * var(--vx-sp-1)) var(--vx-sp-3);margin-inline:calc(var(--drive-row-glyph) + var(--verser-row-card-gap,var(--vx-sp-3h))) 0}
.drive-row-acts:empty{display:none}
.drive-row-acts .btn{min-height:var(--vx-h);padding:0 var(--vx-sp-3h);font-size:var(--font-size-small)}
.drive-item:has(.drive-row-acts)>.drive-more{display:none}
.drive-item:has(.drive-row-acts){grid-template-columns:minmax(0,1fr)}

/* ---- Search: the field over the places, the type chips under it in one row that scrolls sideways. ---- */
.drive-search{margin-top:var(--vx-sp-2h)}
.drive-search.hidden{display:none}
.drive-types{display:flex;gap:var(--vx-sp-1h);margin-top:var(--vx-sp-2h);overflow-x:auto;scrollbar-width:none;overscroll-behavior-x:contain}
.drive-types::-webkit-scrollbar{display:none}
.drive-types>*{flex:none;white-space:nowrap}

/* ---- The item's sheet: the look at the file, its details, then what can be done, one row each. ---- */
.drive-show{display:grid;place-items:center;min-height:64px;margin:var(--vx-sp-0h) 0 var(--vx-sp-3h)}
.drive-show img{display:block;max-width:100%;max-height:min(52vh,420px);border-radius:var(--r-inner);object-fit:contain;background:var(--fill-1)}
.drive-show video{display:block;width:100%;max-height:min(52vh,420px);border-radius:var(--r-inner);background:var(--fill-1)}
.drive-show audio{width:100%}
.drive-show .drive-pdf{justify-self:start}
.drive-show>.skel{width:100%}
.drive-show-none{display:grid;justify-items:center;gap:var(--vx-sp-2);padding:var(--vx-sp-4h) 0;color:var(--text-2);text-align:center}
.drive-show-none .icon{width:34px;height:34px}
.drive-show-none p{margin:0;font-size:var(--font-size-small)}
.drive-text{width:100%;max-height:min(46vh,360px);overflow:auto;padding:var(--vx-sp-3) var(--vx-sp-3h);border:1px solid var(--line);border-radius:var(--r-inner);background:var(--fill-1);font-size:var(--font-size-small);line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;-webkit-overflow-scrolling:touch}
.drive-table{width:100%;max-height:min(46vh,360px);overflow:auto;border:1px solid var(--line);border-radius:var(--r-inner);background:var(--fill-1);-webkit-overflow-scrolling:touch}
.drive-table table{border-collapse:collapse;font-size:var(--font-size-meta);font-variant-numeric:tabular-nums}
.drive-table th,.drive-table td{max-width:16em;padding:7px var(--vx-sp-2h);border-bottom:1px solid var(--row-edge);text-align:start;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drive-table th{position:sticky;top:0;z-index:1;background:var(--glass-solid);font-weight:600;color:var(--text)}
.drive-slide{width:100%;margin-bottom:var(--vx-sp-2);padding:var(--vx-sp-3) var(--vx-sp-3h);border:1px solid var(--line);border-radius:var(--r-inner);background:var(--fill-1)}
.drive-slide small{display:block;font-size:var(--font-size-caption);color:var(--text-2)}
.drive-slide b{display:block;margin-top:var(--vx-sp-0h);font-size:var(--font-size-small)}
.drive-slide p{margin:var(--vx-sp-1) 0 0;font-size:var(--font-size-small);line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.drive-show-note{width:100%;margin:var(--vx-sp-1h) 0 0;font-size:var(--font-size-meta)}
.drive-access-line{display:block}
.drive-access-line+.drive-access-line{margin-top:var(--vx-sp-0h);color:var(--text-2)}
.drive-link{min-height:0;padding:0;border:0;background:none;color:var(--text);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px}
.drive-versions{margin:calc(-1 * var(--vx-sp-1)) 0 var(--vx-sp-3)}
.drive-versions.hidden{display:none}
.drive-version{min-height:56px;padding:var(--vx-sp-2) 0}
.drive-version .btn{min-height:var(--vx-h-sm);padding:0 var(--vx-sp-3);font-size:var(--font-size-small)}
.drive-decide{margin:var(--vx-sp-1) 0 var(--vx-sp-1h)}
.drive-decide .btn{flex:1 1 0}
.drive-share .glist{margin-top:var(--vx-sp-2);padding:0 var(--vx-sp-1);background:none;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.drive-share .glist-row{min-height:52px;padding:var(--vx-sp-1h) 0}
.drive-share .glist-icon{width:36px;height:36px}
.drive-acts .drive-down .icon{transform:rotate(180deg)}
.drive-acts [data-act="star"][aria-pressed="true"] .icon{fill:var(--warn);stroke:var(--warn)}

/* The move picker: where it goes as a path, then the folders there. */
.drive-move-crumbs{margin:calc(-1 * var(--vx-sp-0h)) 0 var(--vx-sp-1)}
.drive-move-list{min-height:120px}
.drive-move-empty{margin:var(--vx-sp-3) var(--vx-sp-1)}

/* Drive.pick: the search over the browser, then rows that toggle; a chosen row is lit with a check. */
.drive-pick-search{width:100%;margin:0 0 var(--vx-sp-2h)}
.drive-pick .glist-text{min-width:0}
.drive-pick .glist-text b,.drive-pick .glist-text small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drive-pick-row{border-radius:var(--radius-sm)}
.drive-pick-row .drive-pick-check{display:flex;align-items:center;visibility:hidden}
.drive-pick-row[aria-pressed="true"]{background:var(--vx-nav-current);box-shadow:inset 0 0 0 1px var(--tab-edge)}
.drive-pick-row[aria-pressed="true"] .drive-pick-check{visibility:visible}
.drive-pick-note:empty{display:none}

/* The share sheet: who can open it already, the search and what it finds, then the shares with their level. */
.drive-audience{margin:0 0 var(--vx-sp-3)}
.drive-share-group{margin:var(--vx-sp-3) var(--vx-sp-1) 0;font-size:var(--font-size-meta);font-weight:600;color:var(--text-2)}
.drive-share-list{margin-top:var(--vx-sp-2h)}
.drive-share-row{grid-template-columns:auto minmax(0,1fr)}
.drive-share-ctl{grid-column:1/-1;display:flex;align-items:center;gap:var(--vx-sp-1h);margin-block:calc(-1 * var(--vx-sp-0h)) var(--vx-sp-1);margin-inline:50px 0}
.drive-level{display:flex;flex:1 1 auto;max-width:240px;margin:0;padding:3px;-webkit-backdrop-filter:none;backdrop-filter:none}
.drive-level .seg-tab{min-height:var(--vx-h-sm);font-size:var(--font-size-meta)}
.drive-level .seg-tab[aria-pressed="true"]{background:var(--vx-nav-current);box-shadow:inset 0 0 0 1px var(--tab-edge);color:var(--text)}
.drive-share-ctl .drive-more{width:40px;height:40px}

/* A link to an item this person can't open: the words and Request access, nothing about the item. */
.drive-denied>button{margin-block-start:var(--vx-sp-2)}

/* ---- The upload tray: over the bottom of the screen, under the + (which rises above it). ---- */
.drive-tray{position:fixed;inset-inline:max(16px,calc(50% - var(--phone) / 2 + 16px));bottom:calc(var(--nav-bottom) + 92px);z-index:41;display:flex;flex-direction:column;max-height:min(46vh,340px);border:1px solid var(--vx-hair-2);border-radius:var(--r-panel);background:var(--gloss),radial-gradient(120% 80% at 0% 0%,color-mix(in srgb,var(--a) 22%,transparent) 0%,transparent 60%),var(--glass-modal);background-origin:border-box;-webkit-backdrop-filter:var(--blur-sheet);backdrop-filter:var(--blur-sheet);box-shadow:var(--shadow);overflow:hidden;transition:transform .24s var(--ease-out),opacity .2s var(--ease-out)}
.drive-tray.hidden{display:none}
.drive-tray.is-entering{transform:translateY(12px);opacity:0}
body.sheet-open .drive-tray{display:none}
#driveScreen.has-tray .tasks-fab{bottom:calc(var(--nav-bottom) + 92px + var(--drive-tray-h,0px) + 12px);transition:bottom .24s var(--ease-out),transform 160ms var(--ease-out),opacity 120ms ease}
body:not(.sheet-open,.hub-reels-open,.verser-open):has(#driveScreen.active.has-tray){--float-bottom:calc(var(--nav-bottom) + 160px + var(--drive-tray-h,0px) + 12px)}
/* The agent's button (bottom left) rises with the + so the tray has the whole width. */
body:has(#driveScreen.active.has-tray) .agent-fab-btn{bottom:calc(var(--nav-bottom) + 92px + var(--drive-tray-h,0px) + 12px);transition:bottom .24s var(--ease-out)}
body:has(#driveScreen.active.has-tray) .agent-fab-panel{bottom:calc(var(--nav-bottom) + 92px + var(--drive-tray-h,0px) + 12px - var(--af-status-half,0px))}
.drive-tray-head{display:flex;align-items:center;flex:none}
.drive-tray-toggle{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"sum chev" "bar bar";align-items:center;gap:var(--vx-sp-2) var(--vx-sp-2);flex:1 1 auto;min-width:0;min-height:56px;padding-block:var(--vx-sp-2h) var(--vx-sp-3);padding-inline:var(--vx-sp-4) var(--vx-sp-1h);border:0;background:none;color:var(--text);font:inherit;text-align:start}
.drive-tray-sum{grid-area:sum;min-width:0;font-family:var(--mono);font-size:var(--font-size-small);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
.drive-tray-toggle>.icon{grid-area:chev;width:18px;height:18px;color:var(--text-2);transform:rotate(90deg);transition:transform .2s var(--ease-out)}
.drive-tray-toggle[aria-expanded="false"]>.icon{transform:rotate(-90deg)}
.drive-tray-bar,.drive-up-bar{display:block;height:3px;border-radius:var(--r-pill);background:var(--track);overflow:hidden}
.drive-tray-bar{grid-area:bar}
.drive-tray:not(.is-busy) .drive-tray-bar{display:none}
.drive-tray-bar i,.drive-up-bar i{display:block;height:100%;border-radius:inherit;background:var(--track-fill);transform-origin:left;transform:scaleX(var(--p,0));transition:transform .2s linear}
.drive-tray-close{display:grid;place-items:center;flex:none;width:44px;height:44px;margin-inline-end:var(--vx-sp-1);padding:0;border:0;border-radius:var(--r-small);background:none;color:var(--text-2)}
.drive-tray-close.hidden{display:none}
.drive-tray-close .icon{width:18px;height:18px}
.drive-tray-list{flex:1 1 auto;min-height:0;margin:0;padding:var(--vx-sp-0h) var(--vx-sp-3h) var(--vx-sp-1h);overflow-y:auto;overscroll-behavior:contain;list-style:none;border-top:1px solid var(--hairline)}
.drive-tray.is-folded .drive-tray-list{display:none}
.drive-up{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:var(--vx-sp-3);min-height:60px;padding:var(--vx-sp-2) 0}
.drive-up+.drive-up{border-top:1px solid var(--row-edge)}
.drive-up>.icon{box-sizing:content-box;width:20px;height:20px;padding:var(--vx-sp-2);border-radius:var(--r-small);background:var(--fill-2);box-shadow:inset 0 0 0 1px var(--icon-edge);color:var(--text)}
.drive-up-text{display:grid;gap:var(--vx-sp-1);min-width:0}
.drive-up-text b{font-size:var(--font-size-small);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drive-up-text small{font-family:var(--mono);font-size:var(--font-size-meta);color:var(--text-2);font-variant-numeric:tabular-nums}
.drive-up.is-stopped small,.drive-up.is-failed small{color:var(--danger-text)}
.drive-up.is-waiting small{color:var(--warn-text)}
.drive-up.is-done small{color:var(--green)}
.drive-up:is(.is-done,.is-waiting,.is-failed,.is-stopped) .drive-up-bar{display:none}
.drive-up-acts{display:flex;align-items:center;gap:var(--vx-sp-0h)}
.drive-up-acts .btn{min-height:var(--vx-h-sm);padding:0 var(--vx-sp-3);font-size:var(--font-size-small)}
.drive-up-acts .drive-up-x{display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:var(--r-small);background:none;color:var(--text-2)}
.drive-up-acts .drive-up-x .icon{width:18px;height:18px}
/* A box of its own (not display:contents), so the keyboard reaches it; it looks like the name it holds. */
.drive-up-open{display:block;min-width:0;padding:0;border:0;border-radius:var(--r-small);background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}
.drive-up-open b{display:block}
/* A finger reaches the done row's name and the couldn't-read link by 44 (the kit's reach), however short their line;
   the rows keep their height (the link's ::before is its dot, so its reach is its ::after). */
@media (pointer:coarse){.drive-up-open,.drive-brain-failed{position:relative}.drive-up-open::before,.drive-brain-failed::after{content:"";position:absolute;inset-block:min(calc(-1 * var(--vx-sp-3)),calc((100% - var(--vx-h)) / 2));inset-inline:0}}

/* The + arrives once per session, as on Tasks and Documents (workspace.js marks .fab-entered). */
#driveScreen.active:not(.fab-entered) .tasks-fab{animation:tasks-fab-in .36s var(--spring)}
@media (hover:hover) and (pointer:fine){
  .drive-more:hover,.drive-tray-close:hover,.drive-up-x:hover{background:var(--fill-1);color:var(--text)}
  .drive-link:hover{opacity:.8}
  .drive-crumb:not([aria-current]):hover{color:var(--text)}
}
@media (prefers-reduced-motion:reduce){
  #driveScreen.active:not(.fab-entered) .tasks-fab{animation:tasks-fade .2s ease}
  .drive-tray,.drive-tray-toggle>.icon,#driveScreen.has-tray .tasks-fab,body:has(#driveScreen.active.has-tray) .agent-fab-btn{transition:none}
  .drive-tray.is-entering{transform:none}
  .drive-tray-bar i,.drive-up-bar i{transition:none}
  .drive-item.is-new{animation:none}
}

/* ---- Inside files: under the name matches, the files whose words match, each with a few of its words (as text). ---- */
.drive-inside{margin-top:var(--vx-sp-4h)}
.drive-inside-head{margin:0 var(--vx-sp-1) var(--vx-sp-2);font-size:var(--font-size-meta);font-weight:600;letter-spacing:0;line-height:1.3;color:var(--text-2)}
.drive-inside .glist{margin-top:0}
.drive-inside-row .drive-meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drive-snippet{display:-webkit-box;margin-top:var(--vx-sp-1);overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:var(--font-size-meta);line-height:1.4;color:var(--text-2);overflow-wrap:anywhere}

/* ---- What the brain made of a file: a quiet tag, and in the sheet the reason under it. ---- */
.drive-brain-state .tag{vertical-align:1px}
.drive-brain-why{display:block;margin-top:var(--vx-sp-1h);color:var(--text-2)}

/* ---- A file open on a desktop: the pane beside the list (.desk-two), stuck while the list scrolls. ---- */
.drive-main{min-width:0}
.drive-col{min-width:0}
.drive-pane.hidden{display:none}
.drive-pane{margin-top:var(--vx-sp-3);padding:var(--vx-sp-4);border:1px solid var(--line);border-radius:var(--r-panel);background:var(--gloss),var(--glass-modal);background-origin:border-box;-webkit-backdrop-filter:var(--blur);backdrop-filter:var(--blur);box-shadow:var(--shadow);overflow:auto;overscroll-behavior:contain;animation:drive-pane-in 220ms var(--ease-out)}
@keyframes drive-pane-in{from{opacity:0;transform:translateX(8px)}}
.drive-pane-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:var(--vx-sp-3);margin-bottom:var(--vx-sp-3h)}
.drive-pane-glyph{width:44px;height:44px}
.drive-pane-glyph .icon{width:22px;height:22px}
.drive-pane-title{display:grid;gap:3px;min-width:0}
.drive-pane-title b{font-size:var(--font-size-body);font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.drive-pane-title .drive-meta>span{display:inline}
.drive-pane .drive-show{min-height:120px;margin:0 0 var(--vx-sp-3h);padding:var(--vx-sp-2h);border:1px solid var(--hairline);border-radius:var(--r-compact);background:var(--fill-1)}
.drive-pane .drive-show .drive-text,.drive-pane .drive-show .drive-table{max-height:min(44vh,380px);border:0;background:none}
.drive-pane .drive-details{font-size:var(--font-size-small)}
.drive-pane-acts{display:flex;gap:var(--vx-sp-2);margin-block-start:var(--vx-sp-1)}
.drive-pane-acts>button{flex:1 1 0}
.drive-pane-acts .drive-down-icon{transform:rotate(180deg)}

/* ---- Desktop (body.desk): the full middle width, tiles from 200px, List / Tiles, the empty state's own Add button. ---- */
body.desk #driveScreen .drive-view{display:grid}
body.desk #driveScreen .drive-empty .drive-empty-add{display:inline-flex}
body.desk #driveScreen .drive-quick-row{margin:var(--vx-sp-0h) 0 0;padding:var(--vx-sp-0h) 0 var(--vx-sp-1h);scroll-padding-inline:0}
body.desk #driveScreen .drive-quick-tile{flex:0 0 150px}
body.desk #driveScreen .drive-main.desk-two{grid-template-columns:minmax(0,1fr) minmax(300px,min(400px,42%));column-gap:var(--vx-sp-4)}
body.desk #driveScreen .drive-main.desk-two>.drive-pane{--vx-pane-top:calc(var(--vx-sp-9) * 2);top:var(--vx-pane-top)}   /* its height: the kit's [data-pane-fit], above the + */
body.desk #driveScreen .drive-main.desk-two .tile-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}
body.desk #driveScreen .drive-main.desk-two .drive-quick-tile{flex-basis:132px}
body.desk #driveScreen .drive-files.is-grid .drive-tile>.tile{min-height:132px}
@media (hover:hover) and (pointer:fine){
  .drive-quick-tile:hover{transform:translateY(-2px);border-color:var(--line);background:var(--gloss),var(--fill-1)}
  .drive-quick-tile:hover:active{transform:scale(.97)}
  .drive-tile>.drive-more{opacity:.7;transition:opacity 140ms ease,background-color 140ms ease}
  .drive-tile:hover>.drive-more,.drive-tile>.drive-more:focus-visible{opacity:1}
}
@media (prefers-reduced-motion:reduce){
  .drive-pane{animation:tasks-fade .2s ease}
  .drive-tile.is-new>.tile{animation:none}
  .drive-list::after{transition:none}
}

/* =========================================================================
   SELECTION (drive.js): the kit's tick (.verser-check) over the type glyph, shown on hover with a mouse, on focus and
   while anything is picked; a picked item lit with the selected rim. The bar under the list sticks to the window's foot.
   ========================================================================= */
.drive-item>.drive-check{position:absolute;z-index:2;inset-block-start:50%;inset-inline-start:var(--vx-sp-2h);margin:0;opacity:0;pointer-events:none;
  transform:translateY(-50%) scale(.9);transition:opacity var(--duration-fast) ease,transform var(--duration-fast) var(--ease-out)}
/* On a tile the tick sits in the top corner beside the ⋯ and the folder or type glyph stays drawn (9 Nov review: the
   tick over the glyph read as a blank square on hover). */
.drive-tile>.drive-check{inset-block-start:var(--vx-sp-4h);inset-inline-start:auto;inset-inline-end:52px;transform:scale(.9)}
.drive-item>.drive-check:focus-visible,.drive-list.is-selecting .drive-item>.drive-check{opacity:1;pointer-events:auto;transform:translateY(-50%)}
.drive-tile>.drive-check:focus-visible,.drive-list.is-selecting .drive-tile>.drive-check{transform:none}
/* The glyph steps aside for the tick in the same place. */
.drive-glyph{transition:opacity var(--duration-fast) ease}
.drive-item:not(.drive-tile):has(>.drive-check:focus-visible) .drive-glyph,.drive-list.is-selecting .drive-item:not(.drive-tile) .drive-glyph{opacity:0}
.drive-item:not(.drive-tile).is-selected{border-radius:var(--r-row);background:var(--pressed)}
.drive-tile.is-selected>.tile{border-color:var(--selected-edge);box-shadow:var(--shadow),inset 0 0 0 1px var(--selected-edge)}
@media (hover:hover) and (pointer:fine){
  .drive-item:hover>.drive-check{opacity:1;pointer-events:auto;transform:translateY(-50%)}
  .drive-tile:hover>.drive-check{transform:none}
  .drive-item:not(.drive-tile):hover:has(>.drive-check) .drive-glyph{opacity:0}
}
.drive-bulk.hidden{display:none}
.drive-bulk{position:sticky;z-index:5;inset-block-end:calc(var(--space-4) + env(safe-area-inset-bottom,0px));display:flex;align-items:center;gap:var(--space-2);
  margin-block:var(--space-4) 0;padding:var(--space-2);padding-inline-end:var(--space-3);border-radius:var(--vx-r-lg);
  /* The modal glass, as the pane's: the rows passing under it stay out of the way of its words. */
  background:var(--gloss),var(--glass-modal);background-origin:border-box;-webkit-backdrop-filter:var(--blur);backdrop-filter:var(--blur);box-shadow:var(--shadow);
  animation:drive-bulk-in 200ms var(--ease-out)}
@keyframes drive-bulk-in{from{opacity:0;transform:translateY(8px)}}
/* A desktop: docked above the list (drive.js), sticking to the top while the list scrolls. */
body.desk .drive-bulk{inset-block:var(--space-2) auto;margin-block:var(--space-2) var(--space-3)}
.drive-bulk-count{flex:1 1 auto;min-width:0;font-family:var(--font-mono);font-size:var(--font-size-meta);font-variant-numeric:tabular-nums;color:var(--text)}
.drive-bulk-acts{display:flex;align-items:center;gap:var(--space-1)}
.drive-bulk-acts .btn{display:inline-flex;align-items:center;gap:var(--space-2);min-height:var(--vx-h);padding-inline:var(--space-3);font-size:var(--font-size-small)}
.drive-bulk-acts .btn .icon{width:18px;height:18px}
.drive-bulk-acts .drive-down-icon{transform:rotate(180deg)}
.drive-bulk .drive-bulk-x{display:grid;place-items:center;width:var(--vx-h);height:var(--vx-h);padding:0}
.drive-bulk .drive-bulk-x .icon{width:18px;height:18px}
/* The phone's floating agent sits at the bottom, on the start side: the bar begins after it. */
body.agent-fab-on:not(.desk) .drive-bulk{inline-size:auto;margin-inline-start:calc(var(--tap-min) + var(--space-6))}
/* A phone: the words go, the icons stay (each still named for a screen reader by its own words). */
@media (max-width:519px){
  .drive-bulk-acts .btn{position:relative;justify-content:center;min-width:44px;padding-inline:var(--space-2)}
  .drive-bulk-acts .btn>span{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}

/* =========================================================================
   COLUMNS (drive.js driveColsOn): a desktop list with room shows the files as a table, header and rows on one grid.
   ========================================================================= */
.drive-files.is-cols{--drive-cols:minmax(0,1fr) minmax(90px,.42fr) 96px 80px 120px}
.drive-files.is-cols .drive-cols-grid{display:grid;grid-template-columns:var(--drive-cols);align-items:center;column-gap:var(--space-3)}
.drive-cols-head{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:var(--vx-sp-1);padding-block:var(--space-1);border-block-end:1px solid var(--hairline)}
.drive-cols-head .drive-col{font-family:var(--font-mono);font-size:var(--font-size-caption);color:var(--text-2);white-space:nowrap}
.drive-cols-head .drive-col-name{padding-inline-start:calc(36px + var(--space-3))}
.drive-col-sort{display:inline-flex;align-items:center;gap:var(--vx-sp-1);min-height:32px;padding:0;border:0;border-radius:var(--radius-4xs);background:none;color:inherit;font:inherit;cursor:pointer}
.drive-col-sort .icon{width:12px;height:12px}
[aria-sort="ascending"]>.drive-col-sort,[aria-sort="descending"]>.drive-col-sort{color:var(--text)}
.drive-col-sort:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring);outline-offset:2px}
.drive-colrow>.drive-row.glist-row{min-height:56px;padding-block:var(--space-2)}
.drive-col{min-width:0}
.drive-col-name{display:flex;align-items:center;gap:var(--space-3);min-width:0}
.drive-col-name .drive-glyph{width:36px;height:36px}
.drive-col-name .drive-glyph .icon{width:18px;height:18px}
.drive-col-name .drive-badges{flex:none;margin:0}
.drive-col-owner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--font-size-small);color:var(--text-2)}
.drive-col-when,.drive-col-size{font-family:var(--font-mono);font-size:var(--font-size-meta);font-variant-numeric:tabular-nums;color:var(--text-2);white-space:nowrap}
.drive-colrow>.drive-check{inset-inline-start:7px}
@media (hover:hover) and (pointer:fine){.drive-col-sort:hover{color:var(--text)}}

/* ---- What the brain couldn't read here: one quiet link under the places, only when a file failed; it opens the list. ---- */
.drive-brain-line{display:flex;flex-wrap:wrap;align-items:center;margin:var(--space-2) 4px 0;font-family:var(--font-mono);font-size:var(--font-size-meta);font-variant-numeric:tabular-nums;color:var(--text-2)}
.drive-brain-line.hidden{display:none}
.drive-brain-line>*+*::before{content:"·";margin-inline:var(--vx-sp-1h);color:var(--text-2)}
.drive-brain-failed{display:inline-flex;align-items:center;gap:var(--vx-sp-0h);min-height:32px;padding:0;border:0;background:none;color:var(--danger-text);font:inherit;cursor:pointer}
.drive-brain-failed::before{color:var(--text-2)}
.drive-brain-failed .icon{width:14px;height:14px}
.drive-brain-failed:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring);outline-offset:2px;border-radius:var(--radius-4xs)}
.drive-brain-failed-list .glist-row{align-items:flex-start}
.drive-brain-failed-list .drive-glyph{width:40px;height:40px}

/* ---- Ask my agent, in the desktop pane: a full-width row of its own above Download and More. ---- */
.drive-pane-acts{flex-wrap:wrap}
.drive-pane-acts .drive-pane-ask{flex:1 1 100%}

/* A name in the other script than the page's (an Arabic file in an English Drive, or the other way) keeps its own
   direction and is only as wide as its words, at most the column, so it starts on the start edge with the names above
   and below it: the pane's title, a Quick access tile's name and an upload's name (it sat against the far edge). */
.drive-pane-title>b,.drive-quick-tile>b,.drive-up-text>b,.drive-up-open{justify-self:start;max-inline-size:100%}

@media (prefers-reduced-motion:reduce){
  .drive-item>.drive-check,.drive-glyph{transition:none}
  .drive-bulk{animation:tasks-fade .2s ease}
}

/* ---- Places as a column (the deep review's D4, Google Drive's left list): on a desktop whose page is wide enough (the
   page's own width, so the docked agent counts) the places are kit nav rows down the left and the tab row steps aside.
   A phone, and a middle squeezed under 680px, keep the tab row. Arabic mirrors it (logical properties, grid order). */
.drive-side{display:none}
body.desk #driveScreen .drive-shell{container:driveshell/inline-size}
@container driveshell (min-width:680px){
  .drive-shell-in{display:grid;grid-template-columns:clamp(176px,22cqi,240px) minmax(0,1fr);column-gap:var(--vx-sp-5);align-items:start}
  .drive-body{min-width:0}
  #driveScreen .drive-places{display:none}
  .drive-side{display:flex;flex-direction:column;gap:var(--vx-sp-0h);position:sticky;top:calc(var(--safe-top) + 12px);max-height:calc(100dvh - 32px);margin-top:var(--vx-sp-3);padding-bottom:var(--vx-sp-3);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  .drive-side.searching{opacity:.55}
}
/* The kit's nav items (as the sidebar): the name ends in … in a narrow column; Waiting's count at the row's end. */
.drive-side-row{flex:none}
.drive-side-name{flex:1;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drive-side-head{margin:0}
.drive-side-group{display:flex;flex-direction:column;gap:var(--vx-sp-1)}
.drive-side-group+.drive-side-row{margin-block-start:var(--vx-sp-2)}
.drive-side-rule{flex:none;margin:var(--vx-sp-2) var(--vx-sp-3)}
.drive-side-use{flex:none;display:grid;gap:var(--vx-sp-2);margin:var(--vx-sp-4) var(--vx-sp-3) 0}
