/* family-ui 1.1.0 — family 모든 화면의 공통 디자인 (토스 TDS 를 분석해 옮긴 것)
   원본: jjung-yun/family .claude/skills/family-frontend-design/assets/family-ui.css
   앱에는 복사해서 쓴다 (예: static/ui/family-ui.css?v=앱버전). 고칠 때는 원본을 고치고 앱들에 다시 복사한다.
   설명·이유·출처: 같은 폴더의 ../SKILL.md, ../references/*.md
   글꼴: Pretendard (OFL) — 쓰는 페이지의 <head> 에
   <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css"> */

/* ───────────── 1. 값 (토큰) ───────────── */
:root {
  /* 색: @toss/tds-colors 0.1.0 colors.light.css 의 값 그대로 */
  --grey50: #f9fafb; --grey100: #f2f4f6; --grey200: #e5e8eb; --grey300: #d1d6db; --grey400: #b0b8c1;
  --grey500: #8b95a1; --grey600: #6b7684; --grey700: #4e5968; --grey800: #333d4b; --grey900: #191f28;
  --blue50: #e8f3ff; --blue100: #c9e2ff; --blue200: #90c2ff; --blue300: #64a8ff; --blue400: #4593fc;
  --blue500: #3182f6; --blue600: #2272eb; --blue700: #1b64da; --blue800: #1957c2; --blue900: #194aa6;
  --red50: #ffeeee; --red100: #ffd4d6; --red300: #fb8890; --red500: #f04452; --red600: #e42939; --red700: #d22030;
  --green50: #f0faf6; --green100: #aeefd5; --green300: #3fd599; --green500: #03b26c; --green600: #02a262; --green700: #029359;
  --orange50: #fff3e0; --orange100: #ffe0b0; --orange500: #fe9800; --orange700: #f57800;
  --yellow50: #fff9e7; --yellow100: #ffefbf; --yellow500: #ffc342; --yellow800: #ee8f11;
  --teal50: #edf8f8; --teal500: #18a5a5; --purple50: #f9f0fc; --purple500: #a234c7;
  --grey-op50: rgba(0, 23, 51, .02); --grey-op100: rgba(2, 32, 71, .05); --grey-op200: rgba(0, 27, 55, .1);
  --grey-op300: rgba(0, 29, 58, .18); --grey-op500: rgba(3, 24, 50, .46);

  /* 바탕 */
  --bg: #ffffff;              /* 상세 화면·카드 */
  --bg-grey: #f2f4f6;         /* 홈·목록 화면 바탕 (흰 카드를 올린다) */
  --bg-float: #ffffff;        /* 바텀시트·다이얼로그·메뉴 */
  --bg-pc: #f6f7f9;           /* PC 에서 앱 기둥 바깥 */
  --dim: rgba(0, 0, 0, .2);   /* 시트 뒤 어둡게 */
  --hairline: #e5e8eb;
  --disabled-primary: #c9e2ff;

  /* 뜻 (컴포넌트는 이것만 쓴다 — 위 원색을 직접 쓰지 않는다) */
  --text-strong: var(--grey900);
  --text: var(--grey800);
  --text-sub: var(--grey600);
  --text-weak: var(--grey500);
  --text-disabled: var(--grey400);
  --primary: var(--blue500);
  --primary-press: var(--blue600);
  --primary-weak: var(--blue50);
  --primary-weak-text: var(--blue600);
  --danger: var(--red500);
  --danger-weak: var(--red50);
  --success: var(--green500);
  --success-weak: var(--green50);
  --warning: var(--orange500);
  --warning-weak: var(--orange50);
  --up: var(--red500);        /* 우리나라 관례: 오르면 빨강 */
  --down: var(--blue500);     /* 내리면 파랑 */
  --toast-bg: rgba(25, 31, 40, .92);
  --toast-text: #ffffff;
  --shadow-float: 0 8px 28px rgba(2, 32, 71, .10), 0 1px 3px rgba(2, 32, 71, .06);
  --shadow-thumb: 0 1px 2px rgba(0, 0, 0, .09), 0 2px 6px rgba(0, 0, 0, .06);

  /* 글자: TDS t1~t7 (30·26·22·20·17·15·13). rem 이라 브라우저 글자 크기 설정을 따른다 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui,
          "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --t1: 1.875rem; --t2: 1.625rem; --t3: 1.375rem; --t4: 1.25rem; --t5: 1.0625rem; --t6: .9375rem; --t7: .8125rem;
  --st9: 1.125rem; --st10: 1rem; --st11: .875rem; --st12: .75rem;
  --lh-xs: 1.252; --lh-s: 1.35; --lh-m: 1.5;

  /* 간격·모양 */
  --gutter: 20px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --r-xs: 6px; --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-xl: 20px; --r-2xl: 24px; --r-pill: 999px;
  --page-max: 600px;          /* 폰 앱처럼 쓰는 화면의 최대 폭 */
  --page-wide: 1120px;        /* 대시보드처럼 넓게 쓰는 화면 */
  --nav-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* 움직임: TDS 스프링(질량 1)을 시뮬레이션해 CSS linear() 로 옮긴 것. references/motion.md */
  --spring-basic: cubic-bezier(.16, 1, .3, 1);   --dur-basic: .76s;   /* 나타날 때 (200/30) */
  --spring-small: cubic-bezier(.16, 1, .3, 1);   --dur-small: .59s;   /* 작은 요소 이동 (480/50) */
  --spring-quick: cubic-bezier(.25, .8, .25, 1); --dur-quick: .34s;   /* 사라질 때·손 뗄 때 (800/55) */
  --spring-rapid: cubic-bezier(.25, .8, .25, 1); --dur-rapid: .32s;   /* 누르는 순간 (1000/55) */
  --spring-medium: cubic-bezier(.34, 1.3, .64, 1); --dur-medium: .55s; /* 살짝 튀며 자리 잡기 (270/25) */
  --spring-bounce: cubic-bezier(.34, 1.56, .64, 1); --dur-bounce: .96s; /* 축하 (300/15) */
  --ease-out: cubic-bezier(.25, .1, .25, 1);     /* TDS bezier.out (기본, 0.5s) */
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.6, 0, 0, .6);      /* TDS bezier.ease */
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --press-scale: .96;         /* 버튼을 누르면 (TDS touchStart) */
  --press-scale-row: .98;     /* 목록 줄을 누르면 */

  color-scheme: light;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-basic: linear(0, .076, .223, .381, .519, .635, .727, .796, .849, .889, .918, .94, .956, .968, .977, .983, .988, .991, .993, .995, .996, .997, .998, .999, 1);
    --spring-small: linear(0, .1, .276, .445, .584, .693, .774, .836, .88, .912, .936, .953, .966, .975, .982, .987, .99, .993, .995, .996, .997, .998, .999, .999, 1);
    --spring-quick: linear(0, .063, .2, .347, .486, .606, .707, .783, .842, .887, .919, .943, .96, .972, .981, .987, .991, .994, .996, .997, .998, .999, .999, 1, 1);
    --spring-rapid: linear(0, .07, .221, .386, .54, .669, .775, .852, .906, .945, .97, .985, .995, 1, 1.002, 1.003, 1.003, 1.003, 1.002, 1.002, 1.001, 1.001, 1.001, 1, 1);
    --spring-medium: linear(0, .06, .195, .358, .518, .66, .776, .866, .93, .974, 1.001, 1.016, 1.023, 1.024, 1.023, 1.019, 1.015, 1.011, 1.008, 1.005, 1.003, 1.002, 1.001, 1, 1);
    --spring-bounce: linear(0, .194, .575, .934, 1.153, 1.22, 1.181, 1.097, 1.018, .968, .952, .959, .978, .996, 1.007, 1.011, 1.009, 1.005, 1.001, .999, .998, .998, .999, 1, 1);
  }
}

