:root{
  --accent:#0a6cff;
  --mb:24px;
  --dz:54px;
  --ui:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;background:#fff;color:#1d1d1f;
  font:13px/1.3 var(--ui);-webkit-font-smoothing:antialiased;
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit}

#desktop{position:fixed;inset:0;overflow:hidden;background:#fff no-repeat center / contain}

/* ---------- menu bar ---------- */
#menubar{position:fixed;inset:0 0 auto 0;height:var(--mb);display:flex;justify-content:space-between;align-items:center;
  padding:0 6px;background:rgba(255,255,255,.62);-webkit-backdrop-filter:blur(30px) saturate(1.8);backdrop-filter:blur(30px) saturate(1.8);
  z-index:100000;color:#000}
#menu-left,#menu-right{display:flex;align-items:center;height:100%}
.mt{height:20px;padding:0 9px;border:0;border-radius:5px;background:none;display:flex;align-items:center;cursor:default}
.mt.bold{font-weight:700}
.mt.nomenu{pointer-events:none}
.mt:not(.nomenu):hover,.mt.open{background:rgba(0,0,0,.14)}
.mt svg{height:15px;width:auto;display:block;fill:currentColor}
#menu-right{gap:14px;padding-right:8px}
#menu-right .sb{display:flex;align-items:center}
#clock{white-space:nowrap}

.dropdown{position:fixed;top:var(--mb);min-width:230px;padding:5px;border-radius:8px;
  background:rgba(246,246,246,.88);-webkit-backdrop-filter:blur(30px) saturate(1.8);backdrop-filter:blur(30px) saturate(1.8);
  box-shadow:0 0 0 .5px rgba(0,0,0,.28),0 10px 30px rgba(0,0,0,.3);z-index:100001}
