/* =========================================================
   고민투표 디자인 (Claude Design 리뉴얼 시안 적용)
   - 컨셉: "질문 한 장에 집중"
   - 따뜻한 회색 바탕 + 흰 카드 + 깊은 에메랄드 포인트
   - 빨간 계열(로즈)은 공감 하트와 새 답변 배지에만 사용
   ========================================================= */
:root {
  --bg: #F3F4F1;
  --card: #FFFFFF;
  --ink: #15181C;
  --muted: #5F6670;          /* 흰 배경 대비 5.9:1 */
  --line: #E4E6E1;
  --line-soft: #EEF0EB;
  --track: #F3F4F1;
  --accent: #0F7A55;         /* 흰 배경 대비 5.4:1 */
  --accent-strong: #0B5E41;
  --accent-soft: #E4F2EB;
  --fill-top: #CFE9DC;       /* 1위 결과 */
  --fill: #EEF0EB;           /* 나머지 결과 */
  --rose: #D6336C;
  --rose-text: #C2255C;
  --rose-soft: #FDF0F4;
  --rose-line: #F6C6D6;
  --dashed: #CDD1CA;
  --pill: #15181C;
  --pill-text: #FFFFFF;
  --focus: #0F7A55;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101311;
    --card: #181C1A;
    --ink: #ECEFEC;
    --muted: #A4ACA7;
    --line: #2A302D;
    --line-soft: #232926;
    --track: #222826;
    --accent: #4FC79A;
    --accent-strong: #7FD6AE;
    --accent-soft: #173327;
    --fill-top: #1F4A37;
    --fill: #262C29;
    --rose: #F06595;
    --rose-text: #F783AC;
    --rose-soft: #2C1520;
    --rose-line: #4F2233;
    --dashed: #3A423E;
    --pill: #ECEFEC;
    --pill-text: #15181C;
    --focus: #7FD6AE;
  }
}

/* ===== 기본 ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.muted { color: var(--muted); }

/* ===== 큰 틀 ===== */
.shell { max-width: 1200px; margin: 0 auto; padding: 0 32px 72px; }

/* ===== 상단 바 ===== */
.topbar { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 22px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.logo-mark { width: 30px; height: 30px; }
.tagline { margin-left: -16px; font-size: 13px; font-weight: 600; color: var(--muted); }
@media (max-width: 1100px) { .tagline { display: none; } }

.nav {
  display: flex; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.nav button {
  display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent;
  font-size: 14px; font-weight: 700; color: var(--muted);
  transition: background .15s, color .15s;
}
.nav button .ic { display: none; }
.nav button:hover { color: var(--ink); }
.nav button.active { background: var(--pill); color: var(--pill-text); }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--rose); color: #FFFFFF; font-size: 11px; font-weight: 800;
}