/* 어두운 모드: @toss/tds-colors colors.dark.css — 회색 단계가 뒤집힌다 (grey900 = 흰색) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grey50: #202027; --grey100: #2c2c35; --grey200: #3c3c47; --grey300: #4d4d59; --grey400: #62626d;
    --grey500: #7e7e87; --grey600: #9e9ea4; --grey700: #c3c3c6; --grey800: #e4e4e5; --grey900: #ffffff;
    --blue50: #202c4d; --blue100: #23386a; --blue500: #3485fa; --blue600: #449bff;
    --red50: #3c2020; --red100: #562025; --red500: #f04251; --red600: #fa616d;
    --green50: #153729; --green100: #135338; --green500: #16bb76; --green600: #26cf88;
    --orange50: #3d2500; --orange500: #f18600; --yellow50: #3d2d1a; --yellow500: #ffb134;
    --teal50: #203537; --teal500: #2eaab2; --purple50: #3f2447; --purple500: #ae3dd1;
    --grey-op100: rgba(217, 217, 255, .11); --grey-op200: rgba(222, 222, 255, .19); --grey-op300: rgba(224, 224, 255, .27);
    --grey-op500: rgba(242, 242, 255, .47);
    --bg: #17171c; --bg-grey: #101013; --bg-float: #2c2c35; --bg-pc: #101013; --dim: rgba(0, 0, 0, .56);
    --hairline: #3c3c47; --disabled-primary: rgba(49, 130, 246, .2);
    --toast-bg: rgba(60, 60, 71, .96);
    --shadow-float: 0 8px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grey50: #202027; --grey100: #2c2c35; --grey200: #3c3c47; --grey300: #4d4d59; --grey400: #62626d;
  --grey500: #7e7e87; --grey600: #9e9ea4; --grey700: #c3c3c6; --grey800: #e4e4e5; --grey900: #ffffff;
  --blue50: #202c4d; --blue100: #23386a; --blue500: #3485fa; --blue600: #449bff;
  --red50: #3c2020; --red100: #562025; --red500: #f04251; --red600: #fa616d;
  --green50: #153729; --green100: #135338; --green500: #16bb76; --green600: #26cf88;
  --orange50: #3d2500; --orange500: #f18600; --yellow50: #3d2d1a; --yellow500: #ffb134;
  --teal50: #203537; --teal500: #2eaab2; --purple50: #3f2447; --purple500: #ae3dd1;
  --grey-op100: rgba(217, 217, 255, .11); --grey-op200: rgba(222, 222, 255, .19); --grey-op300: rgba(224, 224, 255, .27);
  --grey-op500: rgba(242, 242, 255, .47);
  --bg: #17171c; --bg-grey: #101013; --bg-float: #2c2c35; --bg-pc: #101013; --dim: rgba(0, 0, 0, .56);
  --hairline: #3c3c47; --disabled-primary: rgba(49, 130, 246, .2);
  --toast-bg: rgba(60, 60, 71, .96);
  --shadow-float: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ───────────── 2. 바탕 ───────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-size: var(--t5); line-height: var(--lh-m);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all; overflow-wrap: break-word;   /* anywhere 는 좁은 flex 칸을 한 글자씩 쪼갠다 (1.0.1) */
}
body.f-grey { background: var(--bg-grey); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--text-strong); text-wrap: balance; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, video, canvas { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-s); }
::selection { background: var(--blue100); }
.f-num, .f-amount { font-variant-numeric: tabular-nums; }
.f-amount { letter-spacing: -.01em; }   /* 좁은 자간은 큰 글자에만 (작은 글자는 0) */
.f-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* 글자 크기 (TDS 토큰 이름 그대로) */
.f-t1 { font-size: var(--t1); line-height: var(--lh-s); font-weight: 700; letter-spacing: -.02em; }
.f-t2 { font-size: var(--t2); line-height: var(--lh-s); font-weight: 700; letter-spacing: -.02em; }
.f-t3 { font-size: var(--t3); line-height: var(--lh-s); font-weight: 700; letter-spacing: -.015em; }
.f-t4 { font-size: var(--t4); line-height: var(--lh-s); font-weight: 700; }
.f-t5 { font-size: var(--t5); line-height: var(--lh-m); }
.f-t6 { font-size: var(--t6); line-height: var(--lh-m); }
.f-t7 { font-size: var(--t7); line-height: var(--lh-m); }
.f-sub { color: var(--text-sub); }
.f-weak { color: var(--text-weak); }
.f-strong { color: var(--text-strong); font-weight: 700; }