.mi{position:relative;display:flex;justify-content:space-between;gap:28px;padding:3px 10px 3px 20px;border-radius:5px;cursor:default;white-space:nowrap}
.mi:hover:not(.dis){background:var(--accent);color:#fff}
.mi.dis{color:rgba(0,0,0,.3)}
.mi.chk::before{content:"✓";position:absolute;left:6px}
.mi .sc{opacity:.55}
.msep{height:1px;margin:5px 8px;background:rgba(0,0,0,.14)}

/* ---------- items (desktop + finder) ---------- */
.it{display:flex;flex-direction:column;align-items:center;gap:4px;outline:none;cursor:default}
.it .glyph{width:64px;height:64px;display:flex;align-items:center;justify-content:center;border-radius:7px}
.it .glyph svg{width:100%;height:100%;display:block;filter:drop-shadow(0 2px 2px rgba(0,0,0,.28))}
.it .glyph img{max-width:100%;max-height:100%;display:block;border:3px solid #fff;border-radius:2px;
  box-shadow:0 0 0 .5px rgba(0,0,0,.25),0 2px 5px rgba(0,0,0,.4);-webkit-user-drag:none}
.it .label{max-width:92px;padding:1px 6px;border-radius:4px;text-align:center;font-size:12px;line-height:1.25;
  overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.it.sel .glyph{background:rgba(120,120,135,.3)}
.it.sel .label,.it:focus-visible .label{background:var(--accent);color:#fff;text-shadow:none}

.ditem{position:absolute;width:92px;touch-action:none;transform:rotate(var(--r,0deg))}
body.txt-dark .ditem .label{color:#111;text-shadow:0 0 2px #fff,0 0 4px #fff,0 0 8px rgba(255,255,255,.9)}
body.txt-light .ditem .label{color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.85)}
body .ditem.sel .label,body .ditem:focus-visible .label{color:#fff;text-shadow:none}

/* ---------- windows ---------- */
.win{position:absolute;display:flex;flex-direction:column;background:#fff;border-radius:11px;overflow:hidden;
  min-width:240px;min-height:120px;animation:pop .16s ease-out;
  box-shadow:0 0 0 .5px rgba(0,0,0,.28),0 10px 28px rgba(0,0,0,.22)}
.win.active{box-shadow:0 0 0 .5px rgba(0,0,0,.38),0 24px 64px rgba(0,0,0,.38)}
.win.max{border-radius:0}
@keyframes pop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}

.titlebar{height:52px;flex:none;display:flex;align-items:center;gap:6px;padding:0 12px;background:#f6f6f6;
  border-bottom:1px solid rgba(0,0,0,.14);touch-action:none;cursor:default}
.win.slim .titlebar{height:28px;padding:0 10px}
.win.safari .titlebar{height:40px}
.win:not(.active) .titlebar{background:#f0f0f0}
.win:not(.active) .wtitle,.win:not(.active) .tb,.win:not(.active) .seg{opacity:.55}
.center{flex:1;min-width:0;display:flex;justify-content:center}
.spacer{width:60px;flex:none}
.wtitle{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.lights{display:flex;gap:8px;margin-right:8px;flex:none}
.light{position:relative;width:12px;height:12px;padding:0;border-radius:50%;border:.5px solid rgba(0,0,0,.22);display:grid;place-items:center;cursor:default}
.light::after{content:"";position:absolute;inset:-5px -3px}
.light svg{width:8px;height:8px;opacity:0;stroke:rgba(0,0,0,.6);fill:rgba(0,0,0,.55);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
.lights:hover .light svg{opacity:1}
.light.close{background:#ff5f57}.light.min{background:#febc2e}.light.zoom{background:#28c840}
.light:disabled{background:#d4d4d4!important}
.light:disabled svg{display:none}
.win:not(.active) .lights:not(:hover) .light{background:#d4d4d4;border-color:rgba(0,0,0,.12)}

.body{flex:1;min-height:0;position:relative;overflow:auto;background:#fff}
.body.fill{overflow:hidden}
.body>.fbody,.body>.preview{height:100%}
.body iframe,.body video{display:block;width:100%;height:100%;border:0;background:#fff}
.body video{background:#000;object-fit:contain}
.foot{flex:none;display:flex;justify-content:flex-end;gap:16px;padding:4px 14px;border-top:1px solid rgba(0,0,0,.12);background:#f6f6f6;font-size:11px}
.foot a{color:rgba(0,0,0,.65)}

.rz{position:absolute;z-index:3;touch-action:none}
.rz-n{top:0;left:10px;right:10px;height:5px;cursor:ns-resize}
.rz-s{bottom:0;left:10px;right:10px;height:5px;cursor:ns-resize}
.rz-e{right:0;top:10px;bottom:10px;width:5px;cursor:ew-resize}
.rz-w{left:0;top:10px;bottom:10px;width:5px;cursor:ew-resize}
.rz-ne{top:0;right:0;width:12px;height:12px;cursor:nesw-resize}
.rz-nw{top:0;left:0;width:12px;height:12px;cursor:nwse-resize}
.rz-se{bottom:0;right:0;width:12px;height:12px;cursor:nwse-resize}
.rz-sw{bottom:0;left:0;width:12px;height:12px;cursor:nesw-resize}
.win.max .rz{display:none}

/* ---------- finder ---------- */
.nav{display:flex;gap:0;flex:none}
.tb{width:30px;height:26px;padding:0;border:0;border-radius:6px;background:none;display:grid;place-items:center;color:#444}
.tb:hover:not(:disabled){background:rgba(0,0,0,.07)}
.tb:disabled{opacity:.3}
.tb svg,.seg svg,.search svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ftitle{flex:1;min-width:0;display:flex;align-items:center;gap:7px;margin-left:6px}
.ftitle .ico{width:18px;height:18px;flex:none}
.ftitle .ico svg{width:100%;height:100%;display:block}
.seg{display:flex;gap:2px;padding:2px;border-radius:6px;background:rgba(0,0,0,.06);flex:none}
.seg button{width:30px;height:22px;padding:0;border:0;border-radius:5px;background:none;display:grid;place-items:center;color:#555}
.seg button.on{background:#fff;color:#000;box-shadow:0 1px 2px rgba(0,0,0,.22)}
.search{display:flex;align-items:center;gap:5px;flex:none;width:150px;height:26px;padding:0 8px;border-radius:6px;background:rgba(0,0,0,.06);color:#777}
.search:focus-within{box-shadow:0 0 0 3px rgba(10,108,255,.35);background:#fff}
.search input{min-width:0;width:100%;border:0;outline:0;background:none;font:inherit;color:#000;-webkit-user-select:text;user-select:text}

.fbody{display:flex;min-height:0}
.side{width:164px;flex:none;padding:10px 8px;overflow:auto;background:#ececf0;border-right:1px solid rgba(0,0,0,.1)}
.side h6{margin:6px 8px 4px;font-size:11px;font-weight:600;color:rgba(0,0,0,.45)}
.sbi{display:flex;align-items:center;gap:7px;width:100%;height:26px;padding:0 8px;border:0;border-radius:6px;background:none;text-align:left}
.sbi svg{width:16px;height:16px;flex:none}
.sbi span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sbi.on{background:rgba(0,0,0,.1)}
.fcontent{flex:1;min-width:0;overflow:auto;background:#fff}
.pathbar{flex:none;height:24px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 10px;
  border-top:1px solid rgba(0,0,0,.1);background:#f6f6f6;font-size:11px;color:rgba(0,0,0,.6)}
.crumbs{display:flex;align-items:center;min-width:0;overflow:hidden;white-space:nowrap}
.crumb{display:inline-flex;align-items:center;gap:4px;padding:0 2px;border:0;background:none;color:inherit}
.crumb:hover{color:#000}
.crumb svg{width:14px;height:14px}
.crumbs .chev{opacity:.5;margin:0 2px}

.iconview{display:grid;grid-template-columns:repeat(auto-fill,96px);justify-content:start;align-content:start;gap:8px 2px;padding:16px 12px}
.iconview .it.sel .glyph{background:rgba(0,0,0,.1)}
.empty{grid-column:1/-1;padding:28px 12px;text-align:center;color:rgba(0,0,0,.4)}

.lhead,.lrow{display:grid;grid-template-columns:minmax(120px,1fr) 150px 80px;align-items:center;gap:8px;padding:0 12px;height:24px}
.lhead{position:sticky;top:0;background:#fff;border-bottom:1px solid rgba(0,0,0,.1);font-size:12px;color:rgba(0,0,0,.55);z-index:1}
.lrow:nth-child(even){background:#f5f5f7}
.lrow .nm{display:flex;align-items:center;gap:7px;min-width:0}
.lrow .nm svg{width:16px;height:16px;flex:none}
.lrow span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lrow .dim{color:rgba(0,0,0,.5)}
.lrow.sel{background:var(--accent)!important;color:#fff}
.lrow.sel .dim{color:rgba(255,255,255,.75)}

/* ---------- viewers ---------- */
.preview{display:flex;align-items:center;justify-content:center;background:#f2f2f2}
.preview img{max-width:100%;max-height:100%;display:block;object-fit:contain;-webkit-user-drag:none}
.pill{flex:1;max-width:440px;min-width:0;margin:0 auto;height:26px;padding:0 12px;border-radius:7px;background:rgba(0,0,0,.06);
  display:flex;align-items:center;justify-content:center;gap:6px;font-size:12px;color:#333;white-space:nowrap;overflow:hidden}
.pill span{overflow:hidden;text-overflow:ellipsis}

.doc{padding:22px 26px;-webkit-user-select:text;user-select:text}
.doc.md{font:16px/1.6 Georgia,"Times New Roman",serif;max-width:70ch}
.doc.md h1,.doc.md h2,.doc.md h3{font-family:var(--ui);line-height:1.15;margin:.2em 0 .5em}
.doc.md h1{font-size:1.9em}.doc.md h2{font-size:1.4em}.doc.md h3{font-size:1.1em}
.doc.md p,.doc.md ul{margin:0 0 1em}
.doc.md img{max-width:100%;display:block;margin:1em 0;border-radius:4px}
.doc.md code{background:#eee;padding:0 3px;border-radius:3px}
pre.txt{margin:0;padding:18px 22px;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.55 ui-monospace,Menlo,Consolas,monospace;
  -webkit-user-select:text;user-select:text}

.card{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;padding:22px}
.card .glyph{width:64px;height:64px;margin-bottom:6px}
.card .glyph svg,.card .glyph img{width:100%;height:100%;display:block;object-fit:cover;border-radius:12px}
.card .glyph svg{filter:drop-shadow(0 2px 2px rgba(0,0,0,.28));border-radius:0}
.card .h{font-size:15px;font-weight:600;overflow-wrap:anywhere}
.card .sub{color:rgba(0,0,0,.55);overflow-wrap:anywhere;max-width:34ch}
.card audio{width:100%;margin-top:6px}
.actions{margin-top:10px}
.btn{display:inline-block;padding:4px 16px;border-radius:6px;background:#fff;color:#000;text-decoration:none;
  border:.5px solid rgba(0,0,0,.25);box-shadow:0 1px 1px rgba(0,0,0,.12)}
.btn.pri{background:var(--accent);color:#fff;border-color:transparent}
.btn:active{filter:brightness(.92)}

/* ---------- dock ---------- */
#dock-wrap{position:fixed;left:0;right:0;bottom:6px;display:flex;justify-content:center;z-index:90000;pointer-events:none}
#dock{pointer-events:auto;display:flex;align-items:flex-end;gap:5px;padding:5px 7px 7px;border-radius:20px;
  background:rgba(255,255,255,.36);border:1px solid rgba(255,255,255,.55);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);backdrop-filter:blur(24px) saturate(1.8);
  box-shadow:0 8px 30px rgba(0,0,0,.28),inset 0 0 0 .5px rgba(0,0,0,.1)}
.di{position:relative;flex:none;width:var(--dz);height:var(--dz);cursor:default}
.di .dicon{width:100%;height:100%;transform-origin:50% 100%;transform:scale(var(--s,1));transition:transform .09s ease-out;
  filter:drop-shadow(0 3px 4px rgba(0,0,0,.3))}
.di .dicon svg,.di .dicon img{width:100%;height:100%;display:block;object-fit:contain}
.di .dicon img{border:2px solid #fff;border-radius:3px;object-fit:cover}
.di .dot{position:absolute;left:50%;bottom:-6px;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:rgba(0,0,0,.65);display:none}
.di.run .dot{display:block}
.di .tip{position:absolute;left:50%;bottom:calc(var(--dz) * 1.62 + 8px);transform:translateX(-50%);padding:3px 10px;border-radius:6px;
  background:rgba(240,240,242,.92);box-shadow:0 0 0 .5px rgba(0,0,0,.2),0 4px 12px rgba(0,0,0,.25);white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .12s;font-size:13px}
@media (hover:hover){.di:hover .tip{opacity:1}}
.dsep{flex:none;width:1px;height:calc(var(--dz) * .78);align-self:center;margin:0 3px 2px;background:rgba(0,0,0,.28)}
.di.bounce{animation:bounce .42s ease-in-out 2}
@keyframes bounce{50%{transform:translateY(-18px)}}

/* ---------- notification ---------- */
.toast{position:fixed;top:34px;right:12px;width:320px;max-width:calc(100vw - 24px);padding:10px 12px;border-radius:14px;z-index:95000;
  background:rgba(246,246,246,.82);-webkit-backdrop-filter:blur(30px) saturate(1.8);backdrop-filter:blur(30px) saturate(1.8);
  box-shadow:0 0 0 .5px rgba(0,0,0,.2),0 8px 26px rgba(0,0,0,.25);transition:opacity .5s,transform .5s;animation:slidein .4s ease-out}
.toast b{display:block;font-size:13px}
.toast span{color:rgba(0,0,0,.65);font-size:12.5px}
.toast.out{opacity:0;transform:translateX(30px)}
@keyframes slidein{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:none}}

body.dragging{cursor:grabbing}
body.dragging iframe,body.dragging video{pointer-events:none}

@media (max-width:700px){
  .mt:not(.apple):not(.appname){display:none}
  #menu-right .sb{display:none}
  .side,.search{display:none}
  .rz{display:none}
  .light{width:14px;height:14px}
  .lights{gap:9px}
  .lhead,.lrow{grid-template-columns:minmax(80px,1fr) 70px}
  .lhead span:nth-child(2),.lrow span:nth-child(2){display:none}
  .doc{padding:18px}
}
@media (prefers-reduced-motion:reduce){
  .win,.toast,.di.bounce{animation:none}
  .di .dicon{transition:none}
}
