:root{
  --canvas:#f5f5f7;
  --chrome:#fbfbfd;
  --sidebar:#f2f2f5;
  --surface:#fff;
  --line:#d8d8de;
  --hair:#ececf1;
  --text:#1d1d1f;
  --muted:#6e6e73;
  --blue:#0066d6;
  --blue-soft:#e7efff;
  --blue-selected:#d6e6ff;
  --green:#248a3d;
  --yellow:#9a6b00;
  --font:-apple-system,BlinkMacSystemFont,"SF Pro Text","Apple SD Gothic Neo","Pretendard","Segoe UI",sans-serif;
  --radius:12px;
  --file-grid: 4fr 1.15fr 1fr .95fr .72fr .68fr;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--canvas);
  color:var(--text);
  font:13px/1.45 var(--font);
  letter-spacing:-.014em;
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  user-select:none;
  -webkit-user-select:none;
}
.app-shell,
.sidebar,
.main,
.table,
.head,
#file-rows,
.file-row,
.inspector,
button{
  user-select:none;
}
input,
select,
.share-result,
.delivery-link,
.delivery-card a,
.url-text,
code,
pre{
  user-select:text;
  -webkit-user-select:text;
}
::selection{background:#d8e8ff}
button{font:inherit}
button{height:32px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);transition:background-color .12s ease,color .12s ease,border-color .12s ease,transform .12s ease}
button:disabled{opacity:.5;pointer-events:none}
.primary{background:var(--blue)!important;border-color:var(--blue)!important;color:#fff!important}
.ghost{background:#fff}

.app-shell{height:100%;display:grid;grid-template-rows:56px auto 1fr 24px}
.toolbar{
  display:grid;
  grid-template-columns:290px minmax(220px,1fr) auto;
  align-items:center;
  gap:14px;
  padding:9px 14px;
  border-bottom:1px solid var(--line);
  background:var(--chrome);
  backdrop-filter:blur(12px);
}
.brand{display:flex;align-items:center;gap:10px}
.brand img{width:30px;height:30px;border-radius:8px}
.brand b{display:block;font-size:14px;letter-spacing:-.03em}
.brand span{display:block;color:var(--muted);font-size:11px}
.search{height:34px;max-width:620px;border:1px solid var(--line);background:#fff;border-radius:10px;display:flex;align-items:center;gap:8px;padding:0 12px;color:var(--muted)}
.search input{border:0;outline:0;background:transparent;width:100%;color:var(--text)}
.toolbar-actions{display:flex;gap:8px}

.page{display:none;position:relative;min-height:0}
.page.active{display:block}

.page.login-page.active{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:calc(100vh - 56px - 24px);
}

/* Login */
.login-page{align-items:center;justify-content:center}
.login-page .box{width:min(420px, calc(100vw - 32px));padding:30px}
.box{background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 34px rgba(0,0,0,.04)}
.box.narrow{width:min(380px, calc(100vw - 40px));padding:28px}
.eyebrow{margin:0 0 6px;color:var(--muted);font-size:12px;letter-spacing:-.01em}
.login-page h1{margin:0 0 4px;font-size:30px;letter-spacing:-.04em}
.login-page p{color:var(--muted);margin:0 0 18px}
.login-form{display:grid;gap:10px}
.login-form label{display:grid;gap:6px}
.login-form span{font-size:12px;color:var(--muted)}
.login-form input{height:40px;padding:0 12px;border:1px solid var(--line);border-radius:10px}
.error{color:#b00020!important}

.layout{height:calc(100vh - 56px - 24px);display:grid;grid-template-columns:236px minmax(0,1fr)310px;min-height:0}
.sidebar,.main,.inspector{min-height:0}
.sidebar{background:var(--sidebar);border-right:1px solid var(--line);padding:14px 10px;overflow:auto}
h2,p,dl{margin:0}
h2{font-size:15px}
.sidebar h2{font-size:13px}
.sidebar p{margin:11px 0 6px;color:var(--muted);font-size:11px;text-transform:uppercase}
.source{width:100%;text-align:left;height:32px;margin:3px 0;padding:0 12px;border-radius:10px;background:transparent}
.source:hover{background:#fff}
.source.active{background:#fff;border-color:#c5c5cf;box-shadow:inset 0 0 0 1px #fff}

.main{display:flex;flex-direction:column;min-width:0}
.pathbar{padding:14px 16px 8px;display:flex;justify-content:space-between;align-items:flex-end;border-bottom:1px solid var(--hair);gap:12px}
.pathbar-left{min-width:0;display:flex;flex-direction:column;gap:6px}
.pathbar p{color:var(--muted);font-size:11px}
.pathbar h1{margin:2px 0 0;font-size:19px;letter-spacing:-.03em}
.breadcrumb{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:5px}
.breadcrumb button{height:24px;padding:0 8px;border-radius:8px;font-size:12px;border-color:#d7d7de}
.breadcrumb span{color:var(--muted)}
.toolbar-mini{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.table{display:grid;grid-template-rows:auto 1fr;min-height:0}
.head{display:grid;grid-template-columns:var(--file-grid);align-items:center;padding:9px 14px 8px;color:var(--muted);font-size:11px;position:sticky;top:0;background:var(--canvas);border-bottom:1px solid var(--line);gap:12px}
.head-col{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.head .name-col{padding-left:2px}
.align-right{text-align:right}
#file-rows{overflow:auto}
.file-row{width:100%;display:grid;grid-template-columns:var(--file-grid);align-items:center;gap:12px;padding:8px 14px;background:#fff;border:0;border-radius:0;border-bottom:1px solid var(--hair);min-height:36px;transition:background-color .12s ease,color .12s ease}
.file-row:hover{background:#fbfbfd}
.file-row:active{background:#f3f7ff}
.file-row.selected{background:var(--blue-soft)}
.name{display:flex;align-items:center;gap:9px;min-width:0}
.filename{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.muted{color:var(--muted);font-size:12px}
.cell-right{text-align:right}
.status{font-size:12px;min-width:86px;white-space:nowrap}
.status.ready{color:var(--green)}
.lucide-icon{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:#6e6e73}
.lucide-icon svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.lucide-icon.folder{color:#b78916}
.lucide-icon.file{color:#697386}
.lucide-icon.file text{font:700 4.8px var(--font);fill:#697386;stroke:none;letter-spacing:.02em}
.svgicon{width:26px;height:24px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.svgicon svg{width:26px;height:24px;display:block}
.svgicon .folder-tab{fill:#f7d46a;stroke:#c99d32;stroke-width:.7}
.svgicon .folder-body{fill:#f3c451;stroke:#c99d32;stroke-width:.8}
.svgicon.file-doc svg{width:24px;height:27px}
.svgicon .doc-page{fill:#f8f9fb;stroke:#cfd5df;stroke-width:1}
.svgicon .doc-fold{fill:none;stroke:#cfd5df;stroke-width:1}
.svgicon text{font:700 6px var(--font);fill:#50607a;letter-spacing:.02em}
.fileicon{width:24px;height:22px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:6px;font-size:9px;font-weight:700}
.fileicon.folder{background:#f3c451;border:1px solid #c99d32;color:transparent;position:relative}
.fileicon.folder::before{content:'';position:absolute;left:3px;top:-4px;width:10px;height:5px;border-radius:4px 4px 0 0;background:#f7d46a;border:1px solid #c99d32;border-bottom:0}
.fileicon.file{background:#f8f9fb;border:1px solid #cfd5df;color:#50607a}

.inspector{border-left:1px solid var(--line);background:var(--surface);padding:14px;overflow:auto}
.inspector-content{transition:opacity .16s ease, transform .16s ease;opacity:1}
.inspector-content.is-updating{opacity:.72;transform:translateY(4px)}
.preview{display:inline-flex;align-items:center;justify-content:center;height:54px;width:54px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:700;color:#6e6e73}
.inspector h2{font-size:18px;margin:10px 0 4px;letter-spacing:-.03em}
.inspector>p{color:var(--muted);font-size:12px;margin-bottom:14px}
.inspector dl{display:grid;grid-template-columns:auto 1fr;row-gap:8px;column-gap:8px;font-size:12px}
.inspector dt{color:var(--muted)}
.inspector dd{margin:0;word-break:break-all}
#download,#upload-replace,#share-create{width:100%;margin-top:8px}
#upload-replace,.full{margin-top:8px}
.share-result{margin-top:10px;padding:8px 9px;border-radius:8px;font-size:12px;line-height:1.35;border:1px solid var(--line);background:#fafafa;color:var(--muted);display:flex;align-items:center;justify-content:space-between;gap:8px}
.share-result[hidden]{display:none}
.share-result[data-status='success'],.share-result[data-status='error'],.share-result[data-status='info']{background:#fafafa;border-color:var(--line);color:var(--text)}
.copy-share{height:26px;border-radius:7px;padding:0 9px;background:#fff;white-space:nowrap}
.share-list-panel{
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px;
  background:#fafafa;
}
.share-list-panel h3{
  margin:0 0 8px;
  font-size:14px;
}
.share-list-empty{
  font-size:12px;
  color:var(--muted);
}
.share-list-table{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.share-list-head{
  display:grid;
  grid-template-columns:1fr 130px 92px;
  gap:8px;
  padding:0 4px 5px;
  color:var(--muted);
  font-size:12px;
  border-bottom:1px solid var(--hair);
}
.share-list-row{
  display:grid;
  grid-template-columns:1fr 130px 92px;
  gap:8px;
  align-items:center;
  padding:4px;
}
.share-list-row:hover{background:#fff;border-radius:7px}
.share-list-title{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.share-list-copy{height:26px}
.share-list-panel.hidden{display:none}
.sheet:not(.hidden){
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.sheet.hidden{display:none}
.sheet-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.28)}
.sheet-content{
  position:relative;
  z-index:1;
  background:#fff;
  border-radius:18px;
  max-width:460px;
  width:min(92vw, 460px);
  max-height:min(85vh, 560px);
  overflow:auto;
  padding:14px 16px 16px;
  box-shadow:0 18px 40px rgba(0,0,0,.16);
}
.sheet-content header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.sheet .field{padding:10px 0;border-top:1px solid var(--hair)}
.sheet .field label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.sheet select{width:100%;height:34px;border-radius:10px;border:1px solid var(--line);padding:0 10px;background:#fff}
.sheet .hint,.sheet p#language-display{font-size:12px;color:var(--muted);margin:4px 0 0}
.sheet-footer{margin-top:12px;display:flex;gap:8px;justify-content:flex-end}

footer{height:24px;display:flex;align-items:center;padding:0 12px;font-size:11px;color:var(--muted);border-top:1px solid var(--line);background:#fff}
.context-menu{position:fixed;z-index:50;min-width:174px;padding:5px;background:rgba(250,250,252,.98);border:1px solid #cfcfd4;border-radius:10px;box-shadow:0 10px 28px rgba(0,0,0,.14)}
.context-menu.hidden{display:none}
.context-menu button{display:block;width:100%;height:28px;border:0;background:transparent;border-radius:7px;text-align:left;padding:0 10px}
.context-menu button:hover{background:#e9eef8}

body[data-density='compact'] .file-row{padding-top:7px;padding-bottom:7px;min-height:34px}
body[data-density='compact'] .source{height:30px}
body[data-density='spacious'] .file-row{padding-top:10px;padding-bottom:10px;min-height:40px}
body.drop-active{outline:2px dashed var(--blue)}

/* TRST Deliver — client-facing delivery page */
.share-body{overflow:auto;background:#f5f5f7}
.delivery-body{background:radial-gradient(circle at 50% -10%, #ffffff 0, #f5f5f7 42%, #eeeeF2 100%)}
.delivery-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:34px;user-select:none;-webkit-user-select:none}
.delivery-panel{width:min(760px, calc(100vw - 40px));background:rgba(255,255,255,.92);border:1px solid rgba(210,210,218,.9);border-radius:22px;padding:26px;box-shadow:0 22px 70px rgba(0,0,0,.07)}
.delivery-pro{backdrop-filter:blur(18px)}
.delivery-head{display:flex;align-items:center;gap:13px;margin-bottom:20px}
.delivery-head img{width:38px;height:38px;border-radius:10px}
.delivery-head p{font-size:12px;color:var(--muted);margin:0}
.delivery-head h1{font-size:28px;line-height:1.08;letter-spacing:-.045em;margin:1px 0 0}
.delivery-message{font-size:14px;color:#3a3a3c;line-height:1.65;margin:0 0 18px;white-space:pre-line;user-select:text;-webkit-user-select:text}
.delivery-note{color:var(--muted);font-size:12px;margin:14px 0 0;user-select:text;-webkit-user-select:text}
.delivery-meta{display:grid;grid-template-columns:64px 1fr;gap:7px 12px;padding:14px 0;border-top:1px solid var(--hair);border-bottom:1px solid var(--hair);font-size:12px}
.delivery-meta span{color:var(--muted)}
.delivery-meta strong{font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compact-list{margin-top:14px;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}
.delivery-row{display:grid;grid-template-columns:minmax(0,1fr)86px 98px;align-items:center;gap:10px;min-height:42px;padding:8px 11px;border-bottom:1px solid var(--hair)}
.delivery-row:last-child{border-bottom:0}
.delivery-row:hover{background:#fbfbfd}
.delivery-file-name{display:flex;align-items:center;gap:9px;min-width:0}
.delivery-file-name span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.delivery-size,.delivery-muted{color:var(--muted);font-size:12px;text-align:right}
.delivery-actions{display:flex;justify-content:space-between;align-items:center;margin:14px 0 0;gap:12px}
.delivery-upload{margin-top:12px}
.upload-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:118px;padding:22px;border:1.5px dashed #c8c8d0;border-radius:16px;background:rgba(255,255,255,.7);color:var(--muted);cursor:pointer;transition:background-color .14s ease,border-color .14s ease,transform .14s ease}
.upload-drop strong{color:var(--text);font-size:15px;margin-bottom:4px}
.upload-drop span{font-size:12px}
.upload-drop.is-dragging{background:#eef5ff;border-color:var(--blue);transform:translateY(-1px)}
.upload-drop.is-uploading{opacity:.65;pointer-events:none}
.delivery-single{display:grid;grid-template-columns:minmax(0,1fr)86px 126px;align-items:center;gap:12px;margin-top:14px;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}
.download-button{display:inline-flex;height:36px;align-items:center;justify-content:center;padding:0 15px;border-radius:10px;background:var(--blue);color:#fff;text-decoration:none;font-weight:700;font-size:13px;white-space:nowrap;user-select:none;-webkit-user-select:none}
.download-button:hover{filter:brightness(.96)}
.download-button.small{height:30px;padding:0 10px;font-size:12px;border-radius:8px}
.download-button.secondary{background:#fff;color:var(--text);border:1px solid var(--line);margin-top:14px}
.delivery-footer{height:auto;margin-top:18px;padding:12px 0 0;border:0;border-top:1px solid var(--hair);background:transparent;display:flex;justify-content:space-between;gap:12px}
@media (max-width:680px){.delivery-page{padding:18px}.delivery-panel{width:100%;padding:20px;border-radius:18px}.delivery-single,.delivery-row{grid-template-columns:minmax(0,1fr);align-items:start}.delivery-size,.delivery-muted{text-align:left}.delivery-footer{flex-direction:column}}


@media (max-width:1200px){
  .layout{grid-template-columns:190px 1fr}
  .inspector{display:none}
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{transition-duration:0.01ms !important; animation-duration:0.01ms !important;}
}