/* ───────────── 3. 화면 틀 ───────────── */
.f-page {
  width: 100%; max-width: var(--page-max); margin: 0 auto;
  padding: 0 0 calc(var(--s10) + var(--safe-b));
}
.f-page--wide { max-width: var(--page-wide); }
.f-page.has-cta { padding-bottom: calc(112px + var(--safe-b)); }
.f-pad { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }

/* 위 막대: 뒤로 가기 · 가운데 제목(내리면 나타남) · 오른쪽 버튼 */
.f-nav {
  position: sticky; top: 0; z-index: 20; height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  /* 버튼은 내용 기둥(600 / 넓은 화면 1120)에 맞춘다 */
  padding: 0 max(var(--s2), calc((100% - var(--nav-max, var(--page-max))) / 2));
  background: var(--nav-bg, var(--bg));
}
.f-nav--wide { --nav-max: var(--page-wide); }
body.f-grey .f-nav { --nav-bg: var(--bg-grey); }
.f-nav-title { font-size: var(--t5); font-weight: 600; color: var(--text-strong); opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur-quick) var(--spring-quick), transform var(--dur-quick) var(--spring-quick); }
.f-nav.is-scrolled .f-nav-title { opacity: 1; transform: none; }
.f-nav-left { justify-self: start; display: flex; }
.f-nav-right { justify-self: end; display: flex; gap: var(--s1); }

