/* 한글이 깔끔한 Pretendard + 이름용 동글동글한 Jua (인터넷이 안 되면 맑은 고딕으로 자동 대체) */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@import url("https://fonts.googleapis.com/css2?family=Jua&display=swap");

/* ======================================================= 토큰 */
:root {
  --bg: #fbf7f3;
  --surface: #ffffff;
  --surface-2: #f6f0ea;
  --surface-3: #efe7de;
  --border: #ede4da;
  --border-strong: #ddd1c4;
  --text: #1f1a17;
  --text-2: #4a3f38;
  --muted: #8a7d72;
  --primary: #e0344a;
  --primary-soft: #fdeaea;
  --primary-text: #b81f36;
  --on-primary: #ffffff;
  --accent: #ffc93c;        /* 우편 노랑: NEW, 새 파일 개수 */
  --on-accent: #3d2b00;
  --airmail: repeating-linear-gradient(-45deg, #e0344a 0 9px, transparent 9px 14px, #3b6cf6 14px 23px, transparent 23px 28px);
  --brand-grad: linear-gradient(135deg, #ff7b5c 0%, #e0344a 100%);
  --danger: #e03e3e;
  --danger-soft: #fdecec;
  --ok: #12a150;
  --ok-soft: #e4f6ec;
  --wait: #c27c0e;
  --wait-soft: #fdf2dc;
  --thumb: #efe8e0;
  --overlay: rgba(15, 18, 30, .5);
  --shadow-1: 0 1px 2px rgba(17, 24, 39, .04), 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-2: 0 4px 12px rgba(17, 24, 39, .06), 0 2px 4px rgba(17, 24, 39, .04);
  --shadow-3: 0 24px 48px rgba(17, 24, 39, .18), 0 4px 12px rgba(17, 24, 39, .08);
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --side-w: 272px;
  --top-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* 어둡게: 기기 설정이 어두운 모드이거나, 직접 "어둡게"를 고른 경우 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14100f;
    --surface: #1d1817;
    --surface-2: #26201e;
    --surface-3: #2f2826;
    --border: #352d2a;
    --border-strong: #463b37;
    --text: #f5efea;
    --text-2: #d7ccc5;
    --muted: #a3958b;
    --primary: #ff6b6b;
    --primary-soft: #3a1f22;
    --primary-text: #ffb3b3;
    --danger: #ff6b6b;
    --danger-soft: #3a1c1f;
    --ok: #39d07f;
    --ok-soft: #14301f;
    --wait: #f2b84b;
    --wait-soft: #35290f;
    --thumb: #2a2321;
    --overlay: rgba(0, 0, 0, .6);
    --shadow-1: none;
    --shadow-2: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-3: 0 24px 48px rgba(0, 0, 0, .55);
    --accent: #ffcf52;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14100f;
  --surface: #1d1817;
  --surface-2: #26201e;
  --surface-3: #2f2826;
  --border: #352d2a;
  --border-strong: #463b37;
  --text: #f5efea;
  --text-2: #d7ccc5;
  --muted: #a3958b;
  --primary: #ff6b6b;
  --primary-soft: #3a1f22;
  --primary-text: #ffb3b3;
  --danger: #ff6b6b;
  --danger-soft: #3a1c1f;
  --ok: #39d07f;
  --ok-soft: #14301f;
  --wait: #f2b84b;
  --wait-soft: #35290f;
  --thumb: #2a2321;
  --overlay: rgba(0, 0, 0, .6);
  --shadow-1: none;
  --shadow-2: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-3: 0 24px 48px rgba(0, 0, 0, .55);
  --accent: #ffcf52;
}

/* ======================================================= 기본 */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.02em; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.error { color: var(--danger); font-size: 14px; margin: 0; }
::selection { background: var(--primary-soft); }

.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }
.ic.xs { width: 13px; height: 13px; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 32px; height: 32px; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; letter-spacing: -0.03em; color: var(--primary-text); }
.brand-font { font-family: "Jua", "Pretendard Variable", Pretendard, "Malgun Gothic", sans-serif; font-weight: 400; letter-spacing: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: url("icons/logo.svg") center / cover;
  box-shadow: 0 4px 10px rgba(224, 52, 74, .3);
}

/* ======================================================= 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:focus-visible, .device:focus-visible, .card:focus-visible, .target:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { /* 다듬기: 그라데이션·색 그림자 없이 단색 하나 (책상 버튼과 같은 체계) */
  background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600;
}
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 86%, #000); border-color: color-mix(in srgb, var(--primary) 86%, #000); }
.btn.danger { color: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 40px; padding: 0; }
.btn.block { width: 100%; min-height: 50px; font-size: 16px; border-radius: var(--radius); }

.pill {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 800;
}

