* { box-sizing: border-box; }

/* hidden 속성이 항상 이기도록 (display:flex 등을 덮어씀) */
[hidden] { display: none !important; }

:root {
  --blue: #2d7ff9;          /* 메인 파랑 (버튼) */
  --blue-dark: #1b6ae0;
  --blue-soft: #eaf2fd;     /* 밝은 배경 */
  --blue-chip: #dcebfe;
  --sky: #f3f8ff;           /* 화면 배경 */
  --ink: #1b2b45;
  --muted: #8a97ab;
  --line: #e3ebf5;
  --green: #17b26a;
  --orange: #f59e0b;
  --red: #ef4e6b;
  --white: #fff;
}

html, body { height: 100%; margin: 0; }

body {
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #c9ddf5;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

/* 폰 프레임 (데스크톱에서도 모바일처럼) */
.phone {
  position: relative;
  max-width: 440px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--sky);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(27, 43, 69, 0.15);
}

/* ===== 상단 바 ===== */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--white);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.appbar-back, .appbar-bell {
  background: none; border: 0; font-size: 20px; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px; color: var(--ink);
}
.appbar-brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; color: var(--blue); }
.logo-mark { width: 28px; height: 28px; object-fit: contain; }
.appbar-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.appbar-brand { flex: 1; }
.appbar-bell { margin-left: auto; }

/* ===== 화면 영역 ===== */
#view { flex: 1; overflow-y: auto; padding-bottom: 80px; }
.screen { padding: 16px; }
.screen-lead { color: var(--muted); font-size: 14px; margin: 4px 2px 14px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; }
.section-head h2 { font-size: 16px; margin: 0; }
.link-btn { background: none; border: 0; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; }
.muted { color: var(--muted); line-height: 1.6; }
.muted-note { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; background: var(--blue-soft); padding: 14px; border-radius: 12px; margin-top: 14px; }

/* ===== 버튼 ===== */
.btn-primary, .btn-ghost {
  border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer;
  padding: 11px 16px; font-size: 15px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-dark); }
.btn-ghost { background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); }
.btn-lg { width: 100%; padding: 15px; margin-top: 10px; }
button:disabled { opacity: 0.5; }

/* ===== 1. 시작 화면 ===== */
.screen-intro { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 85vh; gap: 10px; }
.logo-big { width: 110px; height: 110px; object-fit: contain; }
.screen-intro h1 { font-size: 40px; color: var(--blue); margin: 4px 0 0; letter-spacing: 1px; }
.tagline { color: var(--blue); font-size: 13px; margin: 2px 0 20px; }
.intro-sub { color: var(--ink); font-size: 15px; line-height: 1.7; }
.intro-art { font-size: 72px; margin: 20px 0; }

/* ===== 검색 박스 ===== */
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
}
.searchbox-icon { color: var(--muted); }
.searchbox input { flex: 1; border: 0; outline: 0; font: inherit; background: none; }

