/* 앱서랍 — 부드러운 3D(클레이) 디자인 시스템
   카드·버튼은 "두툼한 아래 테두리 + 부드러운 바닥 그림자 + 위쪽 하이라이트"로 입체감을 내요. */

:root {
  color-scheme: light;
  --bg: #e4e9f2;
  --glow-a: #f6f9fd;
  --glow-b: #d3eee7;
  --card-top: #ffffff;
  --card-bot: #f0f3f9;
  --soft-top: #ffffff;
  --soft-bot: #eef2f8;
  --link: #0f7461;
  --edge: #c4cddf;
  --drop: rgba(26, 43, 80, .30);
  --hl: #ffffff;
  --ink: #12203a;
  --ink-2: #33425e;
  --muted: #566581;
  --field: #d9e0ec;
  --field-shade: rgba(26, 43, 80, .18);
  --brand: #16977f;
  --brand-hi: #38c8a9;
  --brand-lo: #0f7461;
  --brand-edge: #0a5a4b;
  --brand-glow: rgba(11, 94, 79, .55);
  --danger: #d94a5a;
  --danger-hi: #ee707d;
  --danger-edge: #a32d3b;
  --focus: #2d7ff0;
  --glass: rgba(228, 233, 242, .82);
  --toast: #12203a;
  --toast-ink: #f3f6fb;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1524; --glow-a: #17223a; --glow-b: #0f2f33;
    --card-top: #1f2a43; --card-bot: #18223a; --edge: #0a1020; --drop: rgba(0, 0, 0, .55); --hl: rgba(255, 255, 255, .10);
    --soft-top: #2a3757; --soft-bot: #222d4a; --link: #45d3b4;
    --ink: #eaf0fc; --ink-2: #c4d0e8; --muted: #9aa9c5;
    --field: #0f1728; --field-shade: rgba(0, 0, 0, .55);
    --brand: #1fae93; --brand-hi: #45d3b4; --brand-lo: #139079; --brand-edge: #0b6657; --brand-glow: rgba(0, 0, 0, .6);
    --danger: #e0586a; --danger-hi: #f27d89; --danger-edge: #9d2a38;
    --glass: rgba(14, 21, 36, .82); --toast: #eaf0fc; --toast-ink: #12203a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1524; --glow-a: #17223a; --glow-b: #0f2f33;
  --card-top: #1f2a43; --card-bot: #18223a; --edge: #0a1020; --drop: rgba(0, 0, 0, .55); --hl: rgba(255, 255, 255, .10);
  --soft-top: #2a3757; --soft-bot: #222d4a; --link: #45d3b4;
  --ink: #eaf0fc; --ink-2: #c4d0e8; --muted: #9aa9c5;
  --field: #0f1728; --field-shade: rgba(0, 0, 0, .55);
  --brand: #1fae93; --brand-hi: #45d3b4; --brand-lo: #139079; --brand-edge: #0b6657; --brand-glow: rgba(0, 0, 0, .6);
  --danger: #e0586a; --danger-hi: #f27d89; --danger-edge: #9d2a38;
  --glass: rgba(14, 21, 36, .82); --toast: #eaf0fc; --toast-ink: #12203a;
}

