/* 앱 공통 부품: 위쪽 막대 · 목록 · 아바타 · 하단 탭 · 말풍선 · 시트 내용 */

/* 위쪽 막대 (피그마 Nav Bar · 52) */
.nav-bar {
  flex: none; position: relative; height: 52px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal));
}
.nav-bar .round-btn { position: absolute; left: calc(16px + var(--sal)); top: 6px; }
.nav-bar .round-btn.right { left: auto; right: calc(16px + var(--sar)); }
.nav-bar h1 { font-size: 17px; font-weight: 700; line-height: 1.3; letter-spacing: -0.03em; max-width: 60%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 목록 카드 (흰 둥근 상자) */
.list-card { margin: 0 calc(var(--gutter) + var(--sar)) 0 calc(var(--gutter) + var(--sal)); background: var(--white); border-radius: 20px; overflow: hidden; }
.section-label { margin: 20px calc(var(--gutter) + 4px) 8px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.row {
  position: relative; width: 100%; min-height: 68px; display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; text-align: left; background: var(--white);
  transition: background 120ms;
}
.row:active { background: #EEF2FC; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px; background: rgba(181,209,235,.5); }
.row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .t { font-size: 15px; font-weight: 700; line-height: 1.4; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 14px; line-height: 1.45; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.03em; }
.row .t.red, .row .s.red { color: var(--point-red); }
.row .meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; align-self: flex-start; padding-top: 1px; }
.row .time { font-size: 12px; font-weight: 500; color: var(--text-secondary); line-height: 17px; white-space: nowrap; }
.row .cnt { min-width: 20px; height: 19px; padding: 0 7px; border-radius: 10px; background: var(--point-pink); color: var(--white); font-size: 12px; font-weight: 700; line-height: 19px; text-align: center; }
.row.dim { opacity: .55; }
.row.tall { min-height: 72px; }

/* 아바타 (사람 = 원) */
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-sky) center / cover no-repeat; color: var(--brand-blue);
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
}
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; }

/* 하단 탭 (Tab Bar · 앱 색 알약 + 채운 아이콘) */
.tabbar {
  flex: none; position: relative; z-index: 4;
  display: flex; justify-content: space-around;
  padding: 8px calc(16px + var(--sar)) calc(10px + max(var(--sab), 12px)) calc(16px + var(--sal));
  background: var(--white); box-shadow: inset 0 1px 0 var(--brand-sky);
}
.tabbar .tab { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
.tabbar .tab .ind { position: relative; width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; transition: background 200ms var(--ease); }
.tabbar .tab .ind svg { width: 24px; height: 24px; }
.tabbar .tab[aria-selected="true"] { color: var(--text-primary); font-weight: 700; }
.tabbar .tab[aria-selected="true"] .ind { background: color-mix(in srgb, var(--app) 14%, transparent); color: var(--app-dark); }
.tabbar .tab .tb { position: absolute; top: -1px; left: 33px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--point-red); color: var(--white); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 1.5px var(--white); }

/* 대화방 */
.chat { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 16px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: none; }
.chat::-webkit-scrollbar { display: none; }
.day-chip { align-self: center; margin: 8px 0 6px; padding: 4px 12px; border-radius: 12px; background: var(--brand-sky); color: var(--brand-blue); font-size: 12px; font-weight: 500; line-height: 17px; }
.sender { padding: 6px 20px 0; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.msg { display: flex; align-items: flex-end; gap: 8px; padding: 0 16px; }
.msg.me { flex-direction: row-reverse; }
.bubble {
  max-width: 72%; padding: 10px 14px; border-radius: 20px 20px 20px 6px;
  background: var(--white); box-shadow: inset 0 0 0 1px var(--brand-sky);
  font-size: 14px; line-height: 1.45; letter-spacing: -0.03em; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere;
  user-select: text; -webkit-user-select: text;
}
.msg.me .bubble { background: var(--brand-blue); color: var(--white); box-shadow: none; border-radius: 20px 20px 6px 20px; }
.msg .mt { flex: none; font-size: 12px; font-weight: 500; color: var(--text-secondary); line-height: 17px; }
.bubble a, .bubble .link { display: inline-block; margin-top: 4px; color: var(--brand-light-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bubble.photo { padding: 0; overflow: hidden; width: 180px; aspect-ratio: 4/5; background: var(--brand-sky) center / cover; }
.msg.new, .link-card.new { animation: msg-in 260ms var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }

.link-card { margin: 4px 16px 0; align-self: flex-start; width: min(260px, 72%); padding: 16px 17px; border-radius: 20px; background: var(--white); box-shadow: inset 0 0 0 1px var(--brand-sky); display: flex; flex-direction: column; gap: 10px; }
.link-card b { font-size: 13px; font-weight: 700; }
.link-card .btn.soft { background: var(--brand-sky); color: var(--brand-blue); height: 44px; font-size: 14px; }
.link-card .btn { height: 44px; font-size: 14px; }

/* 대화방 아래 */
.reply-bar { flex: none; background: var(--white); box-shadow: inset 0 1px 0 var(--brand-sky); padding: 12px calc(16px + var(--sar)) calc(16px + max(var(--sab), 8px)) calc(16px + var(--sal)); }
.reply-bar .cap { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 10px; }
.reply-bar .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 44px; padding: 0 18px; border-radius: 22px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--brand-light-blue); color: var(--brand-blue); font-size: 15px; font-weight: 700; }
.chip:active { background: #EEF0FD; }
.reply-bar .done { font-size: 13px; font-weight: 500; color: var(--text-secondary); text-align: center; padding: 6px 0; }
.input-hint { flex: none; background: var(--white); padding: 12px calc(16px + var(--sar)) calc(12px + max(var(--sab), 8px)) calc(16px + var(--sal)); }
.input-hint .field { height: 42px; border-radius: 20px; background: var(--surface-snow); padding: 0 16px; display: flex; align-items: center; font-size: 14px; color: var(--text-secondary); }
.action-bar { flex: none; padding: 12px calc(var(--gutter) + var(--sar)) calc(16px + max(var(--sab), 8px)) calc(var(--gutter) + var(--sal)); background: var(--surface-snow); }

/* 공지 카드 (대교 스타런 공식 채널) */
.notice { margin: 0 calc(var(--gutter) + var(--sar)) 0 calc(var(--gutter) + var(--sal)); padding: 18px; border-radius: 20px; background: var(--white); display: flex; flex-direction: column; gap: 6px; }
.notice b { font-size: 15px; font-weight: 700; }
.notice p { font-size: 14px; line-height: 1.45; color: var(--text-secondary); }
.notice .btn { margin-top: 8px; }
.notice.future b { color: var(--text-secondary); }
.notice.future { opacity: .8; }

/* 시트 안: 프로필·연락처 */
.profile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.profile h3 { margin-top: 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.04em; }
.profile p { font-size: 14px; color: var(--text-secondary); }
.actions { display: flex; justify-content: center; gap: 32px; padding-top: 4px; }
.actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.actions .c { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-snow); display: grid; place-items: center; color: var(--brand-blue); transition: transform 120ms; }
.actions button:active .c { transform: scale(.92); }
.actions button:disabled { opacity: .4; }
.actions .c svg { width: 24px; height: 24px; }
.info-card { padding: 14px 16px; border-radius: 14px; background: var(--surface-snow); display: flex; flex-direction: column; gap: 4px; }
.info-card b { font-size: 15px; }
.info-card p { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