/* 맨 위 큰 제목 (TDS Top) */
.f-top { padding: var(--s6) var(--gutter) var(--s4); display: flex; align-items: flex-start; gap: var(--s3); }
.f-top-text { flex: 1; min-width: 0; }
.f-top-title { font-size: var(--t2); line-height: var(--lh-s); font-weight: 700; letter-spacing: -.02em; color: var(--text-strong); }
.f-top-sub { margin-top: var(--s2); font-size: var(--t6); color: var(--text-sub); }
.f-top-upper { font-size: var(--t6); font-weight: 600; color: var(--text-sub); margin-bottom: var(--s1); }

/* 흰 카드 (회색 바탕 위) — 테두리·그림자 없이 둥근 면으로만 나눈다 */
.f-card { background: var(--bg); border-radius: var(--r-xl); padding: var(--s5) 0; margin: 0 var(--s3) var(--s3); }
.f-card > .f-card-pad, .f-card-pad { padding-left: var(--s5); padding-right: var(--s5); }
.f-card--flat { margin-left: 0; margin-right: 0; border-radius: 0; }
/* 상세 화면: 흰 바탕 위 굵은 회색 띠로 구역을 나눈다 */
.f-band { height: 12px; background: var(--bg-grey); border: 0; margin: var(--s4) 0; }
.f-hairline { height: 1px; background: var(--hairline); border: 0; margin: 0 var(--gutter); }

/* 구역 머리 (TDS ListHeader) */
.f-list-header { display: flex; align-items: baseline; gap: var(--s2); padding: var(--s2) var(--s5) var(--s3); }
.f-list-header h2, .f-list-header .f-list-title { flex: 1; min-width: 0; font-size: var(--t4); font-weight: 700; line-height: var(--lh-s); color: var(--text-strong); }
.f-list-header .f-list-more { font-size: var(--t6); color: var(--text-sub); display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0 0 0 var(--s3); }

/* PC 에서 넓은 화면: 카드를 두세 줄로 */
.f-grid { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .f-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); padding: 0 var(--s3); }
  .f-grid > .f-card { margin: 0; }
}

/* 선 아이콘 (1.1.0) — family-icons.svg (Lucide). 이모지를 아이콘으로 쓰지 않는다 (AI 티 — references/ai-tells.md)
   <svg class="f-i" aria-hidden="true"><use href="ui/family-icons.svg#house"/></svg> 또는 F.icon('house') */
.f-i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: -0.22em;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.f-i--s { width: 16px; height: 16px; } .f-i--l { width: 24px; height: 24px; }
.f-row-icon .f-i { width: 22px; height: 22px; }

