/* 도면금고 — 메신저 앱처럼 단순하게.
   탭 3개(파일·휴지통·설정), 큰 목록 줄, + 버튼 하나. 강조색은 벽돌색 하나, 글꼴은 Pretendard 하나. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/fonts/PretendardVariable.woff2") format("woff2-variations"), url("/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920; font-style: normal; font-display: swap;
}
:root {
  --bg: #FFFFFF; --bg-2: #F3F4F6; --card: #FFFFFF;
  --ink: #191A1C; --ink-2: #4A4D52; --mute: #8B8F96;
  --line: #EEEFF1; --line-2: #DCDEE2; --hover: #F5F6F8; --press: #ECEDF0;
  --accent: #D04A2D; --accent-ink: #FFFFFF; --accent-soft: #FCEEE9;
  --ok: #1F8A4C; --busy: #B7791F; --bad: #D93025;
  --tile: #F1F2F4; --solid: #24272B; --solid-ink: #FFFFFF;
  --scrim: rgba(0, 0, 0, .38); --shadow: 0 12px 40px rgba(0, 0, 0, .14);
  --f: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-code: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --rail: 78px; --w: 780px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121314; --bg-2: #0C0D0E; --card: #1C1D20;
    --ink: #EDEEF0; --ink-2: #C4C7CC; --mute: #8C9097;
    --line: #26282B; --line-2: #393C41; --hover: #1D1F21; --press: #26282B;
    --accent: #F0694C; --accent-ink: #1A0A06; --accent-soft: #3A211B;
    --ok: #4CC27E; --busy: #E7A83E; --bad: #FF6B5E;
    --tile: #26282C; --solid: #E9EAEC; --solid-ink: #141516;
    --scrim: rgba(0, 0, 0, .6); --shadow: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121314; --bg-2: #0C0D0E; --card: #1C1D20;
  --ink: #EDEEF0; --ink-2: #C4C7CC; --mute: #8C9097;
  --line: #26282B; --line-2: #393C41; --hover: #1D1F21; --press: #26282B;
  --accent: #F0694C; --accent-ink: #1A0A06; --accent-soft: #3A211B;
  --ok: #4CC27E; --busy: #E7A83E; --bad: #FF6B5E;
  --tile: #26282C; --solid: #E9EAEC; --solid-ink: #141516;
  --scrim: rgba(0, 0, 0, .6); --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--f); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
body.gray { background: var(--bg-2); }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.code-font { font-family: var(--f-code); letter-spacing: 0; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── 틀: 왼쪽 탭(넓은 화면) / 아래 탭(폰) ── */
.rail {
  position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: max(18px, env(safe-area-inset-top)) 0 18px max(0px, env(safe-area-inset-left));
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.rail .logo { width: 40px; height: 40px; margin-bottom: 18px; border-radius: 11px; }
.tab { position: relative; display: grid; justify-items: center; gap: 3px; width: 64px; padding: 10px 0 8px; border-radius: 14px; color: var(--mute); font-size: 11px; font-weight: 600; }
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--ink); }
.tab.on svg { stroke-width: 2.2; }
.tab .dot { position: absolute; top: 8px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.tab .dot.busy { background: var(--busy); }

.main { margin-left: var(--rail); min-height: 100%; }
.wrap { max-width: var(--w); margin: 0 auto; padding-bottom: 120px; }
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px;
  min-height: 60px; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
}
body.gray .bar { background: color-mix(in srgb, var(--bg-2) 92%, transparent); }
.bar h1 { flex: 1; min-width: 0; margin: 0 6px; font-size: 21px; font-weight: 750; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibtn { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.ibtn:hover { background: var(--hover); }
.ibtn:active { background: var(--press); }
.search { padding: 0 16px 8px; }
.search input { width: 100%; height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--bg-2); outline: none; font-size: 15px; }
body.gray .search input { background: var(--card); }

/* ── 목록 ── */
.list { padding: 4px 8px; }
.item { display: flex; align-items: center; gap: 14px; min-height: 70px; padding: 8px 6px 8px 10px; border-radius: 14px; cursor: pointer; user-select: none; }
.item:hover { background: var(--hover); }
.item:active { background: var(--press); }
.ico { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; overflow: hidden; background: var(--tile); color: var(--ink-2); font: 750 10.5px/1 var(--f); letter-spacing: .02em; }
.ico.dir { background: var(--accent-soft); color: var(--accent); }
.ico.dir svg { width: 24px; height: 24px; stroke-width: 1.9; }
.ico.solid { background: var(--solid); color: var(--solid-ink); }
.ico img { width: 100%; height: 100%; object-fit: cover; }
.txt { flex: 1; min-width: 0; }
.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.sub .wait { color: var(--busy); }
.item .ibtn { color: var(--mute); width: 38px; height: 38px; }
.item .go { color: var(--line-2); }
.pill-btn { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: var(--bg-2); font-size: 13.5px; font-weight: 650; }
.pill-btn:hover { background: var(--press); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 90px 24px 40px; text-align: center; }
.empty .big { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 24px; background: var(--bg-2); color: var(--mute); margin-bottom: 8px; }
.empty .big svg { width: 34px; height: 34px; }
.empty b { font-size: 18px; font-weight: 700; }
.empty span { color: var(--mute); font-size: 14px; max-width: 340px; }
.note { margin: 2px 18px 6px; color: var(--mute); font-size: 13px; }

/* ── 설정 (묶음 목록) ── */
.profile { display: flex; align-items: center; gap: 14px; margin: 6px 16px 4px; padding: 18px; border-radius: 20px; background: var(--card); }
.profile .av { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); font-size: 22px; font-weight: 800; }
.profile b { display: block; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.profile span { color: var(--mute); font-size: 13px; }
.gt { margin: 24px 22px 8px; font-size: 13px; font-weight: 650; color: var(--mute); }
.group { margin: 0 16px; border-radius: 20px; overflow: hidden; background: var(--card); }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 18px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 15.5px; }
.srow:first-child { border-top: 0; }
button.srow:hover, a.srow:hover { background: var(--hover); }
.srow .lbl { flex: 1; min-width: 0; }
.srow .lbl small { display: block; color: var(--mute); font-size: 12.5px; }
.srow .val { color: var(--mute); font-size: 14px; white-space: nowrap; }
.srow .go { color: var(--line-2); width: 18px; height: 18px; }
.srow.danger { color: var(--bad); }
.stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; }
.stat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stat.ok { color: var(--ok); } .stat.busy { color: var(--busy); } .stat.bad { color: var(--bad); } .stat.none { color: var(--mute); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 15px; background: var(--line-2); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.seg { display: flex; gap: 4px; padding: 4px; margin: 0 16px; border-radius: 16px; background: var(--card); }
.seg button { flex: 1; height: 42px; border: 0; border-radius: 12px; background: none; color: var(--mute); font-weight: 650; font-size: 14px; }
.seg button.on { background: var(--ink); color: var(--bg); }

/* ── 버튼 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--bg-2); font-size: 15.5px; font-weight: 700; white-space: nowrap; }
.btn:hover { background: var(--press); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.block { width: 100%; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.google { background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; }
.btn.google:hover { background: #F8F9FA; }
.btn.google svg { width: 20px; height: 20px; }
.link { padding: 8px; border: 0; background: none; color: var(--mute); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.fab {
  position: fixed; z-index: 15; right: max(28px, calc((100vw - var(--rail) - var(--w)) / 2 + 20px)); bottom: max(28px, env(safe-area-inset-bottom));
  width: 60px; height: 60px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.2; }
.fab:active { transform: scale(.96); }

/* ── 시트(창) ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; /* 로그인 화면(80) 위에서도 "구글 로그인 켜기" 창이 보이게 */ display: grid; place-items: center; padding: 20px; background: var(--scrim); }
.sheet { width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
body.gray .sheet, .sheet { background: var(--bg); }
.sheet.wide { width: min(900px, 100%); }
.sh-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 4px 22px; }
.sh-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.03em; overflow-wrap: anywhere; }
.sh-body { padding: 8px 22px 6px; }
.sh-body p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.sh-foot { display: flex; gap: 8px; padding: 12px 22px 22px; }
.sh-foot .btn { flex: 1; }
.acts { padding: 6px 10px 14px; }
.act { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 14px; border: 0; border-radius: 14px; background: none; text-align: left; font-size: 16px; font-weight: 550; }
.act:hover { background: var(--hover); }
.act svg { color: var(--ink-2); }
.act.danger, .act.danger svg { color: var(--bad); }
.act .val { margin-left: auto; color: var(--mute); font-size: 14px; }
.field { display: grid; gap: 6px; margin: 4px 0 12px; }
.field span { font-size: 13px; font-weight: 600; color: var(--mute); }
.field input { height: 50px; padding: 0 14px; border: 1.5px solid transparent; border-radius: 14px; background: var(--bg-2); outline: none; font-size: 16px; }
.field input:focus { border-color: var(--ink); }
.field .inrow { display: flex; gap: 8px; }
.field .inrow input { flex: 1; min-width: 0; }
.field .inrow button { flex: none; height: 50px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font: 650 14px/1 var(--f); cursor: pointer; }
.field .inrow button:active { background: var(--press); }
.err { min-height: 18px; color: var(--bad); font-size: 13px; }
.picker { max-height: 46vh; overflow: auto; margin: 0 -8px; }
.picker label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px 0 calc(12px + var(--d, 0) * 18px); border-radius: 12px; cursor: pointer; }
.picker label:hover { background: var(--hover); }
.picker input { width: 18px; height: 18px; accent-color: var(--accent); }

