/* Leet Drive on the web, the WRITER part of the page (section 10): New button, read-only bar, Trash note, select-bar actions,
   drop zone, upload panel, name dialog, "Move to" dialog. Colours are only the tokens of app.css (dark + light), nothing inline. */

/* buttons the writer adds */
.btn.small{padding:6px 12px;font-size:13px;gap:6px}
.btn.danger{background:var(--bad);color:var(--bg);border-color:transparent;font-weight:600}
.btn.danger:hover{background:var(--bad);box-shadow:0 6px 22px var(--badsoft)}
.btn.ghost.danger{background:transparent;color:var(--bad);border-color:var(--line2);font-weight:500}
.btn.ghost.danger:hover{background:var(--badsoft);box-shadow:none}
.ctx-i.danger,.ctx-i.danger .i{color:var(--bad)}
.pill.ro{background:var(--warnsoft);color:var(--warn)}

/* + New: in the sidebar, and in the top bar only where the sidebar is a drawer (phones, narrow windows) */

/* the store cannot be changed from here (folder, newer app, an old phone app, an unreadable manifest) */
.rbar{display:flex;gap:10px;align-items:flex-start;margin:0 0 14px;padding:11px 14px;border-radius:14px;background:var(--warnsoft);border:1px solid color-mix(in srgb,var(--warn) 40%,transparent);color:var(--text);font-size:14px;line-height:1.45;max-width:780px}
.rbar .btn{margin-left:auto;flex:none;align-self:center}
.rbar .i{color:var(--warn);margin-top:1px}
.trash-note{margin:-6px 0 14px;font-size:13.5px;color:var(--dim);max-width:780px}
.ftile.trashed{cursor:default}
.ftile.trashed .btn{margin-left:12px;flex:none}

/* select bar: the writer buttons */
.selbar .btn.ghost.danger{padding:7px 14px}
@media (max-width:640px){.selbar{border-radius:20px;padding:8px 10px 8px 14px}.selbar b{flex-basis:100%;margin-right:0}}

/* drag and drop over the documents */
.main{position:relative}
.drop{position:absolute;inset:10px;z-index:30;display:grid;place-items:center;border-radius:22px;border:2.5px dashed var(--accline);background:color-mix(in srgb,var(--bg) 84%,transparent);backdrop-filter:blur(2px);pointer-events:none;animation:ctxin .12s ease-out both}
.drop-in{display:flex;flex-direction:column;align-items:center;gap:12px;padding:24px;text-align:center;max-width:32ch}
.drop-in .i{width:40px;height:40px;color:var(--acct);stroke-width:1.5}
.drop-in b{font-size:17px;font-weight:600}
.drop.ro{border-color:color-mix(in srgb,var(--warn) 55%,transparent)}
.drop.ro .i{color:var(--warn)}