/* ───────────── 4. 목록 줄 (TDS ListRow) ───────────── */
.f-row {
  position: relative; display: flex; align-items: center; gap: var(--s4);
  min-height: 56px; padding: var(--s3) var(--s5); color: inherit; text-align: left;
  width: 100%; background: none; border: 0; border-radius: 0; isolation: isolate;
  transition: transform var(--dur-quick) var(--spring-quick);
}
.f-row::before { /* 누를 때 깔리는 옅은 면 */
  content: ""; position: absolute; inset: 2px var(--s2); border-radius: var(--r-m); background: var(--grey-op100);
  opacity: 0; z-index: -1; transition: opacity var(--dur-quick) var(--spring-quick);
}
a.f-row:active, button.f-row:active, .f-row.is-pressable:active { transform: scale(var(--press-scale-row)); transition-duration: var(--dur-rapid); transition-timing-function: var(--spring-rapid); }
a.f-row:active::before, button.f-row:active::before, .f-row.is-pressable:active::before { opacity: 1; transition-duration: var(--dur-rapid); }
@media (hover: hover) { a.f-row:hover::before, button.f-row:hover::before, .f-row.is-pressable:hover::before { opacity: .6; } }
.f-row-icon {
  flex: none; width: 40px; height: 40px; border-radius: var(--r-m); display: grid; place-items: center;
  background: var(--grey100); color: var(--text-sub); font-size: 20px; line-height: 1;
}
.f-row-icon--circle { border-radius: 50%; }
.f-row-body { flex: 1; min-width: 0; }
.f-row-title { font-size: var(--t5); font-weight: 500; line-height: var(--lh-s); color: var(--text); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.f-row-sub { margin-top: 2px; font-size: var(--t6); line-height: var(--lh-s); color: var(--text-sub); }
.f-row-sub.is-clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.f-row-right { flex: none; text-align: right; display: flex; align-items: center; gap: var(--s2); color: var(--text-sub); font-size: var(--t6); }
.f-row-value { font-size: var(--t5); font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.f-chevron { width: 16px; height: 16px; flex: none; color: var(--grey400); }
.f-chevron::before { content: ""; display: block; width: 8px; height: 8px; margin: 3px 0 0 3px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); border-radius: 1px; }
.f-row.is-disabled { opacity: .45; pointer-events: none; }

/* ───────────── 5. 버튼 (TDS Button · BottomCTA) ───────────── */
.f-btn {
  --btn-bg: var(--primary); --btn-fg: #fff; --btn-press: var(--primary-press);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 48px; padding: 0 var(--s5); border: 0; border-radius: 14px;
  font-size: var(--t5); font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg);
  transition: transform var(--dur-quick) var(--spring-quick), background-color .2s var(--ease-out), opacity .2s var(--ease-out);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.f-btn:active:not(:disabled) { transform: scale(var(--press-scale)); background: var(--btn-press);
  transition-duration: var(--dur-rapid), .1s, .1s; transition-timing-function: var(--spring-rapid), var(--ease-out), var(--ease-out); }
.f-btn:disabled, .f-btn[aria-disabled="true"] { cursor: default; opacity: .4; }
.f-btn--primary:disabled, .f-btn--primary[aria-disabled="true"] { opacity: 1; --btn-bg: var(--disabled-primary); }
.f-btn--weak { --btn-bg: var(--primary-weak); --btn-fg: var(--primary-weak-text); --btn-press: var(--blue100); }
.f-btn--dark { --btn-bg: var(--grey800); --btn-fg: var(--bg); --btn-press: var(--grey900); }
.f-btn--light { --btn-bg: var(--grey100); --btn-fg: var(--grey700); --btn-press: var(--grey200); }
.f-btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-press: var(--red600); }
.f-btn--danger-weak { --btn-bg: var(--danger-weak); --btn-fg: var(--red600); --btn-press: var(--red100); }
.f-btn--text { --btn-bg: transparent; --btn-fg: var(--primary); --btn-press: var(--grey-op100); padding: 0 var(--s2); }
.f-btn--s { height: 32px; padding: 0 var(--s3); font-size: var(--t7); border-radius: var(--r-s); }
.f-btn--m { height: 40px; padding: 0 var(--s4); font-size: var(--t6); border-radius: 10px; }
.f-btn--xl { height: 56px; padding: 0 var(--s6); font-size: var(--t5); font-weight: 700; border-radius: var(--r-l); }
.f-btn--block { display: flex; width: 100%; }
.f-btn.is-loading { color: transparent; pointer-events: none; position: relative; }
.f-btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 28px; height: 6px;
  background: radial-gradient(circle closest-side, var(--btn-fg) 90%, transparent) 0 50% / 6px 6px repeat-x;
  animation: f-dots 1s steps(1) infinite; }