.preview { display: grid; place-items: center; min-height: 220px; max-height: 62vh; margin: 8px 22px 0; border-radius: 16px; overflow: hidden; background: var(--bg-2); }
.preview img, .preview video { max-width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.preview iframe { width: 100%; height: 62vh; border: 0; background: #fff; }
.preview pre { width: 100%; height: 50vh; margin: 0; padding: 16px; overflow: auto; font: 12.5px/1.6 var(--f-code); white-space: pre-wrap; }
.preview .ico { width: 84px; height: 84px; border-radius: 24px; font-size: 16px; }
.meta { padding: 14px 22px 0; }
.meta b { display: block; font-size: 19px; font-weight: 750; letter-spacing: -.03em; overflow-wrap: anywhere; }
.meta span { color: var(--mute); font-size: 13.5px; }
.two { display: flex; gap: 8px; padding: 14px 22px 4px; }
.two .btn { flex: 1; }
.ver { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 8px 6px 12px; border-radius: 14px; }
.ver:hover { background: var(--hover); }
.ver .r { width: 44px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ver.cur .r { color: var(--accent); }

.qr { width: 200px; height: 200px; margin: 6px auto 14px; padding: 10px; border-radius: 16px; background: #fff; }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }
.code { display: block; margin: 0 0 14px; text-align: center; font-size: 28px; font-weight: 800; letter-spacing: .1em; font-variant-numeric: tabular-nums; user-select: all; }
.steps { margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.steps li + li { margin-top: 6px; }
.copy { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--bg-2); font: 12.5px/1.4 var(--f-code); overflow-wrap: anywhere; }
.copy span { flex: 1; min-width: 0; }
.copy button { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--card); font: 650 12.5px var(--f); }
.bar-p { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.bar-p i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ── 올리기 ── */
.uploads { position: fixed; z-index: 30; left: calc(var(--rail) + 20px); bottom: max(20px, env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 40px)); max-height: 50vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.up-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; }
.up-head b { flex: 1; font-size: 15px; }
.up-list { overflow: auto; padding: 0 10px 10px; }
.uploads.min .up-list { display: none; }
.up { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px; font-size: 13.5px; }
.up .nm { font-size: 13.5px; font-weight: 550; }
.up .st { color: var(--mute); font-size: 12.5px; }
.up .st.ok { color: var(--ok); } .up .st.bad { color: var(--bad); }
.up .bar-p, .up .e { grid-column: 1 / -1; }
.up .e { color: var(--bad); font-size: 12.5px; }

.drop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); }
.drop div { display: grid; gap: 6px; padding: 40px 48px; border: 2px dashed var(--accent); border-radius: 24px; background: var(--card); text-align: center; }
.drop b { font-size: 20px; }
.drop span { color: var(--mute); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: max(30px, env(safe-area-inset-bottom)); z-index: 100; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 550; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }

/* ── 로그인 ── */
.login { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow: auto; padding: 32px 24px; background: var(--bg); }
.login .box { display: grid; gap: 10px; width: min(360px, 100%); text-align: center; }
.login .logo { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 24px; box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }
.login h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.login .tag { margin: 0 0 26px; color: var(--mute); font-size: 14.5px; }
.login .wait { display: grid; gap: 12px; justify-items: center; padding: 10px 0; color: var(--ink-2); font-size: 14.5px; }
.spin { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login .codein { height: 54px; padding: 0 16px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--bg); text-align: center; font: 750 22px/1 var(--f); letter-spacing: .14em; text-transform: uppercase; outline: none; font-variant-numeric: tabular-nums; }
.login .codein:focus { border-color: var(--ink); }
.login .hint { color: var(--mute); font-size: 13px; }

/* ── 폰 ── */
@media (max-width: 760px) {
  .rail {
    top: auto; right: 0; width: auto; height: auto; flex-direction: row; justify-content: space-around; gap: 0;
    padding: 4px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px);
  }
  body.gray .rail { background: color-mix(in srgb, var(--bg-2) 94%, transparent); }
  .rail .logo { display: none; }
  .tab { width: 84px; padding: 8px 0 4px; }
  .main { margin-left: 0; }
  .wrap { padding-bottom: 150px; }
  .fab { right: max(18px, env(safe-area-inset-right)); bottom: calc(78px + env(safe-area-inset-bottom)); }
  .uploads { left: 12px; right: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sheet-wrap { place-items: end center; padding: 0; }
  .sheet, .sheet.wide { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet::before { content: ""; display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line-2); }
  .hide-phone { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