/* upload panel */
.upl{position:fixed;right:20px;bottom:20px;z-index:75;width:min(380px,calc(100vw - 24px));border:1px solid var(--line2);border-radius:18px;background:var(--panel);box-shadow:var(--shadow);overflow:hidden;animation:rise .3s both}
.upl-h{display:flex;align-items:center;gap:6px;padding:10px 8px 8px 16px}
.upl-h b{flex:1;min-width:0;font-size:14.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upl-h .icon-btn{width:34px;height:34px}
.upl-min .i{transform:rotate(90deg);transition:transform .18s}
.upl.min .upl-min .i{transform:rotate(-90deg)}
.upl-bar{height:4px;background:var(--line);margin:0 16px 8px;border-radius:4px;overflow:hidden}
.upl-bar span{display:block;height:100%;width:0;background:var(--acc);border-radius:4px;transition:width .25s ease}
.upl-list{list-style:none;margin:0;padding:0 8px 8px;max-height:min(36vh,240px);overflow:auto}
.upl-list li{display:flex;align-items:center;gap:10px;padding:7px 8px;border-radius:10px;font-size:13.5px;color:var(--dim)}
.upl-list li .i{width:18px;height:18px;color:var(--faint)}
.upl-list .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.upl-list em{font-style:normal;font-size:12.5px;color:var(--faint);flex:none;font-variant-numeric:tabular-nums}
.upl-list .st-ok .i{color:var(--acct)}
.upl-list .st-up{background:var(--hi)}
.upl-list .st-up em{color:var(--acct);font-weight:600}
.upl-list .st-bad .i,.upl-list .st-big .i,.upl-list .st-bad em,.upl-list .st-big em{color:var(--bad)}
.upl-list .more{justify-content:center;font-size:12.5px;color:var(--faint)}
.upl.min .upl-list,.upl.min .upl-bar{display:none}
.upl.min .upl-h{padding-bottom:10px}
@media (max-width:640px){
  .upl{left:12px;right:12px;bottom:12px;width:auto}
  body:has(.upl:not([hidden])) .toast{bottom:auto;top:14px}
}

/* dialogs: name / confirm, and "Move to" */
.dlg .ask-form{display:block;margin:0}
.dlg-btns{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}
.dlg-btns.rev{flex-direction:row-reverse;justify-content:flex-start}
.dlg .ask-in{display:block;width:100%;height:46px;border-radius:12px;border:1px solid var(--line2);background:var(--card);color:var(--text);padding:0 14px;font-size:16px}
.dlg .ask-in:focus{outline:0;border-color:var(--accline);box-shadow:0 0 0 4px var(--accsoft)}
.dlg .ask-err{color:var(--bad);font-size:13.5px;min-height:20px;margin:6px 0 0}
.dlg .ask-err:empty{min-height:0;margin:0}
.mv-list{display:flex;flex-direction:column;gap:2px;max-height:min(50vh,340px);overflow:auto;padding:4px;border:1px solid var(--line);border-radius:14px;background:var(--card)}
.mv-row{display:flex;align-items:center;gap:10px;width:100%;border:0;background:none;color:var(--text);text-align:left;font-size:14.5px;padding:9px 10px 9px calc(10px + var(--d,0) * 18px);border-radius:10px}
.mv-row:hover{background:var(--hi)}
.mv-row.on{background:var(--accsoft);box-shadow:inset 0 0 0 1.5px var(--accline)}
.mv-row .i{width:20px;height:20px;color:var(--acct)}
.mv-row .solid{fill:currentColor;stroke:none;color:var(--faint)}
.mv-row.on .solid{color:var(--acct)}
.mv-row span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mv-row em{font-style:normal;font-size:12px;color:var(--faint);flex:none}
.mv-row:disabled{opacity:.5;cursor:default}
.mv-row:disabled:hover{background:none}

/* picking: the select bar lives INSIDE the sort bar and takes its place. RULE: the sort bar keeps ONE height always; the buttons are icons only. */
.sortbar{height:52px;box-sizing:border-box;padding-top:0;padding-bottom:0}
.sortbar .selbar{position:static;flex:1;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:none;gap:4px;flex-wrap:nowrap}
.sortbar .selbar[hidden]{display:none}
.sortbar:has(.selbar:not([hidden])) > .sortbtn,.sortbar:has(.selbar:not([hidden])) > .crumbs,.sortbar:has(.selbar:not([hidden])) > .seg{display:none}
.sortbar .selbar b{font-size:15px;font-weight:600;margin-right:auto;padding-left:2px;white-space:nowrap}
.sortbar .selbar .btn{width:38px;height:38px;padding:0;gap:0;border-color:transparent;background:none;box-shadow:none;flex:none}
.sortbar .selbar .btn span{display:none}
.sortbar .selbar .btn:hover{background:color-mix(in srgb,var(--text) 8%,transparent)}
.sortbar .selbar .btn.danger{color:var(--bad)}
.sortbar .selbar .btn.danger:hover{background:color-mix(in srgb,var(--bad) 12%,transparent)}

/* selection bar: the cross sits left of "N selected"; star / colour / information / share; their dialogs */
.sortbar .selbar #sel-clear{margin-right:2px}
.sortbar .selbar b{margin-right:auto}
.sortbar .selbar .btn.on{color:var(--acct)}
.sortbar .selbar .btn.on .i{fill:currentColor}
.starmark{width:14px;height:14px;fill:currentColor;stroke:none;color:var(--acct);vertical-align:-2px;margin-right:5px}
.col-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:10px}
.col-sw{aspect-ratio:1;border-radius:50%;border:2px solid transparent;cursor:pointer;display:grid;place-items:center;padding:0}
.col-sw:hover,.col-sw:focus-visible{outline:0;border-color:var(--text)}
.col-sw.none{background:color-mix(in srgb,var(--text) 8%,var(--bg));color:var(--dim)}
.col-sw .i{width:18px;height:18px}
.info-rows{margin:0;display:flex;flex-direction:column;gap:2px}
.info-r{display:flex;gap:16px;justify-content:space-between;padding:9px 12px;border-radius:8px;background:color-mix(in srgb,var(--text) 6%,var(--bg))}
.info-r dt{color:var(--dim);font-size:14px}
.info-r dd{margin:0;font-size:14.5px;font-weight:500;text-align:right;overflow-wrap:anywhere}