@keyframes f-dots { 0% { width: 6px; } 33% { width: 17px; } 66% { width: 28px; } }

/* 동그란 아이콘 버튼 (44px 누를 곳) */
.f-icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-m);
  background: transparent; color: var(--text); font-size: 22px; line-height: 1;
  transition: transform var(--dur-quick) var(--spring-quick), background-color .2s var(--ease-out); }
.f-icon-btn:active { transform: scale(.9); background: var(--grey-op100); transition-duration: var(--dur-rapid); }
.f-back::before { content: ""; width: 11px; height: 11px; border: solid currentColor; border-width: 0 0 2.4px 2.4px; transform: translateX(2px) rotate(45deg); border-radius: 1px; }

/* 화면 아래 고정 버튼 (TDS FixedBottomCTA) — 위로 바탕색이 번져 글을 가리지 않는다 */
.f-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: var(--s6) max(var(--gutter), env(safe-area-inset-right, 0px)) calc(var(--s3) + var(--safe-b)) max(var(--gutter), env(safe-area-inset-left, 0px));
  background: linear-gradient(to bottom, color-mix(in srgb, var(--cta-bg, var(--bg)) 0%, transparent), var(--cta-bg, var(--bg)) 36%);
  display: flex; gap: var(--s2); max-width: var(--page-max); margin: 0 auto; pointer-events: none;
}
.f-cta > * { pointer-events: auto; flex: 1; }
body.f-grey .f-cta { --cta-bg: var(--bg-grey); }
.f-cta-note { position: absolute; left: 0; right: 0; bottom: calc(100% - var(--s4)); text-align: center; font-size: var(--t7); color: var(--text-sub); }

/* ───────────── 6. 작은 표시 ───────────── */
.f-badge { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 var(--s2); border-radius: var(--r-xs);
  font-size: var(--st12); font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--grey700); background: var(--grey100); }
.f-badge--blue { color: var(--blue600); background: var(--blue50); }
.f-badge--green { color: var(--green600); background: var(--green50); }
.f-badge--red { color: var(--red600); background: var(--red50); }
.f-badge--orange { color: var(--orange700); background: var(--orange50); }
.f-badge--yellow { color: var(--yellow800); background: var(--yellow50); }
.f-badge--purple { color: var(--purple500); background: var(--purple50); }
.f-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grey400); flex: none; }
.f-dot.is-ok { background: var(--success); } .f-dot.is-bad { background: var(--danger); } .f-dot.is-warn { background: var(--warning); }

/* 금액·숫자: 크게, 단위는 작게. 오르면 빨강 내리면 파랑 (색만으로 알리지 않게 ▲▼ 도 붙인다) */
.f-amount { font-size: var(--t1); font-weight: 700; line-height: var(--lh-s); color: var(--text-strong); }
.f-amount small, .f-amount .f-unit { font-size: .6em; font-weight: 600; margin-left: 2px; }
.f-change { font-size: var(--t6); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-sub); }
.f-change.is-up { color: var(--up); } .f-change.is-up::before { content: "▲ "; font-size: .75em; }
.f-change.is-down { color: var(--down); } .f-change.is-down::before { content: "▼ "; font-size: .75em; }

/* 한 줄 숫자 셋 (요약) */
.f-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: var(--s2); padding: 0 var(--s5); }
.f-stat { padding: var(--s3) 0; }
.f-stat-num { font-size: var(--t3); font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: var(--lh-s); }
.f-stat-label { font-size: var(--t7); color: var(--text-sub); margin-top: 2px; }