.me { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tickets {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 40px; padding: 0 4px;
  border: 0; background: none;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.tickets .tickets-l { margin-right: 3px; }
.tickets .tickets-l b { color: var(--ink); font-size: 14px; font-weight: 800; margin: 0 0 0 2px; }
.tickets i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tickets i.on { background: var(--accent); }
.tickets b { font-size: 12px; color: var(--accent); margin-left: 2px; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: 13px; font-weight: 800;
}
.me-text { display: flex; flex-direction: column; line-height: 1.25; }
.me-text b { font-size: 14px; }
.me-text span { font-size: 12px; color: var(--muted); }

/* ===== 화면 제목 (고민 올리기, 내 고민) ===== */
.page-head { margin: 8px 0 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 32px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.25; }
.page-head p { margin: 0; color: var(--muted); }

/* ===== 레이아웃 ===== */
.layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.main-col { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.side-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.stack { display: grid; gap: 16px; align-content: start; }

/* ===== 카드 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 0;
}
.card-h { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.card-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--track); color: var(--muted);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.chip.green { background: var(--accent-soft); color: var(--accent-strong); }

/* ===== 카테고리 필터 ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-bar button {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.filter-bar button:hover { color: var(--ink); }
.filter-bar button[aria-pressed="true"] { background: var(--pill); border-color: var(--pill); color: var(--pill-text); }

/* ===== 마감 시간 칩 ===== */
.time-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--track); color: var(--ink);
  font-size: 12px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.time-chip.urgent { background: var(--rose-soft); color: var(--rose-text); border: 1px solid var(--rose-line); }
.time-chip.closed { background: var(--line); color: var(--muted); }

/* ===== 사진 선택지 ===== */
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo-opt, .photo-item {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-md); border: 1.5px solid var(--line); background: var(--card);
  padding: 0; text-align: left;
}
.photo-opt { transition: border-color .15s, transform .1s; }
.photo-opt:hover { border-color: var(--accent); }
.photo-opt:active { transform: scale(.98); }
.photo-item.is-mine { border: 2px solid var(--accent); }
.opt-img {
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: var(--track); color: var(--muted);
  font-size: 18px; font-weight: 800; text-align: center; padding: 0;
}
.opt-img.empty { padding: 12px; }
.photo-label { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; font-size: 16px; font-weight: 700; }
.photo-item .res-row { border: 0; border-radius: 0; border-top: 1px solid var(--line); min-height: 52px; }
.photo-item.is-mine .res-row { border: 0; border-top: 1px solid var(--line); }

/* 고민 쓰기: 사진 버튼 */
.photo-btn {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1.5px dashed var(--dashed); color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.photo-btn:hover { color: var(--ink); border-color: var(--muted); }
.photo-btn:focus-within { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.photo-btn.loading { cursor: wait; }
.photo-thumb { position: relative; flex: none; width: 44px; height: 44px; }
.photo-thumb img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; }
.photo-thumb button {
  position: absolute; top: -8px; right: -8px;
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border-radius: 50%; border: 0; background: var(--pill); color: var(--pill-text);
}

/* ===== 넘기면서 투표하기: 자동으로 다음 고민 ===== */
.auto-next {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  margin: -12px 0 18px; padding: 8px 8px 8px 16px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong);
  font-size: 14px; font-weight: 700;
}
.auto-next > span:not(.auto-bar) { flex: 1; position: relative; }
.auto-next .btn { position: relative; min-height: 36px; color: var(--accent-strong); }
.auto-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  background: var(--fill-top); transform-origin: left center;
  animation: countdown var(--ms, 2500ms) linear both;
}
@keyframes countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.kbd-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: right; }
.kbd-hint kbd {
  display: inline-block; min-width: 20px; margin: 0 2px; padding: 0 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  font: inherit; font-weight: 700; text-align: center; background: var(--card);
}

/* 실시간 업데이트로 다시 그릴 때는 막대 애니메이션을 끔 */
.no-anim .res-fill { animation: none; }

/* 알림 켜기 안내 */
.notify-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.notify-card .e-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
.notify-card > div { flex: 1; min-width: 200px; }

