/* BaroDrop v5 — Windows 11 File Explorer–style layout. Light/dark follow the OS setting. */
:root{
  --bg:#eef1f5;--surface:#ffffff;--surface-2:#f9f9f9;--surface-3:#f3f3f3;--border:#e5e5e5;--border-strong:#d1d1d1;
  --text:#1b1b1b;--text-2:#5c5c5c;--text-3:#767676;--accent:#005fb8;--accent-hover:#1a6fc2;--accent-text:#ffffff;
  --hover:rgba(0,0,0,.045);--pressed:rgba(0,0,0,.08);--selected:#e0eefa;--selected-border:#b3d4f0;--focus:#005fb8;
  --danger:#c42b1c;--danger-bg:#fdecea;--warn-bg:#fff4ce;--warn-border:#f2df9d;--warn-text:#6b5100;
  --folder:#f6c343;--folder-dark:#e2a92a;--ok:#0f7b0f;--shadow:0 8px 28px rgba(0,0,0,.14),0 0 0 1px rgba(0,0,0,.06);
  --radius:8px;--font:"Segoe UI Variable Text","Segoe UI",-apple-system,BlinkMacSystemFont,"Malgun Gothic","Apple SD Gothic Neo",sans-serif;
  color-scheme:light;font-family:var(--font);color:var(--text);background:var(--bg);font-synthesis:none;-webkit-text-size-adjust:100%;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#1c1c1c;--surface:#272727;--surface-2:#2b2b2b;--surface-3:#232323;--border:#3a3a3a;--border-strong:#4a4a4a;
  --text:#f0f0f0;--text-2:#c5c5c5;--text-3:#a0a0a0;--accent:#4cc2ff;--accent-hover:#6dcfff;--accent-text:#002033;
  --hover:rgba(255,255,255,.06);--pressed:rgba(255,255,255,.1);--selected:#0f3a5c;--selected-border:#1f5f8f;--focus:#4cc2ff;
  --danger:#ff99a4;--danger-bg:#442726;--warn-bg:#433519;--warn-border:#5e4a20;--warn-text:#f5d68a;--ok:#6ccb5f;--shadow:0 8px 28px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.08);color-scheme:dark;
}}
*{box-sizing:border-box}
body{margin:0;zoom:var(--ui-zoom,1);height:calc(100dvh / var(--ui-zoom,1));display:flex;flex-direction:column;font-size:13px;background:var(--bg)}
button,input{font:inherit;color:inherit}
button{border:0;cursor:pointer;background:transparent;border-radius:5px;white-space:nowrap}
button:disabled{opacity:.4;cursor:default}
:focus-visible{outline:2px solid var(--focus);outline-offset:1px}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
[hidden]{display:none!important}

