/* 모여 — 무채색 + 더스티 블루(기본) + 살구 오렌지(포인트), 반투명 유리 질감 */
:root {
  --bg: #F3F5F8;
  --glass: rgba(255, 255, 255, .64);
  --glass-strong: rgba(255, 255, 255, .82);
  --glass-line: rgba(255, 255, 255, .75);
  --hair: rgba(91, 122, 168, .14);
  --hair-strong: rgba(91, 122, 168, .26);
  --ink: #232833;
  --ink-2: #5B6271;
  --ink-3: #959BA8;
  --brand: #5B7AA8;
  --brand-deep: #48638C;
  --brand-a90: rgba(91, 122, 168, .9);
  --brand-a16: rgba(91, 122, 168, .16);
  --brand-a10: rgba(91, 122, 168, .1);
  --accent: #E07B39;
  --accent-ink: #A9541C;
  --accent-a18: rgba(224, 123, 57, .18);
  --accent-a10: rgba(224, 123, 57, .1);
  --neutral-a08: rgba(35, 40, 51, .07);
  --shadow: 0 1px 2px rgba(35, 40, 51, .04), 0 8px 24px rgba(72, 99, 140, .08);
  --blur: saturate(150%) blur(18px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --app-w: 560px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151B;
    --glass: rgba(30, 35, 45, .62);
    --glass-strong: rgba(34, 39, 50, .86);
    --glass-line: rgba(255, 255, 255, .07);
    --hair: rgba(154, 175, 204, .14);
    --hair-strong: rgba(154, 175, 204, .26);
    --ink: #E7EAF0;
    --ink-2: #A9B0BD;
    --ink-3: #727A88;
    --brand: #8FA7CF;
    --brand-deep: #A9BDDD;
    --brand-a90: rgba(110, 138, 183, .9);
    --brand-a16: rgba(143, 167, 207, .2);
    --brand-a10: rgba(143, 167, 207, .12);
    --accent: #F0995F;
    --accent-ink: #F6B486;
    --accent-a18: rgba(240, 153, 95, .2);
    --accent-a10: rgba(240, 153, 95, .12);
    --neutral-a08: rgba(255, 255, 255, .07);
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px; line-height: 1.6; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: anywhere;
  background:
    radial-gradient(60% 45% at 8% 0%, rgba(91, 122, 168, .16) 0%, transparent 70%),
    radial-gradient(50% 40% at 100% 18%, rgba(224, 123, 57, .1) 0%, transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(91, 122, 168, .1) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
.app { max-width: var(--app-w); min-height: 100vh; min-height: 100dvh; margin: 0 auto; position: relative; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 유리 표면 공통 */
.panel, .item, .cmp-card, .choice, .steps div, .member, .link, .empty, .share-box, .day-chip {
  background: var(--glass);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow);
}

/* ---------- 공통 ---------- */
.page { padding: 18px 18px calc(110px + var(--safe-b)); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.03em; }
.brand .mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 18px;
  background: linear-gradient(140deg, rgba(91, 122, 168, .78), rgba(91, 122, 168, .98)); box-shadow: 0 6px 16px rgba(91, 122, 168, .28); }
.lead { color: var(--ink-2); margin-top: 6px; }
.panel { border-radius: 22px; padding: 18px; margin-top: 14px; }
.panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.02em; }
.field { display: block; margin-top: 16px; }
.field:first-of-type { margin-top: 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--hair-strong); background: var(--glass-strong); outline: 0; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-a16); }
textarea.input { height: auto; min-height: 46px; padding: 11px 14px; resize: none; line-height: 1.5; }
.error { color: var(--accent-ink); font-size: 13px; margin-top: 8px; min-height: 18px; }
.hint { display: flex; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; line-height: 1.5; }
.hint i { font-size: 15px; margin-top: 1px; }

.choices { display: grid; gap: 8px; }
.choices.cols-2 { grid-template-columns: 1fr 1fr; }
.choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 16px; box-shadow: none; border: 1px solid var(--hair); transition: background .15s, border-color .15s; }
.choice i { font-size: 20px; color: var(--brand); margin-top: 1px; }
.choice b { display: block; font-size: 14.5px; }
.choice small { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; margin-top: 1px; }
.choice.on { background: var(--brand-a16); border-color: var(--brand); }
.choice.center { justify-content: center; text-align: center; font-weight: 600; font-size: 14px; padding: 11px 8px; }
.choice[disabled] { opacity: .45; cursor: default; }
.soon { font-size: 11px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--hair-strong); border-radius: 999px; padding: 0 7px; margin-left: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15.5px; transition: transform .12s, opacity .12s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-primary { color: #fff; background: linear-gradient(180deg, rgba(91, 122, 168, .86), rgba(72, 99, 140, .94)); box-shadow: 0 8px 20px rgba(72, 99, 140, .26), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { background: var(--glass-strong); border: 1px solid var(--hair-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { opacity: .65; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; color: var(--ink-2); transition: background .15s; }
.icon-btn:active { background: var(--brand-a10); }

.bottom-bar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(var(--app-w), 100%); z-index: 20;
  display: flex; gap: 10px; padding: 14px 16px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg) 85%, transparent) 40%); }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 60;
  max-width: calc(min(var(--app-w), 100vw) - 40px); padding: 11px 18px; border-radius: 999px; font-size: 14px; transition: .2s;
  background: rgba(35, 40, 51, .82); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.topic-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: var(--brand-deep); background: var(--brand-a16); }