/* ===== 홈 배너 ===== */
.home-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #2d7ff9, #5aa0ff);
  color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 6px;
}
.home-banner-text { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.home-banner-text strong { font-size: 16px; line-height: 1.4; }
.home-banner-text span { font-size: 12px; opacity: 0.9; }
.home-banner-art { font-size: 40px; }

/* ===== 카테고리 그리드 ===== */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat-item {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 4px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.cat-item .ic {
  width: 42px; height: 42px; border-radius: 12px; background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.cat-item .nm { font-size: 11px; line-height: 1.3; color: var(--ink); }

/* 검색 화면 카테고리 리스트(가로줄) */
.cat-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; cursor: pointer;
}
.cat-row .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.cat-row .nm { flex: 1; font-weight: 600; }
.cat-row .arrow { color: var(--muted); }

/* ===== 칩(필터) ===== */
.chips-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-chip {
  border: 1px solid var(--line); background: var(--white); color: var(--muted);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.filter-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ===== 목록 / 사람 카드 ===== */
.list { display: flex; flex-direction: column; gap: 12px; }
.person {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; display: flex; gap: 12px; cursor: pointer;
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.person-main { flex: 1; min-width: 0; }
.person .nick { font-weight: 700; font-size: 15px; }
.person .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 600; white-space: nowrap; }
.chip.learn { background: #fff3f6; color: var(--red); }
.person-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* 매칭 퍼센트 배지 */
.percent { font-size: 12px; font-weight: 800; color: var(--blue); background: var(--blue-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.percent.mutual { color: var(--green); background: #e4f8ef; }

.mini-btn { border: 0; background: var(--blue); color: #fff; border-radius: 10px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.heart { color: var(--red); font-size: 12px; }

/* ===== 상세 화면 ===== */
.detail { display: flex; flex-direction: column; gap: 16px; }
.detail-head { display: flex; align-items: center; gap: 14px; }
.detail-head .avatar { width: 64px; height: 64px; font-size: 32px; }
.detail-name { font-weight: 800; font-size: 18px; }
.detail-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.detail-block h4 { margin: 0 0 8px; font-size: 14px; }
.detail-intro { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.6; color: var(--ink); }

/* ===== 등록 스텝 ===== */
.steps { display: flex; justify-content: space-between; margin-bottom: 20px; position: relative; }
.steps::before { content: ""; position: absolute; top: 15px; left: 15%; right: 15%; height: 2px; background: var(--line); z-index: 0; }
.step {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--line); color: var(--muted);
  font-weight: 700; font-size: 14px; line-height: 32px; text-align: center;
}
.step small { position: absolute; top: 38px; font-size: 11px; white-space: nowrap; font-weight: 600; }
.step.active { background: var(--blue); color: #fff; }

/* ===== 폼 ===== */
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.form input, .form textarea, .form select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-weight: 400; background: var(--white);
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--blue); }
.form textarea { resize: vertical; }

/* ===== 교환 제안 내역 상태 태그 ===== */
.status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status.pending { background: #fff4e0; color: var(--orange); }
.status.accepted { background: #e4f8ef; color: var(--green); }
.status.rejected { background: #fdeaef; color: var(--red); }
.status.done { background: var(--blue-soft); color: var(--blue); }

/* 코드 입장 박스 */
.join-box { display: flex; gap: 8px; margin-bottom: 14px; }
.join-box input { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; text-transform: uppercase; letter-spacing: 2px; }

/* ===== 진행 현황 타임라인 ===== */
.progress-head { text-align: center; margin-bottom: 20px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 14px; }
.tl-dot { display: flex; flex-direction: column; align-items: center; }
.tl-dot .circle {
  width: 28px; height: 28px; border-radius: 50%; background: var(--line); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0;
}
.tl-item.done .circle { background: var(--blue); }
.tl-item.current .circle { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.tl-line { width: 2px; flex: 1; background: var(--line); margin: 2px 0; }
.tl-item:last-child .tl-line { display: none; }
.tl-body { padding-bottom: 22px; }
.tl-body .t { font-weight: 700; font-size: 15px; }
.tl-body .d { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tl-item.pending .t { color: var(--muted); }

/* ===== 교환 완료 화면 ===== */
.screen-done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 30px; }
.done-art { font-size: 64px; }
.screen-done h2 { color: var(--blue); font-size: 22px; margin: 6px 0; }
.done-pair { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 20px 0; }
.done-pair .avatar { width: 64px; height: 64px; font-size: 30px; }
.done-pair .arrow { font-size: 24px; color: var(--blue); }
.done-pair .nm { font-size: 13px; font-weight: 700; margin-top: 6px; }
.done-pair .sk { font-size: 11px; color: var(--muted); }

/* ===== 내 정보 ===== */
.me-head { display: flex; align-items: center; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 8px; }
.me-head .avatar { width: 60px; height: 60px; font-size: 30px; }
.me-head .nm { font-weight: 800; font-size: 18px; }
.me-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* 통계 카드 */
.stat-cards { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; color: var(--blue); }
.stat .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.rank-bar { height: 8px; background: var(--blue); border-radius: 999px; }
.stat-section { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.stat-section h3 { margin: 0 0 10px; font-size: 14px; }
.stars { color: var(--orange); }
.review-item { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.review-item:first-of-type { border-top: 0; }

/* ===== 더보기 메뉴 ===== */
.menu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.menu-list li {
  display: flex; align-items: center; gap: 10px; background: var(--white);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-weight: 600; cursor: pointer;
}
.menu-list li span { margin-left: auto; color: var(--muted); }

/* ===== 채팅 오버레이 ===== */
.chat-overlay {
  position: fixed; inset: 0; z-index: 60; max-width: 440px; margin: 0 auto;
  background: var(--sky); display: flex; flex-direction: column;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 76%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.4; word-break: break-word; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg.theirs { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.mine { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg .time { display: block; font-size: 10px; opacity: 0.6; margin-top: 3px; }
.msg.system { align-self: center; background: var(--blue-soft); color: var(--blue); font-size: 12px; }
.chat-input {
  display: flex; gap: 8px; padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--line);
}
.chat-input input { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 999px; font: inherit; }
.chat-send { border: 0; background: var(--blue); color: #fff; width: 44px; border-radius: 50%; font-size: 16px; cursor: pointer; }

/* ===== 하단 탭 ===== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 440px; margin: 0 auto;
  display: flex; background: var(--white); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0; font-size: 20px; color: var(--muted); cursor: pointer;
}
.tab span { font-size: 10px; font-weight: 600; }
.tab.active { color: var(--blue); }
.tab-plus {
  position: relative; top: -2px;
}
.tab-plus { color: var(--blue); }

/* ===== 토스트 ===== */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,0.25); max-width: 86%; text-align: center;
}

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; line-height: 1.7; }

/* ===== 후기 작성 모달 ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(27, 43, 69, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--white); border-radius: 18px; padding: 22px; width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal h3 { margin: 0; font-size: 18px; }
.modal textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; resize: vertical; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; }
.star-pick { display: flex; justify-content: center; gap: 6px; font-size: 38px; cursor: pointer; }
.star-pick span { color: var(--line); transition: color 0.1s; }
.star-pick span.on { color: var(--orange); }
.star-label { text-align: center; color: var(--muted); font-size: 13px; }

/* ===== 상세: 받은 후기 ===== */
.rv-summary { display: flex; align-items: center; gap: 10px; }
.rv-avg { font-size: 26px; font-weight: 800; color: var(--orange); }
.rv-count { color: var(--muted); font-size: 13px; }
.rv-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.rv-item .rv-head { display: flex; justify-content: space-between; align-items: center; }
.rv-item .rv-writer { color: var(--muted); font-size: 12px; }
.rv-item .rv-text { margin-top: 6px; line-height: 1.5; }

/* ===== 2.11~2.15 신규 기능 ===== */

/* 홈 빠른 바로가기 */
.quick-row { display: flex; gap: 12px; margin: 14px 0 4px; }
.quick-btn {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; cursor: pointer; text-align: left;
}
.quick-btn .q-ic { font-size: 24px; }
.quick-btn .q-tx { display: flex; flex-direction: column; }
.quick-btn .q-tx b { font-size: 14px; }
.quick-btn .q-tx small { color: var(--muted); font-size: 11px; }

/* 진단 결과 */
.diag-box { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 16px; }
.diag-box h4 { margin: 0 0 10px; font-size: 15px; }
.diag-ai { white-space: pre-line; line-height: 1.6; font-size: 14px; }
.diag-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.diag-cat { display: flex; align-items: center; gap: 6px; background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer; }

/* 캘린더 */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 14px; }
.cal-head strong { font-size: 16px; }
.icon-btn2 { background: var(--blue-soft); border: 0; color: var(--blue); width: 36px; height: 36px; border-radius: 10px; font-size: 18px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal-cell { aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; font-size: 13px; position: relative; }
.cal-cell.empty-cell { background: transparent; }
.cal-cell.has-day { background: var(--white); border: 1px solid var(--line); }
.cal-cell.today { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.cal-cell .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-top: 3px; }
.cal-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.cal-item .cal-date { font-weight: 700; color: var(--blue); font-size: 13px; min-width: 88px; }
.cal-item .cal-info { flex: 1; font-size: 13px; }
.cal-item .cal-info small { color: var(--muted); display: block; }
.cal-del { background: #fdeaef; color: var(--red); border: 0; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

/* 배지 */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr)); gap: 10px; }
.badge-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 6px; text-align: center; }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }
.badge-card .b-ic { font-size: 30px; }
.badge-card .b-nm { font-size: 12px; font-weight: 700; margin-top: 4px; }
.badge-card .b-ds { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

/* 진행현황 안 미션/추가 */
.mission-box { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 14px 0; }
.mission-box h4 { margin: 0 0 10px; font-size: 14px; }
.mission-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.mission-item:first-of-type { border-top: 0; }
.mission-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: #fff; }
.mission-item.done .mission-check { background: var(--blue); border-color: var(--blue); }
.mission-item.done .m-title { text-decoration: line-through; color: var(--muted); }
.m-title { flex: 1; font-size: 14px; }
.m-del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
.mission-add { display: flex; gap: 8px; margin-top: 10px; }
.mission-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; text-align: center; }

/* 등급(티어) 카드 */
.tier-card {
  background: linear-gradient(135deg, #2d7ff9, #5aa0ff);
  color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 14px;
}
.tier-icon { font-size: 44px; }
.tier-info { flex: 1; }
.tier-name { font-size: 20px; font-weight: 800; }
.tier-sub { font-size: 12px; opacity: 0.92; margin-top: 3px; }
.tier-bar { height: 8px; background: rgba(255,255,255,0.3); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.tier-bar > span { display: block; height: 100%; background: #fff; border-radius: 999px; }
.tier-steps { display: flex; justify-content: space-between; gap: 2px; margin-top: 10px; }
.tier-step { flex: 1; text-align: center; font-size: 16px; opacity: 0.45; }
.tier-step.on { opacity: 1; }
.done-mission-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.done-mission-item .dm-check { color: var(--blue); }
.done-mission-item .dm-date { color: var(--muted); font-size: 11px; margin-left: auto; }
.prog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prog-actions button { flex: 1; min-width: 120px; }

/* QR 코드 */
.qr-code-text { font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--blue); margin: 6px 0; }

/* 요약 모달 textarea */
#summary-note, #summary-result { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; resize: vertical; }
#summary-result { white-space: pre-line; }
.summary-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.summary-item .s-result { white-space: pre-line; line-height: 1.5; margin-top: 4px; }
.summary-item .s-date { color: var(--muted); font-size: 11px; }

/* ========================================================= */
/* 반응형: 태블릿 / PC 에서 화면을 넓게 쓰고 목록을 여러 열로  */
/* ========================================================= */

/* --- 태블릿 (600px 이상) --- */
@media (min-width: 600px) {
  body { background: #c9ddf5; }
  .phone { max-width: 760px; }
  .chat-overlay { max-width: 760px; }
  .tabbar { max-width: 760px; }

  .screen { padding: 22px 28px; }

  /* 사람/제안/후기 목록을 2열 그리드로 */
  #home-popular,
  #search-result,
  #cat-list,
  #match-list,
  #offer-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    align-items: start;
  }
  /* 안내문/빈 상태는 그리드 전체 폭 차지 */
  #home-popular .empty, #search-result .empty, #cat-list .empty,
  #match-list .empty, #offer-list .empty { grid-column: 1 / -1; }

  /* 폼·상세·진행현황·완료·후기모달은 너무 넓으면 어색 → 가운데 폭 제한 */
  #register-form, #me-form, .detail, .progress-body, .screen-done {
    max-width: 520px; margin-left: auto; margin-right: auto;
  }

  /* 홈 카테고리는 8칸 한 줄로 넉넉하게 */
  .cat-grid { grid-template-columns: repeat(8, 1fr); }
  .cat-item .nm { font-size: 10px; }
}

/* --- PC (960px 이상): 데스크톱 레이아웃 (왼쪽 세로 사이드바 + 넓은 콘텐츠) --- */
@media (min-width: 960px) {
  body { background: var(--sky); }

  /* 폰 프레임 해제 → 전체 폭 사용, 왼쪽에 사이드바 공간 확보 */
  .phone {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 220px;        /* 사이드바 폭만큼 비움 */
    box-shadow: none;
    background: var(--sky);
    min-height: 100vh;
  }

  /* 하단 탭바 → 왼쪽 세로 사이드바로 변신 */
  .tabbar {
    position: fixed;
    top: 0; bottom: 0; left: auto;
    right: auto;
    width: 220px;
    margin: 0;
    max-width: none;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    padding: 24px 14px;
    border-top: 0;
    border-right: 1px solid var(--line);
    /* 사이드바를 .phone 왼쪽 가장자리에 맞추기 위해 계산 */
    left: max(0px, calc((100vw - 1200px) / 2));
  }
  .tabbar .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 20px;
  }
  .tabbar .tab span { font-size: 15px; }
  .tabbar .tab.active { background: var(--blue-soft); }
  .tabbar .tab-plus { top: 0; }
  /* 사이드바 맨 위에 로고 넣기 */
  .tabbar::before {
    content: "🤝 TelToT";
    display: block;
    font-weight: 800; font-size: 20px; color: var(--blue);
    padding: 6px 16px 18px;
  }

  /* 상단바: 사이드바가 생겼으니 브랜드 숨기고 제목 영역만 */
  .appbar { padding-left: 32px; padding-right: 32px; }

  #view { padding-bottom: 40px; }
  .screen { padding: 30px 48px; max-width: 1000px; margin: 0 auto; }

  /* 목록 3열 */
  #home-popular,
  #search-result,
  #cat-list,
  #match-list,
  #offer-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  /* 채팅 오버레이도 사이드바 공간 비우기 */
  .chat-overlay {
    max-width: none;
    left: max(220px, calc((100vw - 1200px) / 2 + 220px));
    right: max(0px, calc((100vw - 1200px) / 2));
    margin: 0;
  }

  /* 홈: 배너와 카테고리를 더 시원하게 */
  .home-banner { padding: 30px; }
  .home-banner-text strong { font-size: 22px; }
  .home-banner-art { font-size: 64px; }
  .cat-grid { grid-template-columns: repeat(8, 1fr); }

  /* 검색 화면의 카테고리 줄 목록도 2열 */
  #search-category-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  #search-category-list .empty { grid-column: 1 / -1; }

  /* 폼·상세·진행현황·완료는 중앙 폭 제한 */
  #register-form, #me-form, .detail, .progress-body, .screen-done {
    max-width: 580px;
  }
}

/* 아주 큰 화면 */
@media (min-width: 1280px) {
  .phone { max-width: 1320px; }
  .tabbar { left: max(0px, calc((100vw - 1320px) / 2)); }
  .chat-overlay {
    left: max(220px, calc((100vw - 1320px) / 2 + 220px));
    right: max(0px, calc((100vw - 1320px) / 2));
  }
  .screen { max-width: 1080px; }
}

/* 초대형 화면(와이드 모니터)에서만 4열 */
@media (min-width: 1600px) {
  .phone { max-width: 1520px; }
  .tabbar { left: max(0px, calc((100vw - 1520px) / 2)); }
  .screen { max-width: 1260px; }
  #home-popular, #search-result, #cat-list, #match-list, #offer-list {
    grid-template-columns: repeat(4, 1fr);
  }
}
