/* ==================================================================
   WebHard Web — design system
   ================================================================== */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #fbfbfe;
  --surface-sunken: #f7f8fc;
  --line: #eaecf3;
  --line-strong: #dfe2ec;
  --ink: #0e1016;
  --ink-2: #363c49;
  --ink-3: #4b5263;
  --muted: #6b7280;
  --muted-2: #9aa1ae;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-ink: #3730a3;
  --brand-soft: #eef0ff;
  --brand-glow: rgba(79, 70, 229, 0.28);
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --warn: #b45309;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.10), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 28px 70px rgba(16, 24, 40, 0.18);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic",
    "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: #dcd9ff; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d8dbe4; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c3c8d4; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

[data-icon] { display: inline-flex; width: 16px; height: 16px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

/* ================================================================== boot */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 12% 0%, #e6e9ff 0%, rgba(245, 246, 250, 0) 60%),
    radial-gradient(760px 420px at 92% 8%, #f0e8ff 0%, rgba(245, 246, 250, 0) 55%),
    var(--bg);
  z-index: 40;
}

.boot-card {
  width: min(408px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 30px 28px 22px;
  box-shadow: 0 30px 80px rgba(21, 26, 45, 0.16);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; filter: drop-shadow(0 6px 14px var(--brand-glow)); }
.brand-text { display: flex; align-items: baseline; gap: 6px; letter-spacing: -0.02em; }
.brand-text strong { font-size: 16px; font-weight: 800; }
.brand-text span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}
.brand.small strong { font-size: 14.5px; }

.boot-card h1 { margin: 24px 0 6px; font-size: 22px; letter-spacing: -0.03em; }
.boot-card .muted { margin: 0 0 20px; font-size: 12.5px; line-height: 1.6; }

.field { display: block; margin-bottom: 12px; }
.field span {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  outline: none;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.boot-links { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 14px; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.link-btn:hover { background: var(--brand-soft); }
.link-sep { color: var(--muted-2); font-size: 10px; }

.boot-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.error { color: var(--danger); font-size: 12px; min-height: 16px; margin: 8px 0 0; }

/* ================================================================== buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background 0.14s, border-color 0.14s, color 0.14s, box-shadow 0.14s, transform 0.06s;
}
.btn:hover:not(:disabled) { background: #f7f8fc; border-color: #d2d7e3; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; box-shadow: none; cursor: default; }
.btn.primary {
  background: linear-gradient(180deg, #5b52f0, var(--brand));
  border-color: #4a41d8;
  color: #fff;
  box-shadow: 0 6px 18px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #5147e8, var(--brand-strong)); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: #eef0f7; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: #f6d5d5; }
.btn.block { width: 100%; height: 44px; font-size: 13.5px; border-radius: var(--radius); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover:not(:disabled) { background: #eef0f7; color: var(--ink); }
.icon-btn:disabled { opacity: 0.32; cursor: default; }
.icon-btn:disabled:hover { background: transparent; }

/* ================================================================== layout */

.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100vh; height: 100dvh; }

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 12px 10px;
  background: linear-gradient(180deg, #fcfcff 0%, #f7f8fc 100%);
  border-right: 1px solid var(--line);
  z-index: 20;
}
.side-head { padding: 2px 6px 16px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.14s, color 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.nav-item:hover { background: #f1f2f8; }
.nav-item.active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--brand-ink);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}
.nav-item .nav-ico { color: var(--muted); }
.nav-item.active .nav-ico { color: var(--brand); }
.nav-count { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.nav-count.alert {
  color: #92400e;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 10px;
}

.side-block {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.side-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.side-block-head .muted { font-size: 10.5px; }
.meter { height: 6px; border-radius: 999px; background: #edeff5; overflow: hidden; }
.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 8px;
  padding: 9px 6px;
}
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
}
.side-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.side-user-text strong { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text span { font-size: 10.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge {
  margin-left: auto;
  flex: none;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef0f5;
  color: var(--muted);
}
.role-badge.admin { background: var(--brand-soft); color: var(--brand-ink); }
.role-badge.guest { background: #e9f6ef; color: #15803d; }

.side-foot { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 1px; }

/* ================================================================== main */

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.nav-btns {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.nav-btns .icon-btn { width: 30px; height: 30px; border-radius: 0; }
.nav-btns .icon-btn + .icon-btn { border-left: 1px solid var(--line); }
.flip { transform: rotate(180deg); display: inline-flex; }

.crumbs { display: flex; align-items: center; gap: 1px; min-width: 0; overflow: hidden; }
.crumb-home {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  flex: none;
}
.crumb-home:hover { background: #eef0f7; color: var(--ink); }
.crumb {
  border: 0;
  background: transparent;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb:hover { background: #eef0f7; color: var(--ink); }
.crumb.current { color: var(--ink); font-weight: 700; }
.crumb-sep { color: var(--muted-2); font-size: 10px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.search { position: relative; display: flex; align-items: center; }
.search input {
  width: 240px;
  height: 34px;
  padding: 0 28px 0 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f5f9;
  outline: none;
  font-size: 12.5px;
  transition: width 0.2s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  width: 280px;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.11);
}
.search-ico { position: absolute; left: 10px; color: var(--muted-2); pointer-events: none; }
.search-clear {
  position: absolute;
  right: 7px;
  width: 19px;
  height: 19px;
  border: 0;
  border-radius: 50%;
  background: #dfe3ec;
  color: #4b5263;
  line-height: 1;
  font-size: 12px;
}

.transfer-btn { position: relative; height: 34px; padding: 0 11px; border-radius: 10px; }
.transfer-btn:hover { background: #eef0f7; }
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.toolbar { display: flex; align-items: center; gap: 5px; padding: 12px 18px 10px; flex: none; }

/* 아이콘만 보이다가, 마우스를 올리면 이름이 펼쳐진다. */
#toolbar .btn {
  height: 36px;
  padding: 0 10px;
  gap: 0;
  overflow: hidden;
  transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s, padding 0.2s ease;
}
#toolbar .btn .btn-label {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.14s ease, margin-left 0.22s ease;
}
#toolbar .btn:hover .btn-label,
#toolbar .btn:focus-visible .btn-label {
  max-width: 150px;
  margin-left: 7px;
  opacity: 1;
}
.toolbar-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.toolbar-spacer { flex: 1; }
.hide-sm {
  font-size: 11px;
  color: var(--muted-2);
  background: #f1f2f8;
  border-radius: 999px;
  padding: 5px 10px;
}
#btn-upload { background: linear-gradient(180deg, #5b52f0, var(--brand)); border-color: #4a41d8; color: #fff; box-shadow: 0 6px 18px var(--brand-glow); }
#btn-upload:hover { background: linear-gradient(180deg, #5147e8, var(--brand-strong)); }

/* ================================================================== content */

.content {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 18px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-head,
.row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 46px 100px 152px;
  align-items: center;
}

.list-head {
  height: 38px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f7f8fc);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
  flex: none;
  user-select: none;
}
.sortable {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.12s;
}
.sortable:hover { color: #5b6373; }
.sortable.active { color: var(--brand-ink); }
.sort-ind { font-size: 8.5px; opacity: 0.45; }
.sortable.active .sort-ind { opacity: 1; }

.list-head .col-size, .list-head .col-date { justify-content: flex-end; }
.list-head .col-name { padding-left: 42px; }

.list { flex: 1; overflow: auto; min-height: 0; }

.row {
  height: 48px;
  padding: 0 10px;
  border-bottom: 1px solid #f3f4f8;
  cursor: default;
  user-select: none;
  position: relative;
  transition: background 0.12s;
}
.row:hover { background: #f8f9fd; }
.row.selected { background: linear-gradient(90deg, #eef0ff 0%, #f6f7ff 70%); }
.row.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.row.dragging { opacity: 0.4; }
.row.drop-target {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
  border-radius: 8px;
}
.crumb.drop-target { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }

.col-check { display: grid; place-items: center; }

.check {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1.5px solid #c6ccda;
  border-radius: 5px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.check:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10); }
.check.on,
.check.partial { background: var(--brand); border-color: var(--brand); }
.check.on::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -1px);
}
.check.partial::after {
  content: "";
  width: 9px;
  height: 2px;
  border-radius: 1px;
  background: #fff;
}
.check:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.list-head .check { width: 17px; height: 17px; }

.name { display: flex; align-items: center; gap: 11px; min-width: 0; padding-left: 2px; }
.name .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--ink); }
.row:hover .name .label { color: var(--ink); }
.name .tag {
  flex: none;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 5px;
  padding: 2px 5px;
}
.name .path {
  color: var(--muted-2);
  font-size: 11px;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.f-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
}
.f-ico svg { width: 16px; height: 16px; }
.ico-folder { background: #eef2ff; color: #4f46e5; }
.ico-image { background: #ecfdf5; color: #059669; }
.ico-pdf { background: #fef2f2; color: #dc2626; }
.ico-video { background: #f5f3ff; color: #7c3aed; }
.ico-audio { background: #fff7ed; color: #c2410c; }
.ico-archive { background: #fefce8; color: #a16207; }
.ico-doc { background: #eff6ff; color: #2563eb; }
.ico-code { background: #f1f5f9; color: #475569; }

.col-size, .col-date {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty {
  position: absolute;
  inset: 38px 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  text-align: center;
  padding: 24px;
  pointer-events: none;
}
.empty h3 { margin: 14px 0 4px; font-size: 15px; letter-spacing: -0.01em; }
.empty p { margin: 0; font-size: 12.5px; }
.empty-actions { display: flex; gap: 8px; margin-top: 16px; pointer-events: auto; }

.dropzone {
  position: absolute;
  inset: 10px;
  border: 2px dashed var(--brand);
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.06);
  backdrop-filter: blur(1px);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  font-weight: 700;
  z-index: 5;
  pointer-events: none;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 20px 8px;
  font-size: 11.5px;
  color: var(--muted);
  flex: none;
}
.statusbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.dot { color: var(--muted-2); }

/* ================================================================== selection bar */

.selbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px 7px 16px;
  background: rgba(20, 22, 31, 0.96);
  color: #f4f5fa;
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.28);
  z-index: 35;
  animation: selbar-in 0.16s ease;
}
@keyframes selbar-in { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.selbar-count { font-size: 12.5px; color: #c9ccd8; white-space: nowrap; }
.selbar-count b { color: #fff; font-weight: 800; }
.selbar-div { width: 1px; height: 16px; background: rgba(255, 255, 255, 0.16); margin: 0 6px; }
.selbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e7e9f2;
  font-size: 12px;
  font-weight: 600;
}
.selbar-btn:hover { background: rgba(255, 255, 255, 0.12); }
.selbar-btn.danger { color: #fca5a5; }
.selbar-btn.danger:hover { background: rgba(220, 38, 38, 0.22); }
.selbar-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9aa0b3;
}
.selbar-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ================================================================== panel */

.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 30;
  animation: slide-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.panel-head h2 { margin: 0; font-size: 15.5px; letter-spacing: -0.02em; }

.tabs { display: flex; gap: 4px; padding: 2px 14px 12px; border-bottom: 1px solid var(--line); }
.tab {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.tab:hover { background: #f1f2f8; }
.tab.active { background: var(--brand-soft); color: var(--brand-ink); }

.panel-sub {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
}
.panel-sub .link-btn { font-size: 11.5px; }

.panel-body { flex: 1; overflow: auto; padding: 12px; }

.t-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.t-item:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.t-top { display: flex; gap: 9px; align-items: center; }
.t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.t-meta { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11px; color: var(--muted); }
.t-bar { margin-top: 8px; height: 5px; border-radius: 999px; background: #edeff5; overflow: hidden; }
.t-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.t-actions { display: flex; gap: 1px; }
.t-actions .icon-btn { width: 27px; height: 27px; }
.t-fail { color: var(--danger); }

.panel-empty { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 12.5px; }


/* ------------------------------------------------------------------ memo */
.col-memo {
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.memo-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c3c8d4;
  transition: background 0.14s, color 0.14s;
}
.row:hover .memo-btn { color: var(--muted-2); }
.memo-btn:hover { background: var(--brand-soft); color: var(--brand); }
.memo-btn.has { color: var(--brand); }
.memo-btn.has:hover { background: var(--brand-soft); }

.memo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.memo-item-text { display: flex; flex-direction: column; min-width: 0; }
.memo-item-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-item-text span { font-size: 11px; color: var(--muted-2); }

.memo-input {
  width: 100%;
  min-height: 168px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.memo-input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10); }
.memo-input::placeholder { color: var(--muted-2); }

.memo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.memo-foot-right { display: flex; align-items: center; gap: 10px; }


/* ------------------------------------------------------------------ 동의 · 약관 */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 10px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  cursor: pointer;
}
.consent input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.consent a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.boot-legal { text-align: center; margin: 14px 0 0; font-size: 11.5px; }
.boot-legal a { color: var(--muted); text-decoration: underline; }
.boot-legal a:hover { color: var(--brand); }

/* ================================================================== modal */

.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(13, 16, 25, 0.42);
  backdrop-filter: blur(1.5px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
  animation: fade 0.14s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pop { from { transform: scale(0.97) translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head { padding: 22px 24px 6px; }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }
.modal-body { padding: 12px 24px 6px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 24px 20px; }

.preview-body { padding: 0 0 6px; background: #0c0d12; }
.preview-body img, .preview-body iframe, .preview-body video {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: #0c0d12;
  border: 0;
}
.preview-body pre {
  margin: 0;
  padding: 18px 22px;
  max-height: 62vh;
  overflow: auto;
  color: #e7e9f1;
  background: #0c0d12;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ================================================================== menu */

.menu {
  position: fixed;
  min-width: 196px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 60;
  animation: fade 0.1s ease;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  color: var(--ink-2);
}
.menu-item:hover { background: #f3f4fa; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--line); }

/* ================================================================== toast */

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast {
  min-width: 220px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #12141c;
  color: #f2f4f8;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.18s ease;
  display: flex;
  gap: 9px;
  align-items: center;
}
.toast svg { color: #8b93a8; }
.toast.ok { background: #0f2a1e; }
.toast.ok svg { color: #34d399; }
.toast.err { background: #2c1417; }
.toast.err svg { color: #f87171; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================================================================== tooltip */

.tooltip {
  position: fixed;
  z-index: 90;
  padding: 6px 10px;
  border-radius: 8px;
  background: #12141c;
  color: #f2f4f8;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.24);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: #12141c;
  transform: rotate(45deg);
  border-radius: 1.5px;
}
.tooltip.below::after { bottom: auto; top: -4px; }

/* ================================================================== forms / settings */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.form-grid .field { margin-bottom: 10px; }
.auth-note { font-size: 11px; color: var(--muted-2); line-height: 1.55; margin: 2px 0 0; }
.auth-result {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  min-height: 20px;
}
.auth-result strong { font-size: 14px; letter-spacing: 0.04em; }
.auth-result.err { background: var(--danger-soft); border-color: #f6d5d5; color: #991b1b; }
.auth-result.ok { background: #effaf4; border-color: #cdeadd; color: #065f46; }
.auth-result .copy-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.auth-result code {
  font-family: var(--mono);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
}
.su-sec { margin-top: 2px; }
.su-sec summary { cursor: pointer; font-size: 11.5px; color: var(--muted); padding: 4px 0; user-select: none; }
.su-sec[open] summary { margin-bottom: 8px; }

.settings-sec { margin-bottom: 20px; }
.settings-sec h4 {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.user-row:hover { box-shadow: var(--shadow-xs); }
.user-row .u-main { min-width: 0; flex: 1; }
.user-row .u-main strong { display: block; font-size: 12.5px; font-weight: 600; }
.user-row .u-main span { font-size: 11px; color: var(--muted-2); }
.user-row .u-state {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9f6ef;
  color: #15803d;
}
.user-row .u-state.pending { background: #fef3c7; color: #92400e; }
.user-row .u-state.off { background: #f2f3f6; color: var(--muted); }
.user-row .u-actions { display: flex; gap: 1px; }

.add-guest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}
.add-guest label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.add-guest input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: #fff;
  outline: none;
}
.add-guest input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }

/* ================================================================== help / properties */

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; }
.help-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f3f4f8; }
.help-row span { font-size: 12.5px; color: var(--ink-2); }
.help-row kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f3f4f8;
  border: 1px solid var(--line);
  color: var(--ink-3);
  white-space: nowrap;
}
.help-sec { margin-bottom: 16px; }
.help-sec h4 { margin: 0 0 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-2); }

.prop-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 14px; }
.prop-head strong { font-size: 13.5px; word-break: break-all; }
.prop-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #f3f4f8; font-size: 12.5px; }
.prop-row > span:first-child { color: var(--muted); flex: none; }
.prop-row > span:last-child { text-align: right; word-break: break-all; color: var(--ink-2); }

/* ================================================================== misc */

.skeleton { padding: 0 10px; }
.sk-row { height: 48px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #f3f4f8; }
.sk { background: linear-gradient(90deg, #eef0f5 25%, #f7f8fb 37%, #eef0f5 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: 7px; }
.sk-ico { width: 30px; height: 30px; border-radius: 9px; }
.sk-line { height: 10px; flex: 1; max-width: 320px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.only-mobile { display: none; }
.sidebar-scrim { display: none; }


/* ------------------------------------------------------------------ row more (터치) */
.row-more {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-2);
  place-items: center;
}
.row-more:hover { background: #eef0f7; color: var(--ink); }

#btn-search { display: none; }

.row, .btn, .icon-btn, .nav-item, .tab, .crumb, .sortable, .memo-btn, .row-more, .selbar-btn {
  touch-action: manipulation;
}

/* ================================================================== responsive */

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(13, 16, 25, 0.36);
    border: 0;
    z-index: 10;
  }
  .only-mobile { display: inline-grid; }
  .nav-btns { display: none; }
  .search input { width: 150px; }
  .search input:focus { width: 180px; }
  .list-head, .row { grid-template-columns: 36px minmax(0, 1fr) 34px 84px; }
  .col-date { display: none; }
  .list-head .col-name { padding-left: 40px; }
  .panel { width: 100%; }
  .toolbar { overflow-x: auto; padding-bottom: 8px; }
  .hide-sm { display: none; }
  .btn-label { display: none; }
  .btn { padding: 0 10px; }
  #status-path, .statusbar-right .dot { display: none; }
  .selbar { left: 12px; right: 12px; transform: none; justify-content: center; bottom: 14px; }
  @keyframes selbar-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media (max-width: 600px) {
  .topbar {
    position: relative;
    z-index: 25;
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0;
    gap: 6px;
  }
  .topbar .search { display: none; }
  .topbar .search.open {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    z-index: 45;
  }
  .topbar .search.open input {
    width: 100%;
    height: 42px;
    background: #fff;
    box-shadow: var(--shadow-md);
  }
  .topbar .search.open .search-clear { right: 10px; }
  #btn-search { display: inline-grid; }

  .toolbar { padding: 8px 12px 6px; gap: 4px; }
  #toolbar .btn { height: 40px; padding: 0 11px; }

  .content { margin: 0 10px 8px; }

  .list-head, .row { grid-template-columns: 30px minmax(0, 1fr) 34px; }
  .col-size, .col-date { display: none; }
  .list-head .col-name { padding-left: 40px; }
  .row { height: 56px; padding: 0 46px 0 10px; }
  .row-more { display: grid; }
  .f-ico { width: 32px; height: 32px; }
  .name .label { font-size: 13.5px; }
  .check { width: 20px; height: 20px; }
  .name .path { display: none; }

  .statusbar { height: auto; padding: 0 14px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .selbar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }

  .modal { max-height: 88dvh; display: flex; flex-direction: column; }
  .modal-body { overflow: auto; }
  .modal-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

  .add-guest { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .add-guest .btn { grid-column: 1 / -1; }
  .user-row { flex-wrap: wrap; row-gap: 8px; }
  .user-row .u-actions { margin-left: auto; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }

  .field input, .field select, .add-guest input, .search input, .memo-input { font-size: 16px; }
  .boot { padding: 16px; }
  .boot-card { padding: 26px 20px 20px; }
}

/* 터치 기기에서는 hover로 이름이 펼쳐지지 않게(탭 후 고정 방지) */
@media (hover: none) {
  #toolbar .btn:hover .btn-label { max-width: 0; margin-left: 0; opacity: 0; }
  #toolbar .btn:focus-visible .btn-label { max-width: 150px; margin-left: 7px; opacity: 1; }
}

/* ================================================================== 전송 상태창 (2026-11-24) */
.toasts { bottom: calc(18px + var(--dock-h, 0px)); transition: bottom .2s ease; }
.xfer-dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 65;
  width: min(380px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -12px rgba(16, 24, 40, .28), 0 2px 6px rgba(16, 24, 40, .06);
  overflow: hidden; display: flex; flex-direction: column;
}
.xfer-dock[hidden] { display: none; }
.xfer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 10px 16px; }
.xfer-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xfer-title b { font-size: 14px; font-weight: 600; color: var(--ink); }
.xfer-title span { font-size: 12px; color: var(--muted); }
.xfer-head-actions { display: flex; gap: 2px; }
.xfer-head-actions #xfer-min svg { transition: transform .2s ease; transform: rotate(90deg); }
.xfer-dock.is-min #xfer-min svg { transform: rotate(-90deg); }
.xfer-total { height: 3px; background: var(--line); }
.xfer-total i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s ease; }
.xfer-dock:not(.is-live) .xfer-total i { background: var(--ok); }
.xfer-list { max-height: min(320px, 45vh); overflow-y: auto; padding: 6px 0; }
.xfer-dock.is-min .xfer-list { display: none; }
.xfer-item { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; }
.xfer-item + .xfer-item { border-top: 1px solid var(--line); }
.xfer-kind { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.xfer-kind.download { background: #ecfdf5; color: var(--ok); }
.xfer-body { min-width: 0; display: grid; gap: 4px; }
.xfer-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.xfer-name { font-size: 13px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xfer-pct { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.xfer-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.xfer-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .25s linear; }
.xfer-item.is-done .xfer-bar i { background: var(--ok); }
.xfer-item.is-failed .xfer-bar i, .xfer-item.is-cancelled .xfer-bar i { background: var(--danger); }
.xfer-item.is-wait .xfer-bar i { background: var(--muted-2); }
.xfer-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xfer-item.is-failed .xfer-meta { color: var(--danger); }
.xfer-act { display: grid; place-items: center; }
.xfer-ok { color: var(--ok); display: grid; place-items: center; }
.xfer-bad { color: var(--danger); display: grid; place-items: center; }
@media (max-width: 640px) {
  .xfer-dock { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .toasts { bottom: calc(12px + var(--dock-h, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .xfer-total i, .xfer-bar i, .toasts { transition: none; } }
/* 아래쪽 선택 막대(n개 선택)가 보이면 상태창과 알림을 그 위로 올림 */
body:has(#selbar:not([hidden])) .xfer-dock { bottom: 72px; }
body:has(#selbar:not([hidden])) .toasts { bottom: calc(72px + var(--dock-h, 0px)); }

/* 처음 불러오는 동안 보이는 화면 (로그인 화면 깜빡임 방지) */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 45; }
.splash-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--brand); animation: splash-spin .8s linear infinite; opacity: 0; animation-delay: .25s; animation-fill-mode: forwards; }
@keyframes splash-spin { from { opacity: 1; transform: rotate(0); } to { opacity: 1; transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .splash-dot { animation: none; opacity: 1; } }
/* 사이드바 도구 링크(a.nav-item)도 버튼과 같은 모양 */
a.nav-item { text-decoration: none; color: inherit; }
a.nav-item[hidden] { display: none; }