/* ======================================================= 아바타 */
.avatar {
  --hue: 220;
  position: relative; display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, hsl(var(--hue) 85% 95%), hsl(var(--hue) 70% 89%));
  color: hsl(var(--hue) 60% 38%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { background: linear-gradient(145deg, hsl(var(--hue) 35% 26%), hsl(var(--hue) 35% 19%)); color: hsl(var(--hue) 80% 78%); }
}
:root[data-theme="dark"] .avatar { background: linear-gradient(145deg, hsl(var(--hue) 35% 26%), hsl(var(--hue) 35% 19%)); color: hsl(var(--hue) 80% 78%); }
.avatar .ic { width: 22px; height: 22px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; }
.avatar.sm .ic { width: 16px; height: 16px; }
.avatar .dot {
  position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: #a7aebb; border: 2.5px solid var(--surface);
}
.avatar .dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

/* ======================================================= 레이아웃 */
.app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template: "top top" var(--top-h) "side main" minmax(0, 1fr) / var(--side-w) minmax(0, 1fr);
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); z-index: 10; position: relative;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--airmail); opacity: .85; pointer-events: none;
}
.me-chip {
  display: flex; align-items: center; gap: 8px; max-width: 260px; min-height: 38px; padding: 0 12px 0 5px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.me-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.me-chip .me-name { font-size: 14px; font-weight: 600; }
.me-chip .ic { color: var(--muted); }

.status {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border-radius: 15px; background: var(--wait-soft); color: var(--wait); font-size: 13px; font-weight: 600;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.ok i { animation: pulse 2s infinite; }
.status.off { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

.sidebar {
  grid-area: side; display: flex; flex-direction: column; min-height: 0;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--border); overflow: auto;
}
.side-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 8px 10px; }
.side-head h2 { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.side-hint {
  margin: auto 0 0; padding: 14px; border-radius: var(--radius); background: var(--surface-2);
  font-size: 12.5px; color: var(--muted); line-height: 1.65;
}

.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.device {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px;
  border-radius: var(--radius); border: 1.5px solid transparent; background: none; text-align: left; cursor: default;
  transition: background .15s, border-color .15s;
}
.device.droppable { cursor: pointer; }
.device.droppable:hover { background: var(--surface-2); }
.device.drag-over { border-color: var(--primary); border-style: dashed; background: var(--primary-soft); }
.device .info { min-width: 0; flex: 1; display: grid; gap: 1px; }
.device .name { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.device .sub { font-size: 12.5px; color: var(--muted); }
.device .sub.live { color: var(--ok); font-weight: 500; }
.count-badge {
  display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(240, 170, 0, .35);
}
.tag {
  padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.tag.me { background: var(--primary-soft); color: var(--primary-text); }

.content { grid-area: main; min-width: 0; overflow: auto; padding: 24px 32px 120px; }
.content-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

.segmented { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 16px;
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; font-size: 14.5px; font-weight: 600;
  white-space: nowrap; transition: background .15s, color .15s;
}
.segmented button:hover { color: var(--text-2); }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.tab-count { font-weight: 500; color: var(--muted); font-size: 13px; }
.tab-count:empty { display: none; }

.banner {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 12px 12px 12px 18px;
  border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-text); font-size: 14.5px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
.banner span { flex: 1; }
.banner.home-hint {
  background: var(--surface); color: var(--text-2); font-weight: 400; line-height: 1.6;
  border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent);
}

.selection-bar {
  position: sticky; top: -24px; z-index: 5; display: flex; align-items: center; gap: 8px;
  margin: 0 0 20px; padding: 8px 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  box-shadow: var(--shadow-3); font-size: 14px; font-weight: 600;
}

.empty { padding: 96px 16px; text-align: center; color: var(--muted); }
.empty .ic {
  width: 72px; height: 72px; padding: 20px; margin-bottom: 16px; border-radius: 24px;
  background: var(--surface); color: var(--primary); box-shadow: var(--shadow-2);
}
.empty-illust { display: block; width: 190px; height: auto; margin: 0 auto 18px; }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; letter-spacing: -0.02em; }
.empty span { display: block; font-size: 14.5px; }

/* ======================================================= 갤러리 */
.day { display: flex; align-items: baseline; gap: 8px; margin: 32px 0 12px; font-size: 15px; font-weight: 700; color: var(--text); }
.day:first-child { margin-top: 0; }
.day-count { font-size: 13px; font-weight: 500; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }

.card {
  position: relative; overflow: hidden; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.thumb { position: relative; aspect-ratio: 1; background: var(--thumb); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.card:hover .thumb img { transform: scale(1.03); }
/* 사진 위 글씨가 잘 보이도록 위·아래를 살짝 어둡게 */
.thumb:has(img)::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .22), transparent 30%, transparent 65%, rgba(0, 0, 0, .3));
}
.thumb .fallback { padding: 12px; font-size: 12px; color: var(--muted); text-align: center; word-break: break-all; }

.badge {
  position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 700;
  background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px);
}
.badge.video { right: 8px; bottom: 8px; }
.badge.new { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(240, 170, 0, .45); }

