/* FilePark — LifePark 과 같은 배경·같은 틀, **강조색은 FilePark 것**(청록 #22B892, 2026-09-22 사용자 결정).
   ★전부 보라였을 때 LifePark 과 구별이 안 됐다. '내 PC' 는 호박색(아이콘 폴더 색)으로 NAS 와 가른다. */
:root {
  --bg: #0b0a12;
  --text: #eceaf3;
  --muted: #bcb8cd;
  --line: rgba(255,255,255,.10);
  --glass: rgba(255,255,255,.055);
  --card: rgba(14,12,22,.58);
  --primary: #22b892;
  --primary-soft: rgba(34,184,146,.20);
  --error: #ff8a8a;
  --ok: #6adc91;
  --side-w: 300px;   /* 폴더 이름이 길다 - 좁으면 잘려서 못 읽는다 */
}
* { box-sizing: border-box; }

/*
   ★★hidden 속성이 CSS 에 지지 않게 못 박는다.
   `[hidden] { display:none }` 은 브라우저 기본 규칙이라 힘이 약해서,
   `.center-view { display:flex }` 같은 **클래스 규칙 하나에 진다**.
   그러면 hidden 을 켜도 화면이 안 사라진다 - 로그인이 다 됐는데도 로그인 화면이
   그대로 남아 "로그인이 안 된다"로 보였다(2026-09-02, 원인 찾는 데 오래 걸림).
*/
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  overflow: hidden;
}