/* phone: Move, Delete, Select all and a ⋮ with the rest (like the Android app) */
.sel-more{display:none}
@media (max-width:640px){
  .sortbar .selbar .sel-x{display:none}
  .sortbar .selbar .sel-more{display:inline-flex}
}

/* secure share dialogs */
.dlg-btns.wrap{flex-wrap:wrap}

/* Secure share: ONE dialog, its panes dissolve into each other (they sit on top of each other, so the dialog never jumps or closes) */
.sec-stack{display:grid;align-items:start;overflow:hidden;padding:4px;margin:-4px;transition:height .24s ease}
.sec-stack>.sec-pane{align-self:start}
.sec-pane{grid-area:1/1;opacity:0;visibility:hidden;transition:opacity .22s ease,visibility 0s .22s}
.sec-pane.on{opacity:1;visibility:visible;transition:opacity .22s ease .1s,visibility 0s}
.sec-pane h2{margin-top:0}
.sec-trust{padding:12px 14px;border-radius:14px;background:color-mix(in srgb,#9CCC00 16%,var(--bg));color:var(--text);font-size:13.5px;line-height:1.5;margin:0 0 12px}
.sec-trust .i{display:inline-block;width:20px;height:20px;vertical-align:-4px;margin-right:7px}
.sec-trust b{font-weight:600}
.sec-field{position:relative}
.sec-field .ask-in{padding-right:52px}
.sec-eye{position:absolute;right:5px;top:50%;transform:translateY(-50%);width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--dim);cursor:pointer}
.sec-eye:hover{background:var(--hi);color:var(--text)}
.sec-eye .i{width:21px;height:21px}
.sec-link{display:flex;align-items:center;gap:7px;margin:4px 0 10px auto;padding:5px 0 5px 10px;border:0;border-radius:99px;background:transparent;color:var(--acct);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.sec-link:hover{background:var(--accsoft)}
.sec-link .i{width:19px;height:19px}
.sec-lbl{display:block;font-size:13.5px;font-weight:500;margin:0 0 5px}
.sec-lbl em{font-style:normal;color:var(--faint);font-weight:400;margin-left:4px}
.dlg textarea.sec-note-in{height:auto;min-height:58px;padding:9px 14px;resize:none;font:inherit;font-size:15px;line-height:1.4}
.sec-hint{font-size:13px;color:var(--dim);margin:0 0 4px}
.sec-genbox{position:relative;display:flex;align-items:center;min-height:62px;padding:12px 56px 12px 16px;border-radius:14px;background:color-mix(in srgb,var(--text) 7%,var(--bg));margin-bottom:4px}
.sec-genbox code{font:500 20px/1.3 "IBM Plex Mono",ui-monospace,monospace;letter-spacing:.5px;overflow-wrap:anywhere;user-select:all}
.sec-working{padding:18px 0 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:2px}
.sec-spin{width:38px;height:38px;border-radius:50%;border:3px solid var(--accsoft);border-top-color:var(--acc);animation:secspin .8s linear infinite;margin-bottom:14px}
@keyframes secspin{to{transform:rotate(360deg)}}
.sec-file{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:12px;background:color-mix(in srgb,var(--text) 6%,var(--bg));margin-bottom:12px}
.sec-file .i{width:20px;height:20px;color:var(--acct);flex:none}
.sec-file b{flex:1;min-width:0;font-weight:500;overflow-wrap:anywhere}
.sec-file span{color:var(--dim);font-size:13px;flex:none}
@media (prefers-reduced-motion:reduce){.sec-pane,.sec-pane.on{transition:none}.sec-spin{animation-duration:2s}}
.dlg.sec-dlg{padding:20px 24px 18px;max-height:calc(100% - 16px)}

/* ============================================================ document viewer (viewer.js): full window, always dark like Google Drive */
.lv{position:fixed;inset:0;z-index:75;display:flex;flex-direction:column;background:#0b0b0d;color:#ececec;animation:lvin .22s ease both}
.lv[hidden]{display:none}
@keyframes lvin{from{opacity:0}to{opacity:1}}
html.lv-on,html.lv-on body{overflow:hidden}
.lv-top{flex:none;display:flex;align-items:center;gap:6px;height:56px;padding:0 8px;background:linear-gradient(rgba(0,0,0,.55),rgba(0,0,0,0))}
.lv-title{flex:1;min-width:0;display:flex;align-items:baseline;gap:12px;padding:0 4px}
.lv-title h2{font-size:16px;font-weight:500;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;color:#f4f4f4}
.lv-title span{flex:none;font-size:13.5px;color:#b8b8c0;font-variant-numeric:tabular-nums}
.lv-tools{flex:none;display:flex;align-items:center;gap:2px}
.lv-btn,.lv-nav{width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:#ececec;display:grid;place-items:center;cursor:pointer;transition:background .15s,opacity .15s}
.lv-btn:hover,.lv-nav:hover{background:rgba(255,255,255,.14)}
.lv-btn:focus-visible,.lv-nav:focus-visible{outline:2px solid #fff;outline-offset:-2px}
.lv-btn:disabled{opacity:.35;pointer-events:none}
.lv-i{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.lv-strip{flex:none;display:flex;align-items:center;gap:8px;min-height:50px;padding:6px 16px;box-sizing:border-box;background:rgba(255,255,255,.07)}
.lv-strip[hidden]{display:none}
.lv-strip b{font-weight:600;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.lv-strip i{flex:1}
.lv-num{flex:1;min-width:0;font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lv-chip{flex:none;padding:5px 12px;border-radius:99px;background:rgba(255,255,255,.1);font-size:13.5px;color:#c9c9d0;white-space:nowrap}
.lv-chip.exp{color:#ffb4ab}.lv-chip.soon{color:#ffc857}
.lv-mini{flex:none;width:36px;height:36px;border:0;border-radius:50%;background:transparent;color:#d4d4da;display:grid;place-items:center;cursor:pointer}
.lv-mini:hover{background:rgba(255,255,255,.14)}
.lv-mini .lv-i{width:20px;height:20px}
.lv-stage{position:relative;flex:1;min-height:0;display:flex;overflow:hidden;padding:6px 76px 18px;box-sizing:border-box}
.lv-stage.zoomed{overflow:auto}
.lv-stage img{margin:auto;display:block;flex:none;max-width:none;border-radius:4px;background:#fff;box-shadow:0 6px 34px rgba(0,0,0,.55);animation:lvimg .25s ease both;cursor:zoom-in;user-select:none;-webkit-user-drag:none}
.lv-stage.zoomed img{cursor:zoom-out}
@keyframes lvimg{from{opacity:0;transform:scale(.985)}to{opacity:1;transform:none}}
.lv-stage iframe{margin:0 auto;width:min(100%,980px);height:100%;border:0;border-radius:4px;background:#fff}
.lv-stage .spinner{margin:auto}
.lv-msg{margin:auto;max-width:340px;text-align:center;color:#c9c9d0}
.lv-msg-i{width:64px;height:64px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.08)}
.lv-msg-i .lv-i{width:30px;height:30px}
.lv-msg p{margin:0;font-size:14.5px;line-height:1.5}
.lv-nav{position:absolute;top:50%;margin-top:-22px;width:48px;height:48px;background:rgba(40,40,46,.85);box-shadow:0 2px 12px rgba(0,0,0,.5);z-index:2}
.lv-nav[hidden]{display:none}
.lv-nav:hover{background:rgba(70,70,78,.95)}
.lv-prev{left:14px}.lv-next{right:14px}
.lv-print{position:fixed;width:0;height:0;border:0;right:0;bottom:0}
@media (max-width:640px){
  .lv-top{height:52px;padding:0 2px;gap:0}
  .lv-strip{padding:4px 12px}
  .lv-btn{width:40px;height:40px}
  .lv-z{display:none}
  .lv-title{gap:8px}
  .lv-stage{padding:4px 6px 12px}
  .lv-nav{width:42px;height:42px;margin-top:-21px;background:rgba(40,40,46,.7)}
  .lv-prev{left:6px}.lv-next{right:6px}
}
@media (prefers-reduced-motion:reduce){.lv,.lv-stage img{animation:none}}
