:root{
  font-family:"Arial Rounded MT Bold","Trebuchet MS","Noto Sans Thai",system-ui,sans-serif;
  color:#2f3142;
  background:#fff8e9;
  --ink:#2f3142;
  --primary:#ff9f43;
  --primary-dark:#e98624;
  --blue:#62c7ff;
  --green:#63d7a6;
  --pink:#ff8fb1;
  --purple:#8f7cf6;
  --cream:#fff8e9;
  --paper:#fffefb;
  --line:#2f3142;
  --muted:#74788b;
  --shadow:6px 6px 0 var(--ink);
  --shadow-sm:3px 3px 0 var(--ink);
}

*{box-sizing:border-box}
html{min-height:100%;background:var(--cream)}
body{
  margin:0;
  min-height:100vh;
  color:var(--ink);
  background:
    radial-gradient(circle at 12% 18%,rgba(98,199,255,.22) 0 72px,transparent 73px),
    radial-gradient(circle at 88% 12%,rgba(255,143,177,.18) 0 88px,transparent 89px),
    radial-gradient(circle at 82% 86%,rgba(99,215,166,.18) 0 110px,transparent 111px),
    linear-gradient(135deg,#fff9eb 0%,#fffdf7 52%,#f7fbff 100%);
  background-attachment:fixed;
}
body::before,body::after{
  content:"";
  position:fixed;
  z-index:-1;
  border:3px solid rgba(47,49,66,.08);
  border-radius:50%;
  pointer-events:none;
}
body::before{width:180px;height:180px;left:-70px;bottom:9%;background:#ffe49477}
body::after{width:130px;height:130px;right:-45px;top:34%;background:#c9f2ff77}

button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.35)}
[hidden]{display:none!important}
a{color:inherit}

.center{min-height:100vh;display:grid;place-items:center;padding:32px 20px}
.card{
  background:rgba(255,254,251,.96);
  border:3px solid var(--ink);
  border-radius:26px;
  padding:24px;
  box-shadow:var(--shadow);
}

.login-card{
  position:relative;
  width:min(440px,100%);
  display:grid;
  gap:16px;
  padding:28px 30px 30px;
  overflow:visible;
}
.login-card::before,.login-card::after{
  content:"";
  position:absolute;
  border:3px solid var(--ink);
  border-radius:50%;
  z-index:-1;
}
.login-card::before{width:44px;height:44px;background:var(--pink);left:-24px;top:56px}
.login-card::after{width:34px;height:34px;background:var(--blue);right:-18px;bottom:60px}
.login-icon{
  display:block;
  width:min(238px,58vw);
  height:auto;
  object-fit:contain;
  margin:-8px auto 0;
  filter:drop-shadow(0 8px 0 rgba(47,49,66,.10));
  transition:transform .2s ease;
}
.login-card:hover .login-icon{transform:rotate(-2deg) scale(1.02)}
.login-card h1{margin:-2px 0 0;text-align:center;font-size:clamp(34px,7vw,46px);line-height:1;color:var(--ink);letter-spacing:-1px}
.login-card p{margin:2px 0 8px;text-align:center;color:var(--muted);font-weight:700;line-height:1.5}

label{display:grid;gap:7px;font-size:14px;font-weight:800;color:var(--ink)}
input,select{
  width:100%;
  min-height:46px;
  padding:11px 13px;
  border:2.5px solid var(--ink);
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  outline:none;
  box-shadow:0 3px 0 #d9d9e4;
  transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
}
input:focus,select:focus{background:#fffdf3;box-shadow:0 4px 0 var(--blue);transform:translateY(-1px)}
input[type="checkbox"]{accent-color:var(--purple);box-shadow:none;min-height:0}

.primary,.ghost,.nav,.mini,.crumb,.brand{
  border:2.5px solid var(--ink);
  font-weight:900;
  transition:transform .11s ease,box-shadow .11s ease,filter .11s ease;
}
.primary,.ghost{padding:10px 15px;border-radius:14px}
.primary{background:var(--primary);color:var(--ink);box-shadow:var(--shadow-sm)}
.primary:hover{background:#ffae59;transform:translate(-1px,-1px);box-shadow:5px 5px 0 var(--ink)}
.ghost{background:#fff;color:var(--ink);box-shadow:var(--shadow-sm)}
.ghost:hover{background:#eef9ff;transform:translate(-1px,-1px);box-shadow:5px 5px 0 var(--ink)}
.primary:active,.ghost:active,.nav:active,.mini:active,.crumb:active,.brand:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--ink)}
.login-card>.primary{margin-top:4px;min-height:50px;font-size:16px;background:linear-gradient(#ffb85f,#ff9f43)}

header{
  min-height:76px;
  background:#fffefb;
  border-bottom:3px solid var(--ink);
  display:flex;
  align-items:center;
  padding:10px 24px;
  gap:24px;
  position:sticky;
  top:0;
  z-index:10;
  box-shadow:0 4px 0 rgba(47,49,66,.08);
}
.brand{
  border-radius:16px;
  padding:9px 13px;
  background:#ffe17a;
  color:var(--ink);
  font-size:20px;
  box-shadow:var(--shadow-sm);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.brand-icon{width:30px;height:30px;object-fit:contain;display:block;flex:none}
header>div:last-child{display:flex;align-items:center;gap:10px;font-weight:800}
#who{padding:7px 10px;background:#eafff6;border:2px solid var(--ink);border-radius:999px}

nav{display:flex;gap:9px;flex:1;align-items:center}
.nav{
  padding:9px 13px;
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  box-shadow:2px 2px 0 var(--ink);
}
.nav:nth-child(2)::before{content:"👥 ";}
.nav:nth-child(3)::before{content:"⚙️ ";}

.nav-icon{width:24px;height:24px;display:block;object-fit:contain;flex:0 0 24px}
.nav{display:inline-flex;align-items:center;gap:7px}
.home-crumb{width:52px;height:44px;padding:7px;display:inline-grid;place-items:center}
.home-crumb-icon{width:28px;height:28px;display:block}
.nav:hover{transform:translateY(-2px);box-shadow:3px 5px 0 var(--ink)}
.nav.active{background:#dff5ff;color:var(--ink)}

.page{padding:30px;max-width:1440px;margin:auto}
.narrow{max-width:1120px}
.page>h2{display:inline-block;margin:0 0 18px;padding:8px 14px;background:#ffe17a;border:3px solid var(--ink);border-radius:16px;box-shadow:var(--shadow-sm)}

.toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}
.toolbar>div:last-child{display:flex;gap:10px}
#crumbs{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.crumb{background:#fff;border-radius:12px;color:var(--ink);padding:7px 10px;box-shadow:2px 2px 0 var(--ink)}
.crumb:hover{background:#fff6cc}
.crumb:last-of-type{background:#e9f8ff}

.workspace{
  position:relative;
  min-height:calc(100vh - 190px);
  border:3px solid var(--ink);
  border-radius:28px;
  background:
    linear-gradient(#ffffffee,#ffffffee),
    radial-gradient(circle,#dfefff 1.2px,transparent 1.5px);
  background-size:auto,22px 22px;
  padding:22px;
  box-shadow:var(--shadow);
}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}
.folder{
  position:relative;
  border:3px solid var(--ink);
  border-radius:20px;
  padding:15px;
  background:#fff7d6;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
  box-shadow:4px 4px 0 var(--ink);
  transition:transform .14s ease,box-shadow .14s ease;
}
.folder::before{content:"📁";font-size:27px;line-height:1;filter:drop-shadow(1px 2px 0 #0001)}
.folder:hover{transform:translate(-2px,-3px) rotate(-.4deg);box-shadow:7px 8px 0 var(--ink);background:#fff1b6}
.folder-name{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:900;
  flex:1;
  border:0;
  padding:7px 3px;
  background:transparent;
  text-align:left;
  color:var(--ink);
  box-shadow:none;
}
.folder-actions{display:flex;gap:6px}
.mini{
  padding:6px 8px;
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  box-shadow:2px 2px 0 var(--ink);
}
.mini:hover{background:#e8f8ff;transform:translate(-1px,-1px);box-shadow:3px 3px 0 var(--ink)}

.file-list{margin-top:22px;display:grid;gap:10px}
.file{
  display:grid;
  grid-template-columns:minmax(0,1fr) 110px 140px 44px;
  align-items:center;
  gap:12px;
  padding:12px 13px;
  border:2.5px solid var(--ink);
  border-radius:16px;
  background:#fff;
  box-shadow:3px 3px 0 var(--ink);
  transition:transform .12s ease,background .12s ease;
}
.file:hover{background:#f8fdff;transform:translateX(2px)}
.file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:900;text-decoration:none}
.file-name::before{content:"📄";margin-right:9px}
.file-name:hover{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
.muted{color:var(--muted);font-size:13px;font-weight:700}

.empty{min-height:52vh;display:grid;place-content:center;text-align:center;color:var(--muted);gap:9px}
.empty::before{content:"📦";font-size:72px;filter:drop-shadow(4px 5px 0 #0001)}
.empty b{font-size:24px;color:var(--ink)}
.empty span{font-weight:700}

#dropHint{
  position:absolute;
  inset:14px;
  border:4px dashed var(--ink);
  border-radius:24px;
  background:rgba(216,246,255,.95);
  z-index:5;
  display:grid;
  place-items:center;
  font-size:26px;
  font-weight:900;
  color:var(--ink);
  box-shadow:inset 0 0 0 8px rgba(255,255,255,.55);
}
#dropHint::before{content:"✨📥✨  ";}

progress{width:100%;height:18px;accent-color:var(--green)}

.cols{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:18px 0 24px}
.card h2,.card h3{margin-top:0;color:var(--ink)}
.card h3{font-size:20px}
.card label{margin:10px 0}
.team-row,.user-row,.perm-row{display:flex;align-items:center;gap:10px;padding:12px 2px;border-top:2px dashed #c8c8d5}
.grow{flex:1;font-weight:800}
.checks{display:flex;flex-wrap:wrap;gap:8px}
.check{display:flex;align-items:center;gap:7px;background:#f1fbff;padding:8px 10px;border:2px solid var(--ink);border-radius:12px;box-shadow:2px 2px 0 var(--ink)}
.check input{width:auto}
.actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}

#passForm{max-width:560px;margin:0 auto}
#settingsView:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;align-items:start;gap:20px}
#settingsView>form{width:100%;min-width:0;margin:0;max-width:none}
#accountSettingsFields{min-width:0;margin:0;padding:0;border:0}
.settings-hint{font-size:12px;line-height:1.6;margin:6px 0 16px}
#accountUsername{background:var(--cream);color:var(--muted)}
@media(max-width:760px){#settingsView:not([hidden]){grid-template-columns:minmax(0,1fr)}}

 dialog{
  border:3px solid var(--ink);
  border-radius:24px;
  padding:24px;
  width:min(500px,calc(100vw - 32px));
  background:#fffdf7;
  color:var(--ink);
  box-shadow:9px 9px 0 var(--ink);
}
dialog::backdrop{background:rgba(47,49,66,.38);backdrop-filter:blur(3px)}
dialog form{display:grid;gap:12px}
.dialog-head{display:flex;justify-content:space-between;align-items:center}
dialog h3{font-size:22px;margin-top:0}
.perm-form{grid-template-columns:1fr 1fr;align-items:end}
.perm-form label{display:flex;align-items:center;gap:7px;background:#f5fbff;border:2px solid var(--ink);border-radius:11px;padding:8px}
.perm-form input{width:auto}
.hint{font-size:13px;color:var(--muted);font-weight:700;background:#fff4c7;padding:10px;border:2px dashed var(--ink);border-radius:12px}

#toast{
  position:fixed;
  top:92px;
  left:50%;
  transform:translateX(-50%);
  background:#2f3142;
  color:#fff;
  padding:11px 16px;
  border:3px solid #fff;
  border-radius:14px;
  z-index:50;
  box-shadow:5px 5px 0 #ffb14e;
  font-weight:800;
}

@media(max-width:820px){
  header{padding:10px 12px;gap:10px;flex-wrap:wrap}
  .brand{font-size:17px}
  header>div:last-child{margin-left:auto}
  nav{order:3;width:100%;overflow:auto;padding-bottom:2px}
  .nav{white-space:nowrap;padding:8px 10px}
  .page{padding:18px 14px 24px}
  .cols{grid-template-columns:1fr}
  .toolbar{align-items:flex-start;flex-direction:column}
  .file{grid-template-columns:minmax(0,1fr) 80px 42px}
  .file .uploaded{display:none}
  .grid{grid-template-columns:1fr 1fr}
  .perm-form{grid-template-columns:1fr}
  .workspace{min-height:70vh;padding:14px;border-radius:22px}
}

@media(max-width:540px){
  .center{padding:22px 14px}
  .login-card{padding:22px 18px 24px;border-radius:22px}
  .login-icon{width:min(210px,68vw)}
  .grid{grid-template-columns:1fr}
  .toolbar>div:last-child{width:100%}
  .toolbar>div:last-child button{flex:1}
  #who{display:none}
  .file{grid-template-columns:minmax(0,1fr) 68px 38px;gap:8px}
  .brand{font-size:0;padding:8px 10px}
  .brand-icon{width:30px;height:30px}
}

/* Login feedback */
.login-icon.shake{animation:mascotShake .62s cubic-bezier(.36,.07,.19,.97) both}
@keyframes mascotShake{0%,100%{transform:translateX(0) rotate(0)}15%{transform:translateX(-12px) rotate(-4deg)}30%{transform:translateX(10px) rotate(3deg)}45%{transform:translateX(-8px) rotate(-3deg)}60%{transform:translateX(7px) rotate(2deg)}75%{transform:translateX(-4px) rotate(-1deg)}90%{transform:translateX(2px) rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.login-icon.shake{animation:none}}


/* Drive-style content list */
.content-table{
  overflow:hidden;
  border:2.5px solid var(--ink);
  border-radius:20px;
  background:#fff;
  box-shadow:4px 4px 0 rgba(47,49,66,.14);
}
.content-head,.content-row{
  display:grid;
  grid-template-columns:minmax(280px,1.8fr) minmax(130px,.8fr) minmax(170px,1fr) minmax(100px,.55fr) 64px;
  align-items:center;
  gap:18px;
}
.content-head{
  min-height:54px;
  padding:8px 14px;
  background:#fffaf0;
  border-bottom:2.5px solid var(--ink);
  font-size:13px;
  font-weight:900;
  color:#5e6172;
}
.content-head>span{white-space:nowrap}
.sort-name{
  justify-self:start;
  border:0;
  background:transparent;
  color:var(--ink);
  padding:7px 8px;
  border-radius:10px;
  font-weight:900;
}
.sort-name:hover{background:#e8f8ff}
#sortArrow{
  display:inline-grid;
  place-items:center;
  width:24px;
  height:24px;
  margin-left:4px;
  border-radius:50%;
  background:#ccefff;
  color:#2077a3;
}
.table-menu-head{text-align:center}
.content-rows:empty{display:none}
.content-row{
  min-height:66px;
  padding:9px 14px;
  background:#fff;
  border-top:2px solid #e6e3df;
  transition:background .12s ease,transform .12s ease;
}
.content-head + .content-rows .content-row:first-child{border-top:0}
.content-row:hover{background:#fff8dc}
.folder-row{background:#fffcf2}
.name-cell{min-width:0;display:flex;align-items:center;gap:10px}
.item-icon{width:30px;flex:0 0 30px;text-align:center;font-size:22px;line-height:1}
.file-icon-img{width:32px;height:32px;flex:0 0 32px;object-fit:contain;display:block}
.image-preview-dialog{width:min(96vw,1320px);max-width:none;padding:0;overflow:hidden;border:3px solid var(--ink);border-radius:22px;background:rgba(255,255,255,.78);box-shadow:0 12px 32px rgba(47,49,66,.22),9px 9px 0 rgba(47,49,66,.72);backdrop-filter:blur(16px) saturate(135%);-webkit-backdrop-filter:blur(16px) saturate(135%)}
.image-preview-dialog::backdrop{background:rgba(37,35,75,.48);backdrop-filter:blur(3px)}
.image-preview-shell{display:flex;flex-direction:column;max-height:94vh;min-height:min(660px,86vh)}
.image-preview-head{padding:12px 14px;border-bottom:2px dashed #d6d2ca;background:#fff8dc;gap:14px;min-height:66px}
.image-preview-title{min-width:0;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.image-preview-head h3{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.image-preview-counter{flex:none;color:var(--muted);font-size:12px;font-weight:800;white-space:nowrap}
.image-editor-dirty{padding:3px 8px;border:1.5px solid #d99d39;border-radius:999px;background:#fff1c6;color:#8a5a05;font-size:10px;font-weight:900;white-space:nowrap}
.image-preview-actions{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap;justify-content:flex-end}
.image-editor-save{padding:8px 11px}
.image-preview-stage{position:relative;flex:1;min-height:0;display:grid;place-items:center;overflow:auto;padding:18px 70px;background:rgba(255,255,255,.58);backdrop-filter:blur(14px) saturate(135%);-webkit-backdrop-filter:blur(14px) saturate(135%);overscroll-behavior:contain}
.image-preview-viewport{position:relative;display:grid;place-items:center;max-width:100%;max-height:100%;transform-origin:center center;transition:transform .12s ease;will-change:transform}
.image-preview-img,.image-editor-canvas{display:block;max-width:100%;max-height:calc(94vh - 172px);width:auto;height:auto;object-fit:contain;border-radius:10px;box-shadow:0 8px 24px rgba(37,35,75,.16)}
.image-editor-canvas{touch-action:none;user-select:none;-webkit-user-select:none;background:transparent}
.image-editor-canvas.is-crop{cursor:crosshair}.image-editor-canvas.is-draw{cursor:crosshair}
.image-preview-nav{position:absolute;z-index:4;top:50%;transform:translateY(-50%);width:46px;height:58px;display:grid;place-items:center;padding:0;border:2px solid var(--ink);border-radius:18px;background:rgba(255,254,251,.92);color:var(--ink);font-size:38px;line-height:1;box-shadow:3px 3px 0 rgba(47,49,66,.15);backdrop-filter:blur(4px);cursor:pointer}
.image-preview-nav:hover:not(:disabled){background:#fff8dc;transform:translateY(-50%) translateY(-1px)}
.image-preview-nav:disabled{opacity:.28;cursor:default;box-shadow:none}
.image-preview-prev{left:14px}.image-preview-next{right:14px}
.image-editor-toolbar{display:flex;align-items:center;gap:7px;padding:10px 12px;border-top:2px solid #d6d2ca;background:#fff8dc;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;flex:none}
.image-editor-tool{flex:none;min-height:38px;padding:7px 10px;border:1.8px solid #b9bac3;border-radius:12px;background:#fff;color:var(--ink);font-size:12px;font-weight:900;white-space:nowrap;cursor:pointer;box-shadow:1px 2px 0 rgba(47,49,66,.09)}
.image-editor-tool:hover{background:#f7fbff;border-color:#6aaee6}.image-editor-tool.active{background:#e7f5ff;border-color:#278bd1;box-shadow:0 0 0 2px rgba(39,139,209,.13)}
.image-editor-tool:disabled{opacity:.4;cursor:not-allowed;box-shadow:none}
.image-editor-color-wrap,.image-editor-brush-wrap{flex:none;display:flex;align-items:center;gap:7px;height:38px;padding:5px 9px;border:1.5px solid #d1d1d7;border-radius:11px;background:#fff;color:var(--muted);font-size:10px;font-weight:900}
.image-editor-toolbar input[type=color],.image-editor-toolbar input[type=range]{min-height:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;outline:none!important;transform:none!important;filter:none!important}
.image-editor-toolbar input[type=color]:focus,.image-editor-toolbar input[type=range]:focus{background:transparent!important;box-shadow:none!important;outline:none!important;transform:none!important}
.image-editor-color-wrap input[type=color]{-webkit-appearance:none;appearance:none;display:block;flex:0 0 28px;width:28px!important;height:28px!important;cursor:pointer;overflow:hidden;border-radius:8px!important}
.image-editor-color-wrap input[type=color]::-webkit-color-swatch-wrapper{padding:0}.image-editor-color-wrap input[type=color]::-webkit-color-swatch{border:1px solid #b9bac3;border-radius:7px}.image-editor-color-wrap input[type=color]::-moz-color-swatch{border:1px solid #b9bac3;border-radius:7px}
.image-editor-brush-wrap input[type=range]{-webkit-appearance:none;appearance:none;display:block;flex:0 0 104px;width:104px!important;height:24px!important;cursor:pointer;accent-color:#278bd1}
.image-editor-brush-wrap input[type=range]::-webkit-slider-runnable-track{height:6px;border:1px solid #b9bac3;border-radius:999px;background:#edf1f5}
.image-editor-brush-wrap input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin-top:-7px;border:2px solid #fff;border-radius:50%;background:#278bd1;box-shadow:0 0 0 1px #8f96a3;cursor:grab}
.image-editor-brush-wrap input[type=range]:active::-webkit-slider-thumb{cursor:grabbing}
.image-editor-brush-wrap input[type=range]::-moz-range-track{height:6px;border:1px solid #b9bac3;border-radius:999px;background:#edf1f5}
.image-editor-brush-wrap input[type=range]::-moz-range-thumb{width:16px;height:16px;border:2px solid #fff;border-radius:50%;background:#278bd1;box-shadow:0 0 0 1px #8f96a3;cursor:grab}
.image-editor-brush-wrap output{min-width:22px;text-align:right;color:var(--ink);font-size:10px;font-weight:900;font-variant-numeric:tabular-nums}
.image-editor-spacer{flex:1;min-width:8px}.image-editor-zoom{flex:none;display:flex;align-items:center;gap:5px;padding-left:8px;border-left:1.5px solid #d4d0c8}.image-editor-zoom-button{width:38px;padding:6px 0;font-size:18px}.image-editor-zoom span{min-width:46px;text-align:center;font-size:11px;font-weight:900;color:var(--muted)}
.image-preview-dialog.image-preview-maximized{position:fixed!important;z-index:2147483647!important;inset:0!important;top:0!important;right:0!important;bottom:0!important;left:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:rgba(255,255,255,.78)!important}
.image-preview-dialog.image-preview-maximized .image-preview-shell{width:100vw;height:100vh;height:100dvh;max-height:none;min-height:0}
.image-preview-dialog.image-preview-maximized .image-preview-img,.image-preview-dialog.image-preview-maximized .image-editor-canvas{max-height:100dvh;max-width:100vw;border-radius:0;box-shadow:none}
.image-preview-dialog.image-preview-maximized .image-preview-stage{padding:0;background:#000;backdrop-filter:none;-webkit-backdrop-filter:none}
.image-preview-dialog.image-preview-maximized .image-preview-head,.image-preview-dialog.image-preview-maximized .image-editor-toolbar{display:none}
.image-preview-shell:fullscreen{width:100vw;height:100dvh;max-height:none;min-height:0;background:#000}
.image-preview-shell:-webkit-full-screen{width:100vw;height:100vh;max-height:none;min-height:0;background:#000}
body.image-preview-maximized{overflow:hidden}
@media(max-width:800px){.image-preview-dialog{width:calc(100vw - 12px)}.image-preview-shell{min-height:82vh}.image-preview-head{align-items:flex-start}.image-preview-actions{gap:5px}.image-preview-actions .action-link{display:none}.image-preview-stage{padding:10px 46px}.image-preview-img,.image-editor-canvas{max-height:calc(94vh - 184px)}.image-preview-nav{width:34px;height:46px;border-radius:13px;font-size:28px}.image-preview-prev{left:6px}.image-preview-next{right:6px}#imagePreviewFullscreen{font-size:0}#imagePreviewFullscreen::before{content:'⛶';font-size:18px}.image-preview-counter{font-size:11px}.image-editor-toolbar{padding:8px;gap:5px}.image-editor-tool{min-height:34px;padding:6px 8px;font-size:11px}.image-editor-color-wrap,.image-editor-brush-wrap{height:34px}.image-editor-brush-wrap input[type=range]{width:82px!important;flex-basis:82px}.image-editor-save{font-size:0}.image-editor-save::before{content:'💾';font-size:16px}}
.audio-player-dialog{width:min(620px,calc(100vw - 28px));max-width:none;padding:0;overflow:hidden;border:3px solid var(--ink);border-radius:22px;background:#fffefb;box-shadow:8px 8px 0 var(--ink)}
.audio-player-dialog::backdrop{background:rgba(37,35,75,.42);backdrop-filter:blur(3px)}
.audio-player-shell{display:grid;gap:0}
.audio-player-head{padding:16px 18px;border-bottom:2px dashed #d6d2ca;background:#fff8dc;gap:16px;align-items:flex-start}
.audio-player-head>div:first-child{min-width:0}
.audio-player-head h3{margin:0;max-width:430px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.audio-player-status{margin:5px 0 0;color:var(--muted);font-size:11px;font-weight:800;line-height:1.4}
.audio-player-actions{display:flex;align-items:center;gap:8px;flex:none}
.audio-player-stage{padding:22px 20px 24px;background:#f8fbff}
.audio-player-control{display:block;width:100%;min-height:54px}
@media(max-width:620px){.audio-player-actions .action-link{display:none}.audio-player-head h3{max-width:calc(100vw - 120px)}.audio-player-stage{padding:18px 12px 20px}}
.video-player-dialog{width:min(1080px,calc(100vw - 28px));max-width:none;padding:0;overflow:hidden;border:2px solid var(--ink);border-radius:20px;background:#08090d;box-shadow:0 16px 60px #0005}
.video-player-dialog::backdrop{background:rgba(12,14,22,.72);backdrop-filter:blur(4px)}
.video-player-shell{position:relative;display:flex;flex-direction:column;height:min(700px,90vh);max-height:94vh;min-height:min(420px,82vh);overflow:hidden;background:#08090d}
.video-player-head{flex:none;padding:12px 16px;gap:16px;align-items:flex-start;margin:0;background:var(--paper)}
.video-player-head>div:first-child{min-width:0}.video-player-head h3{margin:0;max-width:680px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.video-player-status{margin:4px 0 0;color:var(--muted);font-size:11px;font-weight:800;line-height:1.4}
.video-player-actions{display:flex;align-items:center;gap:8px;flex:none;justify-content:flex-end}
.video-player-stage{position:relative;flex:1;min-height:0;display:grid;place-items:center;padding:0;background:#08090d;overflow:hidden}
.video-player-control{position:absolute;inset:0;display:block;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;object-fit:fill;object-position:center;background:#08090d;border-radius:0;outline:none}
.video-player-loading{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);z-index:4;padding:9px 14px;border:1px solid #ffffff30;border-radius:999px;background:#12141dcc;color:#fff;font-size:12px;font-weight:800;pointer-events:none}
.video-player-edge{appearance:none;position:absolute;top:0;bottom:0;width:25%;padding:0;border:0;border-radius:0;background:transparent;color:#fff;box-shadow:none;cursor:pointer;z-index:2;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transform:none}
.video-player-edge.is-left{left:0}.video-player-edge.is-right{right:0}
.video-player-edge:focus-visible{outline:2px solid #ffffffb3;outline-offset:-4px;background:#ffffff0a}
.video-player-seek-feedback{display:grid;place-items:center;position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);width:min(128px,90%);aspect-ratio:1;border-radius:50%;background:#ffffff20;text-shadow:0 1px 4px #000;white-space:nowrap;font-size:14px;font-weight:900;opacity:0;transition:opacity .12s ease;pointer-events:none}
.video-player-seek-feedback.is-visible{opacity:1}
.video-player-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.video-player-dialog .video-player-controls{position:absolute;z-index:10;left:0;right:0;bottom:0;display:flex;flex-direction:column;gap:5px;padding:30px 14px 10px;border:0;background:linear-gradient(transparent,rgba(0,0,0,.78));color:#fff;opacity:1;transition:opacity .18s ease,transform .18s ease}
.video-player-control-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-width:0;flex-wrap:wrap}
.video-player-control-left,.video-player-control-right{display:flex;align-items:center;gap:8px;min-width:0}
.video-player-control-right{margin-left:auto}
.video-player-control-button{appearance:none;flex:none;width:36px;height:36px;min-height:36px;padding:0;display:grid;place-items:center;border:0;border-radius:50%;background:#ffffff15;color:#fff;box-shadow:none;font-size:19px;font-weight:800;cursor:pointer;transition:background .15s}
.video-player-control-button:hover{background:#ffffff35;transform:none}
.video-player-control-button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.video-player-time{flex:none;color:#fff;font-size:12px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.video-player-time-divider{color:#ffffffb3}
.video-player-rate{flex:none;min-width:66px;color:#ffffffc7;font-size:10px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.video-player-rate::before{content:"↓ ";color:#fff}
.video-player-seek,.video-player-volume{-webkit-appearance:none!important;appearance:none!important;display:block!important;min-height:20px!important;height:20px!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;transform:none!important;cursor:pointer}
.video-player-dialog .video-player-seek{width:100%;min-width:0;flex:none;order:0}
.video-player-volume{flex:0 0 68px;width:68px!important}
.video-player-seek::-webkit-slider-runnable-track,.video-player-volume::-webkit-slider-runnable-track{height:4px;border:0;border-radius:999px;background:#ffffff40}
.video-player-seek::-moz-range-track,.video-player-volume::-moz-range-track{height:4px;border:0;border-radius:999px;background:#ffffff40}
.video-player-seek::-webkit-slider-runnable-track{background-image:linear-gradient(to right,#ff3658 0 var(--video-played-percent,0%),transparent var(--video-played-percent,0%) 100%),var(--video-buffer-track,none)}
.video-player-seek::-moz-range-track{background-image:linear-gradient(to right,#ff3658 0 var(--video-played-percent,0%),transparent var(--video-played-percent,0%) 100%),var(--video-buffer-track,none)}
.video-player-seek::-webkit-slider-thumb,.video-player-volume::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:13px;height:13px;margin-top:-4.5px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0006;cursor:pointer}
.video-player-seek::-moz-range-thumb,.video-player-volume::-moz-range-thumb{width:13px;height:13px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0006;cursor:pointer}
.video-player-seek::-webkit-slider-thumb{background:#ff3658}.video-player-seek::-moz-range-thumb{background:#ff3658}
.video-player-seek:focus-visible,.video-player-volume:focus-visible{outline:2px solid #ffffffb3!important;outline-offset:2px}
.video-player-settings-wrap{position:relative}
.video-player-settings{position:absolute;right:0;bottom:calc(100% + 14px);width:min(300px,calc(100vw - 40px));max-height:55vh;overflow:auto;padding:12px;border:1px solid #ffffff30;border-radius:13px;background:#1b1d24f5;box-shadow:0 8px 28px #0006;color:#fff}
.video-player-track{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;margin:0;padding:7px 0;background:transparent;border:0;color:#fff;font-size:12px;font-weight:700}
.video-player-track>span{white-space:nowrap}
.video-player-settings .video-player-track select{width:auto;max-width:180px;min-width:100px;min-height:36px;margin:0;padding:5px 24px 5px 8px;border:1px solid #ffffff40;border-radius:7px;background:#30323a;color:#fff;box-shadow:none;font-size:12px;color-scheme:dark}
.video-player-settings .video-player-track select:focus{background:#30323a;color:#fff;border-color:#8ab4f8;outline:2px solid #8ab4f8;outline-offset:2px;box-shadow:none;transform:none}
.video-player-settings .video-player-track select option,.video-player-settings .video-player-track select optgroup{background:#30323a;color:#fff}
.video-player-shell.video-player-ui-hidden .video-player-controls{opacity:0;transform:translateY(12px);pointer-events:none}
.video-player-shell.video-player-ui-hidden .video-player-stage{cursor:none}
.video-player-dialog.video-player-maximized{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.video-player-dialog.video-player-maximized .video-player-shell{width:100%;height:100dvh;max-height:none;min-height:0}
.video-player-shell:fullscreen,.video-player-shell:-webkit-full-screen{position:relative;width:100vw;height:100vh;max-height:none;min-height:0;overflow:hidden;background:#08090d}
.video-player-shell:fullscreen .video-player-stage,.video-player-shell:-webkit-full-screen .video-player-stage{position:absolute;inset:0}
.video-player-shell:fullscreen .video-player-head,.video-player-shell:-webkit-full-screen .video-player-head{position:absolute;z-index:8;top:0;left:0;right:0;transition:transform .18s ease,opacity .18s ease}
.video-player-shell:fullscreen.video-player-ui-hidden .video-player-head,.video-player-shell:-webkit-full-screen.video-player-ui-hidden .video-player-head{opacity:0;transform:translateY(-110%);pointer-events:none}
body.video-player-maximized{overflow:hidden}
@media(max-width:720px){.video-player-dialog{width:calc(100vw - 10px)}.video-player-head{padding:9px;gap:6px}.video-player-actions{gap:5px}.video-player-actions .action-link{display:none}.video-player-head h3{font-size:15px}.video-player-status{font-size:10px}.video-player-dialog .video-player-controls{padding:25px 10px 8px}.video-player-control-row{gap:6px}.video-player-control-left,.video-player-control-right{gap:5px}.video-player-volume{flex-basis:50px;width:50px!important}.video-player-time{font-size:11px}}
@media(max-width:480px){.video-player-volume{display:none!important}.video-player-rate{min-width:54px;font-size:9px}.video-player-control-button{width:34px;height:34px;min-height:34px}.video-player-seek-feedback{font-size:11px}}


.item-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  border:0;
  background:transparent;
  box-shadow:none;
  color:var(--ink);
  padding:8px 2px;
  text-align:left;
  text-decoration:none;
  font-weight:900;
  font-size:15px;
}
.item-name{cursor:default}
.item-name:hover{text-decoration:none}
.cell{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#626678;font-size:13px;font-weight:750}
.owner-cell{color:#454858;font-weight:850}
.row-menu{
  justify-self:center;
  width:46px;
  height:40px;
  display:grid;
  place-items:center;
  border:2.5px solid var(--ink);
  border-radius:13px;
  background:#fff;
  color:var(--ink);
  box-shadow:2px 2px 0 var(--ink);
  font-size:16px;
  font-weight:900;
  letter-spacing:1px;
}
.row-menu:hover:not(:disabled){background:#dff5ff;transform:translate(-1px,-1px);box-shadow:3px 3px 0 var(--ink)}
.row-menu:active:not(:disabled){transform:translate(1px,1px);box-shadow:1px 1px 0 var(--ink)}
.row-menu:disabled{opacity:.28;border-style:dashed;box-shadow:none}
.settings-wide{width:100%;margin-top:2px}
.file-detail-grid{
  display:grid;
  grid-template-columns:110px minmax(0,1fr);
  gap:10px 14px;
  margin:12px 0 18px;
  padding:15px;
  border:2px dashed var(--ink);
  border-radius:15px;
  background:#fff9df;
}
.file-detail-grid>span{color:var(--muted);font-size:13px;font-weight:800}
.file-detail-grid>strong{min-width:0;overflow-wrap:anywhere;color:var(--ink)}
.action-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.danger{
  padding:10px 15px;
  border:2.5px solid var(--ink);
  border-radius:14px;
  background:#ff8f8f;
  color:var(--ink);
  font-weight:900;
  box-shadow:3px 3px 0 var(--ink);
}
.danger:hover:not(:disabled){background:#ff7777;transform:translate(-1px,-1px);box-shadow:4px 4px 0 var(--ink)}
.danger:disabled{opacity:.38;cursor:not-allowed;box-shadow:none}

@media(max-width:900px){
  .content-head,.content-row{grid-template-columns:minmax(240px,1.7fr) minmax(110px,.75fr) minmax(150px,1fr) 88px 54px;gap:10px}
  .content-head,.content-row{padding-left:10px;padding-right:10px}
}
@media(max-width:680px){
  .content-head,.content-row{grid-template-columns:minmax(0,1fr) 90px 52px;gap:8px}
  .content-head>*:nth-child(3),.content-head>*:nth-child(4),.content-row>*:nth-child(3),.content-row>*:nth-child(4){display:none}
  .content-head>*:nth-child(5){grid-column:3}
  .content-row>*:nth-child(5){grid-column:3}
  .item-icon{width:26px;flex-basis:26px;font-size:20px}
  .file-icon-img{width:28px;height:28px;flex-basis:28px}
  .image-preview-dialog{width:calc(100vw - 16px)}
  .image-preview-shell{min-height:75vh}
  .image-preview-head{align-items:flex-start}
  .image-preview-actions .action-link{display:none}
  .image-preview-stage{padding:10px}
  .item-name{font-size:14px}
  .owner-cell{font-size:12px}
  .row-menu{width:42px;height:38px}
}

/* Context menu + trash + colored folders */
.context-menu{
  position:fixed;
  z-index:100;
  width:min(330px,calc(100vw - 20px));
  max-height:calc(100vh - 20px);
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:8px;
  border:3px solid var(--ink);
  border-radius:18px;
  background:#fffefb;
  box-shadow:7px 7px 0 var(--ink);
}
.context-menu>button{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border:0;
  border-radius:11px;
  background:transparent;
  color:var(--ink);
  text-align:left;
  font-weight:850;
}
.context-menu>button:hover:not(:disabled){background:#eaf7ff}
.context-menu>button:disabled{opacity:.35}
.context-danger{color:#9d3030!important}
.context-palette{
  display:grid;
  grid-template-columns:repeat(5,42px);
  gap:8px;
  justify-content:center;
  padding:12px 28px 14px;
  margin:2px 0 5px;
  border-top:2px dashed #d6d2ca;
  border-bottom:2px dashed #d6d2ca;
}
.color-chip{
  width:34px;
  height:34px;
  border:2.5px solid var(--ink);
  border-radius:50%;
  box-shadow:2px 2px 0 var(--ink);
}
.color-chip:hover{transform:scale(1.08)}
.trash-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.trash-head>div:first-child{display:flex;align-items:baseline;gap:14px;min-width:0}
.trash-head h2{margin:0;white-space:nowrap}
.trash-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}
#trashSelectedCount{min-width:105px;text-align:right;font-weight:800}
.trash-columns{grid-template-columns:minmax(260px,1.6fr) minmax(130px,.8fr) minmax(170px,1fr) 110px!important}
.trash-workspace{min-height:60vh;position:relative}
.trash-row{cursor:default;user-select:none}
.trash-row .item-name{text-decoration:none;cursor:default}
.trash-warning{padding:14px 16px;border:2px dashed #a83e3e;border-radius:14px;background:#fff0f0;color:var(--ink);line-height:1.55}
#emptyTrashDialog form{min-width:min(520px,calc(100vw - 54px))}
@media(max-width:900px){
  .trash-head{align-items:flex-start;flex-direction:column}
  .trash-actions{width:100%;justify-content:flex-start}
  #trashSelectedCount{text-align:left}
}
@media(max-width:680px){
  .trash-head>div:first-child{align-items:flex-start;flex-direction:column;gap:4px}
  .trash-actions>button{flex:1 1 auto}
  .trash-columns{grid-template-columns:minmax(0,1fr) 100px!important}
  .trash-columns>*:nth-child(2),.trash-columns>*:nth-child(4){display:none}
}

/* Exact folder palette sprite derived from the supplied 5x5 icon sheet. */
.folder-icon,.palette-folder-icon{
  display:inline-block!important;
  background-image:url('/folder-colors-sprite.webp')!important;
  background-size:160px 160px!important;
  background-repeat:no-repeat!important;
  background-color:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  -webkit-mask:none!important;
  mask:none!important;
}
.folder-icon{
  width:32px!important;
  height:32px!important;
  flex:0 0 32px!important;
}
.folder-icon::before{content:none!important}
.color-chip{
  width:42px;
  height:42px;
  padding:4px!important;
  display:grid!important;
  place-items:center!important;
  background:#fff!important;
}
.palette-folder-icon{width:32px;height:32px}
.folder-icon,.palette-folder-icon{background-position:var(--folder-position,-128px 0)!important}

/* Multi-select + drag/drop */
.content-row[data-select-key]{user-select:none}
.content-row.selected{
  position:relative;
  z-index:1;
  background:#e5f7ff!important;
  box-shadow:inset 0 0 0 3px #65bde8;
}
.content-row.selected .item-name{color:#174f72}
.content-row.selected .item-icon{
  animation:selectedIconWiggle .58s ease-in-out infinite;
  transform-origin:50% 70%;
}
@keyframes selectedIconWiggle{
  0%,100%{transform:rotate(-3deg) translateY(0)}
  50%{transform:rotate(3deg) translateY(-2px)}
}
.folder-row.drop-target{
  background:#dcf8d8!important;
  box-shadow:inset 0 0 0 4px #66c96b,0 0 0 2px #fff;
}
.folder-row.drop-target .folder-icon{transform:scale(1.12)}
body.dragging-selection .content-row:not(.selected){cursor:copy}
@media(prefers-reduced-motion:reduce){
  .content-row.selected .item-icon{animation:none}
}


/* Cursor marquee selection */
.selection-marquee{
  position:fixed;
  z-index:90;
  pointer-events:none;
  border:2px solid #3d9ed4;
  border-radius:8px;
  background:rgba(92,190,236,.18);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.7);
}
.workspace.marquee-active{
  cursor:crosshair;
  user-select:none;
}
.workspace.marquee-active *{user-select:none}


/* Grouped drag ghost for multi-selection */
.drag-group-preview{
  position:fixed;
  left:-10000px;
  top:-10000px;
  width:330px;
  min-height:62px;
  pointer-events:none;
  z-index:9999;
  font-family:inherit;
}
.drag-group-card{
  position:absolute;
  left:calc(var(--drag-stack-index) * 8px);
  top:calc(var(--drag-stack-index) * 8px);
  width:300px;
  min-height:56px;
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px 52px 10px 12px;
  border:3px solid var(--ink);
  border-radius:15px;
  background:#eefaff;
  box-shadow:5px 5px 0 rgba(47,49,66,.88);
}
.drag-group-card:nth-child(2){background:#e4f6ff}
.drag-group-card:nth-child(3){background:#d9f1ff}
.drag-group-card .drag-preview-icon{
  width:32px!important;
  height:32px!important;
  flex:0 0 32px!important;
  animation:none!important;
}
.drag-group-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--ink);
  font-size:14px;
  font-weight:900;
}
.drag-group-count{
  position:absolute;
  right:4px;
  top:8px;
  min-width:70px;
  padding:6px 9px;
  border:2.5px solid var(--ink);
  border-radius:999px;
  background:#ffe17a;
  color:var(--ink);
  box-shadow:2px 2px 0 var(--ink);
  text-align:center;
  font-size:12px;
  font-weight:950;
  z-index:5;
}
.drag-group-more{
  position:absolute;
  right:8px;
  bottom:-4px;
  display:grid;
  place-items:center;
  min-width:32px;
  height:32px;
  padding:0 7px;
  border:2.5px solid var(--ink);
  border-radius:50%;
  background:#ff9cb0;
  color:var(--ink);
  font-size:12px;
  font-weight:950;
  z-index:6;
}

/* Cut / move pending */
.content-row.cut-pending{opacity:.58}
.content-row.cut-pending .item-icon{filter:saturate(.55)}
.content-row.cut-pending.selected{opacity:.72}

/* List / grid view switcher */
.toolbar-actions{display:flex;align-items:center;gap:10px}
.view-toggle{
  display:inline-flex;
  align-items:center;
  overflow:hidden;
  border:2.5px solid var(--ink);
  border-radius:999px;
  background:#fff;
  box-shadow:2px 2px 0 var(--ink);
}
.view-toggle-button{
  width:48px;
  height:40px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:0;
  background:#fff;
  color:var(--ink);
  box-shadow:none;
  font-size:23px;
  line-height:1;
}
.view-toggle-button+ .view-toggle-button{border-left:2px solid var(--ink)}
.view-toggle-button:hover{background:#eef9ff}
.view-toggle-button.active{background:#cfefff;color:#15577d}
.view-toggle-button:focus-visible{outline:3px solid #65bde8;outline-offset:-4px}
.view-list-glyph{font-size:24px;transform:translateY(-1px)}
.view-grid-glyph{font-size:25px}

/* Grid view keeps the same selectable rows so every file interaction is shared. */
.content-table.grid-mode{
  overflow:visible;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.content-table.grid-mode .content-head{
  display:flex;
  align-items:center;
  min-height:52px;
  margin:0 0 14px;
  padding:8px 12px;
  border:2.5px solid var(--ink);
  border-radius:16px;
  background:#fffaf0;
  box-shadow:3px 3px 0 rgba(47,49,66,.14);
  box-sizing:border-box;
}
.content-table.grid-mode .content-head>span{display:none}
.content-table.grid-mode .sort-name{
  font-size:15px;
  padding:6px 9px;
}
.content-table.grid-mode .content-rows{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}
.content-table.grid-mode #folders:not(:empty){margin-bottom:20px}
.content-table.grid-mode #files:not(:empty){margin-top:0}
.content-table.grid-mode .content-row{
  min-width:0;
  padding:0;
  border:2px solid #e1e5e8;
  border-radius:20px;
  background:#f6f8fb;
  overflow:hidden;
  box-shadow:none;
}
.content-table.grid-mode .content-row:hover{
  background:#f0f6fb;
  transform:translateY(-1px);
}
.content-table.grid-mode .content-row.selected{
  border-color:#50b6e8;
  background:#e4f6ff!important;
  box-shadow:inset 0 0 0 2px #50b6e8;
}
.content-table.grid-mode .content-row>.owner-cell,
.content-table.grid-mode .content-row>.date-cell,
.content-table.grid-mode .content-row>.size-cell{display:none}
.content-table.grid-mode .name-cell{
  min-width:0;
  grid-area:name;
  padding:12px 8px 10px 14px;
  gap:10px;
}
.content-table.grid-mode .item-name{
  min-width:0;
  padding:5px 0;
  font-size:15px;
}
.content-table.grid-mode .row-menu{
  grid-area:menu;
  align-self:center;
  justify-self:center;
  width:38px;
  height:36px;
  border:0;
  background:transparent;
  box-shadow:none;
  font-size:18px;
}
.content-table.grid-mode .row-menu:hover:not(:disabled){
  background:#d9effb;
  transform:none;
  box-shadow:none;
}
.content-table.grid-mode .folder-row{
  min-height:72px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  grid-template-areas:"name menu";
  align-items:center;
  gap:0;
}
.content-table.grid-mode .file-row{
  min-height:278px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  grid-template-rows:auto minmax(190px,1fr);
  grid-template-areas:
    "name menu"
    "preview preview";
  align-items:start;
  gap:0;
}
.grid-file-preview{display:none}
.content-table.grid-mode .grid-file-preview{
  grid-area:preview;
  min-width:0;
  min-height:190px;
  height:220px;
  margin:0 10px 10px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border-radius:14px;
  background:#f2f4f6;
}
.grid-preview-img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  user-select:none;
  -webkit-user-drag:none;
}
/* Show a lightweight skeleton until the actual preview has decoded.
   The thumbnail <img> stays hidden so an empty src never renders a broken
   image badge or its alt text inside the card. */
.content-table.grid-mode .grid-file-preview.preview-pending{
  position:relative;
  background:#e8ecf2;
}
.content-table.grid-mode .grid-file-preview.preview-pending > .grid-preview-img{
  visibility:hidden;
}
.content-table.grid-mode .grid-file-preview.preview-pending::before{
  content:"";
  position:absolute;
  z-index:0;
  width:68%;
  height:76%;
  border-radius:9px;
  background:
    linear-gradient(#edf0f4,#edf0f4) 16px 20px / 64% 9px no-repeat,
    linear-gradient(#edf0f4,#edf0f4) 16px 43px / 84% 7px no-repeat,
    linear-gradient(#edf0f4,#edf0f4) 16px 60px / 75% 7px no-repeat,
    linear-gradient(#edf0f4,#edf0f4) 16px 77px / 82% 7px no-repeat,
    #f8fafc;
  box-shadow:0 4px 14px rgba(33,43,60,.07);
}
.content-table.grid-mode .grid-file-preview.preview-pending::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(100deg,transparent 27%,rgba(255,255,255,.45) 50%,transparent 73%);
  background-size:220% 100%;
  animation:grid-preview-skeleton 2s ease-in-out infinite;
}
@keyframes grid-preview-skeleton{
  from{background-position:115% 0}
  to{background-position:-115% 0}
}
@media(prefers-reduced-motion:reduce){
  .content-table.grid-mode .grid-file-preview.preview-pending::after{animation:none}
}
.content-table.grid-mode .grid-file-preview.preview-unavailable{
  background:#f0f2f5;
}
.grid-preview-unavailable-text{
  display:block;
  max-width:90%;
  padding:12px;
  text-align:center;
  font-size:12px;
  line-height:1.45;
  font-weight:750;
  color:#8b92a0;
}
.grid-preview-file-icon{
  width:96px;
  height:96px;
  object-fit:contain;
  user-select:none;
  -webkit-user-drag:none;
}
.content-table.grid-mode .grid-file-preview.video-preview-card{background:#181b24}
.grid-video-thumbnail{position:relative;width:100%;height:100%;display:grid;place-items:center;overflow:hidden;background:radial-gradient(circle at 50% 42%,#343947 0,#20242f 55%,#171a22 100%)}
.grid-video-placeholder{position:absolute;z-index:1;width:68%;height:66%;border-radius:12px;background:linear-gradient(130deg,#303748 0%,#3d4658 50%,#303748 100%);transition:opacity .18s ease}
.grid-preview-video{position:absolute;inset:0;z-index:2;display:block;width:100%;height:100%;object-fit:cover;opacity:0;pointer-events:none;background:#111;transition:opacity .18s ease}
.grid-video-still{position:absolute;inset:0;z-index:2;width:100%;height:100%;object-fit:cover;opacity:0;pointer-events:none;background:#111;transition:opacity .18s ease}
.grid-video-thumbnail.server-ready .grid-video-still{opacity:1}
.grid-video-thumbnail.ready .grid-preview-video{opacity:1}
.grid-video-thumbnail.ready .grid-video-placeholder{opacity:0}
.grid-video-thumbnail.fallback .grid-preview-video{display:none}
.grid-video-play{position:absolute;z-index:3;left:50%;top:50%;transform:translate(-50%,-50%);width:50px;height:50px;display:grid;place-items:center;padding-left:3px;border:2px solid rgba(255,255,255,.92);border-radius:999px;background:rgba(20,22,31,.66);color:#fff;font-size:20px;line-height:1;box-shadow:0 5px 18px rgba(0,0,0,.28);backdrop-filter:blur(5px);pointer-events:none}
.grid-video-duration{position:absolute;z-index:3;right:8px;bottom:8px;padding:3px 7px;border-radius:7px;background:rgba(15,17,24,.74);color:#fff;font-size:10px;font-weight:900;line-height:1.25;box-shadow:0 2px 8px rgba(0,0,0,.2);pointer-events:none}
.grid-video-duration:empty{display:none}
.content-table.grid-mode .folder-row.drop-target{
  background:#dcf8d8!important;
  box-shadow:inset 0 0 0 3px #66c96b,0 0 0 2px #fff;
}
.content-table.grid-mode .cut-pending{opacity:.58}

@media(max-width:760px){
  .toolbar{align-items:flex-start;flex-direction:column}
  .toolbar-actions{width:100%;flex-wrap:wrap}
  .view-toggle{margin-right:auto}
  .content-table.grid-mode .content-rows{grid-template-columns:repeat(auto-fill,minmax(165px,1fr));gap:12px}
  .content-table.grid-mode .file-row{min-height:230px;grid-template-rows:auto minmax(150px,1fr)}
  .content-table.grid-mode .grid-file-preview{height:170px;min-height:150px;margin:0 8px 8px}
  .content-table.grid-mode .name-cell{padding:10px 6px 8px 10px}
}

/* Share link dialog */
.share-dialog{width:min(620px,calc(100vw - 32px))}
.share-resource-name{margin:-4px 0 14px;padding:10px 12px;border:2px dashed #c8c8d5;border-radius:12px;background:#fff;font-weight:900;overflow-wrap:anywhere}
.share-mode{display:grid;gap:10px;margin:8px 0 14px}
.share-choice{display:flex;align-items:flex-start;gap:10px;padding:12px;border:2.5px solid var(--ink);border-radius:14px;background:#f5fbff;cursor:pointer}
.share-choice input{width:auto;margin-top:4px}
.share-choice span{display:grid;gap:3px}
.share-choice small{color:var(--muted);font-weight:700;line-height:1.4}
.share-public-choice{background:#fff5e6}
.share-permissions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px;border:2px solid var(--ink);border-radius:14px;background:#fff}
.share-permissions>b{margin-right:auto}
.share-permissions label{display:flex;align-items:center;gap:6px;padding:7px 9px;border:2px solid #cfd8df;border-radius:10px;background:#f7fbfd;font-weight:850}
.share-permissions input{width:auto}
.share-warning{margin-top:12px;padding:11px 12px;border:2px dashed #a76125;border-radius:12px;background:#fff0d7;color:#7a4315;font-size:13px;font-weight:850;line-height:1.45}
.share-link-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;margin-top:14px}
.share-link-row input{min-width:0}
.share-actions{justify-content:flex-start}
@media(max-width:620px){.share-link-row{grid-template-columns:1fr}.share-link-row button{width:100%}.share-permissions>b{width:100%}}

/* File search */
.file-search{
  width:min(340px,34vw);
  min-width:220px;
  height:44px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 38px;
  align-items:center;
  border:2.5px solid var(--ink);
  border-radius:999px;
  background:#fff;
  box-shadow:2px 2px 0 var(--ink);
  overflow:hidden;
  transition:box-shadow .15s ease,background .15s ease;
}
.file-search:focus-within{background:#f7fcff;box-shadow:3px 3px 0 var(--ink),0 0 0 3px #bfeaff}
.file-search-icon{display:grid;place-items:center;font-size:25px;font-weight:900;transform:rotate(-18deg);user-select:none}
.file-search input{
  min-width:0;
  width:100%;
  height:100%;
  padding:0 4px;
  border:0;
  outline:0;
  background:transparent;
  box-shadow:none;
  color:var(--ink);
  font-weight:800;
}
.file-search input::-webkit-search-cancel-button{display:none}
.file-search input::placeholder{color:#8b8d99;font-weight:750}
.file-search-clear{
  width:32px;
  height:32px;
  margin:0 5px 0 0;
  padding:0;
  display:grid;
  place-items:center;
  border:0;
  border-radius:50%;
  background:#eef5f8;
  color:var(--ink);
  box-shadow:none;
  font-size:20px;
  line-height:1;
}
.file-search-clear:hover{background:#d9effb;transform:none;box-shadow:none}
.search-crumb{font-weight:850;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:min(360px,42vw)}
@media(max-width:900px){.file-search{order:3;width:100%;min-width:0}.toolbar-actions{justify-content:flex-end}.search-crumb{max-width:65vw}}

/* Keep large file listings scrollable inside the workspace frame. */
.workspace{
  height:calc(100dvh - 190px);
  min-height:420px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.content-head{position:sticky;top:0;z-index:8}
.content-table.grid-mode .content-head{position:sticky;top:6px;z-index:8;background:rgba(255,250,240,.96);backdrop-filter:blur(5px)}

/* Plain-text file editor. */
button,input,select,textarea{font:inherit}
textarea{
  width:100%;
  padding:12px 14px;
  border:2.5px solid var(--ink);
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  outline:none;
  box-shadow:0 3px 0 #d9d9e4;
  transition:box-shadow .12s ease,background .12s ease;
}
textarea:focus{background:#fffdf3;box-shadow:0 4px 0 var(--blue)}
.text-editor-dialog{width:min(880px,calc(100vw - 32px));max-width:none;max-height:92dvh;overflow:auto}
.text-editor-dialog form{gap:14px}
#textFileContent{min-height:min(52dvh,520px);resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;font-size:14px;line-height:1.55;tab-size:4;white-space:pre}
#textFileContent[readonly],#textFileName[readonly]{background:#f2f3f5;color:#5f6270}
.text-editor-hint{font-size:12px;font-weight:750;color:var(--muted)}

@media(max-width:760px){
  .workspace{height:70dvh;min-height:420px}
  .text-editor-dialog{width:calc(100vw - 16px);padding:16px}
  #textFileContent{min-height:52dvh}
}

/* Rich file/folder information */
.resource-info-dialog{width:min(650px,calc(100vw - 32px))}
.resource-info-dialog .dialog-head{margin-bottom:8px}
.resource-detail-grid{
  grid-template-columns:140px minmax(0,1fr);
  max-height:min(68vh,620px);
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:18px;
  gap:12px 18px;
}
.resource-detail-grid>span{font-size:14px}
.resource-detail-grid>strong{line-height:1.45}
.detail-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;font-size:12px;word-break:break-all}
@media(max-width:560px){
  .resource-detail-grid{grid-template-columns:1fr;gap:4px;padding:14px}
  .resource-detail-grid>strong{margin-bottom:10px}
}

/* SSH / SFTP remote mounts */
.remote-mount-dialog{
  width:min(780px,calc(100vw - 48px));
  max-width:none;
  max-height:calc(100dvh - 48px);
  padding:28px;
  box-sizing:border-box;
  overflow:auto;
}
.remote-mount-dialog form{min-width:0;width:100%}
.remote-mount-dialog .dialog-head h3{font-size:26px;margin:0}
.remote-mount-dialog .hint{font-size:14px;line-height:1.45;padding:12px 14px}
.remote-mount-dialog label{font-size:15px}
.remote-mount-dialog input{min-width:0}
.remote-mount-grid{display:grid;grid-template-columns:minmax(0,1fr) 140px;gap:14px}
.remote-auth{margin:2px 0 0;padding:0;border:0;min-width:0}
.remote-auth legend{margin-bottom:8px;font-size:15px;font-weight:900;color:var(--ink)}
.remote-auth-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.remote-auth-choice{display:flex!important;align-items:center;gap:10px;margin:0!important;padding:12px 14px;border:2.5px solid #cfd4de;border-radius:14px;background:#fff;cursor:pointer;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease}
.remote-auth-choice:has(input:checked){border-color:var(--ink);background:#eef9ff;box-shadow:3px 3px 0 rgba(47,49,66,.13)}
.remote-auth-choice input{width:auto;min-width:auto;margin:0;accent-color:#238cc1}
.remote-auth-choice span{display:grid;gap:2px;min-width:0}
.remote-auth-choice b{font-size:14px;color:var(--ink)}
.remote-auth-choice small{font-size:11px;line-height:1.35;color:var(--muted);font-weight:700}
.remote-mount-dialog .actions{flex-wrap:wrap;gap:12px;margin-top:20px}
.remote-mount-status{margin-top:12px;padding:11px 13px;border:2px dashed #7d8ba5;border-radius:12px;background:#eef8ff;font-weight:750;overflow-wrap:anywhere}
.remote-mount-row .size-cell{font-size:12px;font-weight:850;color:#426181}
.remote-mount-icon,.remote-folder-icon{position:relative}
.remote-entry-row .item-name{font-weight:850}
@media(max-width:620px){
  .remote-mount-dialog{width:calc(100vw - 20px);padding:18px;max-height:calc(100dvh - 20px)}
  .remote-mount-grid,.remote-auth-options{grid-template-columns:1fr}
  .remote-mount-dialog .actions{justify-content:stretch}
  .remote-mount-dialog .actions button{flex:1 1 100%;width:100%}
}

/* Remote file metadata editor */
.remote-entry-dialog{
  width:min(720px,calc(100vw - 40px));
  max-width:none;
  box-sizing:border-box;
}
.remote-entry-grid{
  display:grid;
  grid-template-columns:160px minmax(0,1fr) minmax(0,1fr);
  gap:14px;
}
.remote-entry-meta{
  margin-top:2px;
  padding:10px 12px;
  border:2px dashed #b7bdc8;
  border-radius:12px;
  background:#f7fbff;
  color:var(--muted);
  font-size:12px;
  font-weight:750;
  overflow-wrap:anywhere;
}
@media(max-width:680px){
  .remote-entry-dialog{width:calc(100vw - 18px);padding:18px}
  .remote-entry-grid{grid-template-columns:1fr}
}

/* Archive create / preview */
.archive-dialog{width:min(560px,calc(100vw - 36px));max-width:none;box-sizing:border-box}
.archive-progress-dialog{width:min(520px,calc(100vw - 36px));max-width:none;box-sizing:border-box;overflow:hidden}
.archive-progress-dialog .dialog-head{align-items:flex-start}
.archive-progress-dialog .dialog-head h3{margin:0 0 3px}
.archive-progress-dialog .dialog-head small{display:block;color:var(--muted);font-weight:800}
.archive-progress-body{display:grid;gap:12px;padding:12px 2px 6px}
.archive-progress-body progress{width:100%;height:20px;accent-color:#65bde8}
.archive-progress-stats{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;font-weight:850;color:var(--muted)}
.archive-progress-stats strong{font-size:24px;line-height:1;color:var(--ink)}
.archive-progress-name{margin:0;padding:10px 12px;border:2px dashed #c7ccd5;border-radius:13px;background:#f8fbff;color:var(--ink);font-weight:850;overflow-wrap:anywhere}
.archive-progress-dialog .actions{margin-top:14px}
.archive-progress-dialog .actions .danger{min-width:150px}
.archive-preview-dialog{width:min(900px,calc(100vw - 36px));max-width:none;max-height:calc(100dvh - 36px);overflow:auto;box-sizing:border-box}
.archive-preview-summary{margin:8px 0 14px;padding:10px 12px;border:2px dashed #b7bdc8;border-radius:12px;background:#f7fbff;font-size:13px;font-weight:750;color:var(--muted)}
.archive-preview-head,.archive-preview-row{display:grid;grid-template-columns:minmax(0,1fr) 120px 120px;gap:12px;align-items:center}
.archive-preview-head{padding:8px 10px;border-bottom:2px solid #d8dde6;font-size:12px;font-weight:900;color:var(--muted)}
.archive-preview-row{padding:9px 10px;border-bottom:1px solid #e4e8ef;font-size:13px}
.archive-preview-row:last-child{border-bottom:0}
.archive-preview-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:750}
.archive-preview-list{max-height:min(58vh,560px);overflow:auto;border:2px solid #dfe3ea;border-radius:12px;background:#fff}
@media(max-width:620px){.archive-preview-head,.archive-preview-row{grid-template-columns:minmax(0,1fr) 90px}.archive-preview-head span:last-child,.archive-preview-row span:last-child{display:none}}


/* UI language switcher */
.language-switcher{
  position:fixed;
  top:12px;
  right:14px;
  z-index:1200;
  display:flex;
  gap:4px;
  padding:4px;
  border:2px solid var(--ink);
  border-radius:14px;
  background:rgba(255,254,251,.96);
  box-shadow:2px 2px 0 var(--ink);
  backdrop-filter:blur(8px);
}
.language-switcher button{
  min-width:42px;
  padding:6px 9px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--ink);
  font-size:12px;
  font-weight:900;
  line-height:1;
}
.language-switcher button:hover{background:#fff0c9}
.language-switcher button.active{
  background:var(--ink);
  color:#fff;
}
.language-switcher.in-header{
  position:static;
  z-index:auto;
  flex:none;
  box-shadow:2px 2px 0 var(--ink);
}
@media(max-width:720px){
  .language-switcher{top:7px;right:7px}
  .language-switcher button{min-width:36px;padding:6px;font-size:11px}
}

/* Office + PDF document preview */
.document-preview-dialog{width:min(96vw,1320px);max-width:none;padding:0;overflow:hidden;border:3px solid var(--ink);border-radius:22px;background:#fffefb;box-shadow:9px 9px 0 var(--ink)}
.document-preview-dialog::backdrop{background:rgba(37,35,75,.48);backdrop-filter:blur(3px)}
.document-preview-shell{display:flex;flex-direction:column;height:min(92vh,980px);min-height:min(700px,86vh)}
.document-preview-head{padding:14px 16px;border-bottom:2px dashed #d6d2ca;background:#fff8dc;gap:16px}
.document-preview-head h3{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.document-preview-actions{display:flex;align-items:center;gap:8px;flex:none}
.document-preview-stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#e8eaed}
.document-preview-frame{display:block;width:100%;height:100%;border:0;background:#fff}
.document-preview-loading{position:absolute;inset:0;z-index:1;display:grid;place-items:center;background:#f2f4f6;color:#686b78;font-weight:900;pointer-events:none}
.document-preview-loading[hidden]{display:none}
.grid-preview-document{display:block;width:100%;height:100%;border:0;background:#fff;pointer-events:none;user-select:none}
.content-table.grid-mode .grid-file-preview.document-preview-card{background:#e8eaed}
@media(max-width:680px){
  .document-preview-dialog{width:calc(100vw - 12px)}
  .document-preview-shell{height:94vh;min-height:78vh}
  .document-preview-actions .action-link{display:none}
  .document-preview-actions{gap:5px}
}

/* Unified themed controls, permissions, admin and confirmation UI */
.themed-radio{
  appearance:none!important;
  -webkit-appearance:none!important;
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  min-height:22px!important;
  margin:1px 0 0!important;
  padding:0!important;
  border:2.5px solid var(--ink)!important;
  border-radius:50%!important;
  background:#fff!important;
  box-shadow:inset 0 0 0 5px #fff!important;
  cursor:pointer;
  flex:0 0 22px;
}
.themed-radio:checked{background:var(--blue)!important;box-shadow:inset 0 0 0 4px #fff!important}
.themed-radio:focus-visible{outline:3px solid #a9ddf4;outline-offset:3px}
.remote-auth-choice:has(.themed-radio:checked),.share-choice:has(.themed-radio:checked){border-color:var(--ink);background:#eaf8ff;box-shadow:3px 3px 0 rgba(47,49,66,.14)}

.app-confirm-dialog{width:min(520px,calc(100vw - 32px));max-width:none}
.app-confirm-dialog .dialog-head{align-items:flex-start;gap:18px}
.app-confirm-dialog h3{margin:0 0 8px}
.app-confirm-message{margin:0;white-space:pre-line;font-size:16px;line-height:1.55;font-weight:750;color:#55586a}
.app-confirm-actions{margin-top:22px}
.app-confirm-dialog.is-danger #appConfirmOK{background:#ffe1dd;color:#8a241a;border-color:#8a241a;box-shadow:3px 3px 0 #8a241a}

.permissions-dialog{width:min(760px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);overflow:auto}
.permissions-dialog .dialog-head{align-items:flex-start;gap:18px;margin-bottom:18px}
.permissions-dialog .dialog-head h3{margin:0 0 6px}
.permission-hint{margin:0;color:var(--muted);font-size:13px;font-weight:750;line-height:1.45;max-width:580px}
.permission-editor{display:grid!important;gap:16px!important;padding:16px;border:2.5px solid var(--ink);border-radius:18px;background:#fff;box-shadow:3px 3px 0 #e3e4ec}
.permission-subject-grid{display:grid;grid-template-columns:180px minmax(0,1fr);gap:12px}
.permission-subject-grid label{display:grid;gap:7px;margin:0;font-weight:900}
.permission-subject-grid label>span{font-size:13px;color:#55586a}
.permission-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.permission-choice{display:flex!important;align-items:flex-start!important;gap:10px!important;margin:0!important;padding:12px!important;border:2px solid #cfd5de!important;border-radius:14px!important;background:#f8fcff!important;cursor:pointer;min-height:88px;box-sizing:border-box}
.permission-choice:has(input:checked){border-color:var(--ink)!important;background:#eaf8ff!important;box-shadow:2px 2px 0 rgba(47,49,66,.14)}
.permission-choice.permission-manage:has(input:checked){background:#fff4dd!important}
.permission-choice input[type="checkbox"],.check input[type="checkbox"],.account-status input[type="checkbox"],.share-permissions input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  min-height:22px!important;
  margin:1px 0 0!important;
  padding:0!important;
  border:2.5px solid var(--ink)!important;
  border-radius:7px!important;
  background:#fff!important;
  box-shadow:none!important;
  cursor:pointer;
  flex:0 0 22px;
  position:relative;
}
.permission-choice input[type="checkbox"]:checked,.check input[type="checkbox"]:checked,.account-status input[type="checkbox"]:checked,.share-permissions input[type="checkbox"]:checked{background:var(--purple)!important}
.permission-choice input[type="checkbox"]:checked::after,.check input[type="checkbox"]:checked::after,.account-status input[type="checkbox"]:checked::after,.share-permissions input[type="checkbox"]:checked::after{content:"✓";position:absolute;inset:-2px 0 0;display:grid;place-items:center;color:#fff;font-size:15px;font-weight:1000}
.permission-choice input[type="checkbox"]:disabled,.check input[type="checkbox"]:disabled,.account-status input[type="checkbox"]:disabled{opacity:.5;cursor:not-allowed}
.permission-choice span{display:grid;gap:4px;min-width:0}
.permission-choice b{font-size:14px;color:var(--ink)}
.permission-choice small{font-size:11px;line-height:1.4;color:var(--muted);font-weight:700}
.permission-actions{margin:0}
.permission-current{margin-top:18px;padding-top:16px;border-top:2px solid #e1e3ea}
.permission-current-head{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:10px}
.permission-current-head>div{display:grid;gap:3px}
.permission-current-head b{font-size:15px}
.permission-current-head small{color:var(--muted);font-weight:700}
.permission-list{display:grid;gap:9px}
.perm-row{display:grid!important;grid-template-columns:minmax(160px,1fr) auto auto!important;align-items:center!important;gap:12px!important;padding:11px 12px!important;border:2px solid #d9dde5!important;border-radius:13px!important;background:#fff!important}
.perm-row .grow{min-width:0;overflow-wrap:anywhere}
.permission-badges{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}
.permission-badge{padding:4px 7px;border:1.5px solid #bfc8d2;border-radius:999px;background:#f5fbff;font-size:11px;font-weight:900;white-space:nowrap}
.permission-empty{padding:14px;border:2px dashed #cbd0da;border-radius:12px;background:#fafbfc;color:var(--muted);font-weight:750;text-align:center}

.admin-page>.section-title{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:16px}
.admin-page>.section-title h2{margin:0 0 4px}
.admin-page>.section-title p{margin:0}
.admin-cols{align-items:start}
.admin-card{min-height:100%;box-sizing:border-box}
.admin-card-hint{margin:-4px 0 12px;line-height:1.45}
.team-list{display:grid;gap:8px;margin-top:14px}
.team-row{display:flex!important;align-items:center!important;gap:10px!important;padding:10px 12px!important;border:2px solid #e0e2e9!important;border-radius:12px!important;background:#fbfcff!important}
.team-membership-title{display:grid;gap:3px;margin:14px 0 8px}
.team-membership-title b{font-size:13px}
.team-membership-title small{color:var(--muted);font-size:11px;font-weight:700}
.checks{display:flex;flex-wrap:wrap;gap:8px}
.check{display:flex;align-items:center;gap:8px;background:#f1fbff;padding:8px 10px;border:2px solid #c9d5df;border-radius:12px;box-shadow:none;font-weight:850;cursor:pointer}
.check:has(input:checked){border-color:var(--ink);background:#e7f7ff;box-shadow:2px 2px 0 rgba(47,49,66,.12)}
.user-accounts-card{padding:18px 20px}
.admin-card-title{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:12px}
.admin-card-title h3{margin:0 0 4px}
.admin-card-title p{margin:0}
.user-list{display:grid;gap:10px}
.user-row{display:grid!important;grid-template-columns:minmax(180px,1fr) minmax(170px,240px) minmax(190px,260px)!important;align-items:center!important;gap:14px!important;padding:12px 14px!important;border:2px solid #d9dde5!important;border-radius:14px!important;background:#fff!important}
.user-identity{display:grid;gap:3px;min-width:0}
.user-identity b{font-size:15px;overflow-wrap:anywhere}
.user-identity small{color:var(--muted);font-size:12px;font-weight:750;overflow-wrap:anywhere}
.user-field{display:grid;gap:5px;margin:0!important}
.user-field>span{font-size:11px;font-weight:900;color:var(--muted)}
.user-field select{min-height:42px}
.account-status{display:flex;align-items:center;gap:10px;margin:0!important;padding:9px 10px;border:2px solid #d4d9e2;border-radius:12px;background:#f8fbff;cursor:pointer}
.account-status>span{display:grid;gap:2px}
.account-status b{font-size:12px}
.account-status small{font-size:10px;line-height:1.35;color:var(--muted);font-weight:700}
.account-status.is-self{opacity:.72;cursor:default}

.remote-credential-panel{display:grid;gap:10px;padding:14px;border:2px solid #d4dae3;border-radius:14px;background:#f9fcff}
.credential-label-row{display:flex;justify-content:space-between;gap:10px;align-items:center}
.credential-badge{padding:4px 8px;border:1.5px solid #85b998;border-radius:999px;background:#eaf8ef;color:#316d47;font-size:10px;font-weight:900;white-space:nowrap}
.credential-picker{display:flex;align-items:center;gap:10px;min-width:0}
.credential-picker .ghost{padding:8px 11px;flex:0 0 auto}
.credential-picker .muted{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.credential-textarea-label{display:grid!important;gap:7px!important;margin:0!important;font-size:12px!important;color:var(--muted)}
#remotePrivateKey,#remoteShellPrivateKey{min-height:112px;resize:vertical;padding:11px 12px;border:2.5px solid var(--ink);border-radius:12px;background:#fff;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;color:var(--ink);outline:none;box-sizing:border-box;width:100%}
#remotePrivateKey:focus,#remoteShellPrivateKey:focus{background:#fffdf3;box-shadow:0 4px 0 var(--blue)}
.credential-security-note{display:block;margin-top:5px;color:#5f6878;font-size:11px;line-height:1.45;font-weight:700}

@media(max-width:760px){
  .permission-subject-grid,.permission-levels{grid-template-columns:1fr}
  .perm-row{grid-template-columns:1fr!important}
  .permission-badges{justify-content:flex-start}
  .user-row{grid-template-columns:1fr!important}
  .credential-picker{align-items:flex-start;flex-direction:column}
}

.content-row.drop-blocked{cursor:not-allowed;outline:3px dashed #c85b5b;outline-offset:-5px;background:#fff0f0!important}
.workspace.drop-blocked{cursor:not-allowed;outline:4px dashed #c85b5b;outline-offset:-7px;background:#fff7f7}

/* Cloud-drive special mounts */
.onedrive-mount-row{--onedrive-accent:#1684e8}
.onedrive-mount-icon,.google-drive-mount-icon{position:relative}
.onedrive-oauth-card{display:flex;align-items:center;gap:14px;padding:16px;border:2.5px solid #cbd7e5;border-radius:16px;background:#f4faff}
.onedrive-oauth-card .onedrive-cloud-mark{display:grid;place-items:center;width:54px;height:54px;flex:none;border:2.5px solid var(--ink);border-radius:16px;background:#e1f2ff;font-size:30px;box-shadow:3px 3px 0 rgba(47,49,66,.12)}
.onedrive-oauth-card b{display:block;margin-bottom:4px}
.onedrive-oauth-card small{display:block;color:#626b7b;font-weight:700;line-height:1.45}


/* Durable server-side transfer jobs */
.transfer-jobs{
  position:fixed;
  left:18px;
  bottom:18px;
  width:min(420px,calc(100vw - 36px));
  max-height:min(56vh,560px);
  overflow:auto;
  background:rgba(255,255,255,.78);
  border:2.5px solid rgba(47,49,66,.92);
  box-shadow:0 12px 32px rgba(47,49,66,.22),4px 5px 0 rgba(47,49,66,.72);
  border-radius:18px;
  padding:12px;
  z-index:21;
  box-sizing:border-box;
  backdrop-filter:blur(16px) saturate(135%);
  -webkit-backdrop-filter:blur(16px) saturate(135%);
  opacity:.90;
  transition:opacity .18s ease,transform .18s ease,box-shadow .18s ease;
}
.transfer-jobs:hover,.transfer-jobs.is-dragging{opacity:.98}
.transfer-jobs.is-dragging{box-shadow:0 18px 38px rgba(47,49,66,.28),3px 4px 0 rgba(47,49,66,.78);transform:scale(1.008)}
.transfer-jobs.is-closing{opacity:0;transform:translateY(8px) scale(.985);pointer-events:none}
.transfer-jobs-head{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:9px;position:sticky;top:-12px;background:rgba(255,255,255,.72);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);padding:5px 2px 8px;z-index:2;cursor:grab;user-select:none;touch-action:none}
.transfer-jobs-head:active{cursor:grabbing}
.transfer-jobs-head::before{content:"⠿";display:grid;place-items:center;flex:none;width:22px;height:22px;border:1.5px solid rgba(47,49,66,.65);border-radius:8px;background:rgba(255,255,255,.55);color:var(--muted);font-size:13px;line-height:1}
.transfer-jobs-head>div{display:grid;gap:1px;min-width:0;flex:1}
.transfer-jobs-head b{font-size:14px}
.transfer-jobs-head small{font-size:9.5px;color:var(--muted);font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.transfer-active-badge{flex:none;padding:4px 8px;border:1.8px solid var(--ink);border-radius:999px;background:rgba(234,248,239,.82);font-size:9.5px;font-weight:900}
.transfer-job-list{display:grid;gap:9px}
.transfer-job-card{border:1.8px solid rgba(160,170,186,.68);border-radius:14px;padding:9px;background:rgba(251,253,255,.68);display:grid;gap:7px;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.transfer-job-card.is-running{border-color:rgba(132,185,216,.9);background:rgba(243,251,255,.72)}
.transfer-job-card.is-failed,.transfer-job-card.is-partial{border-color:rgba(214,139,139,.9);background:rgba(255,247,247,.78)}
.transfer-job-card.is-completed{border-color:rgba(155,199,169,.92);background:rgba(247,255,249,.76)}
.transfer-job-title{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;font-weight:900}
.transfer-job-title span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.transfer-status{font-size:9px;padding:3px 7px;border:1.5px solid currentColor;border-radius:999px;white-space:nowrap;background:rgba(255,255,255,.46)}
.transfer-job-actions{display:flex;align-items:center;gap:6px;flex:none}
.transfer-cancel-job{border:1.5px solid rgba(185,83,83,.78);background:rgba(255,247,247,.78);color:#a34646;border-radius:999px;padding:3px 8px;font-size:9px;font-weight:900;line-height:1.2;cursor:pointer;box-shadow:none;min-height:0}
.transfer-cancel-job:hover{background:rgba(255,232,232,.95);transform:none}
.transfer-cancel-job:disabled{opacity:.55;cursor:wait}
.transfer-clear-history,.transfer-resume-upload,.transfer-dismiss-job{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  width:auto;
  max-width:100%;
  min-height:28px;
  padding:5px 10px;
  border:1.5px solid var(--ink);
  border-radius:999px;
  background:var(--paper);
  color:var(--ink);
  font:inherit;
  font-size:10px;
  font-weight:800;
  line-height:1.4;
  text-align:center;
  white-space:normal;
  cursor:pointer;
  box-shadow:0 1px 0 var(--ink);
  transition:background .15s ease,box-shadow .15s ease;
}
.transfer-clear-history{justify-self:end;color:var(--muted);border-color:#aeb1bf;box-shadow:none;background:rgba(255,254,251,.8)}
.transfer-clear-history::before{content:"×";font-size:15px;line-height:1}
.transfer-clear-history:hover{background:#fff0ee;color:#a34646;border-color:#ce7676;transform:none}
.transfer-resume-upload{background:#eafff3}
.transfer-resume-upload::before{content:"↻";font-size:14px;line-height:1}
.transfer-resume-upload:hover{background:#d3f5e2;transform:none}
.transfer-dismiss-job{background:var(--paper);white-space:nowrap}
.transfer-dismiss-job::before{content:"×";font-size:14px;line-height:1}
.transfer-dismiss-job:hover{background:var(--cream);transform:none}
.transfer-clear-history:focus-visible,.transfer-resume-upload:focus-visible,.transfer-dismiss-job:focus-visible{outline:2px solid var(--blue);outline-offset:3px}
.transfer-clear-history:active,.transfer-resume-upload:active,.transfer-dismiss-job:active{box-shadow:none;transform:none}
@media(max-width:600px){
  .transfer-job-title{flex-wrap:wrap;gap:7px}
  .transfer-job-actions{flex-wrap:wrap;max-width:100%;margin-left:auto;justify-content:flex-end}
  .transfer-job-item .transfer-item-actions{flex-wrap:wrap;justify-content:flex-end;max-width:100%}
  .transfer-job-item:has(.transfer-resume-upload) .transfer-item-name{grid-column:1/-1}
  .transfer-job-item:has(.transfer-resume-upload) .transfer-item-actions{grid-column:1/-1}
  .transfer-clear-history,.transfer-resume-upload,.transfer-dismiss-job{min-height:32px;font-size:10px;padding:6px 10px}
}
.transfer-job-card.is-cancelled{border-color:rgba(174,177,188,.9);background:rgba(249,249,251,.76)}
.transfer-job-stats,.transfer-item-stats{font-size:10px;color:#5f6878;font-weight:800;display:flex;flex-wrap:wrap;gap:5px 8px}
.transfer-job-card progress{appearance:none;-webkit-appearance:none;position:static;display:block;width:100%;height:15px;border:2px solid var(--ink);box-shadow:0 2px 0 var(--ink);padding:0;background:#fff8e7;border-radius:999px;overflow:hidden;accent-color:var(--green)}
.transfer-job-card progress::-webkit-progress-bar{background:#fff8e7;border-radius:999px;box-shadow:inset 0 2px 0 rgba(47,49,66,.08)}
.transfer-job-card progress::-webkit-progress-value{background:linear-gradient(180deg,#baf1d1 0 28%,var(--green) 28% 100%);border-radius:999px;box-shadow:inset -2px 0 0 rgba(47,49,66,.22);transition:width .45s ease-out}
.transfer-job-card progress::-moz-progress-bar{background:linear-gradient(180deg,#baf1d1 0 28%,var(--green) 28% 100%);border-radius:999px;box-shadow:inset -2px 0 0 rgba(47,49,66,.22)}
.transfer-job-items{display:grid;gap:6px;margin-top:1px;padding-top:7px;border-top:1.5px dashed rgba(160,170,186,.5)}
.transfer-job-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center}
.transfer-item-name{font-size:11px;font-weight:850;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.transfer-item-state{font-size:9px;color:var(--muted);font-weight:850}
.transfer-job-item progress{grid-column:1/-1;height:11px;border-width:1.5px;box-shadow:0 1px 0 var(--ink)}
.transfer-item-stats{grid-column:1/-1;font-size:9px}
.transfer-error{font-size:10px;color:#9f3535;font-weight:800;overflow-wrap:anywhere}
.transfer-job-item>.transfer-error{grid-column:1/-1}
@media(max-width:760px){
  .transfer-jobs{left:10px;bottom:10px;width:min(390px,calc(100vw - 20px));max-height:48vh}
}

/* Admin ownership / deletion controls */
.user-row{grid-template-columns:minmax(180px,1fr) minmax(150px,220px) minmax(180px,240px) auto!important}
.user-actions,.team-actions{display:flex;align-items:center;gap:7px;justify-content:flex-end;flex-wrap:wrap}
.user-actions .mini,.team-actions .mini{min-height:36px;padding:7px 10px}
.team-row .grow{min-width:0}
.admin-edit-dialog,.admin-delete-dialog{width:min(620px,calc(100vw - 28px));max-width:none}
.admin-edit-dialog>form,.admin-delete-dialog>form{margin:0}
.user-password-dialog .user-password-hint{display:block;font-size:12px;line-height:1.5;margin:10px 0 14px}
.user-password-visibility{display:flex!important;align-items:center;gap:8px;cursor:pointer;margin:10px 0 0!important;font-size:12px;font-weight:800}
.user-password-visibility input{width:18px;height:18px;accent-color:var(--purple)}
.user-password-action{white-space:nowrap}

.admin-dialog-checks{margin:16px 0;max-height:320px;overflow:auto;padding:2px}
.ownership-rule{display:grid;gap:5px;margin:14px 0;padding:12px 14px;border:2px solid #e2c979;border-radius:13px;background:#fff9df}
.ownership-rule b{font-size:13px}
.ownership-rule span{font-size:11px;line-height:1.45;color:var(--muted);font-weight:750}
.ownership-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
.ownership-summary-item{display:flex;justify-content:space-between;gap:10px;padding:9px 11px;border:2px solid #d9dde5;border-radius:11px;background:#fafcff;font-size:12px;font-weight:850}
.ownership-summary-item b{font-size:14px}
.admin-delete-hint{margin:9px 0 0;line-height:1.45}
#userDeleteTransferWrap[hidden]{display:none!important}
@media(max-width:760px){.user-row{grid-template-columns:1fr!important}.user-actions{justify-content:flex-start}.ownership-summary{grid-template-columns:1fr}}

/* Remote Shell pseudo-file + terminal */
.remote-shell-row .remote-shell-file-icon{width:34px;height:34px;object-fit:contain;opacity:.96;flex:0 0 auto}
.remote-shell-row .size-cell{font-weight:900;color:var(--muted)}
.remote-shell-default-path-note{display:grid;gap:4px;padding:11px 12px;border:2px dashed color-mix(in srgb,var(--ink) 35%,transparent);border-radius:14px;background:color-mix(in srgb,var(--paper) 92%,var(--blue) 8%);font-size:12px}
.remote-shell-default-path-note b{font-size:12px}
.remote-shell-default-path-note span{color:var(--muted);font-size:11px;font-weight:700;line-height:1.45}
.remote-shell-tray{display:flex;align-items:center;gap:7px;max-width:min(360px,35vw);overflow-x:auto;scrollbar-width:none;padding:2px}
.remote-shell-tray::-webkit-scrollbar{display:none}
.remote-shell-tray-item{position:relative;display:inline-grid;place-items:center;flex:0 0 auto;width:42px;height:42px;padding:6px;border:2.5px solid var(--ink);border-radius:14px;background:var(--paper);box-shadow:2px 2px 0 var(--ink);transition:transform .11s ease,box-shadow .11s ease,background .11s ease}
.remote-shell-tray-item:hover{background:#eef9ff;transform:translate(-1px,-1px);box-shadow:4px 4px 0 var(--ink)}
.remote-shell-tray-item img{width:25px;height:25px;object-fit:contain;display:block}
.remote-shell-tray-item::after{content:"";position:absolute;right:3px;bottom:3px;width:8px;height:8px;border-radius:999px;background:var(--green);border:1.5px solid var(--ink)}
.remote-shell-terminal-dialog{padding:0!important;border:0!important;background:transparent!important;width:min(1100px,94vw);max-width:none!important;overflow:visible!important}
.remote-shell-terminal-dialog::backdrop{background:rgba(47,49,66,.18);backdrop-filter:blur(2px)}
.remote-shell-terminal-shell{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:min(760px,88vh);overflow:hidden;border:3px solid var(--ink);border-radius:20px;background:rgba(255,254,251,.88);box-shadow:var(--shadow);backdrop-filter:blur(14px)}
.remote-shell-terminal-head{margin:0!important;padding:12px 14px;background:rgba(255,254,251,.94);color:var(--ink);border-bottom:3px solid var(--ink);cursor:grab;user-select:none;touch-action:none;backdrop-filter:blur(12px)}
.remote-shell-terminal-head:active{cursor:grabbing}
.remote-shell-terminal-head h3{margin:0 0 3px;color:var(--ink)}
.remote-shell-terminal-status{margin:0;color:var(--muted);font-size:11px;font-weight:900}
.remote-shell-terminal-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.remote-shell-terminal-actions .ghost{background:var(--paper);color:var(--ink);border-color:var(--ink)}
.remote-shell-screen{min-height:0;position:relative;background:#1f2430;overflow:hidden}
.remote-shell-terminal{position:absolute;inset:0;padding:12px 14px 10px;background:#1f2430;color:#f5f7fa;box-sizing:border-box;cursor:text;user-select:none}
.remote-shell-terminal .xterm{height:100%;background:#1f2430!important;color:#f5f7fa!important;font-family:"SFMono-Regular","SF Mono",Menlo,Monaco,Consolas,"Liberation Mono",monospace!important;font-weight:600!important;letter-spacing:0!important}
.remote-shell-terminal .xterm-viewport{background:#1f2430!important;scrollbar-color:#7f899b #1f2430}
.remote-shell-terminal .xterm-screen{height:100%;background:#1f2430!important}
.remote-shell-terminal .xterm-helper-textarea{opacity:0!important}
.remote-shell-context-menu{position:absolute;z-index:50;min-width:150px;padding:7px;background:rgba(255,254,251,.98);border:2.5px solid var(--ink);border-radius:14px;box-shadow:5px 6px 0 rgba(47,49,66,.28);backdrop-filter:blur(10px)}
.remote-shell-context-menu[hidden]{display:none!important}
.remote-shell-context-menu button{display:block;width:100%;padding:9px 12px;border:0;border-radius:9px;background:transparent;color:var(--ink);font:800 13px/1.2 inherit;text-align:left;cursor:pointer}
.remote-shell-context-menu button:hover:not(:disabled),.remote-shell-context-menu button:focus-visible{background:var(--accent-soft);outline:none}
.remote-shell-context-menu button:disabled{opacity:.38;cursor:not-allowed}
.remote-shell-terminal-dialog.is-disconnected .remote-shell-terminal-status{color:#b42318}
.remote-shell-terminal-dialog.is-disconnected .remote-shell-terminal{cursor:default}
@media(max-width:980px){.remote-shell-tray{max-width:180px}}
@media(max-width:760px){
  .remote-shell-tray{max-width:96px}
  .remote-shell-tray-item{width:38px;height:38px;border-radius:12px}
  .remote-shell-terminal-dialog{width:96vw;max-width:96vw}
  .remote-shell-terminal-shell{height:88dvh;border-radius:16px}
  .remote-shell-terminal-head{align-items:flex-start}
  .remote-shell-terminal-actions{gap:5px}
  .remote-shell-terminal{padding:10px 8px 8px}
}

/* Floating folder windows */
.header-session-area{display:flex;align-items:center;gap:9px;min-width:0}
.folder-window-tray{display:flex;align-items:center;gap:7px;max-width:min(420px,38vw);overflow-x:auto;scrollbar-width:none;padding:2px}
.folder-window-tray::-webkit-scrollbar{display:none}
.folder-window-tray-item{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;max-width:150px;height:42px;padding:5px 10px;border:2.5px solid var(--ink);border-radius:14px;background:#fff8d9;color:var(--ink);box-shadow:2px 2px 0 var(--ink);font:900 12px/1 inherit;cursor:pointer;transition:transform .1s ease,box-shadow .1s ease,background .1s ease}
.folder-window-tray-item:hover{background:#fff0a8;transform:translate(-1px,-1px);box-shadow:4px 4px 0 var(--ink)}
.folder-window-tray-icon{font-size:20px;line-height:1}
.folder-window-tray-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.folder-window-layer{position:fixed;inset:0;z-index:30;pointer-events:none;overflow:visible}
.folder-window{position:fixed;display:grid;grid-template-rows:auto minmax(0,1fr);width:min(920px,88vw);height:min(620px,76vh);min-width:520px;min-height:310px;overflow:hidden;border:3px solid var(--ink);border-radius:22px;background:rgba(255,254,251,.97);box-shadow:9px 11px 0 rgba(47,49,66,.34);pointer-events:auto;resize:both;backdrop-filter:blur(12px)}
.folder-window[hidden]{display:none!important}
.folder-window.is-dragging{user-select:none;box-shadow:12px 14px 0 rgba(47,49,66,.27)}
.folder-window.is-loading .folder-window-list{opacity:.55}
.folder-window-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px 10px;background:linear-gradient(180deg,#fff8dc,#fff2bd);border-bottom:3px solid var(--ink);cursor:grab;touch-action:none;user-select:none}
.folder-window-head:active{cursor:grabbing}
.folder-window-title{min-width:0;margin:0;color:var(--ink);font-size:17px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.folder-window-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.folder-window-actions .ghost{min-width:40px;padding:7px 10px;border-radius:12px;background:#fff;font-size:16px;box-shadow:2px 2px 0 var(--ink)}
.folder-window-body{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:0;background:#fff}
.folder-window-columns,.folder-window-row{display:grid;grid-template-columns:minmax(210px,1.65fr) minmax(100px,.75fr) minmax(150px,.9fr) minmax(85px,.55fr) 48px;align-items:center;column-gap:12px}
.folder-window-columns{min-height:40px;padding:0 14px;background:#faf7ee;border-bottom:2px solid var(--ink);color:var(--muted);font-size:11px;font-weight:900}
.folder-window-list{min-height:0;overflow:auto;background:#fff}
.folder-window-row{min-height:58px;padding:7px 14px;border-bottom:1.5px solid #e6e5e0;color:var(--ink);cursor:default;transition:background .09s ease}
.folder-window-row:hover{background:#f4fbff}
.folder-window-row:last-child{border-bottom:0}
.folder-window-name{display:flex;align-items:center;gap:9px;min-width:0;font-weight:900}
.folder-window-name .item-icon{width:31px;height:31px;flex:0 0 31px}
.folder-window-item-name,.folder-window-owner,.folder-window-modified,.folder-window-size{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.folder-window-owner,.folder-window-modified,.folder-window-size{font-size:12px;font-weight:800;color:var(--muted)}
.folder-window-size{text-align:right}
.folder-window-menu-head{text-align:center}
.folder-window-row .row-menu{justify-self:end}
.folder-window-row[data-select-key]{user-select:none}
.folder-window-row.selected{position:relative;z-index:1;background:#e5f7ff!important;box-shadow:inset 0 0 0 3px #65bde8}
.folder-window-row.selected .folder-window-item-name{color:#174f72}
.folder-window-row.selected .item-icon{animation:selectedIconWiggle .58s ease-in-out infinite;transform-origin:50% 70%}
.folder-window-row.cut-pending{opacity:.64}
.folder-window-row.drop-target{background:#dcf8d8!important;box-shadow:inset 0 0 0 4px #66c96b,0 0 0 2px #fff}
.folder-window-row.drop-blocked{cursor:not-allowed;background:#ffe7e7!important;outline:3px dashed #c85b5b;outline-offset:-5px;box-shadow:none}
.folder-window-body.drop-blocked{cursor:not-allowed;outline:4px dashed #c85b5b;outline-offset:-7px;background:#fff0f0!important}
.folder-window-body.external-drop-target{box-shadow:inset 0 0 0 5px #65bde8;background:#eefaff}
.folder-window-empty{display:grid;place-items:center;min-height:160px;padding:30px;color:var(--muted);font-weight:900;background:#fff}
@media(max-width:900px){.folder-window{width:94vw;min-width:0}.folder-window-columns,.folder-window-row{grid-template-columns:minmax(180px,1.5fr) minmax(100px,.75fr) minmax(120px,.9fr) 48px}.folder-window-columns>span:nth-child(4),.folder-window-size{display:none}.folder-window-tray{max-width:180px}}
@media(max-width:640px){.folder-window{left:3vw!important;top:88px!important;width:94vw;height:72vh;resize:none}.folder-window-columns,.folder-window-row{grid-template-columns:minmax(0,1fr) 90px 44px}.folder-window-columns>span:nth-child(3),.folder-window-modified{display:none}.folder-window-tray-name{display:none}.folder-window-tray-item{width:40px;padding:5px;justify-content:center}}

/* Cloud mount source/destination tabs and post-OAuth folder picker */
.cloud-mount-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.cloud-mount-tab{padding:10px 9px;border:2px solid var(--line);border-radius:12px;background:white;font-size:13px;font-weight:900}
.cloud-mount-tab.active{background:#e8f6ff;box-shadow:3px 3px 0 var(--ink)}
.cloud-mount-source-panel{padding:14px;border:2px dashed #b7cbdc;border-radius:14px;background:#f6fbff}
.cloud-mount-source-panel p{margin:0 0 10px}
.cloud-mount-radio{display:flex!important;align-items:center;gap:9px;margin:10px 0!important;font-weight:800}
.cloud-mount-radio input{width:18px;height:18px;min-width:18px}
.cloud-source-picker{width:min(620px,calc(100vw - 20px))}
.cloud-source-breadcrumbs{display:flex;flex-wrap:wrap;gap:6px;margin:16px 0}
.cloud-source-breadcrumbs button{padding:7px 10px;border:2px solid var(--line);border-radius:10px;background:#f3fbff;font-size:12px}
.cloud-source-breadcrumbs button.active{background:#e6f4fa;font-weight:900}
.cloud-source-folders{display:grid;gap:7px;max-height:46vh;overflow:auto;margin:10px 0;min-height:88px}
.cloud-source-folders button{text-align:left;padding:12px 14px;border:2px solid #cbd7e5;border-radius:12px;background:#fff;font-weight:800}
.cloud-source-folders button:hover{background:#eef9ff;border-color:var(--line)}
.cloud-source-folders .empty{padding:14px;color:var(--muted)}

/* Non-admin users may manage owned groups but cannot administer accounts. */
.admin-page #userForm[hidden],.admin-page .user-accounts-card[hidden]{display:none!important}
.admin-page .admin-cols.group-only{grid-template-columns:minmax(0,1fr)}
.admin-page .admin-cols.group-only #teamForm{max-width:750px;width:100%}
#teamMembersChecks{max-height:min(50vh,420px);overflow-y:auto;padding:8px 2px;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}
#teamMembersChecks .check{min-width:0}

/* At-rest encryption mode picker */
.file-encryption-dialog{width:min(620px,calc(100vw - 22px))}
.file-encryption-modes{border:0;margin:12px 0;padding:0;display:grid;gap:10px}
.file-encryption-modes legend{font-weight:900;padding:0 0 10px}
.file-encryption-choice{display:flex!important;align-items:flex-start;gap:12px;border:2px solid #cbd5e1;border-radius:14px;background:#f8fbff;padding:14px;cursor:pointer;margin:0!important}
.file-encryption-choice:has(input:checked){border-color:#7565df;background:#f0edff;box-shadow:3px 3px 0 rgba(35,39,59,.22)}
.file-encryption-choice>input{width:19px;height:19px;flex:0 0 19px;accent-color:#7463dc;margin-top:3px}
.file-encryption-choice span{display:grid;gap:4px}
.file-encryption-choice b{font-size:14px}
.file-encryption-choice small{color:#687083;line-height:1.5}
#fileEncryptionPasswordFields{margin-top:12px}
#fileEncryptionPasswordFields[hidden],#fileEncryptionModes[hidden]{display:none!important}

.password-unlock-dialog{width:min(490px,calc(100vw - 24px))}
.password-unlock-dialog #passwordUnlockError{color:#b42318;font-weight:700}

/* Baengpan-local AES-GCM file/folder protection indicator.
   Keep the existing file and folder artwork intact in list/grid/window views. */
.encryption-marked-icon{
  width:32px;height:32px;flex:0 0 32px;
  display:inline-flex;align-items:center;justify-content:center;
  position:relative;
}
.encryption-marked-icon>.item-icon{flex:0 0 32px}
/* Neutral silver for server-managed, warm gold for password-protected.
   CSS-drawn lock avoids platform-colored emoji and keeps previews clean. */
.encryption-lock-badge{
  --lock-color:#8994a4;
  position:absolute;right:-7px;bottom:-5px;z-index:2;
  display:block;
  width:20px;height:20px;
  border-radius:7px;border:1px solid #cfd5de;
  background:#fff;
  box-shadow:0 1px 4px rgba(34,47,67,.22);
  color:var(--lock-color);
  pointer-events:none;
}
.encryption-lock-badge.encryption-mode-password{
  --lock-color:#c39a26;
  background:#fffaf0;
  border-color:#e8ce89;
}
.encryption-lock-badge::before{
  content:"";
  position:absolute;box-sizing:border-box;
  width:9px;height:9px;
  left:5px;top:2px;
  border:2px solid var(--lock-color);
  border-bottom:0;
  border-radius:6px 6px 0 0;
}
.encryption-lock-badge::after{
  content:"";
  position:absolute;
  left:4px;top:9px;width:12px;height:9px;
  border-radius:2px;
  background:var(--lock-color);
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.08);
}
/* Provider mounts share the compact rounded badge frame used for AES-GCM
   lock icons. Only provider artwork differs; thumbnails stay untouched. */
.remote-mount-icon::after,
.onedrive-mount-icon::after,
.google-drive-mount-icon::after{
  content:"";
  position:absolute;
  right:-7px;bottom:-5px;z-index:2;
  width:20px;height:20px;
  box-sizing:border-box;
  border:1px solid #cfd5de;
  border-radius:7px;
  background-color:#fff;
  background-repeat:no-repeat;
  background-position:center;
  box-shadow:0 1px 4px rgba(34,47,67,.22);
  pointer-events:none;
}
.remote-mount-icon::after{
  content:"SSH";
  display:grid;place-items:center;
  color:#425e79;
  background-color:#f4fbff;
  border-color:#cbdbe8;
  font-size:7px;
  font-weight:950;
  line-height:1;
  letter-spacing:0;
}
.onedrive-mount-icon::after{
  background-image:url("/onedrive-logo.svg");
  background-size:15px auto;
}
.google-drive-mount-icon::after{
  background-image:url("/google-drive-logo.png");
  background-size:13px auto;
}
.folder-window-name .encryption-marked-icon{flex:0 0 32px}
@media(max-width:640px){
 .encryption-lock-badge,
 .remote-mount-icon::after,
 .onedrive-mount-icon::after,
 .google-drive-mount-icon::after{transform:scale(.88);transform-origin:right bottom}
}


/* Consistent circular radio controls across all dialogs, forms and panels.
   The shared input rule must never apply a rectangular focus shadow. */
input[type="radio"],
input[type="radio"]:focus,
input[type="radio"]:focus-visible,
.themed-radio,
.file-encryption-choice>input[type="radio"],
.remote-auth-choice input[type="radio"]{
  appearance:none!important;
  -webkit-appearance:none!important;
  display:inline-block;
  width:21px!important;height:21px!important;
  min-width:21px!important;min-height:21px!important;
  flex:0 0 21px;
  box-sizing:border-box!important;
  padding:0!important;
  margin:1px 0 0!important;
  border:2px solid #777d8d!important;
  border-radius:50%!important;
  background-color:#fff!important;
  background-image:none!important;
  box-shadow:none!important;
  outline:0!important;
  transform:none!important;
  vertical-align:middle;
  cursor:pointer;
  transition:border-color .12s ease,background-color .12s ease!important;
}
input[type="radio"]:checked,
.themed-radio:checked{
  border-color:#7059da!important;
  background:#fff radial-gradient(circle at center,#7059da 0 5px,transparent 5.5px)!important;
  box-shadow:none!important;
}
input[type="radio"]:focus-visible,
.themed-radio:focus-visible{
  outline:2px solid #8a79ea!important;
  outline-offset:3px!important;
  box-shadow:none!important;
}
input[type="radio"]:disabled{opacity:.5;cursor:not-allowed}
.file-encryption-choice:has(input:checked),
.remote-auth-choice:has(input:checked),
.share-choice:has(input:checked){
  box-shadow:none!important;
}

/* Native language names stay readable in every locale, with no truncated labels. */
.language-switcher button{min-width:52px;white-space:nowrap;font-size:12px}
@media(max-width:720px){.language-switcher button{min-width:43px;padding:6px 7px;font-size:11px}}


/* Baengpan project information: compact footer and accessible About dialog. */
#app:not([hidden]){display:flex;flex-direction:column;min-height:calc(100vh - 80px)}
#app>.page:not([hidden]){flex:1;width:100%}
#login.center{min-height:calc(100vh - 80px)}
.site-footer{
  position:relative;z-index:1;
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;
  gap:10px 24px;min-height:80px;padding:16px clamp(18px,4vw,56px);
  color:var(--muted);background:rgba(255,254,251,.92);
  border-top:2px solid rgba(47,49,66,.16);
  font-size:13px;font-weight:650;
}
.site-footer-version{display:inline-block;margin-left:5px;font-variant-numeric:tabular-nums}
.site-footer-links{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px}
.site-footer-link{
  color:var(--ink);font:inherit;line-height:1.5;
  border:0;background:none;padding:5px 3px;
  text-decoration:none;cursor:pointer;
}
.site-footer-link:hover,.site-footer-link:focus-visible{
  color:#5743b2;text-decoration:underline;text-underline-offset:3px;
}
.about-dialog{
  width:min(690px,calc(100vw - 28px));max-height:min(90vh,900px);
  border:3px solid var(--ink);border-radius:27px;
  background:var(--paper);color:var(--ink);
  padding:0;box-shadow:9px 9px 0 var(--ink);
  overflow-y:auto;overscroll-behavior:contain;
}
.about-dialog::backdrop{background:rgba(28,32,48,.66);backdrop-filter:blur(4px)}
.about-shell{padding:clamp(18px,4vw,34px);display:grid;gap:20px}
.about-heading{display:flex;justify-content:space-between;align-items:start;gap:14px}
.about-brand{display:flex;align-items:center;gap:14px;min-width:0}
.about-brand img{object-fit:contain;flex-shrink:0}
.about-eyebrow{margin:0 0 3px;font-size:11px;font-weight:900;letter-spacing:.09em;color:#5b5680;text-transform:uppercase}
.about-brand h2{margin:0 0 5px;font-size:clamp(22px,3.8vw,30px)}
.about-release{font-size:12px;font-weight:800;color:#6e7180}
.about-close{min-width:42px;min-height:42px;flex-shrink:0}
.about-lead{font-size:15px;line-height:1.65;margin:0}
.about-section{border-top:1px solid #d9dbe4;padding-top:16px}
.about-section h3,.about-support h3{margin:0 0 9px;font-size:16px}
.about-section p,.about-support p{margin:0 0 8px;font-size:13px;line-height:1.65}
.about-section ul{display:grid;gap:7px;margin:0;padding-left:22px;font-size:13px;line-height:1.55}
.about-fine-print{color:var(--muted)}
.about-support{padding:18px;border:2px solid #d7d0ff;border-radius:17px;background:#f3f0ff}
.about-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}
.about-action{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:38px;padding:8px 12px;border:2px solid var(--ink);
  border-radius:11px;background:#fff;color:var(--ink);
  font-size:12px;font-weight:850;text-decoration:none;
  box-shadow:2px 2px 0 var(--ink);
}
.about-action-primary{background:#ffe17a}
.about-action:hover{transform:translateY(-1px)}
.about-action:focus-visible{outline:3px solid #7465d6;outline-offset:3px}
@media(max-width:680px){
 .site-footer{flex-direction:column;text-align:center;justify-content:center;gap:5px}
 .site-footer-links{justify-content:center}
 #app:not([hidden]),#login.center{min-height:calc(100vh - 110px)}
 .about-shell{gap:15px}
 .about-brand img{width:44px;height:44px}
 .about-actions{flex-direction:column}
 .about-action{width:100%}
}

/* Folder download mode picker. */
.folder-download-dialog{width:min(520px,calc(100vw - 32px))}
.folder-download-modes{display:grid;gap:12px;margin:18px 0}
.folder-download-option{display:flex;align-items:flex-start;gap:12px;padding:16px;border:1px solid #d9dee8;border-radius:12px;cursor:pointer}
.folder-download-option:has(input:checked){border-color:#4676d7;background:#f1f6ff}
.folder-download-option input{width:18px;height:18px;flex:0 0 18px;margin:3px 0 0}
.folder-download-option span{display:grid;gap:6px;min-width:0}
.folder-download-option small{color:#67748a;font-weight:400;line-height:1.5}
#folderDownloadSummary{overflow-wrap:anywhere}
#folderDownloadBrowserHint{font-size:13px;line-height:1.6}

.transfer-item-actions{display:flex;align-items:center;gap:6px}
.transfer-cancel-item{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;min-height:0;padding:0;border:1.5px solid #ce7676;border-radius:50%;background:transparent;color:#b44747;font-size:17px;line-height:1;cursor:pointer}
.transfer-cancel-item:hover{background:#ffeaea}
.transfer-cancel-item:focus-visible{outline:2px solid var(--ink);outline-offset:2px}

.folder-download-format{display:flex;align-items:center;gap:12px;margin:14px 0;font-weight:700}
.folder-download-format[hidden]{display:none}
.folder-download-format select{min-width:170px}
.transfer-item-phase{grid-column:1/-1;font-size:10px;color:var(--muted);overflow-wrap:anywhere}
/* Move one small stripe tile per cycle, independent of the bar's width. */
.transfer-job-card progress:indeterminate{background:linear-gradient(135deg,#d1f3df 25%,#7bd3aa 25%,#7bd3aa 50%,#d1f3df 50%,#d1f3df 75%,#7bd3aa 75%);background-size:36px 36px;animation:transfer-progress-drift 3.6s linear infinite}
.transfer-job-card progress:indeterminate::-webkit-progress-bar{background:transparent;box-shadow:inset 0 2px 0 rgba(255,255,255,.5)}
.transfer-job-card progress:indeterminate::-webkit-progress-value{background:transparent;box-shadow:none}
.transfer-job-card progress:indeterminate::-moz-progress-bar{background:transparent;box-shadow:none;animation:none}
@keyframes transfer-progress-drift{from{background-position:0 0}to{background-position:36px 0}}
@media(prefers-reduced-motion:reduce){
  .transfer-job-card progress:indeterminate{animation:none}
  .transfer-job-card progress::-webkit-progress-value{transition:none}
}

.transfer-pause-job{padding:4px 9px;border:1.5px solid #7e90ad;border-radius:999px;background:transparent;font-size:10px;font-weight:800;cursor:pointer}
.transfer-pause-job:hover{background:#eaf2ff}
.transfer-job-card.is-paused progress{animation-play-state:paused}

.transfer-pause-item{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;min-height:0;padding:0;border:1.5px solid #7e90ad;border-radius:50%;background:transparent;font-size:12px;line-height:1;cursor:pointer}
.transfer-pause-item:hover{background:#eaf2ff}
.transfer-pause-item:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.transfer-job-item.is-paused progress{animation-play-state:paused}

/* Phone layout: one scrolling surface, reachable navigation and touch targets. */
@media(max-width:640px){
  html{scroll-padding-bottom:90px}
  body{background-attachment:scroll}
  #app>header{padding:8px 12px;gap:8px;flex-wrap:nowrap;min-height:64px;border-bottom-width:2px}
  #app>header .brand{font-size:0;padding:7px;width:44px;height:44px;flex:none;justify-content:center;box-shadow:2px 2px 0 var(--ink)}
  #app>header .header-session-area{min-width:0;gap:6px;margin-left:auto}
  #app>header #who{display:none}
  #logout{width:44px;height:44px;min-width:44px;padding:0;font-size:0}
  #logout::before{content:'↪';font-size:25px}
  .language-switcher.in-header{gap:2px;padding:3px;flex-shrink:1}
  .language-switcher.in-header button{min-height:36px;min-width:38px;padding:5px 7px;font-size:11px}
  #app>header nav{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;gap:4px;width:100%;padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:var(--paper);border-top:2px solid var(--ink);box-shadow:0 -3px 16px #2f314214;overflow:visible}
  #app>header nav .nav{flex:1;min-width:0;min-height:54px;padding:5px 2px;flex-direction:column;gap:3px;border:0;border-radius:12px;box-shadow:none;font-size:11px;line-height:1.2;white-space:normal;justify-content:center;text-align:center}
  #app>header nav .nav::before{font-size:19px;line-height:22px}
  #app>header nav .nav-icon{width:22px;height:22px;flex-basis:22px}
  #app>header nav .nav.active{background:#dff5ff;box-shadow:inset 0 0 0 1.5px #9edcff}
  .page{padding:14px 12px calc(88px + env(safe-area-inset-bottom));min-width:0}
  .toolbar{gap:12px;margin-bottom:14px;width:100%}
  #crumbs{width:100%;flex-wrap:nowrap;overflow-x:auto;padding:2px 2px 5px;scrollbar-width:none}
  #crumbs .crumb{flex-shrink:0;max-width:70vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:42px;font-size:13px}
  .toolbar .toolbar-actions{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,1fr);gap:8px;width:100%;align-items:center}
  .toolbar .file-search{order:0;grid-column:1/-1;width:100%;min-width:0}
  .file-search input{font-size:16px;min-height:44px}
  .toolbar .view-toggle{margin:0;align-self:stretch}
  .toolbar .view-toggle-button{min-width:40px;min-height:44px;padding:6px}
  #newFolder,#pickFiles{min-height:44px;padding:8px 6px;font-size:13px;white-space:nowrap}
  .workspace{height:auto;min-height:45dvh;overflow:visible;padding:0;border-radius:18px;box-shadow:3px 3px 0 var(--ink);scrollbar-gutter:auto}
  .content-table:not(.grid-mode) .content-head{position:static;grid-template-columns:minmax(0,1fr) 48px;padding:10px 12px;border-radius:15px 15px 0 0}
  .content-table:not(.grid-mode) .content-head>span{display:none}
  .content-table:not(.grid-mode) .content-row{grid-template-columns:minmax(0,1fr) 48px;gap:3px 8px;min-height:76px;padding:10px 12px}
  .content-table:not(.grid-mode) .content-row .name-cell{grid-column:1;grid-row:1;min-width:0}
  .content-table:not(.grid-mode) .content-row .owner-cell{display:block;grid-column:1;grid-row:2;padding-left:38px;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
  .content-table:not(.grid-mode) .content-row .row-menu{grid-column:2;grid-row:1/3;align-self:center}
  .row-menu{min-width:44px;width:44px;height:44px;min-height:44px}
  .item-name{font-size:14px;line-height:1.4}
  .content-table.grid-mode{padding:8px}
  .content-table.grid-mode .content-rows{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .content-table.grid-mode .name-cell{min-width:0;padding:10px 4px 8px 8px}
  .content-table.grid-mode .item-name{font-size:12px}
  .content-table.grid-mode .file-row{min-height:180px;grid-template-rows:auto minmax(110px,1fr)}
  .content-table.grid-mode .grid-file-preview{height:128px;min-height:110px;margin:0 6px 6px}
  .content-table.grid-mode .row-menu{width:36px;min-width:36px}
  input,select,textarea{font-size:16px}
  button,.mini,.action-link{touch-action:manipulation}
  .card{padding:16px;border-radius:18px;box-shadow:3px 3px 0 var(--ink)}
  dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:16px;border-radius:20px;overflow-y:auto;overscroll-behavior:contain}
  .dialog-head{gap:8px;align-items:flex-start}
  .dialog-head h3{font-size:20px;overflow-wrap:anywhere}
  .dialog-head>button{flex:none;min-width:44px;min-height:44px}
  .permission-editor{padding:12px;gap:12px!important}
  .permission-subject-grid,.permission-levels{grid-template-columns:1fr}
  .perm-row{flex-wrap:wrap;gap:8px;padding:10px}
  .perm-row .grow{flex-basis:100%;overflow-wrap:anywhere}
  .permission-badges{flex-wrap:wrap}
  .context-menu{left:8px!important;right:8px!important;top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;width:auto;max-height:70dvh;border-radius:20px;padding:10px;z-index:100}
  .context-menu button:not(.color-chip){min-height:44px}
  .transfer-jobs{left:8px;bottom:calc(78px + env(safe-area-inset-bottom));width:calc(100vw - 16px);max-height:40dvh}
  #toast{top:76px;width:max-content;max-width:calc(100vw - 24px);font-size:13px}
  .image-preview-dialog,.video-player-dialog,.audio-player-dialog{padding:0}
  .image-preview-head,.video-player-head{flex-wrap:wrap;padding:10px;gap:8px}
  .image-preview-title,.video-player-title{width:100%;min-width:0}
  .image-preview-actions,.video-player-actions{margin-left:auto}
  .image-preview-shell,.video-player-shell{min-height:0;max-height:calc(100dvh - 32px)}
  .image-preview-img,.image-editor-canvas{max-height:calc(100dvh - 260px)}
  .image-editor-toolbar{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;padding:8px}
  .image-editor-toolbar>*{flex-shrink:0}
  .image-editor-tool{min-height:44px}
  .video-player-head h3{max-width:100%;font-size:16px}
  .video-player-controls{gap:6px}
  .video-player-track{max-width:100%}
  .video-player-settings .video-player-track select{font-size:16px;max-width:160px}
  .folder-window{top:72px!important;left:8px!important;width:calc(100vw - 16px);height:calc(100dvh - 160px);min-height:0;min-width:0}
  .remote-shell-tray,.folder-window-tray{max-width:44px;overflow-x:auto}
}
@media(pointer:coarse){
  .content-row,.folder-window-row{touch-action:pan-y}
  .content-row:hover{transform:none}
}
.mobile-select-toggle,.image-fullscreen-exit{display:none}
@media(max-width:640px){
  .site-footer{margin-bottom:calc(76px + env(safe-area-inset-bottom))}
  .content-table .content-head>.table-menu-head{display:block!important;grid-column:2;justify-self:end}
  .desktop-menu-label{display:none}
  .mobile-select-toggle{display:inline-grid;place-items:center;width:44px;min-height:44px;padding:0;border:1.5px solid var(--ink);border-radius:12px;background:#fff;color:var(--ink);font-size:21px}
  .mobile-select-toggle[aria-pressed=true]{background:#dff5ff;box-shadow:inset 0 0 0 2px var(--blue)}
  .content-table.grid-mode .content-head{display:flex;justify-content:space-between}
}
@media(pointer:coarse){
  .image-preview-maximized .image-fullscreen-exit{display:grid;place-items:center;position:absolute;right:calc(12px + env(safe-area-inset-right));top:calc(12px + env(safe-area-inset-top));z-index:8;width:44px;height:44px;background:#ffffffd9}
}
@media(max-width:640px){
  .content-table.grid-mode .content-row{position:relative;grid-template-columns:minmax(0,1fr);grid-template-areas:'name' 'preview'}
  .content-table.grid-mode .name-cell{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:12px 8px 8px}
  .content-table.grid-mode .item-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow:hidden;overflow-wrap:anywhere;line-height:1.4;min-height:2.8em;width:100%}
  .content-table.grid-mode .row-menu{position:absolute;top:4px;right:2px;width:44px;min-width:44px;height:44px}
  .content-table.grid-mode .folder-row{min-height:112px}
}

/* Compact workspace: visual emphasis belongs to the files, not the frame. */
:root{font-family:"Trebuchet MS","Noto Sans Thai",system-ui,sans-serif;--ink:#343645;--muted:#7a7d8c;--line:#dde0e8;--paper:#fffefb;--cream:#fffaf0;--shadow:2px 2px 0 #343645;--shadow-sm:1px 1px 0 #343645}
html,body{background:#fffaf0}
body::before,body::after{display:none}
header{min-height:56px;padding:7px 18px;gap:18px;background:#fff;border-bottom:1.5px solid #343645;box-shadow:none}
.brand{padding:5px 9px;font-size:17px;border:0;border-radius:8px;background:#ffe58b;box-shadow:1px 1px 0 var(--ink);gap:7px}
.brand-icon{width:28px;height:28px}
.nav{min-height:36px;padding:6px 10px;font-size:13px;font-weight:700;border:1px solid transparent;border-radius:9px;background:transparent;box-shadow:none}
.nav:hover,.nav.active{transform:none;box-shadow:none;background:#edf4fb}
.nav-icon{width:20px;height:20px;flex-basis:20px}
#who{padding:4px 8px;font-size:12px;border:0;background:#f4f6f8;font-weight:500}
.primary,.ghost,.mini,.danger,.crumb{border:1.5px solid #343645;border-radius:10px;box-shadow:1px 1px 0 #343645;font-weight:700}
.primary{background:#ffae59;border-color:#343645;color:#342a20}
.primary:hover:not(:disabled),.ghost:hover:not(:disabled),.mini:hover:not(:disabled),.danger:hover:not(:disabled),.crumb:hover{transform:none;box-shadow:none;filter:none}
.primary,.ghost,.danger{min-height:36px;padding:7px 12px;font-size:13px}
.language-switcher,.language-switcher.in-header{border:1px solid #e3e6eb;border-radius:8px;box-shadow:none;padding:2px;gap:2px;background:#fff}
.language-switcher button{min-height:28px;padding:4px 7px;border-radius:5px;font-size:11px;font-weight:600}
.page{max-width:none;padding:14px 20px 20px}
.page.narrow{max-width:1120px}
.page>h2{border:0;background:transparent;box-shadow:none;padding:0;font-size:22px}
.toolbar{gap:12px;margin-bottom:12px}
.toolbar-actions{align-items:center}
#crumbs{gap:5px}
.crumb{min-height:32px;padding:4px 8px;font-size:13px;background:transparent;border-color:transparent;box-shadow:none}
.crumb:last-of-type{background:#eef3f8}
.home-crumb{width:34px;height:32px}
.home-crumb-icon{width:22px;height:22px}
.file-search{height:36px;border:1.5px solid #343645;border-radius:10px;grid-template-columns:30px minmax(0,1fr) 30px;box-shadow:none;background:#fff}
.file-search:focus-within{box-shadow:0 0 0 2px #b9ddfa;border-color:#78b5e4;background:#fff}
.file-search input{font-weight:400;font-size:13px}
.file-search input::placeholder{font-weight:400;color:#959ba6}
.file-search-icon{font-size:20px;transform:none;font-weight:400}
.file-search-clear{width:26px;height:26px;font-size:18px}
.view-toggle{height:36px;border:1.5px solid #343645;border-radius:10px;box-shadow:none;background:#fff}
.view-toggle-button{min-height:34px;padding:5px 9px;border:0;box-shadow:none}
.workspace{height:calc(100dvh - 132px);min-height:300px;padding:0;border:1px solid #e2e6eb;border-radius:9px;box-shadow:none;background:#fff;scrollbar-gutter:auto}
.content-table{border:0;border-radius:8px;background:#fff;box-shadow:none}
.content-head{min-height:38px;padding:3px 12px;background:#fff9e8;border-bottom:1px solid #e5e1d6;font-size:11px;font-weight:600}
.sort-name{font-weight:600;padding:5px 0;font-size:12px}
#sortArrow{width:18px;height:18px;font-size:11px;background:transparent;color:#69839b}
.content-row{min-height:48px;padding:5px 12px;border-top:1px solid #f0f1f4}
.content-row:hover{background:#f7faff;transform:none}
.item-name{font-size:13px;font-weight:600}
.owner-cell,.date-cell,.size-cell{font-size:12px;font-weight:400;color:#7a818d}
.row-menu{width:34px;height:32px;min-width:0;min-height:0;border:0;border-radius:6px;box-shadow:none;background:transparent;font-size:20px}
.row-menu:hover:not(:disabled){background:#edf1f6;box-shadow:none;transform:none}
.card,dialog{border:1px solid #dce0e6;border-radius:12px;box-shadow:0 8px 30px #26334b0c}
.card{padding:18px}
input,select,textarea{border:1px solid #d8dde5;border-radius:8px;box-shadow:none}
input:focus,select:focus,textarea:focus{transform:none;box-shadow:0 0 0 2px #c8e3f8;background:#fff}
.dialog-head h3{font-weight:600}
.permission-editor{border:1px solid #e2e6eb;border-radius:10px;box-shadow:none}
.permission-choice{border-width:1px;border-radius:9px;box-shadow:none}
.context-menu{border:1px solid #dce0e6;border-radius:12px;box-shadow:0 8px 32px #1e293b26}
.content-table.grid-mode{padding:10px}
.content-table.grid-mode .content-row{border:1px solid #e6e9ee;border-radius:10px;box-shadow:none}
.content-table.grid-mode .content-head{background:#f7f8fa;border:0;border-radius:6px;box-shadow:none;top:0}
.site-footer{font-size:11px;background:transparent;border:0;box-shadow:none;padding:10px;color:#9298a2}
@media(max-width:640px){
  #app>header{min-height:48px;padding:5px 10px;gap:6px;border-bottom:1px solid #e4e7ec}
  #app>header .brand{width:34px;height:34px;padding:2px;background:#ffe58b;border:1px solid #343645;box-shadow:1px 1px 0 #343645}
  #app>header .brand-icon{width:30px;height:30px}
  #logout{width:36px;min-width:36px;height:36px;min-height:36px;border:0;background:transparent}
  #logout::before{font-size:23px}
  .language-switcher.in-header{padding:2px;border-radius:7px}
  .language-switcher.in-header button{min-height:28px;padding:3px 6px;font-size:10px}
  #app>header nav{gap:4px;padding:3px 8px calc(3px + env(safe-area-inset-bottom));border-top:1px solid #e3e6eb;box-shadow:none}
  #app>header nav .nav{min-height:46px;font-size:10px;padding:3px 2px;gap:2px;border-radius:7px;font-weight:500}
  #app>header nav .nav.active{box-shadow:none;background:#eef5fb}
  #app>header nav .nav-icon{width:18px;height:18px;flex-basis:18px}
  #app>header nav .nav::before{font-size:17px;line-height:20px}
  .page{padding:8px 10px calc(66px + env(safe-area-inset-bottom))}
  .toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:6px;margin-bottom:8px}
  #crumbs{grid-column:1/-1;padding:0;min-height:28px;gap:4px}
  #crumbs .crumb{min-height:28px;height:28px;padding:3px 6px;font-size:12px;max-width:75vw}
  #crumbs .home-crumb{width:30px;border:0;box-shadow:none}
  .toolbar .toolbar-actions{display:contents}
  .toolbar .file-search{grid-column:1;order:0;height:40px;min-width:0;border-radius:7px}
  .file-search input{min-height:38px;font-size:16px}
  .toolbar .view-toggle{height:40px;min-width:64px;border-radius:7px}
  .toolbar .view-toggle-button{min-height:38px;min-width:32px;padding:5px;font-size:17px}
  #newFolder,#pickFiles{width:40px;min-width:40px;height:40px;min-height:40px;padding:0;font-size:0;border-radius:7px}
  #newFolder::before{content:'＋';font-size:24px;font-weight:400}
  #pickFiles::before{content:'↑';font-size:24px;font-weight:500}
  .workspace{height:auto;min-height:calc(100dvh - 196px);border:0;border-radius:7px;box-shadow:none;padding:0;overflow:visible}
  .content-table:not(.grid-mode) .content-head{min-height:34px;padding:0 8px;border-radius:6px 6px 0 0;border-bottom:1px solid #e5e8ed}
  .content-table:not(.grid-mode) .content-row{min-height:52px;padding:4px 8px;gap:0 6px;grid-template-columns:minmax(0,1fr) 40px}
  .content-table:not(.grid-mode) .content-row .name-cell{grid-row:1/3}
  .content-table:not(.grid-mode) .content-row .owner-cell{display:none}
  .content-table:not(.grid-mode) .item-name{font-size:13px;font-weight:600}
  .row-menu{width:40px;min-width:40px;height:44px;min-height:44px;border:0;box-shadow:none;background:transparent;font-size:20px}
  .mobile-select-toggle{width:40px;min-height:34px;padding:0;border:0;border-radius:6px;background:transparent;font-size:18px}
  .mobile-select-toggle[aria-pressed=true]{box-shadow:none;background:#e2f0fb}
  .content-table.grid-mode{padding:0}
  .content-table.grid-mode .content-head{padding:0 8px;min-height:34px;border:0}
  .content-table.grid-mode .content-rows{gap:6px}
  .content-table.grid-mode .folder-row{min-height:94px}
  .content-table.grid-mode .name-cell{padding:8px;gap:6px}
  .content-table.grid-mode .item-name{font-weight:500}
  .content-table.grid-mode .row-menu{width:40px;min-width:40px;height:40px;min-height:40px;top:0;right:0}
  dialog{padding:14px;border:1px solid #dce0e6;border-radius:12px}
  .context-menu{border:1px solid #dce0e6;border-radius:14px}
  .transfer-jobs{bottom:calc(60px + env(safe-area-inset-bottom))}
  .site-footer{margin-bottom:calc(54px + env(safe-area-inset-bottom))}
  #toast{top:56px}
}
@media(max-width:640px){
  .toolbar>div.toolbar-actions:last-child{display:contents}
  .toolbar .file-search{width:auto;min-width:0;max-width:none;margin:0}
  .toolbar>div.toolbar-actions:last-child .view-toggle{min-width:64px;width:64px}
  .toolbar>div.toolbar-actions:last-child #newFolder,.toolbar>div.toolbar-actions:last-child #pickFiles{width:40px;max-width:40px}
}
.image-preview-dialog,.video-player-dialog,.audio-player-dialog,.remote-mount-dialog,.permissions-dialog,.about-dialog{border:1px solid #dce0e6;box-shadow:0 12px 40px #1e293b1f}
.image-preview-head,.video-player-head,.audio-player-head{background:#f8f9fb;border-bottom:1px solid #e4e7ec}
.image-editor-toolbar{background:#f8f9fb;border-top:1px solid #e4e7ec}

/* Shared control geometry keeps glyphs centered at every breakpoint. */
.action-icon{display:block;width:18px;height:18px;min-width:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#newFolder,#pickFiles,.view-toggle-button,.row-menu,.mobile-select-toggle{display:inline-flex;align-items:center;justify-content:center;line-height:1;flex-shrink:0;box-sizing:border-box}
#newFolder,#pickFiles{gap:6px;white-space:nowrap}
.view-toggle{display:inline-flex;align-items:stretch;overflow:hidden;flex:none}
.view-toggle-button{width:36px;min-width:36px;max-width:36px;height:34px;padding:0;flex:0 0 36px;border-radius:0}
.view-toggle-button+.view-toggle-button{border-left:1px solid #34364555}
.toolbar-actions{min-width:0;flex-wrap:wrap;gap:8px}
.name-cell{min-width:0}
.name-cell>.item-icon,.name-cell>.file-icon-img,.name-cell>.encryption-marked-icon{flex-shrink:0}
.item-name{min-width:0;overflow:hidden;text-overflow:ellipsis}
.content-head,.content-row{grid-template-columns:minmax(0,1.8fr) minmax(90px,.8fr) minmax(130px,1fr) 80px 40px;gap:12px}
.content-table.grid-mode .content-rows{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:12px}
.content-table.grid-mode #folders:not(:empty){margin-bottom:16px}
.content-table.grid-mode .content-row{border:1px solid #dfe2e8;border-radius:12px;background:#f4f7fb;box-shadow:1px 1px 0 #34364512}
.content-table.grid-mode .folder-row{min-height:54px;grid-template-columns:minmax(0,1fr) 36px;grid-template-areas:'name menu';gap:0}
.content-table.grid-mode .file-row{min-height:0;grid-template-columns:minmax(0,1fr) 36px;grid-template-rows:46px auto;grid-template-areas:'name menu' 'preview preview';gap:0}
.content-table.grid-mode .name-cell{display:flex;flex-direction:row;align-items:center;gap:8px;padding:8px 4px 8px 10px}
.content-table.grid-mode .item-name{display:block;font-size:13px;font-weight:600;line-height:1.4;white-space:nowrap;min-height:0;padding:0;-webkit-line-clamp:unset;overflow-wrap:normal;width:auto}
.content-table.grid-mode .item-icon,.content-table.grid-mode .file-icon-img{width:25px;height:25px;flex-basis:25px}
.content-table.grid-mode .row-menu{position:static;grid-area:menu;width:32px;min-width:32px;height:36px;min-height:36px;justify-self:center;align-self:center;padding:0;border:0;box-shadow:none;font-size:20px}
.content-table.grid-mode .grid-file-preview{height:auto;min-height:0;aspect-ratio:4/3;margin:0 8px 8px;border-radius:8px}
@media(min-width:641px) and (max-width:1100px){
  header{gap:10px;flex-wrap:wrap}
  header nav{flex:1;min-width:0}
  header .header-session-area{margin-left:auto;min-width:0}
  .toolbar{flex-wrap:wrap}
  .toolbar-actions{flex:1;justify-content:flex-end}
  .toolbar .file-search{order:0;width:clamp(180px,30vw,340px);flex:1;min-width:160px}
  .content-head,.content-row{grid-template-columns:minmax(0,1.8fr) minmax(90px,.8fr) minmax(120px,1fr) 68px 36px;gap:8px}
}
@media(max-width:640px){
  .toolbar{grid-template-columns:minmax(0,1fr) 74px 40px 40px}
  .toolbar>div.toolbar-actions:last-child .view-toggle{width:74px;min-width:74px;height:40px}
  .toolbar .view-toggle-button{width:36px;min-width:36px;max-width:36px;flex-basis:36px;height:38px;min-height:38px;padding:0}
  #newFolder::before,#pickFiles::before{content:none}
  #newFolder .action-label,#pickFiles .action-label{display:none}
  #newFolder,#pickFiles{width:40px;height:40px;padding:0;gap:0;box-shadow:1px 1px 0 #343645;border:1px solid #343645}
  #newFolder .action-icon,#pickFiles .action-icon{width:20px;height:20px;flex-basis:20px}
  .content-table:not(.grid-mode) .content-head{grid-template-columns:minmax(0,1fr) 40px}
  .content-table:not(.grid-mode) .content-row{grid-template-columns:minmax(0,1fr) 40px;gap:6px}
  .content-table.grid-mode .content-rows{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .content-table.grid-mode .folder-row{min-height:54px}
  .content-table.grid-mode .file-row{grid-template-rows:44px auto}
  .content-table.grid-mode .name-cell{padding:7px 2px 7px 8px;gap:6px}
  .content-table.grid-mode .item-name{font-size:12px;min-height:0;white-space:nowrap;display:block;width:auto}
  .content-table.grid-mode .row-menu{width:32px;min-width:32px;height:40px;min-height:40px}
  .content-table.grid-mode .grid-file-preview{height:auto;min-height:0;margin:0 6px 6px;aspect-ratio:1}
}
.row-menu{font-size:0!important;overflow:hidden}
.row-menu::before{content:'';display:block;width:18px;height:18px;flex:0 0 18px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='5' r='1.7'/%3E%3Ccircle cx='12' cy='12' r='1.7'/%3E%3Ccircle cx='12' cy='19' r='1.7'/%3E%3C/svg%3E") center/18px 18px no-repeat}
.nav.active{border-color:#34364566;background:#dff3ff;box-shadow:1px 1px 0 #34364526}
.content-table.grid-mode .content-row{border:1.5px solid #34364555;box-shadow:1px 2px 0 #34364514}

.content-table.grid-mode .content-head{min-height:36px;margin-bottom:10px;padding:2px 10px}
/* Filters and selection share a compact workspace action rail. */
.workspace-controls{display:grid;gap:7px;margin-bottom:10px;min-width:0}
.workspace-filters{display:flex;align-items:center;flex-wrap:wrap;gap:7px;min-width:0}
.filter-control{display:flex;align-items:center;gap:5px;min-width:0;padding:0 8px;border:1px solid #34364566;border-radius:9px;background:#fffefb;font-size:12px;font-weight:600;white-space:nowrap;min-height:34px}
.filter-control>span{color:#7a7d8c;font-size:11px;flex:none}
.filter-control select{width:auto;min-width:50px;max-width:148px;height:32px;min-height:32px;padding:4px 20px 4px 3px;border:0;border-radius:6px;box-shadow:none;background:transparent;font-size:12px;overflow:hidden;text-overflow:ellipsis}
#resetWorkspaceFilters{min-height:34px;padding:5px 9px;font-size:12px;white-space:nowrap;flex:none}
.bulk-actions{display:flex;align-items:center;gap:6px;min-height:44px;padding:4px 8px;background:#e7f3fc;border:1px solid #aecfe4;border-radius:12px;min-width:0;overflow-x:auto}
#bulkCount{font-size:12px;font-weight:700;white-space:nowrap;margin-right:6px;flex:none}
.bulk-icon,.bulk-button{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:34px;height:34px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--ink);line-height:1}
.bulk-icon:hover:not(:disabled),.bulk-button:hover:not(:disabled){background:#cee7f8}
.bulk-button{font-size:12px;padding:0 7px;white-space:nowrap}
#bulkClear{font-size:24px}
#bulkDelete:hover:not(:disabled){background:#ffe2dc;color:#b13228}
.bulk-divider{height:20px;flex:0 0 1px;background:#b8d4e7;margin:0 2px}
#sortModified{font-size:11px;color:inherit;white-space:nowrap}
.content-table.grid-mode #sortModified{display:none}
@media(max-width:640px){
 .workspace-controls{gap:6px;margin-bottom:7px}
 .workspace-filters{flex-wrap:nowrap;overflow-x:auto;padding:1px 1px 5px;scrollbar-width:thin;overscroll-behavior-x:contain}
 .workspace-filters>*{flex:none}
 .filter-control{min-height:34px;padding:0 6px;gap:3px}
 .filter-control select{font-size:16px;max-width:124px;min-width:48px;transform:none}
 .filter-control>span{font-size:10px}
 .bulk-actions{min-height:44px;padding:3px 5px;gap:3px}
 .bulk-icon{width:36px;height:38px;min-width:36px}
 .bulk-button{height:38px;font-size:11px}
 #bulkCount{font-size:11px;margin-right:2px}
 .content-table:not(.grid-mode) #sortModified{display:none}
 .workspace{min-height:calc(100dvh - 245px)}
}
@media(min-width:641px){.mobile-select-toggle{display:none}.desktop-menu-label{font-size:10px}}
.table-menu-head{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* Selection actions occupy the filter rail without changing the listing position. */
.workspace-controls{grid-template-areas:'rail';gap:0}
.workspace-controls>.workspace-filters,.workspace-controls>.bulk-actions{grid-area:rail;min-height:48px}
.workspace-controls>.bulk-actions{align-self:stretch;z-index:1}
.workspace-controls.has-selection>.workspace-filters{visibility:hidden;pointer-events:none}

/* Sorting stays with the column headings in both views. */
.content-table.grid-mode #sortModified{display:inline-flex;margin-left:auto;align-items:center}
@media(max-width:640px){
 .content-table:not(.grid-mode) .content-head{grid-template-columns:minmax(0,1fr) auto 40px}
 .content-table:not(.grid-mode) #sortModified{display:inline-flex;grid-column:2;align-items:center;font-size:11px}
 .content-table:not(.grid-mode) .content-head>.table-menu-head{grid-column:3}
}

/* One selection toggle lives in the heading on every screen size. */
.content-table .content-head>.table-menu-head,.content-table.grid-mode .content-head>.table-menu-head{display:block;justify-self:center;flex:none;margin-left:0;overflow:visible}
.selection-toggle-label{display:inline-grid;place-items:center;width:32px;height:32px;cursor:pointer;margin:0;padding:0}
input.mobile-select-toggle,.content-table input.mobile-select-toggle{display:block!important;appearance:auto;-webkit-appearance:checkbox;width:17px;min-width:17px;height:17px;min-height:17px;margin:0;padding:0;accent-color:#6c8ecb;border:0;border-radius:3px;box-shadow:none;background:transparent;cursor:pointer;transform:none}
@media(max-width:640px){.selection-toggle-label{width:40px;height:36px}}

/* The page gutter remains available for marquee selection without adding space. */
.workspace:has(>.content-table:not(.grid-mode)){border:1px solid #e2e6eb;border-radius:9px;box-shadow:none;background:#fff}
.content-table:not(.grid-mode){border:0;border-radius:0;box-shadow:none}
/* Fit the application to the viewport; only the file frame scrolls. */
body:has(#app:not([hidden])){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
#app:not([hidden]){flex:1 1 0;min-height:0;height:auto;overflow:hidden}
#app>header{flex:none;position:relative;top:auto}
#app>.page:not([hidden]){min-height:0;overflow:auto}
#app>#filesView:not([hidden]),#app>#trashView:not([hidden]){display:flex;flex-direction:column;overflow:hidden;min-height:0;padding-bottom:8px}
#filesView>.toolbar,#filesView>.workspace-controls,#trashView>.trash-head{flex:none}
#filesView>#workspace,#trashView>#trashWorkspace{flex:1 1 0;height:auto;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;position:relative;scrollbar-gutter:stable}
#filesView>#workspace .content-head,#trashView>#trashWorkspace .content-head{position:sticky;top:0;z-index:8}
body:has(#app:not([hidden]))>.site-footer{flex:none;min-height:0;margin:0;padding:6px 18px;gap:4px 16px;border-top:1px solid #e7e4dc;background:#fffefb;font-size:10px;line-height:1.35}
body:has(#app:not([hidden])) .site-footer-links{flex:0 1 auto;gap:6px 12px}
@media(max-width:640px){
 body:has(#app:not([hidden])){padding-bottom:calc(52px + env(safe-area-inset-bottom))}
 #app>#filesView:not([hidden]),#app>#trashView:not([hidden]){padding:8px 10px 4px}
 #filesView>#workspace,#trashView>#trashWorkspace{scrollbar-gutter:auto}
 body:has(#app:not([hidden]))>.site-footer{padding:4px 10px;font-size:9px;gap:1px;flex-direction:column;justify-content:center;align-items:center}
 body:has(#app:not([hidden])) .site-footer-links{gap:4px 10px}
 body:has(#app:not([hidden])) .site-footer-link{padding:2px 1px;font-size:9px}
}
#filesView>#workspace>.content-table,#trashView>#trashWorkspace>.content-table{overflow:visible}
/* Keep the mobile grid inside the same frame used by list view. */
@media(max-width:640px){
 #filesView>#workspace{border:1px solid #e2e6eb;border-radius:9px;background:#fff;box-sizing:border-box}
 #filesView>#workspace>.content-table.grid-mode{width:100%;min-width:0;padding:8px;box-sizing:border-box}
 #filesView>#workspace>.content-table.grid-mode>.content-head{margin:0 0 8px;padding:0 4px;border-radius:6px;min-width:0;box-sizing:border-box}
 #filesView>#workspace .grid-mode .content-rows{width:100%;min-width:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
 #filesView>#workspace .grid-mode .content-row{min-width:0;max-width:100%;box-sizing:border-box}
}
/* Mobile identity stays readable; the workspace gets the footer space back. */
@media(max-width:640px){
 .site-footer{display:none}
 #app>header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 8px;padding:6px 10px}
 #app>header .brand{display:inline-flex;align-items:center;justify-content:flex-start;flex:0 0 auto;width:auto;max-width:100%;height:36px;padding:4px 8px;gap:6px;font-size:15px;line-height:1;white-space:nowrap;border:1px solid #343645;border-radius:10px;background:#ffe58b;box-shadow:1px 1px 0 #343645}
 #app>header .brand-icon{display:block;width:24px;height:24px;min-width:24px;flex:0 0 24px;object-fit:contain;aspect-ratio:1}
 #app>header .header-session-area{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px;flex:1 1 auto;min-width:0;margin-left:0}
 #app>header #who{display:block;min-width:0;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.4;padding:4px 6px;margin:0}
 #app>header .language-switcher.in-header{flex:none;margin:0;padding:2px;gap:1px}
 #app>header .language-switcher.in-header button{min-width:30px;min-height:27px;padding:3px 5px;font-size:10px;line-height:1.2}
 #app>header #logout{display:inline-flex;align-items:center;justify-content:center;width:32px;min-width:32px;height:34px;min-height:34px;padding:0;line-height:1;flex:none}
}
@media(max-width:374px){
 #app>header .header-session-area{display:grid;grid-template-columns:minmax(0,1fr) 32px;gap:3px;flex:1 1 140px}
 #app>header .language-switcher.in-header{grid-column:1;grid-row:1;justify-self:end}
 #app>header #who{grid-column:1;grid-row:2;max-width:100%;padding:0 3px;font-size:10px}
 #app>header #logout{grid-column:2;grid-row:1/3}
}
/* The welcome screen keeps its original playful background and full footer. */
body:has(#login:not([hidden])){
 background:radial-gradient(circle at 12% 18%,rgba(98,199,255,.22) 0 72px,transparent 73px),radial-gradient(circle at 88% 12%,rgba(255,143,177,.18) 0 88px,transparent 89px),radial-gradient(circle at 82% 86%,rgba(99,215,166,.18) 0 110px,transparent 111px),linear-gradient(135deg,#fff9eb 0%,#fffdf7 52%,#f7fbff 100%);
 background-attachment:fixed;
}
body:has(#login:not([hidden])) .login-card{width:min(380px,100%);gap:16px;border:1px solid #dedee5;border-radius:20px;background:rgba(255,254,251,.96);box-shadow:0 10px 32px rgba(52,54,69,.07);padding:28px}
body:has(#login:not([hidden])) .login-card::before,body:has(#login:not([hidden])) .login-card::after{display:none}
body:has(#login:not([hidden])) .login-icon{width:88px;height:88px;margin:0 auto;filter:none;transform:none}
body:has(#login:not([hidden])) .login-card h1{font-size:30px;line-height:1.15;letter-spacing:-.5px}
body:has(#login:not([hidden])) .login-card p{margin:-8px 0 8px;font-size:13px;font-weight:500;line-height:1.5}
body:has(#login:not([hidden])) .login-card label{font-size:13px;font-weight:600;gap:6px}
body:has(#login:not([hidden])) .login-card input{min-height:44px;padding:10px 12px;border:1px solid #cfd1db;border-radius:10px;box-shadow:none}
body:has(#login:not([hidden])) .login-card input:focus{border-color:#62b6e8;box-shadow:0 0 0 3px #dff2ff;transform:none}
body:has(#login:not([hidden])) .login-card .primary{min-height:44px;font-size:14px;border:1px solid #343645;border-radius:10px;box-shadow:0 2px 0 #343645}
body:has(#login:not([hidden]))>.site-footer{display:flex;min-height:80px;margin:0;padding:16px clamp(18px,4vw,56px);gap:10px 24px;font-size:13px;color:var(--muted);background:transparent;border:0;box-shadow:none}
body:has(#app:not([hidden]))>.site-footer{display:flex;justify-content:center;background:transparent;border:0;box-shadow:none}
@media(max-width:640px){body:has(#app:not([hidden]))>.site-footer{display:none}}
@media(max-width:640px){
 body:has(#login:not([hidden])){background-attachment:scroll}
 body:has(#login:not([hidden])) .login-card{padding:24px 20px;border-radius:18px}
 body:has(#login:not([hidden]))>.site-footer{display:flex;flex-direction:column;min-height:90px;padding:12px 14px;gap:5px;font-size:11px}
 body:has(#login:not([hidden])) .site-footer-links{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 12px}
}
body:has(#login:not([hidden])){display:flex;flex-direction:column;min-height:100dvh;height:auto;overflow:auto}
body:has(#login:not([hidden]))>#login{flex:1}
body:has(#login:not([hidden]))>.site-footer{flex:none}

/* Shared file header and compact mobile controls. */
.file-search{align-items:center}
.file-search input{height:100%;min-height:0;line-height:normal;padding:0 4px;margin:0;align-self:stretch;box-shadow:none;transform:none}
.file-search-icon,.file-search-clear{display:flex;align-items:center;justify-content:center;line-height:1;align-self:center}
.file-search-icon{font-size:0}
.file-search-icon::before{content:"";width:14px;height:14px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
#filesView .content-table .content-head{background:#fff9e8;border-bottom:1px solid #e5e1d6;color:var(--ink);border-radius:8px 8px 0 0}
.mobile-sort-control{display:none}
@keyframes welcomeDrift{0%,100%{background-position:0% 0%,100% 0%,100% 100%,center}50%{background-position:12% 8%,88% 12%,90% 88%,center}}
body:has(#login:not([hidden])){background-size:115% 115%,115% 115%,115% 115%,100% 100%;animation:welcomeDrift 32s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){body:has(#login:not([hidden])){animation:none}}
@media(max-width:640px){
 #filesView .content-head>#sortModified{display:none!important}
 #filesView .content-head>.mobile-sort-control{display:block!important;grid-column:2;min-width:0;margin-left:auto}
 .mobile-sort-control select{width:136px;max-width:100%;min-height:32px;padding:4px 20px 4px 6px;font-size:11px;border:0;border-radius:6px;background:transparent;box-shadow:none;line-height:1.3}
 #filesView .content-table .content-head{gap:6px;padding:2px 8px;min-height:38px}
 #filesView .content-table.grid-mode .content-head{padding:2px 8px}
}

/* Keep mobile filters inside the viewport with their own horizontal scroll. */
@media(max-width:640px){
 #filesView>.workspace-controls{grid-template-columns:minmax(0,1fr);width:100%;max-width:100%;min-width:0}
 #workspaceFilters{width:100%;max-width:100%;min-width:0;box-sizing:border-box;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;scrollbar-width:thin;scrollbar-color:#adb7c4 transparent;padding:2px 1px 7px}
 #workspaceFilters>*{flex:0 0 auto}
 #workspaceFilters::-webkit-scrollbar{height:4px}
 #workspaceFilters::-webkit-scrollbar-thumb{background:#adb7c4;border-radius:4px}
}

/* Random pastel bubbles stay behind the welcome content. */
body:has(#login:not([hidden])){background:linear-gradient(135deg,#fff9eb 0%,#fffdf7 52%,#f7fbff 100%);animation:none}
.welcome-bubbles{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:0}
body:has(#login:not([hidden]))>#login{position:relative;z-index:1}
.welcome-bubble{position:absolute;display:block;border-radius:50%;opacity:0;animation:welcomeBubbleLife var(--bubble-duration) ease-in-out forwards;will-change:transform,opacity}
@keyframes welcomeBubbleLife{0%{opacity:0;transform:translate(0,0) scale(.8)}20%{opacity:.24}70%{opacity:.22}100%{opacity:0;transform:translate(var(--bubble-x),var(--bubble-y)) scale(1.12)}}
@media(prefers-reduced-motion:reduce){.welcome-bubble{animation:none;opacity:.2;will-change:auto}}

.audio-playlist-controls{display:flex;align-items:center;gap:8px;padding:12px 20px 0;min-width:0}
.audio-playlist-controls select{flex:1;min-width:0;font-size:13px;box-shadow:none}
.audio-playlist-controls button{flex:none;width:42px;padding:6px;box-shadow:none}
.audio-dock{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);z-index:40;display:flex;align-items:center;gap:6px;width:min(480px,calc(100% - 24px));padding:8px;border:1px solid #d5d9e3;border-radius:14px;background:#fffefb;box-shadow:0 6px 24px #34364526}
.audio-dock button{border:0;background:transparent;color:var(--ink);min-width:36px;min-height:36px;border-radius:8px;flex:none}
.audio-dock button:hover{background:#e7f3fc}
#audioDockOpen{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-size:13px;padding:0 8px}
@media(max-width:640px){.audio-dock{bottom:calc(64px + env(safe-area-inset-bottom))}.audio-player-actions{flex-wrap:wrap}.audio-playlist-controls{padding:10px 12px 0}}

.audio-art-preview{position:relative;display:grid;place-items:center;width:100%;height:100%;min-height:100px;overflow:hidden;background:linear-gradient(135deg,#e2f3fc,#eee6fa);border-radius:10px}
.audio-art-preview img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#f2f3f6}
.audio-art-fallback{font-size:56px;color:#9298b7}
.audio-art-preview.has-art .audio-art-fallback{visibility:hidden}
.audio-player-artwork{width:180px;height:180px;margin:18px auto 2px}
.audio-player-artwork .audio-art-preview{border:1px solid #dde1e9}
.grid-mode .grid-file-preview .audio-art-preview{min-height:0}
@media(max-width:640px){.audio-player-artwork{width:140px;height:140px;margin-top:12px}}

.audio-queue-edit{display:flex;flex-wrap:wrap;gap:6px;padding:10px 20px}
.audio-queue-edit button{font-size:12px;min-height:34px;padding:5px 9px;box-shadow:none;border-width:1px}
@media(max-width:640px){.audio-queue-edit{padding:8px 12px}.audio-queue-edit button{flex:1 1 auto;font-size:11px}}

/* Keep the transfer indicator available on mobile and preserve reduced motion. */
#who{display:inline-flex;align-items:center;gap:6px;cursor:pointer;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#who.has-transfers::before{content:"";width:8px;height:8px;border-radius:50%;background:#12a66a;flex:none;animation:transfer-user-pulse 1.4s ease-in-out infinite}
@keyframes transfer-user-pulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(18,166,106,.4)}50%{opacity:.4;box-shadow:0 0 0 5px rgba(18,166,106,0)}}
@media(max-width:600px){#who{display:inline-flex;max-width:95px;font-size:11px;padding:5px 7px}#openTransferJobs{display:none}}
@media(prefers-reduced-motion:reduce){#who.has-transfers::before{animation:none}}

/* Keep the transfer indicator inside the mobile account button. */
@media(max-width:600px){
 #app>header #who{display:inline-flex;align-items:center;gap:7px;min-height:36px;min-width:38px;max-width:120px;padding:6px 10px;overflow:hidden;line-height:1.4}
 #app>header #who.has-transfers::before{display:block;width:9px;height:9px;min-width:9px;margin:0 2px;box-shadow:0 0 0 4px rgba(18,166,106,.14)}
}

/* Moving stripes show activity without advancing the measured percentage. */
.transfer-job-card progress[data-active="true"]::-webkit-progress-value{
 background:repeating-linear-gradient(110deg,transparent 0 12px,rgba(255,255,255,.38) 12px 22px,transparent 22px 32px),linear-gradient(180deg,#baf1d1 0 28%,var(--green) 28% 100%);
 background-size:68px 100%,100% 100%;
 animation:transfer-active-stripes 1.8s linear infinite;
}
.transfer-job-card progress[data-active="true"]::-moz-progress-bar{
 background:repeating-linear-gradient(110deg,transparent 0 12px,rgba(255,255,255,.38) 12px 22px,transparent 22px 32px),linear-gradient(180deg,#baf1d1 0 28%,var(--green) 28% 100%);
 background-size:68px 100%,100% 100%;
 animation:transfer-active-stripes 1.8s linear infinite;
}
.transfer-job-card progress[data-active="true"]::-webkit-progress-bar{
 background:repeating-linear-gradient(110deg,#fff8e7 0 12px,#f4eddb 12px 22px,#fff8e7 22px 32px);
 background-size:68px 100%;
 animation:transfer-active-stripes 1.8s linear infinite;
}
@keyframes transfer-active-stripes{from{background-position:0 0,0 0}to{background-position:68px 0,0 0}}
@media(prefers-reduced-motion:reduce){
 .transfer-job-card progress[data-active="true"]::-webkit-progress-value,
 .transfer-job-card progress[data-active="true"]::-webkit-progress-bar,
 .transfer-job-card progress[data-active="true"]::-moz-progress-bar{animation:none}
}
/* Animate the host as well: native progress parts inherit its moving offset. */
.transfer-job-card progress[data-active="true"]{animation:transfer-active-stripes 1.8s linear infinite}
.transfer-job-card progress[data-active="true"]::-webkit-progress-bar,
.transfer-job-card progress[data-active="true"]::-webkit-progress-value,
.transfer-job-card progress[data-active="true"]::-moz-progress-bar{background-position:inherit}
@media(prefers-reduced-motion:reduce){.transfer-job-card progress[data-active="true"]{animation:none}}

/* Lightweight video overlays; scoped to stay above shared dialog styles. */
.video-player-dialog .video-player-head{position:absolute;z-index:8;inset:0 0 auto;display:flex;padding:14px 18px 24px;border:0;background:linear-gradient(rgba(20,22,31,.64),rgba(20,22,31,.22) 75%,transparent);color:#fff;transition:opacity .18s ease,transform .18s ease;text-shadow:0 1px 3px #0008}
.video-player-dialog .video-player-head h3{font-size:20px;color:#fff}
.video-player-dialog .video-player-status{color:#ffffffc7;font-weight:600}
.video-player-dialog .video-player-actions .ghost{min-height:36px;padding:7px 12px;border:1.5px solid #ffffff8c;border-radius:13px;background:#ffffff18;color:#fff;box-shadow:0 2px 0 #0003;text-shadow:0 1px 2px #0005}
.video-player-dialog .video-player-actions .ghost:hover{background:#ffffff30;transform:none}
.video-player-dialog .video-player-actions #closeVideoPlayer{width:38px;padding:4px;font-size:22px}
.video-player-shell.video-player-ui-hidden .video-player-head{opacity:0;transform:translateY(-110%);pointer-events:none}
.video-player-dialog .video-player-control-row{gap:8px;flex-wrap:nowrap}
.video-player-dialog .video-player-control-left,.video-player-dialog .video-player-control-right{gap:6px;padding:4px 9px;border:1px solid #ffffff12;border-radius:999px;background:#20232a66}
.video-player-dialog .video-player-control-button{width:36px;height:36px;min-height:36px;background:transparent;color:#fff;border:0;box-shadow:none}
.video-player-dialog .video-player-control-button:hover{background:#ffffff26}
.video-player-icon{display:block;width:24px;height:24px;filter:drop-shadow(0 1px 1px #0005);pointer-events:none}
.video-player-control-button .icon-pause,.video-player-control-button .icon-collapse,.video-player-control-button .icon-volume-muted{display:none}
.video-player-control-button[data-paused="false"] .icon-play,.video-player-control-button[data-fullscreen="true"] .icon-expand,.video-player-control-button[data-muted="true"] .icon-volume-waves{display:none}
.video-player-control-button[data-paused="false"] .icon-pause,.video-player-control-button[data-fullscreen="true"] .icon-collapse,.video-player-control-button[data-muted="true"] .icon-volume-muted{display:block}
.video-player-dialog .video-player-time{padding:0 4px;font-weight:600;text-shadow:0 1px 2px #0008}
.video-player-dialog .video-player-rate{padding-left:4px}
@media(max-width:720px){.video-player-dialog .video-player-head{padding:10px 12px 22px;gap:8px}.video-player-dialog .video-player-head h3{font-size:15px}.video-player-dialog .video-player-control-left,.video-player-dialog .video-player-control-right{padding:3px 5px;gap:3px}}
@media(max-width:480px){.video-player-dialog .video-player-control-button{width:32px;height:32px;min-height:32px}.video-player-icon{width:22px;height:22px}.video-player-dialog .video-player-control-left,.video-player-dialog .video-player-control-right{gap:1px}.video-player-dialog .video-player-time{font-size:10px}.video-player-dialog .video-player-rate{min-width:46px;font-size:9px}}

/* Shared glass treatment for image and video viewing. */
.image-preview-dialog{background:#101218;backdrop-filter:none;-webkit-backdrop-filter:none}
.image-preview-dialog .image-preview-shell{position:relative;background:#101218;height:min(860px,94vh)}
.image-preview-dialog .image-preview-head{position:absolute;inset:0 0 auto;z-index:6;gap:12px;margin:0;padding:14px 16px 28px;border:0;background:linear-gradient(#14161fa8,#14161f38 75%,transparent);color:#fff;text-shadow:0 1px 3px #0008}
.image-preview-dialog .image-preview-head h3{color:#fff;font-size:20px}
.image-preview-dialog .image-preview-counter{color:#ffffffc7}
.image-preview-dialog .image-preview-actions .ghost{background:#ffffff18;color:#fff;border:1.5px solid #ffffff8c;border-radius:13px;box-shadow:0 2px 0 #0003;min-height:36px}
.image-preview-dialog .image-preview-stage{background:#101218;padding:78px 64px 16px;backdrop-filter:none;-webkit-backdrop-filter:none}
.image-preview-dialog .image-preview-img,.image-preview-dialog .image-editor-canvas{max-height:calc(94vh - 170px);border-radius:4px;box-shadow:none}
.image-preview-dialog .image-preview-nav{border:1px solid #ffffff40;background:#20232a99;color:#fff;box-shadow:none;border-radius:999px;width:40px;height:48px;backdrop-filter:none}
.image-preview-dialog .image-editor-toolbar{border:0;background:#20232a;color:#fff;padding:9px 12px;gap:6px}
.image-preview-dialog .image-editor-tool{background:#ffffff0d;color:#fff;border:1px solid #ffffff30;border-radius:999px;box-shadow:none;font-weight:600}
.image-preview-dialog .image-editor-tool:hover,.image-preview-dialog .image-editor-tool.active{background:#ffffff26;border-color:#ffffff80}
.image-preview-dialog .image-editor-color-wrap,.image-preview-dialog .image-editor-brush-wrap{background:#ffffff0d;border:1px solid #ffffff30;color:#ffffffcf;border-radius:999px}
.image-preview-dialog .image-editor-brush-wrap output,.image-preview-dialog .image-editor-zoom span{color:#fff}
.image-export-panel{position:absolute;z-index:7;right:12px;bottom:64px;display:flex;flex-wrap:wrap;gap:12px;align-items:end;width:min(530px,calc(100% - 24px));max-height:65vh;overflow:auto;padding:16px;border:1px solid #ffffff40;border-radius:16px;background:#1b1d24f5;color:#fff;box-shadow:0 8px 28px #0006}
.image-export-panel[hidden]{display:none}
.image-export-panel label{display:grid;gap:6px;flex:1 1 140px;color:#fff;font-size:12px}
.image-preview-dialog .image-export-panel input,.image-preview-dialog .image-export-panel select{width:100%;min-height:38px;padding:6px 9px;background:#30323a;color:#fff;border:1px solid #ffffff50;border-radius:8px;box-shadow:none;color-scheme:dark}
.image-preview-dialog .image-export-panel input:focus,.image-preview-dialog .image-export-panel select:focus{background:#30323a;color:#fff;outline:2px solid #8ab4f8}
.image-export-panel small{flex-basis:100%;font-size:11px;color:#ffffffb3}
@media(max-width:800px){.image-preview-dialog .image-preview-head{padding:10px 12px 22px}.image-preview-dialog .image-preview-head h3{font-size:15px}.image-preview-dialog .image-preview-stage{padding:68px 42px 12px}.image-preview-dialog .image-preview-nav{width:30px;height:42px}.image-preview-dialog .image-editor-tool{font-size:11px}}

.image-preview-dialog .image-editor-tool{display:inline-flex;align-items:center;justify-content:center;gap:6px}.image-editor-icon{width:18px;height:18px;flex:none;pointer-events:none}

.image-preview-dialog .image-preview-stage{touch-action:none;overflow:hidden;user-select:none;-webkit-user-select:none}.image-preview-dialog .image-preview-viewport{transition:none}.image-preview-dialog .image-preview-img{-webkit-user-drag:none;user-select:none}.image-preview-dialog .image-is-zoomed{cursor:grab}.image-preview-dialog .image-is-zoomed:active{cursor:grabbing}

/* Add uses a label on desktop and a compact icon on mobile. */
.toolbar>div.toolbar-actions:last-child #newFolder{width:auto;max-width:none;min-width:76px;padding:8px 12px;gap:6px;font-size:14px}
#newFolder .action-label{display:inline}
#newFolder::before{content:none}
#contextMenu{max-height:calc(100dvh - 20px);overflow-y:auto;overscroll-behavior:contain}
@media(max-width:720px){.toolbar>div.toolbar-actions:last-child #newFolder{width:40px;min-width:40px;max-width:40px;height:40px;min-height:40px;padding:0;gap:0;font-size:0}#newFolder .action-label{display:none}#newFolder .action-icon{width:20px;height:20px;flex-basis:20px}#newFolder::before{content:none}}

/* Friendly outlined icons match the Files and Trash characters. */
.nav:nth-child(2)::before,.nav:nth-child(3)::before{content:none}
#contextMenu>button{display:flex;align-items:center;gap:10px}
#contextMenu>button[hidden]{display:none}
#contextMenu>button::before{content:"";display:block;width:24px;height:24px;flex:0 0 24px;background:var(--cartoon-menu-icon) center/contain no-repeat}
#ctxNewFolder{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%208V5q0-2%202-2h5l3%203h6q2%200%202%202v11q0%202-2%202H5q-2%200-2-2V8h18%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxNewText{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6q-2%200-2%202v16q0%202%202%202h12q2%200%202-2V8l-6-6v6h6%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxNewRemoteShell{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%2220%22%20height%3D%2216%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M2%208h20M6%2012l3%202-3%202m6%200h5%22%2F%3E%3Ccircle%20cx%3D%225%22%20cy%3D%226%22%20r%3D%22.5%22%2F%3E%3C%2Fsvg%3E")}
#ctxOpenShell{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%2220%22%20height%3D%2216%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M2%208h20M6%2012l3%202-3%202m6%200h5%22%2F%3E%3Ccircle%20cx%3D%225%22%20cy%3D%226%22%20r%3D%22.5%22%2F%3E%3C%2Fsvg%3E")}
#ctxMountOneDrive{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%2019a5%205%200%200%201-1-10%207%207%200%200%201%2013-2%206%206%200%200%201%200%2012Z%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxMountGoogleDrive{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%2019a5%205%200%200%201-1-10%207%207%200%200%201%2013-2%206%206%200%200%201%200%2012Z%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3Cpath%20d%3D%22m11%203%202%202%22%2F%3E%3C%2Fsvg%3E")}
#ctxMountRemote{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%202v5m8-5v5M5%207h14v5q0%206-7%206t-7-6Zm7%2011v4%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxUpload{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2014V2M7%207l5-5%205%205M3%2012v8q0%202%202%202h14q2%200%202-2v-8M8%2017h.01M16%2017h.01M10%2019q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxDownload{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%202v12M7%209l5%205%205-5M3%2012v8q0%202%202%202h14q2%200%202-2v-8M8%2017h.01M16%2017h.01M10%2019q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxTrash{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%205h18M9%205V2h6v3M5%205l1%2015q0%202%202%202h8q2%200%202-2l1-15%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxPermission{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%2210%22%20width%3D%2216%22%20height%3D%2212%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M7%2010V7a5%205%200%200%201%2010%200v3%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxEncrypt{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%2210%22%20width%3D%2216%22%20height%3D%2212%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M7%2010V7a5%205%200%200%201%2010%200v3%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxOpenFolderWindow{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%208V5q0-2%202-2h5l3%203h6q2%200%202%202v11q0%202-2%202H5q-2%200-2-2V8h18%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxCopy{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%227%22%20y%3D%227%22%20width%3D%2215%22%20height%3D%2215%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22M17%204V2H2v15h2%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxMove{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2012h16m-5-5%205%205-5%205M9%207l-5%205%205%205%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%223%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%223%22%20r%3D%221%22%2F%3E%3C%2Fsvg%3E")}
#ctxRename{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m4%2016%2012-12q2-2%204%200t0%204L8%2020H4Zm10-10%204%204M5%2016l3%203%22%2F%3E%3C%2Fsvg%3E")}
#ctxShare{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%225%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%2219%22%20cy%3D%225%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%2219%22%20cy%3D%2219%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22m8%2010%208-4m-8%208%208%204%22%2F%3E%3C%2Fsvg%3E")}
#ctxInfo{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22M12%2011v6M11%207h2%22%2F%3E%3C%2Fsvg%3E")}
#ctxColor{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2015c-5-2-4%205-7%207C1%2023-3%207%207%203c11-5%2020%207%2013%2012Z%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%228%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%2214%22%20cy%3D%226%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%2210%22%20r%3D%221%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxPaste{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6q-2%200-2%202v16q0%202%202%202h12q2%200%202-2V8l-6-6v6h6%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxUnmountRemote{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m5%2013%207-9%207%209ZM4%2019h16%22%2F%3E%3C%2Fsvg%3E")}
#ctxAddAudio{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10%2017V4l10-2v13M10%207l10-2%22%2F%3E%3Cellipse%20cx%3D%226%22%20cy%3D%2218%22%20rx%3D%224%22%20ry%3D%223%22%2F%3E%3Cellipse%20cx%3D%2216%22%20cy%3D%2216%22%20rx%3D%224%22%20ry%3D%223%22%2F%3E%3C%2Fsvg%3E")}
#ctxPlayAudio{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22m10%207%207%205-7%205Z%22%2F%3E%3C%2Fsvg%3E")}
#ctxPlayVideo{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%223%22%20width%3D%2220%22%20height%3D%2218%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22m10%208%206%204-6%204ZM2%207h20M6%203v4m6-4v4m6-4v4%22%2F%3E%3C%2Fsvg%3E")}
#ctxDocumentPreview{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6q-2%200-2%202v16q0%202%202%202h12q2%200%202-2V8l-6-6v6h6%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxOpenWith{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6q-2%200-2%202v16q0%202%202%202h12q2%200%202-2V8l-6-6v6h6%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxExtract{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%208V5q0-2%202-2h5l3%203h6q2%200%202%202v11q0%202-2%202H5q-2%200-2-2V8h18%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxArchivePreview{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%208V5q0-2%202-2h5l3%203h6q2%200%202%202v11q0%202-2%202H5q-2%200-2-2V8h18%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}
#ctxArchive{--cartoon-menu-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%232f3142%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%208V5q0-2%202-2h5l3%203h6q2%200%202%202v11q0%202-2%202H5q-2%200-2-2V8h18%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%2213%22%20r%3D%22.65%22%20fill%3D%22currentColor%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M10%2016q2%202%204%200%22%2F%3E%3C%2Fsvg%3E")}

.video-player-dialog .video-player-aspect{width:auto;min-width:44px;padding:0 6px;border-radius:8px;font-size:10px;font-weight:800;white-space:nowrap}

/* VR renders the existing video into two eye viewports; playback/audio stay shared. */
.video-player-vr-canvas{position:absolute;inset:0;width:100%;height:100%;z-index:3;touch-action:none;cursor:grab;background:#000}
.video-player-vr-canvas:active{cursor:grabbing}
.video-player-vr-active .video-player-edge{display:none}
.video-player-vr-active .video-player-control{opacity:0;pointer-events:none}
.video-player-dialog .video-player-vr-button{font-size:12px;font-weight:900}
.video-player-dialog .video-player-vr-button[aria-pressed="true"]{background:#ffffff30;outline:1px solid #ffffff80}
.video-player-vr-hint{font-size:11px;line-height:1.5;color:#ffffffb3;margin:6px 0}
.video-player-vr-actions{display:flex;gap:8px;margin:8px 0}
.video-player-dialog .video-player-vr-actions button{flex:1;min-height:36px;padding:6px;border:1px solid #ffffff40;border-radius:8px;background:#30323a;color:#fff;font-size:11px;box-shadow:none}
.video-player-vr-actions button[aria-pressed="true"]{outline:1px solid #8ab4f8}
@media(max-width:620px){.video-player-dialog:has(.video-player-vr-button) .video-player-rate{display:none}.video-player-dialog .video-player-control-right{gap:2px;padding:3px}.video-player-dialog .video-player-aspect{font-size:9px;padding:0 3px}}
@media(max-width:620px){.video-player-dialog .video-player-settings-wrap{position:static}.video-player-dialog .video-player-settings{right:8px;bottom:calc(100% + 8px);width:min(300px,calc(100vw - 36px))}}