/* ───────────── 7. 탭 · 고르기 ───────────── */
.f-tabs { position: relative; display: flex; gap: var(--s5); padding: 0 var(--gutter); border-bottom: 1px solid var(--hairline);
  overflow-x: auto; scrollbar-width: none; background: var(--tabs-bg, transparent); }
.f-tabs::-webkit-scrollbar { display: none; }
.f-tab { position: relative; flex: none; height: 48px; padding: 0; border: 0; background: none;
  font-size: var(--t5); font-weight: 600; color: var(--text-weak); transition: color .2s var(--ease-out); }
.f-tab[aria-selected="true"] { color: var(--text-strong); }
.f-tabs-ink { position: absolute; left: 0; bottom: -1px; height: 2px; width: 1px; background: var(--text-strong); border-radius: 2px;
  transform-origin: 0 0; transition: transform var(--dur-small) var(--spring-small); pointer-events: none; }
.f-tabs:not(.is-ready) .f-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text-strong); }

.f-segment { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--r-m);
  background: var(--grey100); isolation: isolate; }
.f-segment button { position: relative; z-index: 1; height: 36px; border: 0; background: none; border-radius: 9px;
  font-size: var(--t6); font-weight: 600; color: var(--text-sub); transition: color .2s var(--ease-out); }
.f-segment button[aria-pressed="true"], .f-segment button[aria-selected="true"] { color: var(--text-strong); }
.f-segment-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 9px; background: var(--bg-float);
  box-shadow: var(--shadow-thumb); transition: transform var(--dur-small) var(--spring-small), width var(--dur-small) var(--spring-small); }

/* 켜기·끄기 */
.f-switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 50px; height: 30px; margin: 0;
  border-radius: var(--r-pill); background: var(--grey300); cursor: pointer; transition: background-color .25s var(--ease-out); }
.f-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-thumb); transition: transform var(--dur-small) var(--spring-medium); }
.f-switch:checked { background: var(--primary); }
.f-switch:checked::after { transform: translateX(20px); }
.f-switch:disabled { opacity: .4; }

/* ───────────── 8. 입력 ───────────── */
.f-field { display: block; padding: 0 var(--gutter); margin-bottom: var(--s5); }
.f-field-label { display: block; font-size: var(--t7); font-weight: 600; color: var(--text-sub); margin-bottom: var(--s2); }
.f-input, .f-select, .f-textarea {
  display: block; width: 100%; min-height: 52px; padding: 14px var(--s4);
  font-size: var(--t5); line-height: var(--lh-s); color: var(--text-strong);  /* 17px — 아이폰 확대 방지(16px 이상) */
  background: var(--grey100); border: 2px solid transparent; border-radius: var(--r-m); outline: none;
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out);
}
.f-textarea { min-height: 120px; resize: vertical; line-height: var(--lh-m); }
.f-input::placeholder, .f-textarea::placeholder { color: var(--text-disabled); }
.f-input:focus, .f-select:focus, .f-textarea:focus { border-color: var(--primary); background: var(--bg); }
.f-field.is-error .f-input, .f-field.is-error .f-textarea, .f-input[aria-invalid="true"] { border-color: var(--danger); }
.f-help { display: block; margin-top: var(--s2); font-size: var(--t7); color: var(--text-sub); }
.f-help.is-error, .f-field.is-error .f-help { color: var(--danger); }
.f-help.is-ok { color: var(--success); }

/* ───────────── 9. 떠 있는 것: 토스트 · 바텀시트 · 다이얼로그 ───────────── */
.f-toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--s4) + var(--safe-b) + var(--toast-lift, 0px)); z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: 0 var(--gutter); pointer-events: none; }
.f-toast { display: flex; align-items: center; gap: var(--s3); max-width: 420px; width: max-content; min-height: 52px;
  padding: var(--s3) var(--s5); border-radius: var(--r-l); background: var(--toast-bg); color: var(--toast-text);
  font-size: var(--t6); font-weight: 500; line-height: var(--lh-s); box-shadow: var(--shadow-float); pointer-events: auto;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.f-toast-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--grey500); }