/* ---------- header & connection strip ---------- */
header{height:50px;flex:none;display:flex;align-items:center;gap:18px;padding:0 16px;background:var(--surface);border-bottom:1px solid var(--border);z-index:5}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--text);font-weight:600;font-size:15px;white-space:nowrap}
.logo{background:var(--accent);color:var(--accent-text);border-radius:6px;width:24px;height:24px;display:grid;place-items:center;font-size:15px}
.header-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.primary{background:var(--accent);color:var(--accent-text);padding:7px 14px;font-size:12px;border-radius:5px}
.primary:hover:enabled{background:var(--accent-hover)}
.secondary{background:var(--surface-2);border:1px solid var(--border);padding:6px 12px;font-size:12px}
.secondary:hover:enabled{background:var(--hover)}
.text-button{padding:6px 4px;font-size:12px;color:var(--text-2)}
.text-button:hover{text-decoration:underline}
.nav{padding:4px 8px;color:var(--text-2);font-size:15px}
.status{display:flex;align-items:center;gap:7px;min-width:0;font-size:12px;color:var(--text-2)}
#statusDot{background:var(--border-strong);width:7px;height:7px;border-radius:50%;flex:none}
#statusDot.connected{background:var(--ok)}
#status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:360px}
.device-badge{font-size:11px;background:var(--surface-3);border:1px solid var(--border);border-radius:4px;padding:2px 7px;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
main{padding:10px 12px 0;min-height:0;flex:1;display:flex;flex-direction:column;gap:8px}
.device-strip{display:flex;align-items:center;gap:10px;min-height:32px;flex:none;max-height:76px;overflow:auto;padding:0 2px}
.device-strip>b{font-size:12px;font-weight:400;white-space:nowrap;color:var(--text-2)}
#trustedList{display:flex;align-items:center;gap:6px}
#trustedList>p{font-size:12px;margin:0;color:var(--text-3);white-space:nowrap}
.trusted-row{display:flex;align-items:center;gap:8px;border:1px solid var(--border);background:var(--surface);border-radius:6px;padding:4px 6px 4px 10px;font-size:12px;white-space:nowrap}
.trusted-row>span:first-child{max-width:140px;overflow:hidden;text-overflow:ellipsis}
.trusted-state{font-size:11px;color:var(--text-3)}
.trusted-row.current{border-color:var(--accent)}.trusted-row.current .trusted-state{color:var(--accent)}
.trusted-row button{font-size:11px;background:var(--surface-3);border:1px solid var(--border);padding:3px 8px}
.trusted-row button:hover:enabled{background:var(--hover)}
.trusted-row .forget{background:transparent;border-color:transparent;color:var(--text-3)}
.strip-note{font-size:11px;color:var(--text-3);max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:auto}
.notice{flex:none;margin:0;padding:7px 12px;font-size:12px;color:var(--warn-text);background:var(--warn-bg);border:1px solid var(--warn-border);border-radius:6px;line-height:1.55;max-height:56px;overflow:auto}

/* ---------- panes ---------- */
.explorers{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}
.pane{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;background:var(--surface);container-type:inline-size;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.pane.active-pane{border-color:var(--border-strong);box-shadow:0 0 0 1px var(--selected-border),0 1px 3px rgba(0,0,0,.06)}
.pane-title{display:flex;align-items:center;gap:8px;padding:6px 10px 2px;min-height:36px;background:var(--surface-3)}
.pane-title h2{font-size:13px;font-weight:600;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.title-icon{color:var(--accent)}
.pill{font-size:11px;color:var(--text-3);margin-left:auto;white-space:nowrap}
.icon-btn{display:inline-grid;place-items:center;width:32px;height:32px;padding:0;border-radius:5px;color:var(--text);flex:none}
.icon-btn.small{width:26px;height:26px;font-size:15px}
.icon-btn:hover:enabled,.cmd:hover:enabled,.crumb:hover,.tree-label:hover,.tree-child:hover,.sort:hover{background:var(--hover)}
.icon-btn:active:enabled,.cmd:active:enabled{background:var(--pressed)}
.navbar{display:flex;align-items:center;gap:2px;padding:4px 8px 6px;background:var(--surface-3);border-bottom:1px solid var(--border)}
.address{flex:1;min-width:0;display:flex;align-items:center;height:32px;margin-left:6px;background:var(--surface);border:1px solid var(--border);border-radius:5px;padding:0 2px 0 4px}
.address:focus-within{border-color:var(--accent);box-shadow:inset 0 -1px 0 var(--accent)}
.crumbs{flex:1;min-width:0;height:100%;display:flex;align-items:center;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;cursor:text;white-space:nowrap}
.crumbs::-webkit-scrollbar{display:none}
.crumbs:empty:before{content:'폴더를 선택해 주세요';color:var(--text-3);font-size:12px;padding-left:6px}
.crumb{flex:none;max-width:160px;overflow:hidden;text-overflow:ellipsis;padding:4px 6px;font-size:12px;border-radius:4px;cursor:pointer}
.crumb:last-child{font-weight:600}
.crumb-sep{flex:none;color:var(--text-3);font-size:13px;padding:0 1px}
.address-input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:12px;padding:0 6px;height:100%}
.search{display:flex;align-items:center;gap:6px;width:clamp(120px,28%,230px);height:32px;margin-left:6px;padding:0 8px;background:var(--surface);border:1px solid var(--border);border-radius:5px;color:var(--text-3)}
.search:focus-within{border-color:var(--accent);box-shadow:inset 0 -1px 0 var(--accent)}
.search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:12px;color:var(--text)}
.commandbar{display:flex;align-items:center;gap:2px;padding:4px 8px;border-bottom:1px solid var(--border);overflow-x:auto;scrollbar-width:none;min-height:42px}
.commandbar::-webkit-scrollbar{display:none}
.cmd{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;font-size:12px;border-radius:5px;flex:none}
.cmd.accent:enabled{color:var(--accent)}
.cmd.danger:enabled svg{color:var(--danger)}
.cmd.subtle{color:var(--text-2)}
.cmd-sep{width:1px;height:20px;background:var(--border);margin:0 6px;flex:none}
.folder-name{display:inline-flex;align-items:center;gap:6px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-2);font-size:12px;padding:0 4px}
.pane-hint{font-size:11px;color:var(--text-2);line-height:1.5;margin:0;padding:5px 12px;border-bottom:1px solid var(--border);background:var(--surface-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.browser-content{display:flex;flex:1;min-height:0;position:relative}

/* ---------- folder tree ---------- */
.folder-tree{width:190px;flex:none;background:var(--surface);border-right:1px solid var(--border);overflow:auto;padding:6px 4px}
.folder-tree:empty:before{content:'등록된 폴더 없음';display:block;text-align:center;font-size:12px;color:var(--text-3);margin:16px 0}
.pane.tree-toggled .folder-tree{display:none}
.tree-item{display:flex;align-items:center;border-radius:4px;position:relative}
.tree-item.active{background:var(--selected)}
.tree-item.active:before,.tree-child.active:before{content:'';position:absolute;left:0;top:25%;height:50%;width:3px;border-radius:2px;background:var(--accent)}
.tree-label{min-width:0;flex:1;display:flex;align-items:center;gap:6px;text-align:left;overflow:hidden;text-overflow:ellipsis;padding:6px 6px 6px 10px;font-size:12px;border-radius:4px}
.tree-label:before,.tree-child:before,.file-name.is-dir:before{content:'';flex:none;width:16px;height:12px;border-radius:2px 2px 2px 2px;background:linear-gradient(var(--folder-dark),var(--folder-dark)) 0 0/7px 3px no-repeat,linear-gradient(var(--folder),var(--folder)) 0 2px/100% 10px no-repeat}
.tree-child{position:relative;display:flex;align-items:center;gap:6px;font-size:12px;text-align:left;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 6px 6px calc(10px + var(--depth,1) * 12px);border-radius:4px}
.tree-child.active{background:var(--selected)}
.tree-child.active:before{position:static;width:16px;height:12px;background:linear-gradient(var(--folder-dark),var(--folder-dark)) 0 0/7px 3px no-repeat,linear-gradient(var(--folder),var(--folder)) 0 2px/100% 10px no-repeat;border-radius:2px}
.tree-indicator{font-size:10px;color:var(--text-3);padding:0 6px;flex:none}

/* ---------- file list ---------- */
.table-wrap{flex:1;overflow:auto;min-width:0;min-height:0;background:var(--surface)}
table{width:100%;border-collapse:collapse;table-layout:fixed;text-align:left}
th{position:sticky;top:0;z-index:1;background:var(--surface);padding:0;border-bottom:1px solid var(--border);font-weight:400}
th:first-child{width:44%}.col-date{width:25%}.col-type{width:16%}.col-size{width:15%}
th+th .sort{border-left:1px solid var(--border)}
.sort{width:100%;text-align:left;padding:8px 10px;font-size:12px;color:var(--text-2);border-radius:0;display:flex;align-items:center;gap:4px;overflow:hidden;text-overflow:ellipsis}
.sort.sorted{color:var(--text)}
.sort.sorted:after{content:'';margin-left:auto;width:0;height:0;border:4px solid transparent;border-bottom:5px solid var(--text-2);border-top:0}
.sort.sorted.desc:after{border-bottom:0;border-top:5px solid var(--text-2)}
td{padding:0 10px;height:30px;color:var(--text-2);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
td.col-size{text-align:right}
th.col-size .sort{justify-content:flex-end}
th.col-size .sort.sorted:after{margin-left:6px}
tbody tr:hover{background:var(--hover)}
tbody tr.chosen{background:var(--selected)}
td:first-child{color:var(--text)}
.file-name{display:flex;align-items:center;gap:8px;font-size:12px;text-align:left;padding:0;width:100%;height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:0}
.file-name .ft{flex:none;width:16px;height:16px;color:var(--text-3)}
.ft .ft-page{fill:var(--surface);stroke:currentColor;stroke-width:1;stroke-linejoin:round}.ft .ft-fold{fill:none;stroke:currentColor;stroke-width:1;stroke-linejoin:round}
.ft .ft-fill{fill:currentColor}.ft .ft-line{fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}
.ft .ft-knock{fill:none;stroke:var(--surface);stroke-width:.7;stroke-linecap:round;stroke-linejoin:round}
.file-name .ft.ft-image{color:#1f9d55}.file-name .ft.ft-video{color:#8e44c9}.file-name .ft.ft-audio{color:#d63f8c}.file-name .ft.ft-archive{color:#b07b00}
.file-name .ft.ft-pdf{color:#d93025}.file-name .ft.ft-doc{color:#2b6fd6}.file-name .ft.ft-sheet{color:#188038}.file-name .ft.ft-slide{color:#e8710a}
.file-name .ft.ft-code{color:#5b6b85}.file-name .ft.ft-app{color:#3d7ea6}
@media (prefers-color-scheme:dark){.file-name .ft.ft-image{color:#4cc38a}.file-name .ft.ft-video{color:#b48ae6}.file-name .ft.ft-audio{color:#f07ab4}.file-name .ft.ft-archive{color:#e0b341}.file-name .ft.ft-pdf{color:#ff7b72}.file-name .ft.ft-doc{color:#6ea8ff}.file-name .ft.ft-sheet{color:#5cc77f}.file-name .ft.ft-slide{color:#ffa657}.file-name .ft.ft-code{color:#9aa8bd}.file-name .ft.ft-app{color:#73b3d8}}
.chosen{background:var(--selected)}
.table-empty{text-align:center;padding:56px 16px;white-space:normal;line-height:1.8;font-size:12px;color:var(--text-3);height:auto}
tbody tr:has(.table-empty):hover{background:transparent}
.statusbar{height:28px;flex:none;display:flex;align-items:center;gap:8px;padding:0 12px;border-top:1px solid var(--border);font-size:11px;color:var(--text-2);background:var(--surface-3)}
.status-sep{width:1px;height:12px;background:var(--border-strong)}
.selected-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
.pager{display:flex;align-items:center;gap:2px;margin-left:auto}

/* ---------- context menu / dialogs ---------- */
.context-menu{position:fixed;z-index:200;min-width:210px;padding:4px;background:var(--surface);border-radius:8px;box-shadow:var(--shadow)}
.context-menu button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:7px 12px 7px 10px;font-size:12px;border-radius:4px}
.context-menu button:hover:enabled,.context-menu button:focus-visible{background:var(--hover);outline:0}
.context-menu hr{border:0;border-top:1px solid var(--border);margin:4px 2px}
.danger-text:enabled svg{color:var(--danger)}
dialog{border:0;border-radius:10px;box-shadow:var(--shadow);padding:20px;width:420px;max-width:calc(100vw - 28px);max-height:85dvh;overflow:auto;color:var(--text);background:var(--surface)}
dialog::backdrop{background:rgba(0,0,0,.3)}
#nameDialog{width:340px}
#nameDialog h2{font-size:15px;font-weight:600;margin:0 0 12px}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
#nameDialog .primary,#nameDialog .secondary{width:auto;min-width:80px}
.dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.dialog-heading h2{font-size:17px;font-weight:600;margin:0}
.tabs{display:flex;background:var(--surface-3);padding:3px;border-radius:6px;margin-bottom:15px}
.tabs button{flex:1;padding:8px;font-size:12px;color:var(--text-2)}
.tabs .active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.1)}
.muted{font-size:12px;line-height:1.7;color:var(--text-2)}
.shortcuts{border-top:1px solid var(--border);padding-top:8px}
dialog .primary,dialog .secondary{width:100%;text-align:center}
dialog form>.primary{margin-top:10px}
.invitation{display:flex;align-items:center;gap:18px;padding:14px 0}
.invitation img{width:120px;height:120px;background:#fff;border-radius:4px}
.invitation small{font-size:11px;color:var(--text-3)}
#code{display:block;font-size:19px;margin:7px 0;letter-spacing:1px}
.small{font-size:11px}
.approval{font-size:12px;line-height:1.7;background:var(--surface-3);border:1px solid var(--border);border-radius:7px;padding:13px;margin-top:13px}
.approval p{font-size:12px;color:var(--text-2);overflow-wrap:anywhere}
input[type=text],input:not([type]){width:100%;border:1px solid var(--border-strong);border-radius:5px;padding:8px 10px;font-size:12px;background:var(--surface);border-bottom-color:var(--text-3)}
input[type=text]:focus,input:not([type]):focus{outline:0;border-bottom:2px solid var(--accent)}
.address-input:not([type]){border:0;padding:0 6px;background:transparent}
.address-input:not([type]):focus{border:0}
input[type=checkbox]{width:15px;height:15px;min-width:15px;flex:0 0 15px;margin:2px 0 0;padding:0;accent-color:var(--accent);align-self:flex-start}
.remember{display:flex;align-items:flex-start;gap:8px;margin:12px 0;font-size:12px;line-height:1.65;color:var(--text-2);max-width:100%}
.remember>span{flex:1;min-width:0;white-space:normal;word-break:keep-all;overflow-wrap:anywhere}
.settings{position:relative;font-size:12px}
.settings summary{cursor:pointer;list-style:none;padding:6px 10px;border-radius:5px;border:1px solid var(--border);background:var(--surface-2);white-space:nowrap}
.settings summary::-webkit-details-marker{display:none}
.settings-panel{position:absolute;right:0;top:38px;width:310px;padding:16px;background:var(--surface);border-radius:9px;box-shadow:var(--shadow);line-height:1.7;z-index:10;max-height:80dvh;overflow:auto}
.settings-panel small{color:var(--text-3);font-size:11px}
.settings-panel #browserSupport{border-top:1px solid var(--border);padding-top:8px}
.name-field{display:flex;align-items:center;gap:7px;margin:6px 0}
.name-field input{min-width:0;flex:1}
.name-field button{flex:none;width:auto}
.quick-send{position:relative;font-size:12px;color:var(--text-2);cursor:pointer;white-space:nowrap;padding:6px 8px;border-radius:5px}
.quick-send:hover{background:var(--hover)}
.quick-send input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.quick-send.hover{background:var(--selected)}
.transfer-dock{position:fixed;right:16px;bottom:16px;width:360px;max-width:calc(100vw - 32px);max-height:65vh;overflow:auto;background:var(--surface);border-radius:10px;padding:12px 14px;box-shadow:var(--shadow);z-index:20}
.dock-heading{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--text-2)}
.dock-heading b{font-weight:600}
.row{padding-top:10px;overflow-wrap:anywhere}
.row b{font-size:12px;font-weight:600}
.row small{display:block;font-size:11px;color:var(--text-2);margin-top:6px}
.row progress{width:100%;height:4px;accent-color:var(--accent)}
.row a{display:inline-block;padding:8px 0;color:var(--accent);font-size:12px}
.transfer-dock .approval{margin-top:8px}
.transfer-dock .primary{margin-right:10px}
footer{height:26px;flex:none;display:flex;align-items:center;gap:8px;justify-content:space-between;font-size:11px;color:var(--text-3);padding:0 3px;overflow:hidden;white-space:nowrap}
footer>span{margin-left:auto}

/* ---------- drag & drop ---------- */
.draggable-item{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.drop-target{outline:2px solid var(--accent)!important;outline-offset:-2px;background:var(--selected)!important}
.touch-drag-ghost{position:fixed;left:0;top:0;z-index:1000;pointer-events:none;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:var(--accent);color:var(--accent-text);padding:10px 16px;border-radius:8px;box-shadow:var(--shadow);font-size:13px}

/* ---------- pane width: hide columns like Explorer does when narrow ---------- */
@container (max-width:640px){.col-type{display:none}th:first-child{width:58%}.col-date{width:26%}.search{width:clamp(110px,30%,180px)}.cmd span{display:none}.cmd.accent span,#chooseFolder span{display:inline}.folder-tree{width:150px}}
@container (max-width:460px){.col-date{display:none}th:first-child{width:72%}.col-size{width:28%}.pill{display:none}}
/* Narrow panes: the tree becomes a drawer that opens over the list. */
@container (max-width:560px){
  .folder-tree{display:none;position:absolute;inset:0 auto 0 0;width:min(240px,75%);z-index:5;box-shadow:var(--shadow)}
  .pane.tree-toggled .folder-tree{display:block}
}

/* ---------- window size ---------- */
@media (max-width:1050px){.strip-note,.device-badge{display:none}.cmd-sep{margin:0 3px}}
/* Phones in portrait: panes stack top/bottom; the page scrolls. */
@media (max-width:600px){
  body{height:auto;min-height:calc(100dvh / var(--ui-zoom,1))}
  header{padding:0 10px;gap:8px;height:48px}.brand{font-size:14px}.quick-send{display:none}#status{max-width:120px;font-size:11px}
  main{padding:8px}
  .explorers{grid-template-columns:1fr;flex:none}
  .pane{height:min(78dvh,640px)}
  .device-strip>b{display:none}.trusted-row .forget{display:none}
  .settings-panel{width:min(310px,calc(100vw - 20px))}
  .pane-hint{display:none}
  footer{white-space:normal;height:auto;min-height:30px;font-size:10px}footer>span{display:none}
  .navbar{flex-wrap:wrap;row-gap:4px}.search{order:5;width:100%;margin-left:0}
}
/* Phones in landscape: keep side by side, trade chrome for list space. */
@media (max-height:500px) and (orientation:landscape){
  header{height:40px}.device-strip{min-height:26px}.pane-hint,footer{display:none}.pane-title{min-height:30px;padding-top:2px}.commandbar{min-height:36px;padding:2px 8px}.cmd{height:28px}
  body{height:auto;min-height:calc(100dvh / var(--ui-zoom,1))}.explorers{flex:none}.pane{height:calc(100dvh / var(--ui-zoom,1) - 90px);min-height:260px}
}
/* Touch: bigger targets. */
@media (pointer:coarse){
  td,.file-name{height:40px}.icon-btn{width:38px;height:38px}.cmd{height:38px}.tree-label,.tree-child{min-height:40px}
  .table-wrap{overscroll-behavior:contain}
}

/* v5.1 settings header with close button */
.settings[open] summary{background:var(--selected);border-color:var(--selected-border)}
.settings-heading{display:flex;align-items:center;justify-content:space-between;margin:-6px -6px 6px 0}
.settings-heading b{font-size:14px;font-weight:600}

/* v5.3 clipboard menu hints, download save buttons */
.context-menu .kbd{margin-left:auto;color:var(--text-3);font-size:11px;padding-left:16px}
.save-link{display:block!important;margin-top:8px;padding:9px 12px!important;background:var(--accent);color:var(--accent-text)!important;border-radius:6px;text-align:center;text-decoration:none}
.share-button{display:block;width:100%;margin-top:6px}
.open-link{display:block!important;text-align:center;font-size:12px;padding:8px 0 2px!important}

/* v5.4 cancel button, cut rows */
.cancel-button{display:block;width:100%;margin-top:8px}
/* v10.0 several transfer rows: running ones get [일시정지]+[중단] side by side; waiting rows are dimmed */
.row.running .cancel-button,.row .pause-button{display:inline-block;width:calc(50% - 4px);margin-top:8px}
.row .pause-button{margin-left:8px}
.row .pause-button[hidden]{display:none}
.row.running:has(.pause-button[hidden]) .cancel-button{width:100%}
.row.waiting b,.row.waiting small{opacity:.7}
.row.waiting progress{opacity:.4}
.row.fading{opacity:0;transition:opacity .3s}
.row+.row{border-top:1px solid var(--border);margin-top:10px}
.small-button{padding:3px 8px;font-size:11px;margin-left:auto;margin-right:6px}
.dock-heading small{font-weight:400}
tbody tr.is-cut .file-name{opacity:.5}

/* v5.5 notice close button; selection bar like the folder tree (short, rounded, with space before the icon) */
.notice{display:flex;align-items:flex-start;gap:8px}
.notice #noticeText{flex:1;min-width:0;padding-top:3px}
.notice .icon-btn{color:var(--warn-text);margin:-3px -6px -3px 0}
td:first-child{position:relative;padding-left:16px}
tbody tr.chosen td:first-child:before{content:'';position:absolute;left:5px;top:25%;height:50%;width:3px;border-radius:2px;background:var(--accent)}
.file-name:focus-visible{outline:none}
tbody tr:has(.file-name:focus-visible){box-shadow:inset 0 0 0 1px var(--selected-border)}
.table-empty{padding-left:16px}

/* v5.5 expandable folder tree */
.tree-item{flex-wrap:wrap;align-items:center}
.tree-item .tree-label{order:2;padding-left:calc(4px + var(--depth,0) * 14px)}
.tree-item .tree-indicator{order:3}
.tree-chevron{order:1;flex:none;width:18px;height:26px;padding:0;margin-left:2px;font-size:14px;line-height:1;color:var(--text-3);border-radius:4px;transition:transform .12s}
.tree-chevron.open{transform:rotate(90deg)}
.tree-chevron.empty{visibility:hidden}
.tree-chevron:hover{background:var(--hover);color:var(--text)}
.tree-group{order:4;flex-basis:100%;min-width:0}
.tree-loading{font-size:11px;color:var(--text-3);padding:4px 0 4px calc(40px + var(--depth,0) * 14px)}
.tree-item.tree-sub{margin-bottom:0}
.tree-item:not(.active)>.tree-label:hover{background:var(--hover)}
.tree-item.active{background:transparent}
.tree-item.active>.tree-label{background:var(--selected)}
.tree-item.active:before{display:none}
.tree-item.active>.tree-label{position:relative}
.tree-item.active>.tree-label:after{content:'';position:absolute;left:0;top:25%;height:50%;width:3px;border-radius:2px;background:var(--accent)}

/* v5.5 drag-to-select box */
.select-band{position:fixed;z-index:50;pointer-events:none;border:1px solid var(--accent);background:color-mix(in srgb,var(--accent) 14%,transparent);border-radius:2px}
.table-wrap{user-select:none;-webkit-user-select:none}

/* v5.6 transfer box slides down when it goes away */
.transfer-dock{transition:transform .4s ease,opacity .4s ease}
.transfer-dock.leaving{transform:translateY(calc(100% + 24px));opacity:0}
.row.stopped progress{accent-color:var(--text-3)}
@media (prefers-reduced-motion:reduce){.transfer-dock{transition:none}}

/* v5.6 search results: where each item was found */
td:first-child .file-name.has-loc{display:inline-flex;width:auto;max-width:58%;vertical-align:middle}
.found-in{display:inline-block;vertical-align:middle;max-width:40%;margin-left:8px;font-size:11px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.found-in:before{content:'· '}

/* v5.7 search location is clickable; tree drop highlight covers only the folder's own row */
.found-in{border:0;background:transparent;padding:2px 4px;border-radius:4px;cursor:pointer;font:inherit;font-size:11px}
.found-in:hover{background:var(--hover);color:var(--accent);text-decoration:underline}
.tree-item.drop-target{outline:none!important;background:transparent!important}
.tree-item.drop-target>.tree-label{outline:2px solid var(--accent);outline-offset:-2px;background:var(--selected)}

.tree-more{display:block;margin:8px 6px 4px;padding:4px 6px;font-size:11px;color:var(--text-3);background:none;border:0;text-align:left;cursor:pointer}.tree-more:hover{color:var(--accent);text-decoration:underline}
/* v7.0: up to two connected computers (tabs or top/bottom split) */
.remote-area{min-width:0;min-height:0;display:flex;flex-direction:column;gap:6px}
.remote-area>.pane{flex:1 1 0}
.remote-area>.pane[hidden]{display:none}
.remote-tabs{display:flex;gap:4px;min-width:0}
.remote-tabs[hidden]{display:none}
.remote-tab{flex:0 1 auto;min-width:0;max-width:50%;height:30px;padding:0 14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);color:var(--text-2);font:inherit;font-size:12px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.remote-tab:hover{background:var(--hover)}
.remote-tab.active{background:var(--surface);color:var(--text);border-color:var(--border-strong);box-shadow:inset 0 -2px 0 var(--accent);font-weight:600}
.pane-close{margin-left:2px}
#layoutMode{width:100%;height:32px;margin:2px 0 8px;padding:0 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}
@media (max-width:600px){.remote-area>.pane{flex:none}}
/* v7.1 activity log */
.activity-button{width:100%;margin:4px 0 8px}
.agent-dialog{width:min(980px,calc(100vw - 32px));height:min(86dvh,900px);max-height:none;display:none;flex-direction:column;padding:14px}.agent-dialog[open]{display:flex}.agent-dialog iframe{flex:1;border:0;border-radius:8px;background:var(--surface-2);width:100%}
.activity-dialog{width:min(760px,calc(100vw - 32px));max-height:min(80dvh,720px)}
.activity-dialog[open]{display:flex;flex-direction:column}
.activity-tools{display:flex;gap:8px;margin:6px 0 10px}
.activity-tools select{flex:1;height:32px;padding:0 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}
.activity-wrap{overflow:auto;min-height:120px;border:1px solid var(--border);border-radius:6px}
.activity-table{width:100%;border-collapse:collapse;font-size:12px}
.activity-table th{position:sticky;top:0;background:var(--surface-3);text-align:left;font-weight:600;padding:6px 8px;color:var(--text-2)}
.activity-table td{padding:6px 8px;border-top:1px solid var(--border);vertical-align:top}
.activity-table td:first-child{white-space:nowrap;color:var(--text-2);font-variant-numeric:tabular-nums}
.activity-table td:last-child{white-space:pre;color:var(--text-3)}
.activity-table tr.warn td:nth-child(2){color:var(--warn-text)}
.activity-table tr.danger td:nth-child(2){color:var(--danger);font-weight:600}
@media (max-width:600px){.activity-table td:last-child,.activity-table th:last-child{display:none}}
.activity-tools .secondary{width:auto;flex:none;padding:0 14px}
.activity-table{table-layout:auto}
.activity-table th:first-child{width:92px}
.activity-table td{height:auto;line-height:1.45;color:var(--text)}
.activity-table td:nth-child(2){white-space:normal;overflow:visible;overflow-wrap:anywhere}
/* v7.3 기기 관리 */
.settings-row{display:flex;gap:6px}
.agent-download{display:flex;align-items:center;gap:6px;margin-top:10px;font-size:13px}.agent-download span{flex:1}.agent-download small{color:var(--text-2)}.agent-download a{color:var(--text);padding:5px 10px;border-radius:5px;text-decoration:none;font-size:12px}.settings-row .activity-button{flex:1;width:auto}
.devices-table th:first-child{width:auto}.devices-table td{white-space:nowrap}.devices-table td:first-child{white-space:normal}
.devices-table tr.me td:first-child{font-weight:600}
.devices-table td:last-child{text-align:right;white-space:nowrap}
.block-button{border:1px solid var(--border);background:var(--surface);border-radius:6px;padding:3px 12px;font:inherit;font-size:12px;cursor:pointer}
.block-button:hover{background:var(--danger-bg)}
@media (max-width:600px){.devices-table td:nth-child(4),.devices-table th:nth-child(4){display:none}}
.block-button{color:var(--danger)}
/* v8.0 권한: 공유 승인 창 */
.share-dialog{width:440px}
.share-dialog .field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text-2);margin:12px 0}
.share-dialog select{height:32px;padding:0 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}
.share-dialog .choice{border:1px solid var(--border);border-radius:6px;padding:4px 12px;margin:12px 0}
.share-dialog .choice legend{font-size:12px;color:var(--text-2);padding:0 4px}
.share-dialog .choice .remember{margin:8px 0}
.share-dialog .dialog-actions .secondary,.share-dialog .dialog-actions .primary{width:auto;padding:7px 16px}
.share-dialog.request h2{color:var(--accent)}
/* v8.1 command bar overflow */
.cmd-more{position:sticky;right:-8px;margin-left:auto;margin-right:-8px;z-index:1;background:var(--surface);box-shadow:-10px 0 8px var(--surface);border-radius:0;font-size:16px;letter-spacing:1px}
.overflow-menu{min-width:160px}
.overflow-menu button{width:100%;text-align:left}
.cmd.cmd-more:hover:enabled,.cmd.cmd-more:active:enabled,.cmd.cmd-more[aria-expanded="true"]{background:linear-gradient(var(--hover),var(--hover)),var(--surface)}

/* v10.1 내 컴퓨터 열기 */
.tab-lock{font-size:11px}
.remote-wait{margin-top:14px;text-align:center;padding:16px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2)}
.remote-wait small{display:block;color:var(--text-2)}
.remote-wait strong{display:block;font-size:44px;letter-spacing:4px;margin:6px 0;font-variant-numeric:tabular-nums}
.start-actions{display:flex;flex-direction:column;align-items:center;gap:10px;padding:28px 12px}
.start-actions p{margin:0 0 4px;color:var(--text-2)}
.start-actions .row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.start-actions button{min-width:150px}

/* v10.2 글자 확대/축소 */
.zoom-control{display:flex;align-items:center;border:1px solid var(--border);border-radius:6px;background:var(--surface);overflow:hidden;flex:none}
.zoom-control button{border:0;border-radius:0;background:transparent;color:var(--text);height:28px;padding:0 9px;font-size:13px;line-height:1}
.zoom-control button:hover:enabled{background:var(--hover)}
.zoom-control button:disabled{opacity:.35}
.zoom-btn{font-size:16px!important;font-weight:600;min-width:30px}
.zoom-reset{display:flex;align-items:center;gap:4px;border-left:1px solid var(--border)!important;border-right:1px solid var(--border)!important;min-width:64px;justify-content:center;font-variant-numeric:tabular-nums}
.zoom-reset svg{width:13px;height:13px}
.zoom-reset.at-default svg{opacity:.35}
@media (max-width:640px){.zoom-control{display:none}}

/* v1.0 language menu (i18n.js) and credit */
.lang-slot{display:flex;flex:none}.lang-menu{position:relative}.lang-button{list-style:none;display:flex;align-items:center;gap:4px;cursor:pointer;padding:4px 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text-2);user-select:none}.lang-button::-webkit-details-marker{display:none}.lang-button:hover{background:var(--hover)}.lang-code{font-size:11px;font-weight:600;letter-spacing:.3px}.lang-list{position:absolute;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:4px;z-index:1000;min-width:130px;display:grid}.lang-list button{border:0;background:transparent;text-align:left;padding:7px 10px;border-radius:5px;font:inherit;color:var(--text);cursor:pointer}.lang-list button:hover{background:var(--hover)}.credit{margin:10px 0 0;font-size:11.5px;color:var(--text-3)}.credit a{color:inherit}
html[lang=en] .crumbs:empty:before{content:'Choose a folder'}html[lang=en] .folder-tree:empty:before{content:'No folders added'}
/* v1.1 BaroDrop iPhone app (native.js adds .ios-app): the iPhone opens computers, it has no folders of its own */
html.ios-app #localPane,html.ios-app #drop,html.ios-app .zoom-control,html.ios-app #openAgent,html.ios-app .credit,
html.ios-app #settingsMenu .remember,html.ios-app label[for=layoutMode],html.ios-app #layoutMode,html.ios-app #agentDownload,
html.ios-app #browserSupport,html.ios-app #verification,html.ios-app .shortcuts,html.ios-app .strip-note,html.ios-app #transferNote{display:none!important}
html.ios-app .explorers{grid-template-columns:1fr}
html.ios-app body{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
html.ios-app input,html.ios-app textarea{-webkit-user-select:text;user-select:text}
html.ios-app header{padding-top:max(env(safe-area-inset-top),8px)}
html.ios-app .pane{height:calc(100dvh - 150px)}
.add-wait{margin-top:12px;padding:10px 12px;border-radius:8px;background:var(--warn-bg);color:var(--warn-text)}
html.ios-app #trustedList>p{white-space:normal}
html.ios-app .kbd{display:none}
/* v1.1.1 app: the folder list opened from the address box gets a dimmed backdrop (tap outside closes it) */
@media (max-width:600px){html.ios-app .pane.tree-toggled .table-wrap::before{content:'';position:absolute;inset:0;background:rgba(0,0,0,.25);z-index:4}}
html.ios-app .folder-tree{width:min(300px,82%)}
html.ios-app .table-wrap{position:relative}
/* v1.3 iPhone app: send button and the "shared from another app" bar */
.ios-send{display:none}
html.ios-app .ios-send{display:inline-flex;font-weight:600;color:var(--accent,#005fb8)}
.ios-incoming{position:fixed;left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom) + 12px);z-index:50;display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px;border-radius:12px;background:var(--surface);border:1px solid var(--border);box-shadow:0 8px 24px rgba(0,0,0,.2)}
.ios-incoming span{flex:1 1 100%;font-size:14px}
/* v1.4 큰 아이콘 보기 · 썸네일 */
.thumb-box{display:none}
.view-toggle[aria-pressed="true"]{background:var(--selected);color:var(--accent)}
.view-icons table{display:block;width:100%}
.view-icons thead{display:none}
.view-icons tbody{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:4px;padding:8px}
.view-icons tbody tr{display:flex;flex-direction:column;border-radius:8px;min-width:0}
.view-icons tbody tr td{display:block;height:auto;padding:0;border:0;min-width:0}
.view-icons tbody tr td:not(:first-child),.view-icons .found-in{display:none}
.view-icons tbody tr td.table-empty{grid-column:1/-1;padding:24px 8px}
.view-icons tbody tr.chosen td:first-child:before{display:none}
.view-icons tbody tr.chosen{box-shadow:inset 0 0 0 1px var(--selected-border)}
.view-icons .file-name,.view-icons td:first-child .file-name.has-loc{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;width:100%;max-width:none;height:auto;padding:8px 4px;white-space:normal;text-align:center;line-height:1.3;word-break:break-all;overflow:hidden}
.view-icons .file-name>.ft,.view-icons .file-name.is-dir:before{display:none}
.view-icons .thumb-box{display:flex;flex:none;align-items:center;justify-content:center;width:96px;height:96px;border-radius:6px;overflow:hidden}
.view-icons .thumb-box .ft{width:44px;height:44px}
.view-icons .thumb-box.is-folder:before{content:'';width:64px;height:48px;border-radius:4px;background:linear-gradient(var(--folder-dark),var(--folder-dark)) 0 0/28px 10px no-repeat,linear-gradient(var(--folder),var(--folder)) 0 6px/100% 42px no-repeat}
.view-icons .thumb-box.has-thumb{background:var(--surface-3)}
.view-icons .thumb-box img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.ios-app .view-icons tbody{grid-template-columns:repeat(auto-fill,minmax(100px,1fr));padding:6px}
.ios-app .view-icons .thumb-box{width:88px;height:88px}
/* v1.5 phone apps: icons only in the header (🌐 ＋ ⚙) so the connection state is not cut off */
html.ios-app .lang-code{display:none}
html.ios-app .header-actions{gap:6px}
html.ios-app #openConnection.icon-only,html.ios-app #settingsMenu summary.icon-only,html.ios-app .lang-button{display:inline-flex;align-items:center;justify-content:center;min-width:40px;width:40px;height:32px;padding:0;border-radius:8px}
html.ios-app #settingsMenu summary.icon-only{list-style:none}
html.ios-app #settingsMenu summary.icon-only::-webkit-details-marker{display:none}
html.ios-app header .status{min-width:0;flex:1 1 auto}
html.ios-app .app-settings{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
#openAgent{display:inline-flex;align-items:center;gap:6px}#openAgent[hidden]{display:none}#openAgent .agent-ico{flex:none;color:var(--accent,#005fb8)}
/* v1.7: another computer opened this one → [○○ 열기] */
.incoming-peer{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:6px 0 0;flex:none;padding:8px 12px;border:1px solid var(--selected-border);background:var(--selected);border-radius:8px;font-size:13px}
.incoming-peer[hidden]{display:none}
.incoming-peer span{flex:1 1 auto}
/* v1.7 Android app: two panes like the computer — this phone (left / top) and the computer (right / bottom).
   Long-press a file and drag it to the other pane; a long press without moving opens its menu. */
html.two-pane #localPane{display:flex!important}
html.two-pane #chooseFolder,html.two-pane #shareFolder,html.two-pane #unshareFolder,html.two-pane #forgetFolder,html.two-pane .pane-hint{display:none!important}
@media (orientation:portrait){html.two-pane .explorers{grid-template-columns:1fr;gap:6px;flex:none;align-content:start}html.two-pane .pane{height:calc((100dvh - 150px) / 2);min-height:200px}}
@media (orientation:landscape){html.two-pane .explorers{grid-template-columns:1fr 1fr;gap:6px;flex:none;align-content:start}html.two-pane .pane{height:calc(100dvh - 110px);min-height:200px}}

.app-settings .app-version{flex-basis:100%;margin:0 0 6px;font-size:13px;color:var(--text-2)}.app-settings .app-version.outdated a{color:var(--accent);font-weight:600}
.ask-dialog{border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);padding:20px 22px;max-width:min(460px,calc(100vw - 32px));box-shadow:var(--shadow)}.ask-dialog::backdrop{background:rgba(0,0,0,.3)}.ask-dialog p{margin:0 0 16px;white-space:pre-line;line-height:1.5}.ask-dialog .ask-buttons{display:flex;justify-content:flex-end;gap:8px}.ask-dialog .ask-buttons button{flex:0 0 auto;width:auto;min-width:76px;padding:7px 16px;border-radius:6px}.ask-dialog .danger-button{background:#c42b1c;border:1px solid #c42b1c;color:#fff}
html.two-pane .remote-area>.pane{flex:none} /* v1.7.5: tablets (iPad, Android tablet): the remote pane keeps the two-pane height */
.pane-hint{display:none!important} /* v1.7.7: no hint line under the toolbars (형님 요청) */
.invite-box{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}.invite-box p{margin:0;flex-basis:100%;white-space:normal}.invite-box input{min-width:160px;padding:6px 8px} /* v1.7.8 초대 코드 */
/* v1.9 초대 코드 칸: 잘리지 않게(기기 줄 높이 제한 풀기), 입력 칸 옆 오른쪽에 [확인] */
.device-strip:has(.invite-box){max-height:none;overflow:visible;align-items:flex-start;padding-top:4px;padding-bottom:4px}
#trustedList:has(.invite-box){flex:1;min-width:0}
.invite-box{flex:1;min-width:0;flex-wrap:wrap}.invite-box input{flex:1 1 160px;min-width:0}.invite-box button{flex:none;padding:6px 16px}
/* v1.9 태블릿(두 칸): 아래로 스크롤해도 위쪽 메뉴(바로드롭·연결 상태·버튼)는 그대로 */
html.two-pane body{height:auto;min-height:calc(100dvh / var(--ui-zoom,1))}
html.two-pane header{position:sticky;top:0}