/* 앱 아이콘 색 8가지: 위쪽 밝은 색 / 아래쪽 진한 색 / 두툼한 아래 테두리 색 */
.c-teal   { --ic-hi: #5fe0c4; --ic-lo: #17a58a; --ic-edge: #0d7562; }
.c-indigo { --ic-hi: #8fa2ff; --ic-lo: #4a5de0; --ic-edge: #3141ad; }
.c-violet { --ic-hi: #c3a1ff; --ic-lo: #8a55e6; --ic-edge: #6234b5; }
.c-rose   { --ic-hi: #ff9db3; --ic-lo: #e8506f; --ic-edge: #b02f4c; }
.c-amber  { --ic-hi: #ffd36a; --ic-lo: #f0a020; --ic-edge: #b8740d; }
.c-sky    { --ic-hi: #7fd3ff; --ic-lo: #2f9be6; --ic-edge: #1e70b3; }
.c-green  { --ic-hi: #9be07a; --ic-lo: #4fb43a; --ic-edge: #36862a; }
.c-slate  { --ic-hi: #aebbd2; --ic-lo: #66789a; --ic-edge: #475775; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html[data-size="1"] { font-size: 112.5%; }
html[data-size="2"] { font-size: 125%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--ink);
  background:
    radial-gradient(1100px 560px at 8% -8%, var(--glow-a) 0%, transparent 62%),
    radial-gradient(900px 520px at 100% 0%, var(--glow-b) 0%, transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 12px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
svg.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.fill { fill: currentColor; stroke: none; }
svg.ic.star-on { fill: currentColor; }

/* ───── 카드 ───── */
.card {
  background: linear-gradient(180deg, var(--card-top), var(--card-bot));
  border-radius: var(--r-xl);
  box-shadow: 0 6px 0 var(--edge), 0 22px 32px -18px var(--drop), inset 0 1px 0 var(--hl);
  padding: 1.5rem;
}
.card + .card { margin-top: 1.4rem; }
.grid > .card + .card, .cols > .card + .card { margin-top: 0; }
.card h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.card .lead { margin-top: .35rem; color: var(--muted); }

/* ───── 버튼 ───── */
.btn {
  --b-top: var(--soft-top); --b-bot: var(--soft-bot); --b-edge: var(--edge); --b-glow: var(--drop); --b-hl: var(--hl); --b-ink: var(--ink);
  min-height: 2.75rem; padding: 0 1.15rem; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 700; white-space: nowrap; color: var(--b-ink); text-decoration: none;
  background: linear-gradient(180deg, var(--b-top), var(--b-bot));
  box-shadow: 0 4px 0 var(--b-edge), 0 12px 16px -8px var(--b-glow), inset 0 1px 0 var(--b-hl);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
:root[data-theme="dark"] .btn, .btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--b-edge), 0 4px 8px -6px var(--b-glow), inset 0 1px 0 var(--b-hl); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.btn-primary { --b-top: var(--brand-hi); --b-bot: var(--brand); --b-edge: var(--brand-edge); --b-glow: var(--brand-glow); --b-hl: rgba(255, 255, 255, .38); --b-ink: #fff; }
.btn-danger { --b-top: var(--danger-hi); --b-bot: var(--danger); --b-edge: var(--danger-edge); --b-glow: rgba(163, 45, 59, .5); --b-hl: rgba(255, 255, 255, .35); --b-ink: #fff; }
.btn-lg { min-height: 3.25rem; padding: 0 1.6rem; font-size: 1.05rem; }
.btn-sm { min-height: 2.25rem; padding: 0 .9rem; font-size: .9rem; box-shadow: 0 3px 0 var(--b-edge), 0 8px 12px -8px var(--b-glow), inset 0 1px 0 var(--b-hl); }
.btn-block { width: 100%; }
.icon-btn { width: 2.75rem; padding: 0; }
.btn-sm.icon-btn { width: 2.25rem; }
.link-btn { background: none; border: 0; padding: .25rem; color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ───── 상단 바 ───── */
.hdr { position: sticky; top: 0; z-index: 20; padding: .7rem 0; background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
.hdr-in { display: flex; align-items: center; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; min-width: 0; }
.brand img { width: 2.9rem; height: 2.9rem; filter: drop-shadow(0 8px 8px rgba(11, 94, 79, .3)); }
.brand-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-t strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.brand-t span { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-spacer { flex: 1; }
.seg {
  display: inline-flex; gap: .2rem; padding: .3rem; border-radius: 999px; background: var(--field);
  box-shadow: inset 0 2px 5px var(--field-shade), 0 1px 0 var(--hl);
}
.seg a, .seg button {
  min-height: 2.5rem; padding: 0 1.05rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.seg .on {
  color: var(--ink); background: linear-gradient(180deg, var(--card-top), var(--card-bot));
  box-shadow: 0 3px 0 var(--edge), 0 8px 12px -6px var(--drop), inset 0 1px 0 var(--hl);
}
.seg-s a, .seg-s button { min-height: 2.15rem; padding: 0 .85rem; font-size: .92rem; }

.sync { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: 0 .95rem; border: 0; border-radius: 999px; font-weight: 700; font-size: .9rem; background: var(--field); color: var(--ink-2); box-shadow: inset 0 2px 5px var(--field-shade), 0 1px 0 var(--hl); }
.sync i { width: .6rem; height: .6rem; border-radius: 50%; background: #9aa6bd; box-shadow: 0 0 0 3px rgba(154, 166, 189, .25); }
.sync .short { display: none; }
.sync.ok i { background: #25b572; box-shadow: 0 0 0 3px rgba(37, 181, 114, .25); }
.sync.busy i { background: #f0a020; box-shadow: 0 0 0 3px rgba(240, 160, 32, .28); animation: pulse 1s ease-in-out infinite; }
.sync.bad i { background: #e0586a; box-shadow: 0 0 0 3px rgba(224, 88, 106, .25); }
@keyframes pulse { 50% { transform: scale(1.35); } }

/* ───── 본문 ───── */
main { padding: 1.4rem 0 3rem; }
.page-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-title h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.page-title p { color: var(--muted); margin-top: .15rem; }

.banner { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.4rem; padding: 1.1rem 1.3rem; }
.banner .b-ic { width: 3.4rem; height: 3.4rem; flex: none; }
.banner .b-t { flex: 1; min-width: 0; }
.banner strong { display: block; font-size: 1.05rem; font-weight: 800; }
.banner .b-act { display: flex; gap: .6rem; flex-wrap: wrap; }

.tools { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.search { position: relative; flex: 1 1 16rem; }
.search svg { position: absolute; left: 1rem; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.input {
  width: 100%; min-height: 3rem; padding: 0 1rem; border: 0; border-radius: var(--r-md);
  background: var(--field); color: var(--ink);
  box-shadow: inset 0 2px 6px var(--field-shade), 0 1px 0 var(--hl);
}
.input::placeholder { color: var(--muted); opacity: .85; }
.search .input { padding-left: 2.8rem; border-radius: 999px; }
textarea.input { padding: .75rem 1rem; min-height: 5rem; resize: vertical; }
select.input { appearance: none; padding-right: 2.4rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.3rem) 52%, calc(100% - .95rem) 52%; background-size: .4rem .4rem; background-repeat: no-repeat; }
.sort { width: auto; min-width: 8.5rem; flex: none; border-radius: 999px; font-weight: 700; }

.chips { display: flex; gap: .6rem; overflow-x: auto; padding: .35rem .25rem 1.1rem; margin: 0 -.25rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { scroll-snap-align: start; flex: none; }
.chip .n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; font-size: .78rem; background: rgba(120, 135, 165, .22); }
.chip.on { --b-top: var(--brand-hi); --b-bot: var(--brand); --b-edge: var(--brand-edge); --b-glow: var(--brand-glow); --b-ink: #fff; --b-hl: rgba(255, 255, 255, .38); }
.chip.on .n { background: rgba(255, 255, 255, .28); }
.dot { width: .8rem; height: .8rem; border-radius: 50%; background: linear-gradient(160deg, var(--ic-hi), var(--ic-lo)); box-shadow: 0 2px 0 var(--ic-edge); }

/* ───── 앱 타일 ───── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.75rem, 1fr)); gap: 1.1rem; }
.tile { position: relative; padding: 0; border-radius: var(--r-lg); transition: transform .15s ease; display: flex; flex-direction: column; }
.tile.anim { animation: rise .35s ease both; }
.tile:hover { transform: translateY(-4px); }
.tile:active { transform: translateY(1px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.tile-link { display: flex; flex-direction: column; gap: .75rem; padding: 1.1rem 1.1rem .7rem; text-decoration: none; border-radius: var(--r-lg); flex: 1; width: 100%; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.tile-foot { display: flex; gap: .5rem; padding: 0 1rem 1rem; }
.tile-foot .btn:not(.icon-btn) { flex: 1; min-width: 0; }
.tile-foot .icon-btn { flex: none; }
.tile-link:focus-visible { outline-offset: -3px; }
.badge {
  position: relative; overflow: hidden; width: 3.6rem; height: 3.6rem; border-radius: 1.2rem;
  display: grid; place-items: center; font-size: 1.75rem; font-weight: 800; color: #fff; line-height: 1;
  background: linear-gradient(160deg, var(--ic-hi), var(--ic-lo));
  box-shadow: 0 5px 0 var(--ic-edge), 0 14px 16px -8px var(--ic-edge), inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -8px 12px rgba(0, 0, 0, .08);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.badge::after { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0)); pointer-events: none; }
.badge.lg { width: 4.6rem; height: 4.6rem; font-size: 2.2rem; border-radius: 1.5rem; }
.tile-name { font-weight: 800; font-size: 1.05rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-desc { color: var(--muted); font-size: .88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.45em; }
.tile-host { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: .3rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .85; }
.tile-btns { position: absolute; top: .6rem; right: .6rem; display: flex; gap: .25rem; }
.mini { width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--muted); }
.mini:hover { background: var(--field); color: var(--ink); }
.mini.fav-on { color: #f0a020; }
.mini svg { width: 1.1rem; height: 1.1rem; }

.empty { text-align: center; padding: 2.6rem 1.4rem; }
.empty img { width: 7rem; height: 7rem; margin: 0 auto 1rem; filter: drop-shadow(0 16px 14px rgba(11, 94, 79, .3)); }
.empty h2 { font-size: 1.4rem; }
.empty p { margin: .5rem auto 1.4rem; max-width: 30rem; color: var(--muted); }
.empty .row-btns { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.empty.small { padding: 2rem 1rem; }
.empty.small img { width: 4.5rem; height: 4.5rem; }

/* ───── 서랍 관리 / 설정 ───── */
.list { display: grid; gap: .9rem; margin-top: 1.1rem; }
.d-row { display: flex; align-items: center; gap: 1rem; padding: .95rem 1.1rem; border-radius: var(--r-lg); background: var(--field); box-shadow: inset 0 2px 6px var(--field-shade), 0 1px 0 var(--hl); }
.d-row .d-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .9rem; background: none; border: 0; padding: 0; text-align: left; }
.d-row .badge { width: 2.9rem; height: 2.9rem; border-radius: 1rem; font-size: 1.3rem; box-shadow: 0 4px 0 var(--ic-edge), inset 0 2px 0 rgba(255, 255, 255, .5); }
.d-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid rgba(120, 135, 165, .22); flex-wrap: wrap; }
.set-row:first-of-type { border-top: 0; }
.set-row .t { font-weight: 800; }
.set-row .d { color: var(--muted); font-size: .92rem; }
.set-row .btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.cols { display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
.user-chip { display: flex; align-items: center; gap: .9rem; }
.avatar { width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; color: #fff; background: linear-gradient(160deg, var(--brand-hi), var(--brand)); box-shadow: 0 4px 0 var(--brand-edge), inset 0 2px 0 rgba(255, 255, 255, .4); }

/* ───── 폼 · 다이얼로그 ───── */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(34rem, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible; }
dialog::backdrop { background: rgba(10, 16, 32, .5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
dialog[open] { animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.sheet { position: relative; max-height: calc(100dvh - 24px); overflow: auto; padding: 1.6rem 1.5rem 1.5rem; }
.sheet h2 { font-size: 1.3rem; font-weight: 800; padding-right: 3rem; letter-spacing: -.01em; }
.sheet .x { position: absolute; top: .9rem; right: .9rem; }
.sheet form, .sheet .body { display: grid; gap: 1.1rem; margin-top: 1.1rem; }
.field { display: grid; gap: .45rem; }
.field > label, .field > .lab { font-weight: 800; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.err { color: var(--danger); font-weight: 700; font-size: .92rem; min-height: 0; }
.err:empty { display: none; }
.actions { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .3rem; }
.actions .spacer { flex: 1; }
.check { display: flex; gap: .65rem; align-items: center; font-weight: 600; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--brand); }
.swatches, .emojis { display: flex; flex-wrap: wrap; gap: .55rem; }
.sw { width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, var(--ic-hi), var(--ic-lo)); box-shadow: 0 3px 0 var(--ic-edge), inset 0 2px 0 rgba(255, 255, 255, .45); }
.sw svg { opacity: 0; width: 1.15rem; height: 1.15rem; stroke-width: 3; }
.sw[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 3px; }
.sw[aria-pressed="true"] svg { opacity: 1; }
.em { min-width: 2.6rem; height: 2.6rem; padding: 0 .3rem; border: 0; border-radius: 14px; font-size: 1.3rem; background: var(--field); box-shadow: inset 0 2px 4px var(--field-shade), 0 1px 0 var(--hl); line-height: 1; }
.em.on { background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 3px 0 var(--edge), 0 8px 10px -6px var(--drop), inset 0 1px 0 var(--hl); outline: 3px solid var(--brand); outline-offset: 1px; }
.em.txt { font-size: .85rem; font-weight: 800; color: var(--ink-2); }
.preview { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border-radius: var(--r-lg); background: var(--field); box-shadow: inset 0 2px 6px var(--field-shade), 0 1px 0 var(--hl); }
.preview .p-name { font-weight: 800; }
.preview .p-desc { color: var(--muted); font-size: .88rem; }

.code-box { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .9rem; padding: 1.2rem 1rem; border-radius: var(--r-lg); background: var(--field); box-shadow: inset 0 2px 6px var(--field-shade), 0 1px 0 var(--hl); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.45rem; font-weight: 800; letter-spacing: .08em; user-select: all; }
.notice { padding: .9rem 1rem; border-radius: var(--r-md); background: rgba(240, 160, 32, .16); color: var(--ink); font-size: .93rem; border-left: 5px solid #f0a020; }

/* ───── 처음 사용 안내 ───── */
.onb-illo { height: 11rem; display: grid; place-items: center; border-radius: var(--r-lg); background: radial-gradient(120% 120% at 50% 0%, var(--card-top), var(--field)); box-shadow: inset 0 2px 8px var(--field-shade), 0 1px 0 var(--hl); overflow: hidden; }
.onb { display: grid; gap: 1.15rem; }
.onb h2 { padding-right: 0; margin-top: .2rem; }
.onb .actions { margin-top: .2rem; align-items: center; }
.onb p.t { color: var(--muted); }
.dots { display: flex; gap: .5rem; justify-content: center; }
.dots i { width: .6rem; height: .6rem; border-radius: 999px; background: var(--field); box-shadow: inset 0 1px 2px var(--field-shade); transition: width .2s; }
.dots i.on { width: 1.8rem; background: var(--brand); box-shadow: 0 2px 0 var(--brand-edge); }
.il-grid { display: grid; grid-template-columns: repeat(3, auto); gap: .9rem; }
.il-grid .badge { width: 3.4rem; height: 3.4rem; animation: bob 3s ease-in-out infinite; }
.il-grid .badge:nth-child(2n) { animation-delay: -1s; }
.il-grid .badge:nth-child(3n) { animation-delay: -2s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.il-row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; justify-content: center; }
.il-fake { min-width: 10rem; padding: .7rem 1rem; border-radius: 999px; background: var(--field); box-shadow: inset 0 2px 5px var(--field-shade); color: var(--muted); font-weight: 600; font-size: .95rem; }
.il-arrow { font-size: 1.6rem; color: var(--brand); font-weight: 800; }

/* ───── 토스트 · 하단 탭 ───── */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); translate: -50% 0; display: grid; gap: .6rem; width: min(30rem, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: .8rem 1.1rem; border-radius: 999px; background: var(--toast); color: var(--toast-ink); font-weight: 700; text-align: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 16px 24px -10px rgba(0, 0, 0, .5); animation: rise .25s ease both; }
.tabbar { display: none; }

/* ───── 열기 방식 선택 · 더 보기 ───── */
.opts { display: grid; gap: .6rem; }
.opt { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .95rem; border-radius: var(--r-md); background: var(--field); box-shadow: inset 0 2px 5px var(--field-shade), 0 1px 0 var(--hl); cursor: pointer; }
.opt input { margin-top: .3rem; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--brand); }
.opt b { display: block; font-weight: 800; }
.opt small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; margin-top: .1rem; }
.opt:has(input:checked) { background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 3px 0 var(--edge), 0 10px 14px -8px var(--drop), inset 0 1px 0 var(--hl); outline: 2px solid var(--brand); outline-offset: -2px; }
.opt:has(input:focus-visible) { outline: 3px solid var(--focus); }
details.more { border-radius: var(--r-md); }
details.more summary { cursor: pointer; font-weight: 800; color: var(--link); padding: .25rem 0; }
details.more[open] summary { margin-bottom: .7rem; }

/* ───── 통합 워크스페이스 ───── */
.ws { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1.1rem; height: var(--ws-h, 34rem); margin-top: 1rem; padding-bottom: 8px; }
.ws > .card + .card { margin-top: 0; }
.ws-side { display: flex; flex-direction: column; min-height: 0; padding: 1rem; border-radius: var(--r-xl); }
.ws-apps { flex: 1; overflow-y: auto; margin-top: .8rem; display: flex; flex-direction: column; gap: .15rem; padding-right: .15rem; }
.ws-group { display: flex; align-items: center; gap: .5rem; padding: .85rem .5rem .3rem; font-size: .78rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.ws-group .dot { width: .7rem; height: .7rem; }
.ws-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .5rem .6rem; border: 0; border-radius: 18px; background: none; text-align: left; text-decoration: none; color: inherit; }
.ws-item:hover { background: var(--field); }
.ws-item.on { background: var(--field); box-shadow: inset 0 2px 5px var(--field-shade), 0 1px 0 var(--hl); }
.ws-item .badge { width: 2.4rem; height: 2.4rem; border-radius: .85rem; font-size: 1.1rem; flex: none; box-shadow: 0 3px 0 var(--ic-edge), inset 0 2px 0 rgba(255, 255, 255, .5); }
.ws-item .nm { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.ws-item .nm b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item .nm small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item .live { width: .6rem; height: .6rem; border-radius: 50%; background: #25b572; box-shadow: 0 0 0 3px rgba(37, 181, 114, .25); flex: none; }
.ws-item .ext { color: var(--muted); flex: none; display: grid; }
.ws-none { padding: .6rem .5rem; }
.ws-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; overflow: hidden; border-radius: var(--r-xl); }
.ws-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .8rem .9rem .2rem; scrollbar-width: none; flex: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tabs.no-tabs { display: none; }
.ws-list-btn { display: none; flex: none; }
.ws-tab { flex: none; display: inline-flex; align-items: center; max-width: 15rem; padding: .15rem .3rem .15rem .35rem; border-radius: 999px; background: var(--field); color: var(--muted); box-shadow: inset 0 2px 5px var(--field-shade), 0 1px 0 var(--hl); }
.ws-tab .sel { display: flex; align-items: center; gap: .5rem; min-width: 0; min-height: 2.3rem; padding: 0 .35rem; border: 0; background: none; font-weight: 700; color: inherit; }
.ws-tab .sel .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-tab .badge { width: 1.6rem; height: 1.6rem; border-radius: .6rem; font-size: .85rem; flex: none; box-shadow: 0 2px 0 var(--ic-edge), inset 0 1px 0 rgba(255, 255, 255, .5); }
.ws-tab.on { color: var(--ink); background: linear-gradient(180deg, var(--card-top), var(--card-bot)); box-shadow: 0 3px 0 var(--edge), 0 8px 12px -6px var(--drop), inset 0 1px 0 var(--hl); }
.ws-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .8rem 1rem .6rem; flex: none; }
.ws-head .who { display: flex; align-items: center; gap: .8rem; min-width: 0; flex: 1 1 14rem; }
.ws-head .who .badge { width: 2.7rem; height: 2.7rem; border-radius: .95rem; font-size: 1.25rem; flex: none; box-shadow: 0 4px 0 var(--ic-edge), inset 0 2px 0 rgba(255, 255, 255, .5); }
.ws-head .wh { min-width: 0; }
.ws-head .wh b { display: block; font-size: 1.05rem; font-weight: 800; }
.ws-head .addr { display: block; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-act { display: flex; flex-wrap: wrap; gap: .45rem; }
.ws-tip { flex: none; padding: .45rem 1rem .7rem; color: var(--muted); font-size: .84rem; }
.ws-stage { position: relative; flex: 1; min-height: 0; background: #fff; box-shadow: inset 0 3px 8px rgba(26, 43, 80, .14); }
.ws-stage::before { content: "앱을 불러오는 중이에요…"; position: absolute; inset: 0; display: grid; place-items: center; color: #66748f; font-weight: 700; }
.ws-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.ws-stage:fullscreen { background: #fff; }
.ws-empty { position: absolute; inset: 0; z-index: 1; overflow: auto; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(180deg, var(--card-top), var(--card-bot)); }
.ws-panel { max-width: 36rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.ws-panel h3 { font-size: 1.35rem; font-weight: 800; }
.pick-grid { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: .4rem; }
.pick { display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem .45rem .5rem; border: 0; border-radius: 999px; font-weight: 700; background: linear-gradient(180deg, var(--soft-top), var(--soft-bot)); box-shadow: 0 4px 0 var(--edge), 0 10px 14px -8px var(--drop), inset 0 1px 0 var(--hl); }
.pick:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), inset 0 1px 0 var(--hl); }
.pick .badge { width: 2.2rem; height: 2.2rem; border-radius: .8rem; font-size: 1.05rem; box-shadow: 0 3px 0 var(--ic-edge), inset 0 2px 0 rgba(255, 255, 255, .5); }

/* ───── 반응형 ───── */
@media (min-width: 760px) and (max-width: 1100px) {
  .brand-t span, .hdr .lbl, .sync .full { display: none; }
  .sync .short { display: inline; }
  .hdr .btn:not(.hdr-add) { min-width: 2.75rem; padding: 0; }
}
@media (min-width: 760px) {
  .cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .cols .card + .card { margin-top: 0; }
  .cols .wide { grid-column: 1 / -1; }
}
@media (max-width: 759px) {
  .wrap { width: calc(100% - 28px); }
  .hdr { padding: .55rem 0; }
  .brand img { width: 2.5rem; height: 2.5rem; }
  .brand-t strong { font-size: 1.25rem; }
  .brand-t span, .hdr .seg, .hdr .hdr-add, .hdr .lbl { display: none; }
  .hdr .btn:not(.hdr-add) { min-width: 2.75rem; padding: 0; }
  .sync { padding: 0 .7rem; font-size: .8rem; }
  .sync .full { display: none; }
  .sync .short { display: inline; }
  main { padding: 1rem 0 8.5rem; }
  .card { padding: 1.15rem; border-radius: 24px; }
  .page-title h1 { font-size: 1.45rem; }
  .banner { flex-wrap: wrap; }
  .banner .b-act { width: 100%; }
  .banner .b-act .btn { flex: 1; }
  .grid { gap: .9rem; }
  .swatches { gap: .4rem; justify-content: space-between; }
  .sw { width: 2.15rem; height: 2.15rem; }
  .tools { flex-wrap: nowrap; gap: .6rem; }
  .search { flex: 1 1 0; min-width: 0; }
  .sort { min-width: 0; width: 6.6rem; padding-left: .85rem; padding-right: 1.9rem; font-size: .9rem; background-position: calc(100% - 1.15rem) 52%, calc(100% - .8rem) 52%; }
  .tile-link { padding: .95rem .95rem .85rem; }
  .sheet { padding: 1.4rem 1.2rem 1.3rem; }
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; }
  dialog .sheet { border-radius: 28px 28px 0 0; padding-bottom: calc(1.3rem + env(safe-area-inset-bottom)); }
  dialog[open] { animation: slide .26s cubic-bezier(.2, .9, .3, 1); }
  @keyframes slide { from { transform: translateY(40px); opacity: 0; } }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: .1rem;
    position: fixed; z-index: 30; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom));
    padding: .45rem .5rem; border-radius: 28px;
    background: linear-gradient(180deg, var(--card-top), var(--card-bot));
    box-shadow: 0 5px 0 var(--edge), 0 22px 30px -12px var(--drop), inset 0 1px 0 var(--hl);
  }
  .tab { display: grid; justify-items: center; gap: .1rem; padding: .45rem 0 .4rem; border: 0; border-radius: 20px; background: none; color: var(--muted); font-size: .68rem; font-weight: 800; text-decoration: none; }
  .tab svg { width: 1.45rem; height: 1.45rem; }
  .tab.on { color: var(--link); }
  .tab-add { width: 3.7rem; height: 3.7rem; margin: -1.6rem auto .15rem; padding: 0; border-radius: 50%; color: #fff;
    background: linear-gradient(180deg, var(--brand-hi), var(--brand)); border: 0; display: grid; place-items: center;
    box-shadow: 0 5px 0 var(--brand-edge), 0 16px 20px -8px var(--brand-glow), inset 0 2px 0 rgba(255, 255, 255, .4); }
  .tab-add:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--brand-edge), inset 0 2px 0 rgba(255, 255, 255, .4); }
  .tab-add svg { width: 1.7rem; height: 1.7rem; stroke-width: 2.8; }
  .toasts { bottom: calc(6.8rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-box { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 작업공간 — 모바일: 앱 목록은 왼쪽에서 밀려 나오는 서랍으로 */
@media (max-width: 759px) {
  .ws { grid-template-columns: minmax(0, 1fr); position: relative; margin-top: .6rem; gap: 0; }
  .ws-side { position: absolute; z-index: 6; left: 0; top: 0; bottom: 0; width: min(20rem, 88vw); transform: translateX(-108%); transition: transform .22s ease; }
  .ws.side-open .ws-side { transform: none; }
  .ws-list-btn { display: inline-flex; }
  .ws-tabs.no-tabs { display: flex; }
  .ws-head .lbl { display: none; }
  .ws-head .btn { min-width: 2.25rem; padding: 0; }
  .ws-head .btn-primary { padding: 0; }
  .tile-foot { padding: 0 .85rem .85rem; }
}

/* 마무리 손질 */
.ws-side .search { flex: none; }
.sync { white-space: nowrap; }
@media (max-width: 1320px) { .brand-t span { display: none; } }

/* 작업공간 — 모바일에서는 위쪽 정보를 줄여 앱 화면을 더 크게 */
@media (max-width: 759px) {
  .ws-tabs { padding: .6rem .7rem .1rem; }
  .ws-head { padding: .45rem .8rem .25rem; gap: .35rem .6rem; }
  .ws-head .who .badge { width: 2.3rem; height: 2.3rem; font-size: 1.05rem; border-radius: .8rem; }
  .ws-head .who { flex: 1 1 35%; }
  .ws-head .wh b { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ws-head .addr { display: none; }
  .ws-act { gap: .3rem; }
  .ws-tip { padding: .15rem .8rem .5rem; font-size: .76rem; line-height: 1.4; }
}

/* 카드 하단 버튼 — 좁은 카드에서도 글자가 잘리지 않게 */
.tile-foot .btn { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 759px) {
  .tile-foot { gap: .4rem; }
  .tile-foot .btn-sm { padding: 0 .5rem; font-size: .86rem; gap: .3rem; }
  .tile-foot .btn-primary svg { display: none; }
}

/* 타일은 안쪽 여백을 직접 관리해요(모바일 .card 여백 규칙에 덮이지 않게) */
.card.tile { padding: 0; }

/* ───── 즐겨찾기 선반 ───── */
.fav-shelf { margin-bottom: 1.8rem; padding: 1rem 1.1rem .5rem; border-radius: var(--r-xl); background: linear-gradient(180deg, rgba(255, 205, 90, .26), rgba(255, 205, 90, .07)); box-shadow: inset 0 2px 10px rgba(240, 160, 32, .16), 0 1px 0 var(--hl); }
.fav-shelf .grid { padding-bottom: 1rem; }
.sec-h { display: flex; align-items: center; gap: .55rem; margin: .1rem .15rem .9rem; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.sec-h svg { color: #f0a020; width: 1.15em; height: 1.15em; }
.sec-h .n { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .4rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(120, 135, 165, .22); }
.apps > section + section { margin-top: .4rem; }
.card.tile.fav { box-shadow: 0 6px 0 color-mix(in srgb, var(--edge) 45%, #f0b030), 0 22px 32px -18px var(--drop), inset 0 1px 0 var(--hl); }
.ws-group.fav { color: #b87400; }
:root[data-theme="dark"] .ws-group.fav { color: #ffcf70; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ws-group.fav { color: #ffcf70; } }
.ws-group svg { width: 1em; height: 1em; color: #f0a020; }

/* ───── 서랍 화면: 서랍 모양 카드 ───── */
.drawers { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.5rem; align-items: stretch; }
.card.drawer-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; margin: 0; }
.dc-face {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; padding: 1.15rem 1.2rem 1.35rem;
  border: 0; text-align: left; color: #fff; cursor: pointer; background: linear-gradient(165deg, var(--ic-hi), var(--ic-lo));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -8px 14px rgba(0, 0, 0, .08);
}
.dc-face::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--ic-edge); opacity: .55; }
.dc-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 2px 0 rgba(0, 0, 0, .16); }
.dc-count { font-size: .9rem; font-weight: 600; opacity: .94; }
.dc-handle { position: absolute; right: 1.2rem; top: 50%; translate: 0 -55%; width: 3.4rem; height: .95rem; border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .2), 0 3px 0 rgba(0, 0, 0, .14); }
.dc-body { display: flex; flex-direction: column; gap: .95rem; flex: 1; padding: 1rem 1.1rem 1.15rem; }
.dc-minis { display: flex; align-items: center; min-height: 2.8rem; padding-left: .2rem; }
.dc-minis .badge { width: 2.6rem; height: 2.6rem; border-radius: .9rem; font-size: 1.15rem; margin-right: -.4rem; box-shadow: 0 3px 0 var(--ic-edge), 0 0 0 3px var(--card-top), inset 0 2px 0 rgba(255, 255, 255, .5); }
.dc-more { margin-left: .9rem; font-weight: 800; color: var(--muted); }
.dc-empty { color: var(--muted); font-size: .9rem; line-height: 1.45; min-height: 2.8rem; }
.dc-actions { display: flex; align-items: center; gap: .4rem; margin-top: auto; }
.dc-actions .spacer { flex: 1; }
.drawer-new {
  display: grid; place-content: center; justify-items: center; gap: .35rem; min-height: 13rem; padding: 1.2rem; border-radius: var(--r-xl);
  border: 3px dashed var(--edge); background: transparent; color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s, transform .15s;
}
.drawer-new:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-2px); }
.drawer-new .plus { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; color: #fff; background: linear-gradient(180deg, var(--brand-hi), var(--brand)); box-shadow: 0 4px 0 var(--brand-edge), inset 0 2px 0 rgba(255, 255, 255, .4); }
.drawer-new b { font-size: 1.05rem; color: var(--ink); }
.drawer-new small { font-size: .85rem; }
@media (max-width: 759px) {
  .fav-shelf { padding: .85rem .8rem .3rem; margin-bottom: 1.4rem; }
  .drawers { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .drawer-new { min-height: 9rem; }
}

/* ───── 하단 안내(버전·사용법 위치) ─────
   CSP가 인라인 <style>을 막으므로 여기(외부 파일)에 둬요. 글자는 본문 기준(1rem)으로 읽기 쉽게. */
.app-foot { padding-block: .5rem 1.6rem; text-align: center; }
.app-foot small { font-size: 1rem; line-height: 1.6; }
#ws:not([hidden]) ~ .app-foot { display: none; }
@media (max-width: 759px) {
  main { padding-bottom: 1rem; }
  .app-foot { padding-bottom: calc(8.5rem + env(safe-area-inset-bottom)); }   /* 하단 탭바에 가려지지 않게 */
}
