:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #1c1d29;
  --muted: #6b6f85;
  --line: #e6e8f2;
  /* 브랜드 기본 색 (CLAUDE.md 참고): 바이올렛 + 민트 */
  --primary: #5B4BDB;
  --primary-dark: #4535B8;
  --primary-soft: #EFEDFD;
  --mint: #3DDC97;
  --mint-dark: #1FA86E;
  --mint-soft: #E6FAF1;
  --brand-grad: linear-gradient(135deg, #5B4BDB 0%, #6E5FE6 60%, #8476F0 100%);
  --pink: #ec4899; /* 마이메이트 하트·알림 배지 전용 */
  --ok: #16a34a;
  --ok-soft: #e8f8ee;
  --warn: #d97706;
  --warn-soft: #fff6e5;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: #dfe2f0;
  color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(30, 30, 80, .12);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(244, 245, 251, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.3px; }
.brand small { color: var(--muted); font-size: 11px; }
.logo { width: 36px; height: 36px; border-radius: 10px; display: block; }
.logo-wide { height: 34px; width: auto; display: block; }
.top-actions { display: flex; gap: 6px; }
.lang-sel { appearance: none; -webkit-appearance: none; padding-right: 26px; max-width: 130px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6f85'/%3E%3C/svg%3E") no-repeat right 10px center; }
.tab em { text-align: center; line-height: 1.15; padding: 0 2px; }
.install-btn { background: var(--primary) !important; color: #fff; border-color: var(--primary) !important; }
.lang-btn {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ---------- layout ---------- */
.view { flex: 1; padding: 16px 16px 96px; }
h2 { font-size: 20px; margin: 4px 0 4px; letter-spacing: -.3px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(20, 20, 60, .04), 0 4px 16px rgba(20, 20, 60, .05);
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #3a3d55; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fbfbfe;
  outline: none;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.field input[type="date"] { min-width: 0; padding: 12px 10px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 10px; color: #3a3d55; }
.check input { margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 13px 16px;
  font-weight: 700; cursor: pointer;
  background: var(--primary); color: #fff; width: 100%;
}
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 8px 12px; font-size: 13px; width: auto; border-radius: 10px; }
.btns { display: flex; gap: 8px; }
.btns .btn { flex: 1; }

/* ---------- visa ---------- */
.visa-hero {
  color: #fff;
  background: var(--brand-grad);
}
.visa-hero .code { font-size: 13px; opacity: .85; }
.visa-hero .name { font-size: 22px; font-weight: 800; margin: 2px 0 14px; }
.dday { font-size: 44px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.dday small { font-size: 15px; font-weight: 600; opacity: .9; margin-left: 6px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.22);
}
.dates { display: flex; justify-content: space-between; font-size: 13px; margin-top: 16px; opacity: .95; }
.dates b { display: block; font-size: 15px; }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.25); margin-top: 8px; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: #fff; border-radius: 999px; }
.bar > u { position: absolute; top: 0; bottom: 0; width: 2px; background: #fde68a; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--bg); border-radius: 12px; padding: 12px 4px; }
.stats b { display: block; font-size: 20px; }
.stats span { font-size: 12px; color: var(--muted); }

.alert { border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.alert.ok { background: var(--ok-soft); color: #14532d; }
.alert.warn { background: var(--warn-soft); color: #7c4a03; }
.alert.danger { background: var(--danger-soft); color: #7f1d1d; }
.alert b { display: block; margin-bottom: 2px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--line); }
.timeline li.done .dot { background: var(--primary); }
.timeline li.now .dot { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.timeline time { color: var(--muted); font-size: 12px; display: block; }

/* ---------- dating ---------- */
.gate { text-align: center; padding: 28px 18px; }
.gate .big { font-size: 44px; }
.profile-card { padding: 0; overflow: hidden; }
.profile-cover {
  height: 230px; display: grid; place-items: center; position: relative;
  font-size: 84px; font-weight: 800; color: rgba(255,255,255,.95);
}
.profile-cover .flag { position: absolute; top: 12px; left: 12px; font-size: 26px; }
.profile-cover .vbadge {
  position: absolute; top: 14px; right: 12px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.9); color: var(--ok); padding: 5px 10px; border-radius: 999px;
}
.profile-body { padding: 16px 18px 18px; }
.profile-body h3 { margin: 0; font-size: 22px; }
.profile-body p { margin: 8px 0 12px; line-height: 1.5; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.actions { display: flex; justify-content: center; gap: 22px; margin: 4px 0 10px; }
.round {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 26px; background: var(--card); box-shadow: 0 4px 16px rgba(20,20,60,.12);
}
.round.like { background: linear-gradient(135deg, #f472b6, #ec4899); color: #fff; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }

/* ---------- chats ---------- */
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-item:last-child { border-bottom: 0; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
}
.chat-item .meta { flex: 1; min-width: 0; }
.chat-item .meta b { display: block; }
.chat-item .meta span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.chat-room { display: flex; flex-direction: column; height: calc(100vh - 170px); }
.chat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.chat-head .meta { flex: 1; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; background: var(--card); }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 12px; }
.composer { display: flex; gap: 8px; padding-top: 8px; }
.composer input { flex: 1; padding: 12px 14px; border-radius: 999px; border: 1px solid var(--line); outline: none; }
.composer button { border: 0; border-radius: 999px; padding: 0 18px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 440px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.tab {
  border: 0; background: none; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); padding: 6px 0;
}
.tab span { font-size: 22px; filter: grayscale(1); opacity: .7; }
.tab em { font-style: normal; font-size: 12px; font-weight: 600; }
.tab.active { color: var(--primary); }
.tab.active span { filter: none; opacity: 1; }
.badge {
  position: absolute; top: 2px; left: calc(50% + 8px);
  background: var(--pink); color: #fff; font-size: 11px; font-style: normal;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: grid; place-items: center;
}

[hidden] { display: none !important; }

/* ---------- roadmap ---------- */
.card-title { margin: 0 0 12px; font-size: 16px; }
.change-list { list-style: none; margin: 0; padding: 0; }
.change-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.change-item:last-child { border-bottom: 0; }
.change-item .small { display: block; margin-top: 2px; line-height: 1.45; }
.change-code {
  flex: none; min-width: 52px; text-align: center; padding: 8px 6px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 14px;
}
.road { list-style: none; margin: 0; padding: 0; }
.road-step {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 14px; background: var(--bg); border: 1px solid var(--line);
}
.road-step.now { background: var(--primary-soft); border-color: #cfc9fa; }
.road-step.goal { background: var(--brand-grad); color: #fff; border: 0; }
.road-tag {
  flex: none; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(91, 75, 219, .12); color: var(--primary);
}
.road-step.goal .road-tag { background: rgba(255, 255, 255, .25); color: #fff; }
.road-arrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px 8px 14px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.road-arrow span { color: var(--primary); font-weight: 800; font-size: 16px; line-height: 1.2; }

/* ---------- card scan ---------- */
.scan label.btn { cursor: pointer; }
.scan-status { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); line-height: 1.5; }
.scan-status.good { background: var(--ok-soft); color: #14532d; }
.scan-status.warn { background: var(--warn-soft); color: #7c4a03; }
.scan-status.bad { background: var(--danger-soft); color: #7f1d1d; }
.field .autofilled { border-color: var(--ok); background: var(--ok-soft); }

/* ---------- reminders ---------- */
.notice {
  display: flex; align-items: center; gap: 12px;
  background: #1c1d29; color: #fff; border-radius: 14px;
  padding: 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(20, 20, 60, .18);
}
.notice b { display: block; margin-bottom: 2px; }
.notice .btn { flex: none; background: #fff; color: var(--text); }
.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd2e3; transition: .2s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick input { display: none; }
.pick span {
  display: inline-block; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: #fbfbfe; color: var(--muted);
}
.pick input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- modal & toast ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 15, 40, .55);
  display: grid; place-items: center; z-index: 50; padding: 24px;
}
.overlay .card { width: 100%; max-width: 360px; text-align: center; }
.match-title {
  font-size: 30px; font-weight: 800; margin: 6px 0;
  background: linear-gradient(135deg, var(--primary), var(--mint));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  background: #1c1d29; color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; z-index: 60; max-width: 90%;
}

/* ---------- 메뉴 구조 ---------- */
.back-link { border: 0; background: none; color: var(--primary); font-weight: 700; font-size: 14px; padding: 0 0 8px; cursor: pointer; }
.menu-group { font-size: 13px; color: var(--muted); margin: 18px 0 8px; letter-spacing: .2px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.menu-tile {
  position: relative; border: 0; cursor: pointer; text-align: center;
  background: var(--card); border-radius: 16px; padding: 14px 6px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: 0 1px 2px rgba(20, 20, 60, .04), 0 4px 12px rgba(20, 20, 60, .05);
}
.menu-tile b { font-size: 13px; line-height: 1.25; word-break: keep-all; }
.mt-icon { font-size: 26px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.quick-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 12px; text-align: left;
}
.quick-btn span { font-size: 20px; }
.quick-btn b { font-size: 13px; line-height: 1.25; word-break: keep-all; }

.link-card { width: 100%; border: 0; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.lc-icon { font-size: 22px; }
.lc-body { flex: 1; min-width: 0; }
.lc-body b { display: block; margin-bottom: 2px; }
.lc-arrow { font-size: 24px; color: var(--muted); }

/* ---------- 할 수 있는 일 ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--line); padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg button { border: 0; background: none; border-radius: 11px; padding: 10px 6px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--mint-dark); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg button.on.no { color: var(--danger); }
.seg small { font-weight: 600; opacity: .7; }
.rights-list { list-style: none; margin: 0; padding: 0; }
.rights-list li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); line-height: 1.45; font-size: 14px; }
.rights-list li:last-child { border-bottom: 0; }
.ri { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.rights-list.ok .ri { background: var(--mint-soft); color: var(--mint-dark); }
.rights-list.no .ri { background: var(--danger-soft); color: var(--danger); }

/* ---------- 체크리스트 ---------- */
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.45; cursor: pointer; }
.check-row:last-of-type { border-bottom: 0; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--mint-dark); flex: none; }
.check-row.ok span { color: var(--mint-dark); }

/* ---------- F-2-7 계산기 ---------- */
.f27-score { text-align: center; }
.f27-num { font-size: 52px; font-weight: 800; letter-spacing: -1px; color: var(--primary); }
.f27-num small { font-size: 18px; color: var(--muted); font-weight: 600; }
.f27-score .bar { background: var(--line); }
.f27-score .bar > i { background: var(--primary); }
.f27-score .bar > u { background: var(--text); }
.f27-score.pass .f27-num { color: var(--mint-dark); }
.f27-score.pass .bar > i { background: var(--mint); }
.tips { margin: 0; padding-left: 18px; line-height: 1.8; font-size: 14px; }

/* ---------- 내 집 ---------- */
.home-hero { background: linear-gradient(135deg, #5B4BDB 0%, #4B8FD6 100%); }
.guide { border-bottom: 1px solid var(--line); padding: 4px 0; }
.guide:last-of-type { border-bottom: 0; }
.guide summary { cursor: pointer; font-weight: 700; padding: 10px 0; display: flex; gap: 8px; align-items: center; list-style: none; font-size: 14px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "＋"; margin-left: auto; color: var(--muted); }
.guide[open] summary::after { content: "－"; }
.guide p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: #3a3d55; }
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row { display: flex; align-items: center; gap: 10px; }
.file-thumb { width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden; background: var(--bg); display: grid; place-items: center; border: 1px solid var(--line); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-pdf { font-size: 12px; font-weight: 800; color: var(--danger); }
.file-meta { flex: 1; min-width: 0; }
.file-meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.btn { text-decoration: none; }

/* ---------- 공통: 칩 버튼, 예시 배지 ---------- */
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-btn { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sample-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #fff4d6; color: #8a5a00; vertical-align: middle; }
.sample-badge.mine { background: var(--mint-soft); color: var(--mint-dark); }

/* ---------- 할 수 있는 직업 ---------- */
.job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.job-card { background: var(--card); border-radius: 14px; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(20,20,60,.04), 0 4px 12px rgba(20,20,60,.05); }
.job-card span { font-size: 26px; }
.job-card b { font-size: 13px; line-height: 1.35; word-break: keep-all; }

/* ---------- 한국어 배우기 ---------- */
.phrase { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.phrase:last-child { border-bottom: 0; }
.ph-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ph-text b { font-size: 16px; }
.ph-play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary-soft); font-size: 18px; cursor: pointer; }
.quiz-q { font-size: 22px; font-weight: 800; margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; }
.quiz-opt { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fbfbfe; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.quiz-opt.right { background: var(--mint-soft); border-color: var(--mint); color: #0f5c3c; font-weight: 700; }
.quiz-opt.wrong { background: var(--danger-soft); border-color: #f5b5b5; color: var(--danger); }

/* ---------- 전문가 찾기 ---------- */
.help-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.help-row:last-child { border-bottom: 0; }
.help-icon { font-size: 24px; flex: none; }
.help-meta { flex: 1; min-width: 0; }
.help-meta b { display: block; font-size: 14px; }
.help-meta > span { display: block; margin-top: 2px; }
.help-row .btn { flex: none; white-space: nowrap; }
.expert { display: flex; gap: 12px; align-items: flex-start; }
.expert .avatar { font-size: 22px; }
.ex-meta { flex: 1; min-width: 0; }

/* ---------- 커뮤니티 ---------- */
.post-card { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; border: 0; cursor: pointer; }
.post-top { display: flex; align-items: center; gap: 6px; }
.post-title { font-size: 16px; line-height: 1.35; }
.post-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.post-foot { display: flex; align-items: center; gap: 4px; }
.comment { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.45; }
.comment b { font-size: 13px; }

/* ---------- 마이스테이 대시보드 ---------- */
.dash-card { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; }
.dash-card.empty { display: flex; align-items: center; gap: 12px; border: 1.5px dashed #d6d2f7; box-shadow: none; }
.dash-icon { font-size: 26px; }
.dash-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.dash-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.dash-pill.ok { background: var(--mint-soft); color: var(--mint-dark); }
.dash-pill.warn { background: var(--warn-soft); color: var(--warn); }
.dash-pill.danger { background: var(--danger-soft); color: var(--danger); }
.dash-main { display: flex; align-items: center; gap: 14px; margin: 10px 0 8px; }
.dash-main > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-main > span b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-dday { font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: var(--primary); flex: none; }
.dash-next { color: #3a3d55; margin-bottom: 10px; }
.dash-bar { background: var(--line); height: 8px; margin: 0; }
.dash-bar > i { background: var(--primary); }
.dash-bar.home > i { background: var(--mint); }
.up-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.up-item { --tone: var(--mint-dark); --tone-soft: var(--mint-soft);
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 14px; background: #f7f7fc; cursor: pointer; }
.up-item.warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.up-item.danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.up-item:hover { background: var(--primary-soft); }
.up-date { flex: none; width: 46px; height: 50px; border-radius: 12px; background: var(--card); box-shadow: 0 1px 3px rgba(20,20,60,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.up-date small { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; white-space: nowrap; }
.up-date b { font-size: 19px; line-height: 1.1; color: var(--text); }
.up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.up-body b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-pill { flex: none; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; background: var(--tone-soft); color: var(--tone); }
.up-empty { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.up-empty span { font-size: 26px; }
.up-empty p { margin: 0; }
.quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-btn { flex-direction: column; text-align: center; padding: 12px 6px; }

/* ---------- 행정사 검수 표시 ---------- */
.rv-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.rv-badge.ok { background: var(--mint-soft); color: var(--mint-dark); }
.rv-badge.pending { background: #f1f2f7; color: var(--muted); }
.rv-box { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; margin: 14px 0; background: #fbfbfe; }
.rv-box.ok { border-style: solid; border-color: #bdeed6; background: var(--mint-soft); }
.row > h2 + .rv-badge { margin-top: 6px; }

/* ---------- 서류 체크리스트 ---------- */
.doc-text { display: flex; flex-direction: column; gap: 2px; }
.agent-cta { display: flex; flex-direction: column; gap: 10px; background: var(--primary-soft); box-shadow: none; }

/* ---------- 신고 의무 ---------- */
.duty-card { --tone: var(--mint-dark); --tone-soft: var(--mint-soft); padding: 16px 16px 12px; }
.duty-card.warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.duty-card.danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.duty-top { display: flex; align-items: center; gap: 12px; }
.duty-ico { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--tone-soft); }
.duty-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.duty-info b { font-size: 15px; }
.duty-info .late { color: var(--danger); font-weight: 700; }
.duty-dday { flex: none; font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--tone); }
.duty-bar { height: 6px; border-radius: 999px; background: var(--line); margin: 14px 0 10px; overflow: hidden; }
.duty-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--tone); }
.duty-actions { display: flex; align-items: center; justify-content: space-between; }
.duty-link { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.duty-done { border: 0; cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.duty-done:hover { background: var(--primary); color: #fff; }
.duty-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.duty-btns:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.duty-btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.25; word-break: keep-all; }
.duty-btn span { font-size: 22px; }
.duty-btn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.duty-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.guide-card summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; flex-wrap: wrap; }
.guide-card summary::-webkit-details-marker { display: none; }
.guide-card[open] summary { margin-bottom: 10px; }

/* ---------- 헬퍼 ---------- */
.help-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.help-cat { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.25; word-break: keep-all; }
.help-cat span { font-size: 22px; }
.help-cat.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.help-cat.legal { border-style: dashed; }
.chip.mint { background: var(--mint-soft); color: var(--mint-dark); }
.helper-card { flex-wrap: wrap; }
.helper-card .btn { flex: 1 1 100%; width: 100%; padding: 10px; }

/* ---------- 장터 ---------- */
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mk-item { position: relative; border: 0; padding: 0; text-align: left; cursor: pointer; background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,20,60,.04), 0 4px 14px rgba(20,20,60,.06); display: flex; flex-direction: column; }
.mk-item.sold { opacity: .55; }
.mk-thumb { display: grid; place-items: center; aspect-ratio: 1 / 1; font-size: 52px; background: linear-gradient(135deg, var(--primary-soft), var(--mint-soft)); overflow: hidden; }
.mk-thumb img, .mk-hero img, .mk-photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-flag { position: absolute; top: 8px; left: 8px; background: var(--card); border-radius: 999px; padding: 3px 7px; font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.mk-heart { position: absolute; top: 8px; right: 10px; color: var(--pink); font-size: 18px; text-shadow: 0 1px 2px rgba(255,255,255,.8); }
.mk-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.mk-title { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mk-price { font-size: 14px; font-weight: 800; color: var(--text); }
.mk-price.free { color: var(--mint-dark); }
.mk-price.swap { color: var(--primary); }
.mk-price.big { font-size: 20px; }
.mk-hero { display: grid; place-items: center; aspect-ratio: 4 / 3; font-size: 96px; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--primary-soft), var(--mint-soft)); }
.mk-photo-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  height: 140px; border: 1.5px dashed #cfc9fa; border-radius: 14px; margin-bottom: 14px; background: #fbfbfe; overflow: hidden; color: var(--muted); }
.mk-photo-pick > span { font-size: 34px; width: 100%; height: 100%; display: grid; place-items: center; }
.mk-photo-pick:has(img) small { display: none; }
.seg-radio { display: block; cursor: pointer; }
.seg-radio input { display: none; }
.seg-radio span { display: block; text-align: center; border-radius: 11px; padding: 10px 4px; font-weight: 700; color: var(--muted); }
.seg-radio input:checked + span { background: var(--card); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- 커뮤니티 모임 ---------- */
.meet-top { display: flex; gap: 12px; align-items: flex-start; }
.meet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.meet-title { font-size: 15px; line-height: 1.35; }
.meet-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.meet-meta { font-size: 13px; color: var(--muted); }
.meet-meta b { color: var(--text); }
.meet-join { border: 0; cursor: pointer; font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px; background: var(--primary); color: #fff; flex: none; }
.meet-join.on { background: var(--mint-soft); color: var(--mint-dark); }
.meet-join:disabled { background: var(--line); color: var(--muted); cursor: default; }

/* ---------- 안내 상자 (noteBox) ---------- */
.note-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; margin: 14px 0;
  background: #f6f6fb; border: 1px solid var(--line); }
.note-box.rules { background: var(--primary-soft); border-color: #dcd8fb; }
.note-box.safety { background: var(--mint-soft); border-color: #c9f0dd; }
.nb-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--card); box-shadow: 0 1px 2px rgba(20,20,60,.06); }
.nb-body { flex: 1; min-width: 0; }
.nb-body b { display: block; font-size: 14px; margin: 2px 0 4px; }
.note-box.rules .nb-body b { color: var(--primary-dark); }
.note-box.safety .nb-body b { color: #0f5c3c; }
.nb-body p { margin: 0; font-size: 13px; line-height: 1.6; color: #4a4d63; }

/* ---------- 체류 상한 ---------- */
.cap-card > .row { flex-wrap: wrap; gap: 6px; }
.cap-mine { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--primary-soft); display: flex; flex-direction: column; gap: 2px; position: relative; }
.cap-mine b { font-size: 15px; color: var(--primary-dark); }
.cap-mine-len { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: 18px; color: var(--primary); }
.cap-total { --tone: var(--mint-dark); margin-top: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); }
.cap-total.warn { --tone: var(--warn); }
.cap-total.danger { --tone: var(--danger); }
.cap-total .duty-bar > i { background: var(--tone); }
.cap-total b { color: var(--tone); font-size: 14px; }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cap-grid > div { background: #f7f7fc; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.cap-grid b { font-size: 15px; line-height: 1.35; color: var(--primary-dark); word-break: keep-all; }

/* ---------- 한국 도착 체크리스트 ---------- */
.arr-phase { padding: 6px 14px; }
.arr-item { border-bottom: 1px dashed var(--line); }
.arr-item:last-child { border-bottom: 0; }
.arr-item summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.arr-item summary::-webkit-details-marker { display: none; }
.arr-item input { width: 20px; height: 20px; accent-color: var(--mint-dark); flex: none; }
.arr-ico { font-size: 20px; }
.arr-title { flex: 1; font-size: 14px; font-weight: 600; }
.arr-more { font-size: 12px; color: var(--muted); }
.arr-item[open] .arr-more { color: var(--primary); }
.arr-item.done .arr-title { color: var(--muted); text-decoration: line-through; }
.arr-item p { margin: 0 0 12px 34px; line-height: 1.6; color: #3a3d55; }
.arr-card { cursor: pointer; }

/* ---------- 민트 포인트 ---------- */
.alert.ok { background: var(--mint-soft); color: #0f5c3c; }
.switch input:checked + span { background: var(--mint-dark); }
.pick input:checked + span { background: var(--primary); border-color: var(--primary); }
.visa-hero .bar > u, .home-hero .bar > u { background: var(--mint); width: 3px; }
.tab em { font-size: 11px; }

/* =====================================================================
   디자인 v2 — 앱 전체 공통 규칙 (위의 개별 스타일보다 우선)
   글꼴 Pretendard · 선 아이콘 · 카드/여백/버튼/입력칸 통일
   ===================================================================== */
:root {
  --bg: #F5F5FA;
  --text: #17172B;
  --muted: #74768C;
  --line: #E9E9F2;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(17, 17, 38, .04), 0 8px 24px rgba(17, 17, 38, .06);
  --shadow-sm: 0 1px 2px rgba(17, 17, 38, .05), 0 3px 10px rgba(17, 17, 38, .05);
}
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: #E8E8F1; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.app { background: var(--bg); }
.ico { display: block; flex: none; }

/* 상단바 */
.topbar { padding: 12px 20px; background: rgba(245, 245, 250, .86); border-bottom: 0; backdrop-filter: saturate(1.4) blur(14px); }
.lang-btn { border: 0; background: var(--card); box-shadow: var(--shadow-sm); font-weight: 600; padding: 8px 14px; }
.lang-sel { padding-right: 28px; }

/* 본문 */
.view { padding: 6px 20px 116px; }
h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 6px; line-height: 1.3; }
.sub { font-size: 14px; line-height: 1.55; margin: 0 0 20px; }
.small { font-size: 13px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; padding: 6px 0 2px; }
.menu-group { font-size: 13px; font-weight: 700; color: var(--muted); margin: 24px 4px 10px; letter-spacing: 0; }

/* 카드 */
.card { border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.visa-hero, .home-hero { border-radius: 24px; box-shadow: 0 14px 30px rgba(91, 75, 219, .28); }
.dash-card.empty { border: 1.5px dashed #D9D5F7; background: rgba(255, 255, 255, .6); box-shadow: none; }

/* 버튼 */
.btn { border-radius: 14px; padding: 14px 16px; font-size: 15px; letter-spacing: -0.01em; transition: transform .08s ease, filter .15s ease; }
.btn:active, .quick-btn:active, .menu-tile:active, .duty-btn:active, .mk-item:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.04); }
.btn.sm { border-radius: 10px; padding: 9px 14px; font-size: 13px; }
.link-btn { color: var(--muted); }

/* 입력칸 */
.field > span { font-size: 13px; font-weight: 600; color: #4A4C63; margin-bottom: 8px; }
.field input, .field select, .field textarea { border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 13px 14px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91, 75, 219, .12); }

/* 알림·안내 */
.alert { border-radius: 16px; padding: 14px 16px; }
.notice { border-radius: 18px; padding: 16px; background: linear-gradient(135deg, #24234A, #3A3378); box-shadow: 0 10px 24px rgba(36, 35, 74, .25); }
.notice .btn { background: rgba(255, 255, 255, .95); color: var(--primary-dark); }

/* 세그먼트·칩 */
.seg { background: #EBEBF3; border-radius: 14px; padding: 4px; }
.seg button { border-radius: 11px; font-size: 14px; }
.seg button.on { color: var(--primary); box-shadow: 0 1px 2px rgba(17,17,38,.06), 0 2px 8px rgba(17,17,38,.06); }
.chip-btn { border: 1.5px solid var(--line); background: #fff; padding: 8px 14px; color: #5A5C72; }
.chip-btn.on { box-shadow: 0 4px 12px rgba(91, 75, 219, .25); }
.chip { border-radius: 8px; padding: 4px 9px; }

/* 바로가기 */
.quick { gap: 10px; }
.quick-btn { border: 0; background: var(--card); box-shadow: var(--shadow-sm); border-radius: 18px; padding: 16px 6px 14px; gap: 10px; }
.q-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.quick-btn b { font-size: 12.5px; font-weight: 600; color: #3A3C52; }

/* 전체 메뉴 */
.menu-grid { gap: 10px; }
.menu-tile { border-radius: 18px; padding: 18px 6px 14px; box-shadow: var(--shadow-sm); gap: 10px; }
.menu-tile b { font-size: 12.5px; font-weight: 600; color: #3A3C52; }
.mt-icon { width: 48px; height: 48px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.mt-icon.g-life { color: #1A9A63; background: var(--mint-soft); }
.mt-icon.g-meet { color: #DB3F79; background: #FDEEF4; }
.mt-icon.g-app { color: #5E6178; background: #EEEFF5; }

/* 하단 탭 */
.tabbar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(10px + env(safe-area-inset-bottom)); }
.tab { color: #A0A2B5; gap: 2px; padding: 4px 0; }
.tab .tab-ico { width: 48px; height: 32px; border-radius: 12px; display: grid; place-items: center; filter: none; opacity: 1; transition: background .2s, color .2s; }
.tab.active { color: var(--primary); }
.tab.active .tab-ico { background: var(--primary-soft); }
.tab em { font-size: 11px; font-weight: 600; }
.tab.active em { font-weight: 700; }
.badge { top: 0; left: calc(50% + 10px); box-shadow: 0 0 0 2px #fff; }

/* 선 아이콘 자리 */
.t-ico { display: inline-flex; align-items: center; gap: 8px; }
.t-ico .ico { color: var(--primary); }
.dash-label { display: inline-flex; align-items: center; gap: 6px; color: #5A5C72; }
.dash-label .ico { color: var(--primary); }
.dash-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.duty-ico { color: var(--tone, var(--primary)); }
.duty-ico.sm { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.duty-btn { border: 0; background: #F7F7FB; border-radius: 16px; padding: 14px 6px; color: #3A3C52; }
.duty-btn span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }
.duty-btn.on { background: var(--primary-soft); }

/* 체크박스·라디오는 브랜드 색 */
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.check-row input { width: 20px; height: 20px; }

/* 목록 줄 간격 다듬기 */
.check-row, .rights-list li, .help-row, .phrase, .change-item { border-bottom-style: solid; border-bottom-color: #F0F0F6; }