.badge.receipt.ok { background: #12a150; }
.badge.receipt.wait { background: rgba(194, 124, 14, .92); }

/* 보낸 사람 이름표: 기기마다 고유 색 */
.who {
  --hue: 220;
  position: absolute; z-index: 1; top: 8px; right: 8px; max-width: calc(100% - 52px);
  height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 11.5px; font-weight: 700; line-height: 22px; color: #fff;
  background: hsl(var(--hue) 62% 44% / .92); backdrop-filter: blur(6px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.check {
  position: absolute; z-index: 2; left: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, .95);
  background: rgba(0, 0, 0, .2); color: transparent; cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s;
}
.card:hover .check, .card.selected .check, .selecting .check { opacity: 1; }
.card.selected .check { background: var(--primary); border-color: var(--primary); color: #fff; }

.card .meta { padding: 10px 12px 12px; }
.card .meta .line1 { font-size: 13.5px; font-weight: 600; color: var(--text); }
.card .meta .line2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.status-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
  height: 22px; padding: 0 8px 0 6px; border-radius: 11px; font-size: 11.5px; font-weight: 600;
}
.status-chip.ok { background: var(--ok-soft); color: var(--ok); }
.status-chip.wait { background: var(--wait-soft); color: var(--wait); }
.status-chip .ic { width: 12px; height: 12px; }

/* ======================================================= 끌어다 놓기 */
.drop-overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px;
  background: var(--overlay); backdrop-filter: blur(6px);
}
.drop-panel {
  width: min(760px, 100%); padding: 32px; border-radius: 24px; background: var(--surface);
  box-shadow: var(--shadow-3); text-align: center;
}
.drop-panel h2 { font-size: 22px; }
.drop-panel p { margin: 8px 0 24px; font-size: 14.5px; }
.drop-targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.drop-target {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px;
  border-radius: var(--radius-lg); border: 2px dashed var(--border-strong); background: var(--surface-2);
  transition: border-color .12s, background .12s, transform .15s var(--ease);
}
.drop-target .avatar { width: 56px; height: 56px; border-radius: 18px; }
.drop-target .ic { width: 28px; height: 28px; }
.drop-target .name { font-size: 14.5px; font-weight: 600; max-width: 100%; }
.drop-target.over { border-color: var(--primary); border-style: solid; background: var(--primary-soft); transform: scale(1.04); }

/* ======================================================= 다이얼로그 */
.dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 24px 28px 28px;
  border: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
}
.dialog[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog.wide { width: min(780px, calc(100vw - 32px)); }
.dialog.narrow { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.dialog h2 { font-size: 20px; }
.dialog h3 { font-size: 14px; font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
#ask-dialog h2 { margin-bottom: 8px; }
#ask-dialog p { margin: 0 0 14px; font-size: 14.5px; white-space: pre-line; } /* 여러 줄 안내 (보내다 만 파일 목록) */
#ask-input, .field input {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface-2); transition: border-color .15s, background .15s;
}
#ask-input:focus, .field input:focus { outline: none; border-color: var(--primary); background: var(--surface); }

.send-files {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); font-size: 14.5px; font-weight: 600;
}
.send-files .stack { display: flex; }
.send-files .stack > * {
  width: 44px; height: 44px; border-radius: 12px; margin-left: -12px; border: 3px solid var(--surface-2);
  background: var(--thumb); object-fit: cover; display: grid; place-items: center; font-size: 10px; color: var(--muted);
}
.send-files .stack > :first-child { margin-left: 0; }
.send-to-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.target {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.target:hover { border-color: var(--border-strong); }
.target[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.target .name { font-size: 14px; font-weight: 600; }
.target .sub { font-size: 12px; color: var(--muted); }
.target .info { min-width: 0; }

.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.add-col { padding: 20px; border-radius: var(--radius-lg); background: var(--surface-2); }
.add-col h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; }
.qr { width: 200px; height: 200px; margin: 0 auto 14px; padding: 10px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-2); }
.qr svg { width: 100%; height: 100%; display: block; }
.steps { margin: 0 0 14px; padding-left: 18px; }
.steps li { margin-bottom: 8px; }
.url-list { display: grid; gap: 4px; margin-top: 8px; }
.url-list code {
  padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
  font: 13px ui-monospace, Consolas, monospace; user-select: all; word-break: break-all;
}
.add-col > p { margin: 0; text-align: center; }
.field-inline { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.manage-title { margin: 24px 0 10px; }
.manage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.manage-list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.manage-list li.fresh { border-color: var(--ok); background: var(--ok-soft); }
.manage-list .info { flex: 1; min-width: 0; font-weight: 600; }
.manage-list .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }

/* ======================================================= 연결 화면 */
.pair-screen {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(255, 123, 92, .18), transparent),
    radial-gradient(50% 40% at 100% 100%, rgba(255, 201, 60, .18), transparent),
    var(--bg);
}
.pair-card {
  position: relative; overflow: hidden;
  width: min(420px, 100%); padding: 36px 28px 32px; border-radius: 28px; text-align: center;
  background: var(--surface); box-shadow: var(--shadow-3);
}
.pair-card::before { /* 항공우편 봉투 테두리 */
  content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: var(--airmail);
}
.pair-illust { display: block; width: 180px; height: auto; margin: 4px auto 6px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
.pair-card h1 { font-size: 32px; margin-bottom: 8px; color: var(--primary-text); }
.pair-card > p { margin: 0 0 28px; font-size: 14.5px; line-height: 1.65; }
.pair-form { display: grid; gap: 16px; text-align: left; }
.field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ======================================================= 미리보기 */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #07080b; color: #fff;
}
.viewer::backdrop { background: #000; }
.viewer-top {
  position: absolute; inset: 0 0 auto; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 10px 14px;
  background: linear-gradient(rgba(0, 0, 0, .7), transparent);
}
.viewer-top .btn { color: #fff; }
.viewer-top .btn:hover { background: rgba(255, 255, 255, .14); }
.viewer-top #viewer-name { font-size: 14.5px; font-weight: 600; margin-left: 4px; }
.viewer-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-nav {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); transition: background .15s;
}
.viewer-nav:hover { background: rgba(255, 255, 255, .24); }
.viewer-nav.prev { left: 18px; }
.viewer-nav.next { right: 18px; }
.viewer-info {
  position: absolute; inset: auto 0 0; z-index: 2; padding: 40px 22px 18px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8)); font-size: 13.5px; color: #d9dce2;
}
.viewer-info .status-chips { margin-top: 10px; }