.f-toast.is-success .f-toast-icon { background: var(--green500); }
.f-toast.is-error .f-toast-icon { background: var(--red500); }
.f-toast.is-info .f-toast-icon { background: var(--blue500); }
.f-toast-action { margin: -12px 0 -12px var(--s2); min-height: 44px; padding: 0 var(--s1); border: 0; background: none; color: var(--blue300); font-weight: 600; }

dialog.f-sheet, dialog.f-dialog { border: 0; padding: 0; color: var(--text); background: var(--bg-float); max-width: none; max-height: none; }
dialog.f-sheet::backdrop, dialog.f-dialog::backdrop { background: var(--dim); }
dialog.f-sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: var(--page-max);
  max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0; padding: var(--s2) 0 calc(var(--s3) + var(--safe-b));
}
.f-sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--grey300); margin: 0 auto var(--s3); touch-action: none; }
.f-sheet-head { padding: var(--s3) var(--gutter) var(--s4); }
.f-sheet-title { font-size: var(--t3); font-weight: 700; line-height: var(--lh-s); color: var(--text-strong); }
.f-sheet-sub { margin-top: var(--s2); font-size: var(--t6); color: var(--text-sub); }
.f-sheet-cta { display: flex; gap: var(--s2); padding: var(--s3) var(--gutter) 0; }
.f-sheet-cta > * { flex: 1; }
dialog.f-dialog { position: fixed; inset: 0; margin: auto; width: min(340px, calc(100% - 40px)); height: fit-content;
  border-radius: var(--r-xl); padding: var(--s6) var(--s5) var(--s4); }
.f-dialog-title { font-size: var(--t4); font-weight: 700; line-height: var(--lh-s); color: var(--text-strong); }
.f-dialog-body { margin-top: var(--s2); font-size: var(--t6); color: var(--text-sub); }
.f-dialog-cta { display: flex; gap: var(--s2); margin-top: var(--s6); }
.f-dialog-cta > * { flex: 1; }
html.f-lock, html.f-lock body { overflow: hidden; }

/* ───────────── 10. 기다림: 스켈레톤 · 점 셋 · 빈 화면 ───────────── */
.f-skel { display: block; border-radius: var(--r-xs); background: var(--grey100); position: relative; overflow: hidden; }
.f-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--grey-op100), transparent); animation: f-shimmer 1.4s ease-in-out infinite; }
@keyframes f-shimmer { to { transform: translateX(100%); } }
.f-skel-line { height: 16px; margin: 6px 0; } .f-skel-title { height: 22px; width: 50%; } .f-skel-icon { width: 40px; height: 40px; border-radius: var(--r-m); }
.f-loader { display: inline-flex; gap: 6px; } .f-loader i { width: 8px; height: 8px; border-radius: 50%; background: var(--grey300); animation: f-hop .9s var(--ease-inout) infinite; }
.f-loader i:nth-child(2) { animation-delay: .15s; } .f-loader i:nth-child(3) { animation-delay: .3s; }
@keyframes f-hop { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }
.f-empty { padding: var(--s10) var(--gutter); text-align: center; }
.f-empty-icon { font-size: 44px; line-height: 1; margin-bottom: var(--s4); }
.f-empty-title { font-size: var(--t5); font-weight: 600; color: var(--text-strong); }
.f-empty-sub { margin-top: var(--s1); font-size: var(--t6); color: var(--text-sub); }
.f-empty .f-btn { margin-top: var(--s5); }


/* 같은 앱 안에서 페이지를 옮길 때 부드럽게 (지원하는 브라우저만) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: f-vt-out .2s var(--ease-out) both; }
::view-transition-new(root) { animation: f-vt-in var(--dur-quick) var(--spring-quick) both; }
@keyframes f-vt-out { to { opacity: 0; } }
@keyframes f-vt-in { from { opacity: 0; transform: translateY(8px); } }

/* 움직임 줄이기: 옮김·크기 변화는 없애고 짧은 흐려짐만 남긴다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .f-btn, .f-row, .f-icon-btn, .f-tabs-ink, .f-segment-thumb, .f-switch::after, .f-nav-title { transition-duration: .01ms !important; }
  .f-btn:active, .f-row:active, .f-icon-btn:active { transform: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
