/* 사라마라: 살까 말까 고민되는 물건에 사라·마라 투표하는 앱.
   색은 로고 고양이에서 따왔다: 사라 = 분홍 스카프, 마라 = 검은 선글라스, 바탕 = 로고 글자의 크림색. */
:root {
  --bg: #fdf5f0;
  --surface: #ffffff;
  --sunken: #f6e9e3;
  --ink: #1d1416;
  --muted: #7a6569;
  --line: #eedcd5;
  --brand: #d7797a;         /* 로고 배경 분홍 */
  --buy: #d4626a;           /* 사라 */
  --on-buy: #ffffff;
  --buy-soft: #fbe4e4;
  --buy-ink: #a63c45;
  --skip: #1d1416;          /* 마라 */
  --on-skip: #ffffff;
  --skip-soft: #efe6e3;
  --skip-ink: #1d1416;
  --danger: #c2414c;
  --danger-ink: #b3343f;
  --shadow: 0 1px 2px rgb(29 20 22 / .05), 0 6px 20px rgb(29 20 22 / .06);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161113; --surface: #211a1c; --sunken: #2b2225; --ink: #f7ece8; --muted: #b39fa3; --line: #3a2e31;
    --buy: #e58089; --on-buy: #1d1416; --buy-soft: #3d2226; --buy-ink: #f4b3b8;
    --skip: #f3e9e5; --on-skip: #1d1416; --skip-soft: #2f2729; --skip-ink: #f3e9e5;
    --danger-ink: #ff9aa2;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* 두 번 빨리 누르면 화면이 확대되는 것을 막는다 (두 손가락 확대는 그대로) */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
/* 아이폰은 글자가 16px보다 작은 입력칸을 누르면 화면을 확대해서, 입력칸 글자는 16px 이상으로 */
input, textarea, select { font-size: max(16px, 1em); }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--buy); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

main#view {
  max-width: 560px; margin: 0 auto;
  padding: 0 16px calc(96px + var(--safe-bottom));
  min-height: 100vh; min-height: 100dvh;
}
body.no-tabs main#view { padding-bottom: calc(32px + var(--safe-bottom)); }
body.has-composer main#view { padding-bottom: calc(132px + var(--safe-bottom)); }