/* ======================================================= 전송 현황 */
.transfers {
  position: fixed; right: 24px; bottom: 24px; z-index: 30; width: min(380px, calc(100vw - 32px));
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-3);
  overflow: hidden;
}
.transfers-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 18px;
  border: 0; border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 14.5px; font-weight: 700;
}
.transfers.collapsed .transfers-head { border-bottom: 0; }
.transfers.collapsed .transfers-list { display: none; }
.transfers.collapsed .transfers-head .ic { transform: rotate(180deg); }
.transfers-list { max-height: 300px; overflow: auto; padding: 6px 0; }
.transfer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 18px; font-size: 13.5px; }
.transfer .to { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -3px; }
.transfer .state { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.transfer .state.err { color: var(--danger); }
.transfer .state.done { color: var(--ok); }
.bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand-grad); border-radius: 3px; transition: width .2s; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 13px 20px; border-radius: 14px;
  background: #1c1f27; color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-3);
  animation: rise .25s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ======================================================= 저장 폴더 */
.folder-chip { max-width: 240px; color: var(--text-2); }
.folder-chip .ellipsis { max-width: 180px; }

/* ======================================================= 모바일 */
@media (max-width: 760px) {
  :root { --top-h: 56px; }
  .app { grid-template: "top" var(--top-h) "side" auto "main" minmax(0, 1fr) / minmax(0, 1fr); }
  .hide-sm { display: none !important; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand strong { display: none; }
  .me-chip { max-width: 46vw; }
  .status { padding: 0 10px; }
  .status span { display: none; }
  .sidebar { flex-direction: row; padding: 10px 8px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .side-head, .side-hint { display: none; }
  .device-list { display: flex; gap: 2px; }
  .device { flex-direction: column; gap: 6px; width: 76px; padding: 8px 2px; text-align: center; }
  .device .info { width: 100%; }
  .device .name { justify-content: center; font-size: 12px; font-weight: 600; }
  .device .name .tag, .device .sub { display: none; }
  .device { flex: none; min-width: 0; }
  .device .name { min-width: 0; max-width: 100%; overflow: hidden; }
  .device .name > span:first-child { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* 긴 이름은 … 로 (옆 기기와 겹치지 않게) */
  .count-badge { position: absolute; top: 2px; right: 10px; min-width: 20px; height: 20px; font-size: 11px; }
  .content { padding: 16px 12px 120px; }
  .content-head { margin-bottom: 14px; }
  .segmented { flex: 1; width: auto; }
  .segmented button { flex: 1; justify-content: center; padding: 0 8px; gap: 5px; font-size: 14px; }
  .folder-chip { width: 40px; padding: 0; flex: none; }
  .folder-chip .ellipsis { display: none; }
  /* 보내기 버튼 → 오른쪽 아래 둥근 버튼 (엄지 위치) */
  .content-head .btn.primary {
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20;
    width: 62px; height: 62px; padding: 0; border-radius: 22px; box-shadow: 0 10px 24px rgba(224, 52, 74, .45);
  }
  .content-head .btn.primary span { display: none; }
  .content-head .btn.primary .ic { width: 26px; height: 26px; }
  .day { margin: 22px 4px 10px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .card { border-radius: 4px; border: 0; box-shadow: none; }
  .card:hover { transform: none; }
  .card:hover .thumb img { transform: none; }
  .card .meta { display: none; }
  .check { opacity: 1; width: 22px; height: 22px; left: 6px; top: 6px; }
  .who { top: 6px; right: 6px; max-width: calc(100% - 40px); height: 20px; line-height: 20px; font-size: 10.5px; padding: 0 6px; }
  .badge { height: 20px; padding: 0 6px; font-size: 10.5px; }
  .badges { left: 6px; bottom: 6px; gap: 3px; }
  .badge.video { right: 6px; bottom: 6px; }
  .add-grid { grid-template-columns: 1fr; }
  .transfers { right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); }
  .viewer-nav { display: none; }
  .dialog { padding: 20px; border-radius: 20px; }
}

/* ======================================================= 프로필 (이모지·색) */
.avatar .emoji { font-size: 22px; line-height: 1; }
.avatar.sm .emoji { font-size: 15px; }
.drop-target .avatar .emoji { font-size: 28px; }
.profile-preview { display: flex; align-items: flex-end; gap: 14px; }
.profile-preview .avatar { width: 64px; height: 64px; border-radius: 20px; }
.profile-preview .avatar .emoji { font-size: 34px; }
.profile-preview .avatar .ic { width: 32px; height: 32px; }
.profile-preview .grow { flex: 1; }
.profile-h { margin: 20px 0 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emoji-grid .pick {
  height: 42px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 22px; cursor: pointer; transition: transform .1s, border-color .15s, background .15s;
}
.emoji-grid .pick.text { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.emoji-grid .pick:hover { transform: scale(1.08); }
.hue-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.hue-grid .swatch {
  --hue: 0;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border);
  background: linear-gradient(145deg, hsl(var(--hue) 80% 72%), hsl(var(--hue) 65% 52%));
}
.hue-grid .swatch.auto {
  width: auto; padding: 0 12px; border-radius: 17px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface-2);
}
.emoji-grid [aria-pressed="true"], .hue-grid [aria-pressed="true"] {
  border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
}
.emoji-grid [aria-pressed="true"] { background: var(--primary-soft); }

/* ======================================================= 휴지통 */
.trash-banner { background: var(--surface-2); color: var(--text-2); border-color: var(--border); font-weight: 500; }
.badge.expire { background: rgba(60, 50, 45, .78); }
.badge.expire.soon { background: var(--danger); }
.card.in-trash .thumb img { filter: grayscale(.4); opacity: .85; }
.card.in-trash:hover .thumb img { opacity: 1; }
.card.in-trash:hover .thumb img { filter: none; }

/* ======================================================= 설정 백업 */
.backup-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2);
}
.backup-row h3 { margin: 0 0 2px; }
.backup-row p { margin: 0; }
.pair-code-row { margin-top: 16px; }
.pair-code-row > div { flex: 1; min-width: 0; }
.pair-code { font: 700 26px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .14em; color: var(--text); white-space: nowrap; }

/* ======================================================= 새 우편 도착: 우체통 깃발 */
.topbar .brand-mark { position: relative; overflow: visible; }
.topbar .brand-mark::after { /* 깃발: 평소에는 내려가 있음 */
  content: ""; position: absolute; right: -5px; top: 14px; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(var(--accent) 0 45%, #b58a1a 45%);
  transform-origin: 50% 100%; transform: rotate(80deg); opacity: 0; transition: transform .4s var(--ease), opacity .3s;
}
.topbar .brand-mark.has-mail::after { opacity: 1; transform: rotate(0deg); top: -2px; }
.topbar .brand-mark.ding { animation: ding .9s var(--ease); }
@keyframes ding {
  0% { transform: none; }
  20% { transform: translateY(-6px) rotate(-8deg); }
  40% { transform: translateY(0) rotate(6deg); }
  60% { transform: translateY(-3px) rotate(-4deg); }
  80% { transform: rotate(2deg); }
}

/* ======================================================= 편지 · 하트 */
.badges { position: absolute; z-index: 1; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.badges .badge { position: static; }
.badge.letter { background: #fff7e6; color: #b45309; padding: 0 7px; }
.badge.heart { background: #ff4d6d; }
.note-line { margin-top: 4px; font-size: 12.5px; color: var(--primary-text); font-style: italic; }
.heart-btn {
  border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 2px 0;
  color: var(--muted); transition: transform .15s;
}
.heart-btn:hover { transform: scale(1.2); color: #ff4d6d; }
.heart-btn.on { color: #ff4d6d; animation: beat .4s var(--ease); }
@keyframes beat { 40% { transform: scale(1.35); } }
.viewer-top .heart-toggle { font-size: 22px; }
.viewer-top .heart-toggle.on { color: #ff6b81; }
.letter-field { display: grid; gap: 6px; margin-top: 18px; }
.letter-head { font-size: 14px; font-weight: 700; }
#send-note {
  width: 100%; resize: vertical; min-height: 60px; padding: 12px 14px; border-radius: var(--radius);
  border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, var(--border));
  background:
    repeating-linear-gradient(transparent 0 26px, color-mix(in srgb, var(--primary) 10%, transparent) 26px 27px),
    #fffaf0;
  font: inherit; line-height: 27px; color: #4a3f38;
}
#send-note:focus { outline: none; border-style: solid; border-color: var(--primary); }
.letter-card {
  max-width: 560px; margin-bottom: 10px; padding: 12px 16px; border-radius: 12px;
  background: #fffaf0; color: #4a3f38; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); position: relative;
}
.letter-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; border-radius: 12px 12px 0 0; background: var(--airmail); }
.letter-card b { font-size: 13px; color: #b81f36; }
.letter-card p { margin: 4px 0 0; font-size: 15px; white-space: pre-wrap; }
.hearts-line { margin-top: 6px; color: #ff9aa9; }

/* ======================================================= 글만 보내기 */
.thumb.text-thumb {
  place-items: stretch; padding: 14px 14px 34px;
  background:
    repeating-linear-gradient(transparent 0 21px, rgba(224, 52, 74, .1) 21px 22px) 0 12px / 100% 100% no-repeat,
    #fffaf0;
}
.thumb.text-thumb::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--airmail); }
.text-preview {
  margin: 0; color: #4a3f38; font-size: 13.5px; line-height: 22px; white-space: pre-wrap; word-break: break-word;
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7;
}
.text-field { display: grid; gap: 6px; margin-bottom: 18px; }
#send-text {
  width: 100%; resize: vertical; min-height: 150px; padding: 12px 14px; border-radius: var(--radius);
  border: 1.5px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  background:
    repeating-linear-gradient(transparent 0 26px, color-mix(in srgb, var(--primary) 10%, transparent) 26px 27px),
    #fffaf0;
  font: inherit; line-height: 27px; color: #4a3f38;
}
#send-text:focus { outline: none; border-color: var(--primary); }
.text-sheet {
  position: relative; width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 190px); overflow: auto;
  padding: 26px 24px 22px; border-radius: 16px; background: #fffaf0; color: #3a302a; box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.text-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; border-radius: 16px 16px 0 0; background: var(--airmail); }
.text-sheet-head { font-size: 13px; font-weight: 700; color: #b81f36; margin-bottom: 8px; }
.text-sheet p { margin: 0; font-size: 16.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; user-select: text; }

/* ======================================================= 전송·다운로드 기록 */
.activity-dialog { width: min(1000px, calc(100vw - 32px)); }
.activity-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.activity-filters select, .activity-filters input, .activity-foot select {
  height: 38px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
.activity-filters input { flex: 1; min-width: 160px; }
.activity-log {
  height: min(56vh, 560px); overflow: auto; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); padding: 4px 0;
  font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, "D2Coding", "Malgun Gothic", monospace;
}
.act-day {
  position: sticky; top: -4px; z-index: 1; padding: 6px 14px; font: 700 12.5px/1.4 "Pretendard Variable", Pretendard, sans-serif;
  color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.act-row {
  display: grid; grid-template-columns: 72px 96px minmax(120px, 1.1fr) minmax(0, 2fr) 112px; gap: 10px; align-items: center;
  padding: 5px 14px; border-bottom: 1px dashed var(--border);
}
.act-row:hover { background: var(--surface-3); }
.act-row.fresh { animation: actFresh 2.4s var(--ease); }
@keyframes actFresh { 0%, 30% { background: color-mix(in srgb, var(--accent) 35%, transparent); } }
.act-time { color: var(--muted); }
.act-tag {
  justify-self: start; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap;
  font-family: "Pretendard Variable", Pretendard, sans-serif;
}
.act-tag.up { background: var(--primary-soft); color: var(--primary-text); }
.act-tag.down { background: var(--ok-soft); color: var(--ok); }
.act-tag.del { background: var(--wait-soft); color: var(--wait); }
.act-tag.misc { background: var(--surface-3); color: var(--text-2); }
.act-tag.desk { background: color-mix(in srgb, #8a6644 16%, var(--surface)); color: color-mix(in srgb, #8a6644 85%, var(--text)); }
.act-tag.ext { background: color-mix(in srgb, #4a6b9a 15%, var(--surface)); color: color-mix(in srgb, #4a6b9a 85%, var(--text)); }
.act-who .arrow { color: var(--muted); }
.act-file small { color: var(--muted); }
.act-ip { color: var(--muted); font-size: 12px; text-align: right; }
.act-empty { padding: 40px; text-align: center; color: var(--muted); font-family: "Pretendard Variable", Pretendard, sans-serif; }
.activity-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.activity-foot p { margin: 0; }
.activity-foot code { font-size: 12px; word-break: break-all; }
#act-summary { margin: 0 0 8px; min-height: 1.5em; }

/* 기기를 눌렀을 때: 사진·파일 / 글 고르기 */
.choose-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choose-btn {
  display: grid; justify-items: center; gap: 4px; padding: 20px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.choose-btn:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); }
.choose-btn .choose-ic { font-size: 34px; line-height: 1.2; }
.choose-btn b { font-size: 15px; }
.choose-btn small { color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 760px) {
  .act-row { grid-template-columns: 62px 1fr; row-gap: 2px; }
  .act-tag { justify-self: end; }
  .act-who, .act-file { grid-column: 1 / -1; }
  .act-ip { display: none; }
  .activity-foot .spacer { display: none; }
}

/* ======================================================= 여러 개 선택 · 한 번에 받기 */
.sel-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.day-select {
  margin-left: 4px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  opacity: 0; transition: opacity .15s, color .15s, border-color .15s;
}
.day:hover .day-select, .selecting .day-select, .day-select:focus-visible { opacity: 1; }
.day-select:hover { color: var(--primary); border-color: var(--primary); }

.marquee {
  position: fixed; z-index: 50; pointer-events: none; border-radius: 6px;
  border: 1.5px solid var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
}
body.marqueeing { user-select: none; cursor: crosshair; }

.dl-folder {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.dl-folder > .ic { color: var(--primary); flex: none; }
.dl-folder-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dl-folder-text small { color: var(--muted); font-size: 12px; }
.dl-note {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2);
  color: var(--text-2); font-size: 13px; line-height: 1.6;
}

@media (max-width: 760px), (hover: none) {
  .sel-hint { display: none; }
  .day-select { opacity: 1; }
}

/* ======================================================= 찾기 · 묶음 · 정리 */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -6px 0 16px; }
.f-rest { display: flex; flex: 1 1 auto; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; }
.f-search { display: flex; align-items: center; gap: 8px; flex: 0 1 300px; min-width: 200px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.f-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.f-search .ic { color: var(--muted); flex: none; }
.f-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; color: var(--text); }
.f-chips { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.f-chips[hidden] { display: none; }
.f-chips button { padding: 5px 11px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.f-chips button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1, 0 1px 3px rgb(0 0 0 / .1)); }
.f-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.f-toggle[hidden] { display: none; }
.f-toggle input { accent-color: var(--primary); width: 16px; height: 16px; }
.filter-result { margin: -8px 0 14px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.filter-result .link { border: 0; background: none; padding: 0; font: inherit; color: var(--primary); font-weight: 700; cursor: pointer; }

.card.bundle .thumb.collage { display: grid; gap: 2px; padding: 0; background: var(--surface-2); }
.thumb.collage.n2 { grid-template-columns: 1fr 1fr; }
.thumb.collage.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.thumb.collage.n3 > :first-child { grid-row: span 2; }
.thumb.collage.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.thumb.collage > img, .thumb.collage > .fallback { width: 100%; height: 100%; object-fit: cover; min-height: 0; display: grid; place-items: center; font-size: 11px; overflow: hidden; }
.bundle-count { position: absolute; right: 8px; bottom: 8px; padding: 2px 9px; border-radius: 9px; background: rgb(0 0 0 / .62); color: #fff; font-size: 12.5px; font-weight: 800; }
.card.bundle::after { content: ''; position: absolute; inset: 6px -6px -6px 6px; z-index: -1; border-radius: inherit; background: var(--surface); border: 1px solid var(--border); }
.card.bundle { overflow: visible; }
.bundle-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); font-weight: 700; font-size: 14px; }
.bundle-end { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--primary) 18%, transparent); }

.old-box { margin-top: 30px; border: 1px dashed var(--border-strong, var(--border)); border-radius: 16px; padding: 10px 14px; background: var(--surface); }
.old-box.open { padding-bottom: 18px; }
.old-head { display: flex; align-items: center; gap: 10px; }
.old-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 2px; font: inherit; color: var(--text); cursor: pointer; }
.old-arrow { width: 16px; color: var(--muted); }
.old-box .day:first-of-type { margin-top: 14px; }

@media (max-width: 760px) {
  .filter-bar { gap: 8px; margin-top: -4px; }
  .f-search { flex: 1 1 100%; }
  .f-rest { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .f-rest::-webkit-scrollbar { display: none; }
  .f-rest .spacer { display: none; }
  .f-chips, .f-toggle { flex: none; }
  .f-toggle { font-size: 12.5px; }
  .old-head { flex-wrap: wrap; gap: 6px; }
  .old-toggle { flex: 1 1 100%; }
  .old-toggle .muted { display: none; }
  .old-toggle b { white-space: nowrap; font-size: 14px; }
  .old-head .spacer { display: none; }
  .old-head .btn { padding: 5px 9px; font-size: 12px; }
}

/* 다듬기: 움직임 줄이기(Windows 설정)를 켠 PC에서는 애니메이션을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ======================================================= 아이디 저장 · 비밀번호 바꾸기 */
.remember { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; margin-top: -4px; }
.remember input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
#password-form { margin-top: 8px; }

/* ======================================================= 이름 연결 기기 정리 */
.legacy-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.legacy-head .btn[hidden] { display: none; }
.manage-list li.revoked { opacity: .72; }
.manage-list .tag.off { margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }

/* ======================================================= 회원 관리: inbox 경로 */
.members-list .inbox-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 12px; font-weight: 400; }
.members-list .inbox-path .lbl { color: var(--muted); }
.members-list .inbox-path code { font: 12px ui-monospace, Consolas, monospace; background: var(--surface-2); border-radius: 6px; padding: 2px 7px; cursor: copy; overflow-wrap: anywhere; }
.members-list .inbox-path .none { color: var(--wait); }
.members-list .inbox-path a, .members-list .inbox-path .linkish { color: var(--primary-text); font-weight: 700; font-size: 12px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

/* ======================================================= 허브 PC 표시 */
.hub-tag { margin-left: 8px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #12a150, #2bb866); white-space: nowrap; }
.hub-tag[hidden] { display: none; }

/* ======================================================= 회원 관리 (허브) */
#btn-members { position: relative; }
.tag.admin { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--wait-soft); color: var(--wait); vertical-align: 1px; }
.members-list li { flex-wrap: wrap; }
.members-list .acts { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.members-list .empty-row { color: var(--muted); font-size: 13.5px; justify-content: center; }
#signup-box[hidden] { display: none; }

/* ======================================================= 로그인한 곳 · 나에게 보내기 */
.sessions-list { margin: 12px 0 4px; }
.sessions-list li.current { border-color: var(--ok); background: var(--ok-soft); }
.sessions-list .here { font-size: 11.5px; font-weight: 700; color: var(--ok); margin-left: 6px; }
.target.self .sub, .drop-target.self .name { color: var(--primary-text); }

/* ======================================================= 로그인 · 회원가입 (2026-11-14) */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 20px;
  border-radius: 14px; background: var(--surface-2);
}
.auth-tabs button {
  min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--muted);
  font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s;
}
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--primary-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.auth-tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pair-form[hidden] { display: none; }
.pair-form .field input { font-size: 16px; min-height: 48px; }
.pair-form .hint.center { text-align: center; margin-top: -6px; }
.ok-note { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; background: var(--ok-soft); color: var(--text); }
.signup-badge {
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.signup-badge[hidden] { display: none; }
.signup-list li { flex-wrap: wrap; }
.signup-list .attach { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.signup-list .attach select { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
.signup-list .acts { display: flex; gap: 6px; margin-left: auto; }

/* ======================================================= 파일 끄는 중 표시 */
body.dragging-files::after {
  content: ""; position: fixed; inset: 8px; z-index: 90; pointer-events: none;
  border: 2.5px dashed var(--primary); border-radius: 20px;
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  animation: drag-pulse 1.4s ease-in-out infinite;
}
@keyframes drag-pulse { 50% { border-color: color-mix(in srgb, var(--primary) 45%, transparent); } }
.drag-hint {
  position: fixed; left: 50%; bottom: 28px; z-index: 91; pointer-events: none;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--surface);
  font-size: 14px; font-weight: 700; box-shadow: var(--shadow-3);
  transform: translateX(-50%); animation: drag-hint-in .18s ease-out;
}
.drag-hint[hidden] { display: none; }
.drag-hint-ic { font-size: 18px; line-height: 1; animation: drag-bob 1s ease-in-out infinite; }
@keyframes drag-hint-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes drag-bob { 50% { transform: translateY(-3px); } }
.device.drag-over { outline: 2.5px solid var(--primary); outline-offset: -2px; background: var(--primary-soft); }
@media (prefers-reduced-motion: reduce) { body.dragging-files::after, .drag-hint, .drag-hint-ic { animation: none; } }

/* ======================================================= 보내기 취소 · 끝난 뒤 요약 */
.transfers-top { display: flex; align-items: stretch; }
.transfers-top .transfers-head { flex: 1; min-width: 0; }
.transfers-cancel { flex: none; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--danger); font: inherit; font-size: 12.5px; font-weight: 700; padding: 0 14px; cursor: pointer; }
.transfers-cancel:hover { background: var(--danger-soft); }
.transfers-cancel[hidden] { display: none; }
.transfers.collapsed .transfers-cancel { border-bottom: 0; }
.transfer .tstate { display: inline-flex; align-items: center; gap: 6px; justify-self: end; }
.tcancel { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 22px; cursor: pointer; padding: 0; }
.tcancel:hover { background: var(--danger-soft); color: var(--danger); }
.transfer .state.cancel { color: var(--muted); text-decoration: line-through; }
.tsum { display: flex; align-items: flex-start; gap: 8px; margin: 6px 12px; padding: 10px 8px 10px 12px; border-radius: 12px; background: var(--ok-soft); font-size: 13px; }
.tsum.warn { background: var(--wait-soft); }
.tsum-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tsum-text b { font-size: 13.5px; }
.tsum-text span { color: var(--text-2); overflow-wrap: anywhere; }

/* 받은 파일 NEW 모두 확인 */
.mark-seen { margin-left: 8px; }
.mark-seen[hidden] { display: none; }

/* 집 와이파이 빠른 길 표시 */
.lan-badge { font-size: 12px; font-weight: 800; color: #0b6b34; background: #dff6e8; border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.lan-badge[hidden] { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lan-badge { color: #8fe0ad; background: #173524; } }
:root[data-theme="dark"] .lan-badge { color: #8fe0ad; background: #173524; }