/* ---------- 홈 ---------- */
.hero { padding: calc(28px + env(safe-area-inset-top, 0px)) 20px 6px; }
.hero h1 { font-size: 30px; font-weight: 700; line-height: 1.32; letter-spacing: -0.04em; margin-top: 22px; }
.hero h1 em { font-style: normal; color: var(--brand-deep); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 18px; }
.steps div { border-radius: 16px; padding: 10px 4px; text-align: center; font-size: 12px; color: var(--ink-2); }
.steps i { display: block; font-size: 20px; color: var(--brand); margin-bottom: 2px; }
.my-rooms a { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--hair); text-decoration: none; }
.my-rooms a:first-child { border-top: 0; }
.my-rooms .topic-ic { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.my-rooms .t { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-rooms small { color: var(--ink-3); }
.my-rooms .own { font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent-a18); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.share-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 13px; font-size: 13px; color: var(--ink-2); word-break: break-all; box-shadow: none; border: 1px dashed var(--hair-strong); }

/* ---------- 방 ---------- */
.room-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 10px 12px;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--hair); }
.room-top .t { flex: 1; min-width: 0; }
.room-top h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-top small { display: block; font-size: 12px; color: var(--ink-3); }
.lock { color: var(--brand); }
.members { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.member { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 4px; border-radius: 999px; font-size: 13px; box-shadow: none; }
.member .av { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.member.me { border-color: var(--brand); }

.conclusion { margin-top: 14px; padding: 18px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, rgba(91, 122, 168, .92), rgba(72, 99, 140, .82)); box-shadow: 0 12px 30px rgba(72, 99, 140, .3);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.conclusion .lbl { font-size: 12.5px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.conclusion p { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; white-space: pre-line; }
.conclusion .acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.conclusion .acts button { height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 13.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; border: 1px solid rgba(255, 255, 255, .22); }

.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 2px; }
.section-head h2 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; letter-spacing: -0.02em; }
.section-head h2 i { color: var(--brand); font-size: 19px; }
.add-btn { height: 34px; padding: 0 13px; border-radius: 999px; background: var(--brand-a16); color: var(--brand-deep); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; transition: background .15s; }
.add-btn:active { background: var(--brand-a10); }
.add-btn.ai { background: var(--accent-a10); color: var(--accent-ink); }
.empty { padding: 16px; border-radius: 16px; color: var(--ink-3); font-size: 13.5px; text-align: center; box-shadow: none; border: 1px dashed var(--hair-strong); }

.item { border-radius: 18px; padding: 14px 14px 11px; margin-top: 8px; transition: border-color .2s; }
.item.new { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.item.best { border-color: rgba(224, 123, 57, .45); }
.item-top { display: flex; gap: 8px; align-items: flex-start; }
.item-text { flex: 1; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; white-space: pre-line; }
.item-by { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.best-tag, .new-tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.best-tag { color: var(--accent-ink); background: var(--accent-a18); }
.new-tag { color: #fff; background: rgba(224, 123, 57, .82); }
.reacts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.react { height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--hair); background: var(--glass-strong); font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); transition: background .15s, color .15s, border-color .15s; }
.react.up.on { background: var(--brand-a16); border-color: var(--brand); color: var(--brand-deep); font-weight: 700; }
.react.down.on { background: var(--neutral-a08); border-color: var(--ink-3); color: var(--ink); font-weight: 700; }
.react.q.on { background: var(--accent-a18); border-color: rgba(224, 123, 57, .5); color: var(--accent-ink); font-weight: 700; }
.react.pop { animation: pop .32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.react.cm { margin-left: auto; }
.comments { margin-top: 8px; border-top: 1px solid var(--hair); padding-top: 8px; display: none; }
.comments.open { display: block; }
.cmt { font-size: 13.5px; padding: 3px 0; }
.cmt b { font-weight: 600; margin-right: 6px; }
.cmt-form { display: flex; gap: 6px; margin-top: 6px; }
.cmt-form .input { height: 38px; font-size: 14px; }
.cmt-form button { flex: none; height: 38px; padding: 0 14px; border-radius: 11px; background: var(--brand-a90); color: #fff; font-size: 13.5px; font-weight: 600; }
.del { color: var(--ink-3); font-size: 17px; }

/* ---------- 시트 ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(20, 26, 38, .32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(var(--app-w), 100%); max-height: 88vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 10px 20px calc(20px + var(--safe-b)); animation: up .25s ease;
  background: var(--glass-strong); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-top: 1px solid var(--glass-line); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--hair-strong); margin: 0 auto 14px; }
.sheet h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -0.02em; }
.sheet .note { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.sum-block { margin-top: 16px; }
.sum-block h3 { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.sum-block ul { margin: 0; padding-left: 18px; }
.sum-block li { margin: 3px 0; }
.sheet .acts { display: flex; gap: 8px; margin-top: 18px; }
.sheet .acts .btn { flex: 1; }

/* ---------- 링크 카드 · AI 비교 ---------- */
.link { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border-radius: 14px; text-decoration: none; color: inherit; box-shadow: none; border: 1px solid var(--hair); }
.link img, .link-ico { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; background: var(--brand-a10); }
.link-ico { display: grid; place-items: center; color: var(--brand); font-size: 22px; }
.link-body { min-width: 0; }
.link-body b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-body small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.cmp-card { border-radius: 18px; padding: 12px; margin-top: 8px; border-color: rgba(224, 123, 57, .28); }
.cmp-head { font-size: 13px; font-weight: 700; color: var(--accent-ink); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cmp-scroll { overflow-x: auto; margin: 0 -2px; }
.cmp { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.cmp th, .cmp td { padding: 7px 8px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; min-width: 110px; }
.cmp thead th { font-size: 13px; background: var(--brand-a10); }
.cmp thead th:first-child { border-top-left-radius: 10px; }
.cmp thead th:last-child { border-top-right-radius: 10px; }
.cmp thead th small { display: block; font-weight: 500; color: var(--accent-ink); font-size: 11px; }
.cmp tbody th { color: var(--ink-2); font-weight: 600; min-width: 70px; white-space: nowrap; }
.cmp .pick { background: var(--accent-a10); }
.cmp thead th.pick { color: var(--accent-ink); background: var(--accent-a18); }
.cmp tr.pc td { font-size: 12.5px; color: var(--ink-2); }
.dots { display: block; font-size: 9px; letter-spacing: 1px; color: var(--brand); margin-top: 2px; }
.dots span { color: var(--hair-strong); }
.cmp-pick { display: flex; gap: 6px; margin-top: 10px; padding: 10px 12px; border-radius: 13px; background: var(--accent-a10); color: var(--accent-ink); font-size: 13.5px; line-height: 1.5; }
.cmp-pick i { margin-top: 2px; }
.cmp-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.pick-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 2px; border-bottom: 1px solid var(--hair); font-size: 14px; }
.pick-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--brand-a16); color: var(--brand-deep); font-size: 13px; font-weight: 600; }
.chip button { width: 22px; height: 22px; display: grid; place-items: center; color: var(--brand-deep); }
.ti-loader-2 { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .item.new, .react.pop, .sheet { animation: none; } }

/* ---------- 3D 이모지 타일 (입체 느낌) ---------- */
.topic-ic3d { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .95) 0%, rgba(91, 122, 168, .14) 100%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -6px 12px rgba(91, 122, 168, .08), 0 6px 14px rgba(72, 99, 140, .16); }
.topic-ic3d img { width: 30px; height: 30px; filter: drop-shadow(0 3px 4px rgba(35, 40, 51, .18)); }
.topic-ic3d i { place-items: center; font-size: 22px; color: var(--brand-deep); }
.topic-ic3d.lg { width: 72px; height: 72px; border-radius: 22px; }
.topic-ic3d.lg img { width: 50px; height: 50px; }
.my-rooms .topic-ic3d { width: 38px; height: 38px; border-radius: 12px; }
.my-rooms .topic-ic3d img { width: 26px; height: 26px; }
.choice-ic3d { width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.choice-ic3d img { width: 28px; height: 28px; filter: drop-shadow(0 2px 3px rgba(35, 40, 51, .18)); }
.choice-ic3d i { font-size: 20px; color: var(--brand); }
.sec-ic3d { width: 24px; height: 24px; display: inline-grid; place-items: center; }
.sec-ic3d img { width: 22px; height: 22px; filter: drop-shadow(0 2px 2px rgba(35, 40, 51, .16)); }
.btn-ic3d { width: 22px; height: 22px; display: inline-grid; place-items: center; }
.btn-ic3d img { width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
@media (prefers-color-scheme: dark) {
  .topic-ic3d { background: linear-gradient(160deg, rgba(255, 255, 255, .14) 0%, rgba(143, 167, 207, .1) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .3); }
}

/* ---------- 공유 화면: 용도별로 나눈 복사 버튼 ---------- */
.share-opt { text-align: left; margin-top: 10px; padding: 14px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--hair); }
.share-opt-head { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.share-opt-head i { font-size: 19px; color: var(--brand); }
.share-opt p { font-size: 13px; color: var(--ink-2); margin: 4px 0 10px; line-height: 1.5; }
.share-opt p b { color: var(--ink); font-weight: 600; }
.share-opt .share-box { font-size: 12px; }