/* 위 막대 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  margin: 0 -16px; padding: calc(var(--safe-top) + 8px) 12px 8px 16px;
  display: flex; align-items: center; gap: 8px; min-height: 56px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar.bar3 { display: grid; grid-template-columns: 1fr auto 1fr; padding-left: 8px; padding-right: 8px; }
.topbar.bar3 .l { justify-self: start; display: flex; }
.topbar.bar3 .r { justify-self: end; display: flex; gap: 2px; }
.topbar h1 { font-size: 1.02rem; margin: 0; font-weight: 700; }
.topbar .page-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.icon-btn {
  width: 40px; height: 40px; border: 0; background: transparent; border-radius: 999px;
  display: grid; place-items: center; flex: none; color: var(--ink); padding: 0;
}
.icon-btn:hover { background: var(--sunken); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.sm { width: 32px; height: 32px; color: var(--muted); }
.icon-btn.sm svg { width: 18px; height: 18px; }
.text-btn { border: 0; background: transparent; padding: 8px; font-weight: 700; border-radius: 10px; }
.text-btn:disabled { opacity: .35; cursor: default; }

/* 로고: 고양이 동그라미 + sara mara 글자(이미지에서 뽑은 모양에 색을 입힘) */
.brand { display: flex; align-items: center; gap: 9px; margin: 0; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.wordmark {
  display: block; height: 21px; aspect-ratio: 1138 / 146; background: var(--ink);
  -webkit-mask: url(icons/wordmark.png) left center / contain no-repeat;
  mask: url(icons/wordmark.png) left center / contain no-repeat;
}
.tagline { color: var(--muted); font-size: .8rem; margin-left: auto; white-space: nowrap; }

/* 정렬 탭 */
.seg { display: flex; gap: 4px; background: var(--sunken); border-radius: 999px; padding: 4px; margin: 4px 0 12px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px 0; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* 피드 카드 */
.feed-list { display: grid; gap: 16px; }
.post-card { background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.photo { position: relative; display: block; aspect-ratio: 1; background: var(--sunken); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
/* 세로로 긴 사진(제품 화면 캡처 등)은 잘라 내지 않고 전체를 보여 준다 (ui.js fitPhoto) */
.photo img.tall, .carousel img.tall { object-fit: contain; }
.thumb img.tall, .mini img.tall { object-position: top; }
.photo-count { position: absolute; right: 12px; top: 12px; background: rgb(29 20 22 / .6); color: #fff; font-size: .76rem; padding: 3px 8px; border-radius: 999px; }
.decided-tag { position: absolute; left: 12px; top: 12px; font-weight: 700; font-size: .84rem; padding: 5px 11px; border-radius: 999px; }
.decided-tag.bought { background: var(--buy); color: var(--on-buy); }
.decided-tag.skipped { background: var(--skip); color: var(--on-skip); }
.card-body { padding: 14px 16px 16px; display: grid; gap: 10px; }
.card-text { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-size: 1.02rem; line-height: 1.55; }
.card-decision { margin: 0; font-size: .9rem; font-weight: 600; }
.card-decision.bought { color: var(--buy-ink); }
.card-decision.skipped { color: var(--skip-ink); }
.meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; min-width: 0; }
.meta .who { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .grow { flex: 1; }
.meta .cmt { display: inline-flex; align-items: center; gap: 4px; padding: 4px 2px; }
.meta svg { width: 17px; height: 17px; }
.avatar {
  width: 24px; height: 24px; border-radius: 999px; flex: none;
  display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff;
}
.avatar.md { width: 32px; height: 32px; font-size: .82rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.35rem; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 내 고민의 프로필 사진: 누르면 바꾼다. 오른쪽 아래 카메라 표시 */
.avatar-btn { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 999px; cursor: pointer; }
.avatar-btn .cam {
  position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 999px;
  display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: 0 0 0 2px var(--bg), 0 1px 3px rgba(0, 0, 0, .18);
}
.avatar-btn .cam svg { width: 13px; height: 13px; }
.avatar-btn.busy .avatar { opacity: .5; }

/* 투표 */
.poll { display: grid; gap: 8px; }
.poll-opts { display: flex; gap: 8px; }
.opt {
  flex: 1 1 0; min-width: 0; min-height: 52px; border: 2px solid currentColor; background: var(--surface);
  border-radius: 16px; padding: 8px 12px; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color .25s, color .25s, border-color .25s, transform .1s;
}
.opt.buy { color: var(--buy); }
.opt.skip { color: var(--skip); }
.opt.buy:hover:not(:disabled) { background: var(--buy-soft); }
.opt.skip:hover:not(:disabled) { background: var(--skip-soft); }
.opt:active:not(:disabled) { transform: scale(.97); }
.opt:disabled { cursor: default; }
.opt .lbl { display: inline-flex; align-items: center; gap: 4px; }
.opt .word { font-size: 1.3rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.opt .emoji { font-size: 1.15rem; line-height: 1; }
.opt .pct { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.opt svg { width: 18px; height: 18px; stroke-width: 3; }
.poll.big .opt { min-height: 60px; border-radius: 18px; }
.poll.big .opt .word { font-size: 1.5rem; }
.poll.result .opt { border-color: transparent; justify-content: space-between; padding: 8px 14px; }
.poll.result .opt.buy { background: var(--buy-soft); color: var(--buy-ink); }
.poll.result .opt.skip { background: var(--skip-soft); color: var(--skip-ink); flex-direction: row-reverse; }
.poll.result .opt.lead.buy { background: var(--buy); color: var(--on-buy); }
.poll.result .opt.lead.skip { background: var(--skip); color: var(--on-skip); }
.poll .note { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.ratio { display: flex; gap: 3px; height: 6px; }
.ratio i { flex: 1 1 0; min-width: 0; border-radius: 999px; transition: flex-grow .7s cubic-bezier(.2, .8, .2, 1); }
.ratio .b { background: var(--buy); }
.ratio .s { background: var(--skip); }
.ratio.sm { height: 4px; gap: 2px; }
.ratio.none i { background: var(--line); }

/* 고민 상세 */
.detail { display: grid; gap: 16px; }
.carousel { margin: 0 -16px; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; background: var(--sunken); }
@media (min-width: 600px) { .carousel { margin: 0; border-radius: 22px; } }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: -6px; }
.dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--line); transition: width .2s, background-color .2s; }
.dots i.on { background: var(--ink); width: 16px; }
.d-body { margin: 0; white-space: pre-wrap; font-size: 1.08rem; line-height: 1.7; }
/* 제품 보기: 글쓴이가 넣은 제품 링크 */
.product-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface);
}
.product-link:active { background: var(--sunken); }
.pl-text { display: grid; gap: 2px; min-width: 0; }
.pl-text b { font-size: .95rem; }
.pl-text span { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-host { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--muted); font-size: .78rem; }
.pl-host svg { width: 16px; height: 16px; }
.product-link.coupang { justify-content: flex-start; }
.product-link.coupang .pl-host { margin-left: auto; }
.pl-img { width: 44px; height: 44px; flex: none; border-radius: 10px; object-fit: cover; background: var(--sunken); }
/* 쿠팡 파트너스 대가성 문구: 링크 바로 아래, 작지만 읽을 수 있게 */
.disclosure { margin: -8px 2px 0; font-size: .75rem; line-height: 1.45; color: var(--muted); }
.author { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.author b { font-weight: 700; }
.decision { border-radius: 18px; padding: 14px 16px; display: grid; gap: 4px; }
.decision.bought { background: var(--buy-soft); color: var(--buy-ink); }
.decision.skipped { background: var(--skip-soft); color: var(--skip-ink); }
.decision b { font-size: 1.05rem; }
.decision p { margin: 0; font-size: .98rem; }
.ask-decide { border: 1.5px dashed var(--line); border-radius: 18px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.ask-decide p { margin: 0; font-size: .9rem; }
.pill-btn { display: inline-block; border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 9px 16px; font-weight: 700; white-space: nowrap; }
.pill-btn.light { background: var(--sunken); color: var(--ink); }
.divider { height: 8px; background: var(--sunken); margin: 4px -16px; }
.section-title { font-size: 1rem; font-weight: 700; margin: 0; display: flex; gap: 6px; align-items: baseline; }
.section-title .num { color: var(--muted); font-weight: 600; }

/* 냥언니: 로고 고양이의 한마디. 검은 말풍선(선글라스 색) */
.cat-card { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; }
.cat-face { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--buy); }
.cat-body { display: grid; gap: 6px; min-width: 0; justify-items: start; }
.cat-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; }
.cat-head b { font-weight: 800; }
.cat-badge { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.cat-bubble { margin: 0; background: var(--ink); color: var(--bg); border-radius: 4px 18px 18px 18px; padding: 11px 14px; font-size: .95rem; line-height: 1.6; }
.cat-bubble.typing { display: inline-flex; align-items: center; gap: 10px; padding: 13px 16px; line-height: 1; }
.cat-bubble .reading { font-size: .85rem; opacity: .85; }
.cat-sources { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .78rem; color: var(--muted); }
.cat-sources a { text-decoration: underline; text-underline-offset: 2px; }
.doc-link { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 999px; background: currentColor; animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }
.cat-line { display: flex; gap: 8px; align-items: flex-start; background: var(--sunken); border-radius: 14px; padding: 9px 11px; font-size: .86rem; line-height: 1.5; }
.cat-line img { width: 24px; height: 24px; border-radius: 999px; object-fit: cover; flex: none; }
.cat-line-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.cat-line-text b { font-weight: 800; margin-right: 5px; }
.cat-line-text .stance { vertical-align: 1px; }

/* 댓글 */
.comments { display: grid; gap: 16px; }
.comment { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start; }
.comment .head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .84rem; min-height: 22px; }
.comment .head b { font-weight: 700; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; }
.comment.fresh { animation: fresh 1.2s ease-out; border-radius: 12px; }
@keyframes fresh { from { background: var(--buy-soft); } to { background: transparent; } }
.stance { font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; }
.stance.buy { background: var(--buy-soft); color: var(--buy-ink); }
.stance.skip { background: var(--skip-soft); color: var(--skip-ink); }
.stance.hold { background: var(--sunken); color: var(--muted); }
.op { font-size: .7rem; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; color: var(--muted); }
.no-comments { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; padding: 20px 0; }

/* 댓글 입력창 (상세 화면 아래 고정) */
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 16px calc(8px + var(--safe-bottom));
}
.composer-in { max-width: 528px; margin: 0 auto; display: grid; gap: 8px; }
.stances { display: flex; gap: 6px; align-items: center; }
.stances .small { margin-right: 2px; }
.stance-btn { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .84rem; color: var(--muted); }
.stance-btn.buy[aria-pressed="true"] { border-color: var(--buy); color: var(--buy-ink); background: var(--buy-soft); }
.stance-btn.skip[aria-pressed="true"] { border-color: var(--skip); color: var(--skip-ink); background: var(--skip-soft); }
.composer .line { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); background: var(--bg); border-radius: 20px;
  padding: 9px 14px; max-height: 120px; line-height: 1.4; min-height: 40px;
}
.composer textarea:focus { outline: none; border-color: var(--ink); }
.send { border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; height: 40px; padding: 0 16px; font-weight: 700; flex: none; }
.send:disabled { opacity: .3; cursor: default; }

/* 아래 탭 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 16px calc(6px + var(--safe-bottom));
}
.tabbar-in { max-width: 528px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.tab { display: grid; justify-items: center; gap: 1px; font-size: .72rem; color: var(--muted); padding: 4px 0; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab-new { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 700; }
.tab-new svg { width: 18px; height: 18px; stroke-width: 2.6; }
body.no-tabs .tabbar { display: none; }
/* 웹으로 링크를 열고 들어온 손님: 아래 탭 대신 앱 안내 띠, 댓글 입력창 대신 안내 상자 */
.app-bar { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.app-bar img { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.app-bar .txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.app-bar .txt b { font-size: .92rem; }
.app-bar .txt span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar .pill-btn { flex: none; }
.cta-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 18px; padding: 14px 16px; background: var(--sunken); }
.cta-box p { margin: 0; font-size: .9rem; }
.get-app img { width: 88px; height: 88px; border-radius: 26px; }
.get-app .small { margin-top: 6px; text-decoration: underline; text-underline-offset: 2px; }

/* 고민 올리기 */
/* minmax(0, 1fr): 긴 링크나 제품 이름 한 줄이 칸을 옆으로 늘리지 않게 */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 6px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.field > .label { font-weight: 700; font-size: .95rem; display: flex; justify-content: space-between; align-items: baseline; }
.label .req { color: var(--buy); margin-left: 2px; }
.label .count { font-weight: 400; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { font-size: .8rem; color: var(--muted); margin: 0; }
.input, .textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.textarea { min-height: 128px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus { outline: none; border-color: var(--ink); }
.input::placeholder, .textarea::placeholder, .composer textarea::placeholder { color: var(--muted); opacity: .8; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: none; }
.photos::-webkit-scrollbar { display: none; }
.add-photo {
  flex: none; width: 96px; height: 96px; border: 1.5px dashed var(--muted); border-radius: 16px; background: transparent;
  display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); font-size: .78rem;
}
.add-photo svg { width: 26px; height: 26px; }
.thumb { flex: none; width: 96px; height: 96px; border-radius: 16px; overflow: hidden; position: relative; background: var(--sunken); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 999px; border: 0; padding: 0;
  background: rgb(0 0 0 / .62); color: #fff; display: grid; place-items: center;
}
.thumb .rm svg { width: 14px; height: 14px; stroke-width: 3; }
.thumb .cover { position: absolute; left: 5px; bottom: 5px; background: rgb(0 0 0 / .62); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 6px; }
/* 제품 링크를 붙여 넣으면 사진을 가져오는 동안·뒤에 보이는 한 줄 */
.link-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 1.3em; }
.link-note.ok { color: var(--ink); flex-wrap: nowrap; }
.link-note.fail { color: var(--danger-ink); }
.link-note svg { width: 14px; height: 14px; flex: none; stroke-width: 3; }
.link-note .ell { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.spinner { width: 13px; height: 13px; flex: none; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 켜는 동안(서버 연결) 잠깐 보이는 화면 */
.boot { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot img { width: 72px; height: 72px; border-radius: 999px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--buy); }
.boot .spinner { width: 20px; height: 20px; }
.primary { width: 100%; border: 0; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 1.02rem; border-radius: 16px; padding: 15px; }
.primary:disabled { opacity: .35; cursor: default; }
.primary.danger { background: var(--danger); color: #fff; }
.ghost { display: block; text-align: center; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; font-weight: 600; }

/* 아래에서 올라오는 창 */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88vh; max-height: 88dvh; overflow: auto;
  background: var(--surface); color: var(--ink); border-radius: 24px 24px 0 0;
}
dialog.sheet::backdrop { background: rgb(0 0 0 / .42); }
dialog.sheet:focus-visible { outline: none; } /* 열릴 때 창 자체에 초점 (ui.js sheet) */
dialog.sheet[open] { animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.sheet[open] { animation: none; } .ratio i { transition: none; } .dots i { animation: none; opacity: .7; } .spinner { animation-duration: 2.4s; } }
.sheet-in { padding: 8px 20px calc(20px + var(--safe-bottom)); display: grid; gap: 14px; }
.grabber { width: 40px; height: 4px; border-radius: 999px; background: var(--line); justify-self: center; margin: 4px 0 2px; }
.sheet h2 { margin: 0; font-size: 1.12rem; }
.sheet p { margin: 0; }
.sheet .err { color: var(--danger-ink); font-size: .85rem; min-height: 1.2em; }
.menu { display: grid; }
.menu button {
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left;
  padding: 15px 4px; font-size: 1rem; display: flex; gap: 12px; align-items: center;
}
.menu button:last-child { border-bottom: 0; }
.menu button svg { width: 20px; height: 20px; color: var(--muted); }
.menu button.danger, .menu button.danger svg { color: var(--danger-ink); }
.menu button.cancel { justify-content: center; color: var(--muted); font-weight: 600; }
/* 아이폰이 어두운 배경을 '누를 수 있는 곳'으로 보게 (바깥을 누르면 닫힘) */
dialog.sheet { cursor: pointer; }
.sheet-in { cursor: auto; }
.actions { display: flex; gap: 8px; }
.actions > * { flex: 1; }
/* 메뉴의 두 줄 항목: 제목 + 설명 (고민 화면의 공유) */
.menu-label { display: grid; gap: 1px; }
.menu-label small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
/* 공유 이미지 창 (share-card.js): 세로 9:16 미리보기 */
.card-frame {
  position: relative; justify-self: center; height: min(50vh, 440px); height: min(50dvh, 440px); aspect-ratio: 9 / 16;
  border-radius: 14px; overflow: hidden; background: var(--brand); box-shadow: 0 2px 14px rgb(29 20 22 / .18);
}
.card-frame img { width: 100%; height: 100%; }
.card-wait { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 16px; color: #fff; font-size: .85rem; font-weight: 600; text-align: center; }
.card-wait .spinner { width: 22px; height: 22px; border-color: rgb(255 255 255 / .35); border-top-color: #fff; }
.card-hint { text-align: center; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 16px 8px; display: grid; justify-items: center; gap: 6px; font-weight: 700; }
.choice .emoji { font-size: 1.8rem; line-height: 1; }
.choice.buy[aria-pressed="true"] { border-color: var(--buy); background: var(--buy-soft); color: var(--buy-ink); }
.choice.skip[aria-pressed="true"] { border-color: var(--skip); background: var(--skip-soft); color: var(--skip-ink); }

/* 알림 한 줄 */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-bottom)); z-index: 100; pointer-events: none;
  transform: translate(-50%, 16px); opacity: 0; transition: opacity .2s, transform .2s;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem;
  max-width: calc(100% - 32px); width: max-content; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.has-composer .toast { bottom: calc(140px + var(--safe-bottom)); }
body.no-tabs:not(.has-composer) .toast { bottom: calc(28px + var(--safe-bottom)); }

/* 처음 여는 화면 */
body.welcome-page main#view { padding: 0; }
/* 위쪽 상태 표시줄·다이내믹 아일랜드 자리는 그림 배경과 같은 분홍으로 채우고, 그림은 그 아래부터 */
.hero { position: relative; background: var(--brand); padding-top: var(--safe-top); overflow: hidden; }
.hero img { width: 100%; aspect-ratio: 1; object-fit: cover; }
/* 언어 바꾸기 (한국어 ↔ English). 지금이 아닌 언어의 이름이 그 언어로 적혀 있다 */
.lang-btn {
  position: absolute; top: calc(var(--safe-top) + 12px); right: 12px;
  padding: 7px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(29, 20, 22, .55); color: #fff; font: inherit; font-size: .86rem; font-weight: 600;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.welcome-card {
  position: relative; margin-top: -28px; background: var(--bg); border-radius: 28px 28px 0 0;
  padding: 26px 20px calc(24px + var(--safe-bottom)); display: grid; gap: 18px;
}
.welcome-card h1 { margin: 0; font-size: 1.6rem; line-height: 1.3; letter-spacing: -0.02em; }
.welcome-card h1 em { font-style: normal; color: var(--buy); }
.welcome-card > p { margin: -8px 0 0; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 0 12px; align-items: center; }
.steps .n { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--sunken); }
.steps b { font-size: .98rem; }
.steps span { color: var(--muted); font-size: .86rem; }

/* 내 고민 */
.page { display: grid; gap: 16px; }
.profile { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.profile .who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.profile .name { font-size: 1.15rem; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 4px; }
.stat b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }
.list { display: grid; gap: 10px; }
.mini { display: grid; grid-template-columns: 68px 1fr; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
.mini img { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; }
.mini-body { display: grid; gap: 6px; min-width: 0; }
.mini .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.settings > a, .settings > button {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 16px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: .98rem;
}
.settings > :last-child { border-bottom: 0; }
.settings svg { width: 18px; height: 18px; color: var(--muted); }
.settings .val { color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 4px; }
.blocked-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.blocked-row b { flex: 1; min-width: 0; }
.notice { background: var(--sunken); border-radius: 14px; padding: 12px 14px; font-size: .86rem; color: var(--muted); margin: 0; }
.notice b { color: var(--ink); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .big { font-size: 2.6rem; line-height: 1; }
.empty b { color: var(--ink); font-size: 1.05rem; }
.empty p { margin: 0; }
.empty .pill-btn { margin-top: 6px; }
.version { text-align: center; color: var(--muted); font-size: .78rem; margin: 4px 0 0; }

/* 커뮤니티 규칙 */
.rules { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 14px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px; }
.rules li::before {
  content: counter(r); grid-row: span 2; width: 24px; height: 24px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: .78rem; font-weight: 700; display: grid; place-items: center;
}
.rules b { font-size: .95rem; }
.rules p { margin: 0; color: var(--muted); font-size: .88rem; }
/* 무관용 원칙 (동의 화면·규칙 화면·동의 시트 맨 위) */
.zero { border-left: 4px solid var(--buy); background: var(--buy-soft); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.zero b { color: var(--buy-ink); font-size: .95rem; line-height: 1.45; }
.zero p { margin: 0; font-size: .86rem; color: var(--ink); }
/* 처음 연 앱의 약관 동의 화면 (#/agree) */
.agree { gap: 16px; padding-top: var(--safe-top); }
/* 위 막대가 없는 화면이라, 내려도 글이 상태 표시줄(시계) 밑으로 비치지 않게 그 자리를 배경색으로 가린다 */
.agree::before { content: ''; position: fixed; inset: 0 0 auto; height: var(--safe-top); background: var(--bg); z-index: 10; }
.agree .page-title { margin-top: 12px; }
.agree > p { margin: -6px 0 0; }
.agree-check { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 600; cursor: pointer; }
.agree-check input { width: 22px; height: 22px; flex: none; accent-color: var(--buy); }
.agree .primary { width: 100%; }

/* 로그인 (내 고민 → 계정). 단추 모양은 각 회사 안내를 따른다: Apple 검정(어두운 화면은 흰색), 카카오 노랑, Google 흰 바탕에 테두리 */
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; }
.login-card > b { font-size: 1rem; }
.login-card > p { margin: -4px 0 4px; }
.login-list { display: grid; gap: 10px; }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 16px;
  border: 0; border-radius: 12px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.login-btn svg { width: 20px; height: 20px; flex: none; }
.login-btn:disabled { opacity: .6; }
.login-btn.apple { background: #000; color: #fff; }
.login-btn.kakao { background: #FEE500; color: rgba(0, 0, 0, .85); }
.login-btn.google { background: #fff; color: #1f1f1f; box-shadow: inset 0 0 0 1px #747775; }
@media (prefers-color-scheme: dark) { .login-btn.apple { background: #fff; color: #000; } }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.acct-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--sunken); font-size: .86rem; font-weight: 600; }
.acct-chip svg { width: 14px; height: 14px; }
.settings > button.danger { color: var(--danger-ink); }
.check-row { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.check-row input { width: 20px; height: 20px; accent-color: var(--buy); }