/* ===== 오늘의 고민 ===== */
.today {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  padding: 16px 18px 16px 20px;
  border: 1px solid var(--accent); border-radius: var(--radius-lg);
  background: var(--accent-soft);
}
.today-l { display: flex; flex-direction: column; gap: 4px; flex: none; }
.today-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: #FFFFFF;
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
@media (prefers-color-scheme: dark) { .today-tag { color: #0B2A1D; } }
.today-date { font-size: 12px; font-weight: 700; color: var(--accent-strong); padding-left: 2px; }
.today-t { flex: 1 1 220px; min-width: 0; margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.4; }

/* 참여자가 적어 결과를 감출 때 */
.res-hidden {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 4px 0 0; padding: 12px; border-radius: var(--radius-md);
  background: var(--track); color: var(--muted); font-size: 14px; font-weight: 700;
}

/* ===== 질문 카드 ===== */
.q-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 40px 44px 30px;
}
.q-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.q-meta .chip { font-size: 13px; padding: 5px 12px; }
.round-btn {
  margin-left: auto; flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.round-btn:hover { background: var(--track); }
.q-title { margin: 0 0 10px; font-size: 36px; line-height: 1.3; font-weight: 800; letter-spacing: -0.035em; }
.q-desc { margin: 0 0 30px; font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 40em; }
.q-title + .opts, .q-title + .res { margin-top: 26px; }

.opts { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 16px;
  width: 100%; min-height: 64px; padding: 10px 22px;
  border-radius: var(--radius-md); border: 1.5px solid var(--line); background: var(--card);
  font-size: 17px; font-weight: 700; text-align: left;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.opt:active { background: var(--accent-soft); }
.key, .num-dot {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--track); color: var(--muted);
  font-size: 14px; font-weight: 800;
}
.opt:hover .key { background: var(--accent); color: #FFFFFF; }

.write-open {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; margin-top: 14px;
  border-radius: var(--radius-md); border: 1.5px dashed var(--dashed); background: transparent;
  font-size: 15px; font-weight: 700; color: var(--muted);
}
.write-open:hover { color: var(--ink); border-color: var(--muted); }
.write { margin-top: 14px; padding: 18px; border: 1.5px solid var(--accent); border-radius: var(--radius-md); background: var(--accent-soft); }
.write .field-l { margin-bottom: 8px; }
.write .input { background: var(--card); }
.write-act { display: flex; justify-content: flex-end; gap: 8px; }

.q-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  font-size: 14px; color: var(--muted);
}
.q-foot-act { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== 결과: 선택지 안에서 차오르는 막대 ===== */
.res { display: flex; flex-direction: column; gap: 10px; }
.res-row {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 20px;
  border-radius: var(--radius-md); border: 1.5px solid var(--line);
}
.res-row.is-mine { border: 2px solid var(--accent); }
.res-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--fill);
  transform-origin: left center;
  animation: grow .7s cubic-bezier(.2, .7, .2, 1) both;
}
.res-row.is-top .res-fill { background: var(--fill-top); }
.res-text { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 16px; font-weight: 700; }
.res-text .key { width: 28px; height: 28px; font-size: 13px; background: var(--card); }
.mine-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: #FFFFFF; font-size: 12px; font-weight: 800;
}
@media (prefers-color-scheme: dark) { .mine-tag { color: #0B2A1D; } }
.res-val { position: relative; text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.res-val small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }

/* ===== 버튼 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: var(--pill); color: var(--pill-text);
  font-size: 15px; font-weight: 800; white-space: nowrap;
  transition: opacity .15s, background .15s;
}
.btn:hover { opacity: .88; }
.btn.green { background: var(--accent); color: #FFFFFF; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { opacity: 1; background: var(--track); }
.btn.text { background: transparent; color: var(--muted); padding: 0 10px; min-height: 44px; font-weight: 700; }
.btn.text:hover { color: var(--ink); opacity: 1; }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn.danger { color: #DC2626; }
.btn.google { background: #FFFFFF; color: #1F1F1F; border: 1px solid #DADCE0; }
.btn.google:hover { opacity: 1; background: #F7F8F8; }
.btn.google svg { width: 18px; height: 18px; }
button:disabled { opacity: .55; cursor: wait; }

/* ===== 오른쪽 카드들 ===== */
.side-h { margin: 0; font-size: 15px; font-weight: 800; }
.ticket-head { display: flex; align-items: baseline; justify-content: space-between; }
.ticket-num { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.ticket-num small { font-size: 15px; font-weight: 700; color: var(--muted); }
.segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 14px 0 12px; }
.segments i { height: 8px; border-radius: 999px; background: var(--line); }
.segments i.on { background: var(--accent); }
.side-p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.side-p + .btn { margin-top: 14px; }

.rank { list-style: none; margin: 8px 0 0; padding: 0; }
.rank li + li { border-top: 1px solid var(--line-soft); }
.rank button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 0;
  border: 0; background: none; text-align: left;
}
.rank .n { width: 18px; font-size: 13px; font-weight: 800; color: var(--accent); }
.rank .t { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank button:hover .t { text-decoration: underline; }
.rank .c { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.dark-card { background: var(--pill); color: var(--pill-text); border-color: var(--pill); }
.dark-card .side-p { color: color-mix(in srgb, var(--pill-text) 78%, transparent); margin-top: 6px; }
.dark-card .btn { background: var(--pill-text); color: var(--pill); margin-top: 16px; }

/* ===== 글 답변 ===== */
.answers { margin-top: 24px; }
.answers-h { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.answers-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.answers-list li { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.answers-list li.mine p::before { content: "내 답변"; display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 800; vertical-align: 1px; }
.answers-list p { margin: 0 0 6px; font-size: 15px; line-height: 1.65; white-space: pre-wrap; }
.a-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.a-meta > span { font-size: 12px; color: var(--muted); }
.a-meta > span b { display: none; }
.like, .like-count {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.like { min-height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.like:hover { color: var(--ink); }
.like.on { color: var(--rose-text); border-color: var(--rose-line); background: var(--rose-soft); }
.like.on .ic { fill: currentColor; }
.small { font-size: 13px; margin: 0; }

/* ===== 빈 화면 ===== */
.empty { text-align: center; padding: 44px 24px; }
.empty .e-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px; }
.empty .e-ic .ic { width: 26px; height: 26px; }
.empty h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.03em; }
.empty p { margin: 0 auto 20px; color: var(--muted); max-width: 30em; }
.empty .error { text-align: center; }

/* ===== 고민 쓰기 ===== */
.field { display: block; margin-bottom: 20px; }
.field-l { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.field-l .counter { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.input {
  width: 100%; min-height: 50px; padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--bg);
}
textarea.input { resize: vertical; min-height: 90px; }
.input.big { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.input:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pick button {
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--muted);
}
.cat-pick button[aria-pressed="true"] { background: var(--pill); border-color: var(--pill); color: var(--pill-text); }
.opt-edit { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.opt-edit .input { min-height: 50px; }
.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.icon-btn:hover { color: #DC2626; }
.add-opt { width: 100%; border: 1.5px dashed var(--dashed) !important; background: transparent !important; color: var(--muted) !important; }
.error { color: #DC2626; font-size: 14px; font-weight: 700; min-height: 1.5em; margin: 4px 0 8px; }

.preview .opt { cursor: default; min-height: 56px; font-size: 16px; }
.preview .opt:hover { border-color: var(--line); background: var(--card); }
.preview .opt:hover .key { background: var(--track); color: var(--muted); }
.preview .q-title { font-size: 24px; }
.preview .placeholder { color: var(--muted); font-weight: 500; }

/* ===== 로그인·계정 ===== */
.login-note { margin: 0 auto 20px; color: var(--muted); font-size: 15px; max-width: 30em; }
.login-note b { color: var(--ink); }
.nick-form { display: flex; gap: 8px; max-width: 380px; margin: 0 auto; }
.nick-form .input { flex: 1; min-width: 0; }
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.account .avatar { width: 44px; height: 44px; }
.account .who { flex: 1; min-width: 160px; }
.account .who b { display: block; }
.account .who span { font-size: 13px; color: var(--muted); }
.nick-edit-row { display: flex; flex-wrap: wrap; gap: 8px; }
.nick-edit-row .input { flex: 1 1 200px; min-width: 0; }
.nick-edit .error { margin: 8px 0 4px; }

.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 0 0 18px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--card); font-size: 14px;
}
.banner p { flex: 1; min-width: 220px; margin: 0; }
.setup ol { text-align: left; max-width: 34em; margin: 0 auto 20px; padding-left: 1.4em; color: var(--muted); }
.setup ol li { margin-bottom: 6px; }
.setup code { background: var(--track); padding: 1px 6px; border-radius: 6px; font-size: 13px; color: var(--ink); }

/* ===== 공유 창 ===== */
.share-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--card); color: var(--ink);
}
.share-dialog::backdrop { background: rgba(21, 24, 28, .5); }
.share-dialog h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 18px; }
.share-q { margin: 0 0 16px; color: var(--muted); }
.share-dialog .input { font-size: 14px; }
.share-status { display: flex; align-items: center; gap: 6px; min-height: 1.5em; margin: 10px 0 16px; font-size: 14px; color: var(--muted); }
.share-status.ok { color: var(--accent); font-weight: 700; }
.share-act { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== 알림 ===== */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 30;
  transform: translate(-50%, 16px);
  max-width: calc(100% - 32px);
  background: var(--pill); color: var(--pill-text);
  padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dev { margin-top: 24px; text-align: center; }

@keyframes grow { from { transform: scaleX(0); } }

/* ===== 태블릿 ===== */
@media (max-width: 1000px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

/* ===== 휴대폰: 하단 탭 바 ===== */
@media (max-width: 680px) {
  .shell { padding: 0 16px 120px; }
  .topbar { gap: 10px; padding: 16px 0 12px; }
  .logo { font-size: 18px; }
  .logo-mark { width: 26px; height: 26px; }
  .me { gap: 8px; }
  .me-text { display: none; }
  .tickets { padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 12px; min-height: 36px; }
  .tickets i { width: 8px; height: 8px; }

  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0; padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid var(--line); border-radius: 0;
  }
  .nav button {
    position: relative; flex-direction: column; gap: 3px;
    min-height: 52px; padding: 0; border-radius: 12px;
    font-size: 11px; color: var(--muted);
  }
  .nav button .ic { display: block; width: 22px; height: 22px; }
  .nav button.active { background: transparent; color: var(--ink); }
  .nav button.active .ic { stroke-width: 2.4; }
  .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; }

  .filter-bar { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar button { min-height: 38px; padding: 0 14px; font-size: 13px; }

  .q-card { padding: 26px 20px 20px; border-radius: 26px; }
  .q-title { font-size: 26px; }
  .q-desc { font-size: 15px; margin-bottom: 22px; }
  .opt { min-height: 58px; padding: 8px 18px; font-size: 16px; gap: 14px; }
  .key { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
  .res-row { min-height: 54px; padding: 8px 16px; }
  .res-text { font-size: 15px; }
  .q-foot-act { width: 100%; }
  .q-foot-act .btn:last-child { flex: 1; }

  .page-head h1 { font-size: 26px; }
  .kbd-hint { display: none; }
  .photo-grid { gap: 8px; }
  .photo-label { font-size: 14px; padding: 6px 10px; gap: 8px; min-height: 46px; }
  .opt-edit { flex-wrap: wrap; }
  .opt-edit .input { flex: 1 1 140px; }
  .card { padding: 20px; }
  .toast { bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
