/* 3·4번 탭 공용 스타일 */
:root {
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --fg: #17191c;
  --muted: #6c727a;
  --line: #e9ebef;
  --primary: #ed6224;
  --primary-soft: #fff1ea;
  --primary-ink: #d4521a;
  --ink: #1b1d21;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-2);
  color: var(--fg);
  font-family: 'Noto Sans KR', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3 { margin: 0; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* 틀 */
.page { max-width: 480px; margin: 0 auto; }
/* 상단 제목줄: 상태바 여백까지 끌어올려 스크롤 때 본문이 비치지 않게 한다 */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-top: calc(-1 * var(--app-safe-top, 0px));
  padding-top: var(--app-safe-top, 0px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar-in { position: relative; display: flex; align-items: center; justify-content: center; padding: 14px 48px; }
.appbar h1 { font-size: 17px; font-weight: 800; letter-spacing: -.03em; text-align: center; }
.appbar .act { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 8px; border-radius: 8px; display: flex; }
.appbar .act:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.screen { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.screen > * { flex-shrink: 0; }

/* 공용 카드·로고 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.ilogo { height: 64px; width: auto; max-width: 100%; object-fit: contain; display: block; }

/* 안내 문구 */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--app-safe-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 100; }
.toast.show { opacity: 1; }

/* 3번 탭: 다이렉트 */
.memo-sum-wrap { position: relative; }
.memo-sum { min-height: 156px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 16px 104px 16px 18px; background: var(--ink); color: #fff; border-radius: 20px; box-shadow: 0 10px 24px rgba(20, 22, 26, .16); }
.memo-sum .ms-k { font-size: 12px; font-weight: 700; color: var(--primary); }
.memo-sum .ms-v { font-size: 15px; font-weight: 700; }
.memo-sum .ms-v b { font-size: 28px; font-weight: 900; letter-spacing: -.03em; margin-right: 2px; }
.memo-sum .ms-s { font-size: 12px; color: rgba(255, 255, 255, .65); }
.memo-sum .ms-s b { color: var(--primary); }
.memo-sum .ms-t { font-size: 17px; line-height: 1.45; font-weight: 500; letter-spacing: -.02em; }
.memo-sum .ms-t b { color: var(--primary); }
.ms-ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 84px; height: 84px; object-fit: contain; pointer-events: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.cell { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.best-chip { display: none; position: absolute; top: -8px; left: 10px; z-index: 2; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(237, 98, 36, .3); }
.cell.best .best-chip { display: block; }
.cell.best .card { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cell.best .memo { border-color: var(--primary); }
.ins-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 12px 12px; }
.logo-area { height: 56px; flex: none; display: flex; align-items: center; justify-content: center; }
.ins-card .ilogo { height: 52px; }
.ins-name { margin: 0; text-align: center; font-size: 13.5px; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-go { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: 13px; font-weight: 800; }
.ins-go::after { content: "›"; font-size: 20px; line-height: 1; margin-top: -2px; }
.cell.best .ins-go { background: var(--primary); color: #fff; }
.memo { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.memo:focus-within { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.memo input { flex: 1; min-width: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 700; text-align: right; outline: none; font-variant-numeric: tabular-nums; }
.memo input::placeholder { font-weight: 400; color: var(--muted); }
.memo span { font-size: 13px; color: var(--muted); }
.note { display: flex; gap: 8px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); border-radius: 16px; }
.note svg { flex: none; width: 18px; height: 18px; }

/* 4번 탭: 더 알아보기 */
.section { overflow: hidden; border-radius: 20px; }
.section header { display: flex; align-items: center; gap: 8px; padding: 16px 16px 4px; font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; }
.section header svg { flex: none; color: var(--primary); background: var(--primary-soft); width: 30px; height: 30px; padding: 6px; border-radius: 10px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 12px 14px; }
.three.cols-2 { grid-template-columns: repeat(2, 1fr); }
.three.cols-1 { grid-template-columns: 1fr; }
.ins-btn { min-height: 104px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 12px; font-weight: 700; text-align: center; }
.ins-btn .ilogo { height: 46px; }
.ins-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.three.cols-1 .ins-btn { min-height: 76px; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 16px; font-size: 14px; }
.three.cols-1 .go { margin-left: auto; color: var(--muted); display: flex; }
@media (max-width: 380px) {
  .memo-sum { padding-left: 16px; padding-right: 80px; }
  .ms-ic { width: 66px; height: 66px; right: 10px; }
  .memo-sum .ms-t { font-size: 16px; }
}
@media (max-width: 360px) {
  .three { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