/* 배경 — LifePark 과 같은 규칙(옅게 깔고 어두운 막 한 겹) */
.aurora { position: fixed; inset: -20% -10%; z-index: -2; filter: blur(72px); opacity: .38; pointer-events: none; }
.aurora span { position: absolute; display: block; border-radius: 50%; mix-blend-mode: screen; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: 2%;  top: 0%;    background: #13a58a; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; right: 4%; top: 10%;   background: #2f7cf6; }
.aurora span:nth-child(3) { width: 34vw; height: 34vw; left: 24%; bottom: 0%; background: #17b8a6; }
.aurora span:nth-child(4) { width: 24vw; height: 24vw; right: 18%; bottom: 4%; background: #e0479e; opacity: .7; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(9,8,14,.34); pointer-events: none; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.center-text { text-align: center; }
.error { color: var(--error); font-size: 13px; }
/* 오류가 아니라 '기다리는 중' 안내일 때 */
.error.muted-note { color: var(--muted); }

.link-btn { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; color: var(--text); background: var(--glass); border: 1px solid var(--line); }
.link-btn:hover { background: rgba(255,255,255,.12); }
.link-btn.danger { color: var(--error); }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; color: var(--muted); }
.icon-btn:hover { background: var(--glass); color: var(--text); }
.primary {
  padding: 13px; border-radius: 999px; font-size: 15px; font-weight: 700;
  color: #fff; background: linear-gradient(100deg, #22b892, #0e8a6c);
}

/* 로그인 */
.center-view { display: flex; align-items: center; justify-content: center; height: 100%; padding: 24px; }
.card {
  width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px;
  padding: 26px; border-radius: 20px;
  background: rgba(16,14,24,.86); border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.badge {
  width: 62px; height: 62px; align-self: center; display: grid; place-items: center;
  font-size: 28px; border-radius: 20px;
  background: linear-gradient(140deg, #22b892, #0e8a6c);
}
.badge-img { align-self: center; border-radius: 18px; }
.brand { margin: 8px 0 0; font-size: 30px; text-align: center; }
.sub { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input {
  padding: 12px 14px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text);
}
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.check-row input { accent-color: var(--primary); }

/* 본화면 */
.app { display: flex; flex-direction: column; height: 100%; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: rgba(11,10,18,.62); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.logo { font-size: 17px; }

/* 프로필 (NAS 폴더 + 내 PC 폴더 짝) — 머리 줄 안, 이름 뒤 */
.profile-bar { position: relative; display: flex; align-items: center; gap: 6px; margin-left: 8px; min-width: 0; }
.profile-select {
  max-width: 260px; min-width: 0; padding: 6px 10px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
}
.profile-select.on { border-color: rgba(34,184,146,.6); background: var(--primary-soft); }
.profile-select option { background: #16141f; color: var(--text); }
.profile-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  display: flex; flex-direction: column; min-width: 180px; padding: 6px;
  background: rgba(20,17,30,.97); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.profile-menu button {
  text-align: left; padding: 9px 12px; font: inherit; font-size: 13.5px;
  color: var(--text); background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.profile-menu button:hover { background: rgba(255,255,255,.08); }
.profile-menu button.danger { color: var(--error); }
.body { flex: 1; display: flex; min-height: 0; }

.side {
  width: var(--side-w); flex: none; padding: 12px 10px; overflow-y: auto;
  border-right: 1px solid var(--line); background: rgba(11,10,18,.42);
}
.side h2 { margin: 4px 8px 10px; font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.share-list { display: flex; flex-direction: column; gap: 2px; }
.share {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px; border-radius: 10px; font-size: 14px;
}
.share:hover { background: var(--glass); }
.share.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(34,184,146,.5); }
/* 펼침 단추와 이름을 나눈다 - 한 자리에 두 뜻을 담으면 어느 쪽도 편하지 않다 */
.share .twist {
  flex: none; width: 20px; height: 22px; border-radius: 6px;
  color: var(--muted); font-size: 11px; line-height: 1;
}
.share .twist:hover { background: rgba(255,255,255,.12); color: var(--text); }
.share .label {
  flex: 1; min-width: 0; text-align: left; padding: 3px 4px; border-radius: 6px;
  color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ★min-height:0 — 폰(칸을 세로로 쌓을 때)에서 목록이 제 칸을 넘어 아래 칸을 덮었다(2026-09-28) */
.pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pathbar, .selbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
/* 홈 단추 - 작은 화살표는 눈에 안 띄고 누르기도 어렵다 */
.home-btn { flex: none; font-size: 13.5px; }
.selbar { background: var(--primary-soft); }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.crumbs button { padding: 4px 8px; border-radius: 8px; color: var(--muted); }
.crumbs button:hover { background: var(--glass); color: var(--text); }
.crumbs .sep { color: var(--muted); opacity: .5; }

/* 정렬 머리글 — 줄과 같은 칸 너비를 써야 눈금이 맞는다 */
.head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 26px 6px 26px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.head .mark { width: 18px; flex: none; }
.head .name { flex: 1; text-align: left; padding: 2px 4px; border-radius: 6px; }
.head .size { width: 78px; flex: none; text-align: right; }
.head .date { width: 132px; flex: none; text-align: right; }
.head button:hover { color: var(--text); background: var(--glass); }
.head button.on { color: var(--text); }

.file-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.row:hover { border-color: rgba(255,255,255,.2); }
.row.picked { border-color: rgba(34,184,146,.65); background: linear-gradient(0deg, var(--primary-soft), var(--primary-soft)), var(--card); }
.row .mark { width: 18px; text-align: center; color: var(--muted); }
.row .mark.pick { cursor: pointer; }
.row .mark.pick:hover { color: var(--text); }
.row .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .name.dir { cursor: pointer; font-weight: 600; }
.row .size, .row .date { flex: none; font-size: 12px; color: var(--muted); }
.row .date { width: 132px; text-align: right; }
.row .size { width: 78px; text-align: right; }
.list-info { margin: 0; padding: 8px 16px 12px; font-size: 12px; }
.list-info.warn { color: #fbbf24; }

/* 올리기 */
.drop {
  flex: none;
  margin: 0 14px 12px; padding: 10px 14px 12px;
  border: 1px dashed var(--line); border-radius: 12px;
  background: rgba(11,10,18,.5);
}
.drop.over { background: var(--primary-soft); }
.drop-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.queue { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; max-height: 148px; overflow-y: auto; }
.up-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.up-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row .st { flex: none; width: 96px; text-align: right; color: var(--muted); font-size: 12px; }
.up-row .st.done { color: var(--ok); }
.up-row .st.fail { color: var(--error); }
.bar { flex: none; width: 130px; height: 6px; border-radius: 999px; background: var(--glass); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22b892, #6ee7f2); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 20;
  padding: 12px 20px; font-size: 14px; color: #fff; border-radius: 999px;
  background: linear-gradient(100deg, #22b892, #0e8a6c);
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}

@media (max-width: 760px) {
  .side { display: none; }
  .row .date { display: none; }
}

/* ══ 두 칸 (위 내 PC · 아래 NAS) ═══════════════════════
   ★두 칸이 같은 모양이라야 눈이 다시 배우지 않는다:
   왼쪽 트리 · 오른쪽 목록, 그리고 가운데에서 주고받는다. */
.split { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.half { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.half-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: rgba(11,10,18,.42);
}
.half-head .crumbs { min-width: 0; overflow: hidden; flex-wrap: nowrap; }
/* 어느 칸인지는 **늘 같은 자리·같은 색**으로 (보라=NAS, 청록=내 PC) */
.half-title {
  flex: none; padding: 3px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
}
.half-title.pc { color: #ffd98a; background: rgba(255,188,31,.14); border: 1px solid rgba(255,188,31,.40); }
.half-title.nas { color: #c9f3e6; background: var(--primary-soft); border: 1px solid rgba(34,184,146,.35); }
.picked-count { font-size: 12px; white-space: nowrap; }
.link-btn.accent { color: #ffd98a; border-color: rgba(255,188,31,.40); }

.half-body { flex: 1; min-height: 0; display: flex; }

/* 트리 + 그 밑의 폴더 단추 (+ 폴더 추가 · 새 폴더 · ↻ / 🏠 홈) — 2026-09-28 */
.side-col {
  width: var(--side-w); flex: none; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: rgba(11,10,18,.42);
}
.side-col > .side { flex: 1; width: auto; min-height: 0; border-right: 0; background: none; }
.side-tools {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.side-tools .link-btn { padding: 5px 11px; font-size: 13px; }

/* ══ 프로필 목록 — 넓은 화면(PC)에서 두 칸 오른쪽 ══════════ */
.work { flex: 1; min-height: 0; display: flex; }
.work > .split { min-width: 0; }
/* ★두 칸 **왼쪽**에 둔다 (2026-09-28 사용자 요청 — 처음엔 오른쪽이었다) */
.profile-panel {
  order: -1;
  width: 290px; flex: none; display: none; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: rgba(11,10,18,.42);
}
.profile-panel-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.profile-panel-head strong { flex: 1; font-size: 14px; }
.profile-panel-head .link-btn { padding: 5px 11px; font-size: 12.5px; }
.profile-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.profile-empty { padding: 14px 8px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.profile-card {
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
}
.profile-card:hover { border-color: rgba(255,255,255,.22); }
.profile-card.on { border-color: rgba(34,184,146,.65); background: linear-gradient(0deg, var(--primary-soft), var(--primary-soft)), var(--card); }
.profile-card .p-name { font-size: 14px; font-weight: 700; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card .p-path {
  display: flex; gap: 6px; font-size: 12px; line-height: 1.55; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-card .p-path b { flex: none; font-weight: 600; }
.profile-card .p-path b.pc { color: #ffd98a; }
.profile-card .p-path b.nas { color: #9fe8d2; }
.profile-card .p-path span { overflow: hidden; text-overflow: ellipsis; }
.profile-card .p-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.profile-card .p-tools button {
  padding: 3px 9px; font: inherit; font-size: 12px; border-radius: 999px; cursor: pointer;
  color: var(--text); background: var(--glass); border: 1px solid var(--line);
}
.profile-card .p-tools button:hover { background: rgba(255,255,255,.12); }
.profile-card .p-tools button.danger { color: var(--error); }

/* 넓으면 목록, 좁으면(폰·좁은 창) 머리 줄 고르개 */
@media (min-width: 1100px) {
  .profile-panel { display: flex; }
  .profile-bar { display: none; }
}
/* 좁은 화면은 트리를 숨기므로, 폴더 단추 줄은 칸 맨 밑으로.
   머리 줄은 두 줄로 — 프로필 고르개가 한 줄을 다 쓴다 (한 줄에 끼우면 글자가 세로로 접혔다) */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .link-btn { white-space: nowrap; }
  .profile-bar { order: 10; flex-basis: 100%; margin-left: 0; }
  .profile-select { flex: 1; max-width: none; }
  .half-body { flex-direction: column; }
  .side-col { width: auto; order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .side-tools { border-top: 0; }
}
.tree-hint { padding: 12px 10px; font-size: 12.5px; line-height: 1.6; white-space: pre-line; }

/* 주고받는 자리 — 두 칸 **사이**에 있어야 어디서 어디로 가는지가 보인다 */
.mid {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  background: rgba(20,17,30,.92);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.xfer {
  flex: none; padding: 7px 15px; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  color: var(--on-primary, #fff); background: var(--primary);
  border: 1px solid var(--primary);
}
.xfer:hover:not(:disabled) { filter: brightness(1.12); }
.xfer:disabled { opacity: .38; cursor: default; }
/* 진행률은 가운데 줄 **바닥에** 깐다 - 자리를 따로 차지하지 않는다 */
.xfer-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,.08);
}
.xfer-bar > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s ease; }
