/* ============================================================
   트립셈 / Trip Math
   Boarding-pass paper: warm stock, navy ink, ticket punches.
   ============================================================ */

:root {
  --paper: #f3f0e8;
  --paper-2: #faf8f1;
  --card: #fffdf8;
  --ink: #0f1a2e;
  --ink-2: #2b3a55;
  --muted: #5f6d84;
  --faint: #8a94a6;
  --line: #ded7c8;
  --line-2: #c9c0ad;
  --blue: #1a46c8;
  --blue-2: #3a63e0;
  --blue-soft: #e9eefb;
  --blue-line: #c3d0f3;
  --sky: #0a86c9;
  --sky-soft: #e2f2fa;
  --teal: #0d7a66;
  --teal-soft: #e0f2ee;
  --amber: #a96300;
  --amber-soft: #fdf0d9;
  --rose: #b3261e;
  --rose-soft: #fbe9e6;
  --jade: #0f7a4f;
  --jade-soft: #e3f3ea;
  --violet: #6544b8;
  --violet-soft: #eee9fa;
  --slate: #64748b;
  --slate-soft: #eef1f5;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 26, 46, .05), 0 18px 44px -28px rgba(15, 26, 46, .35);
  --shadow-sm: 0 1px 2px rgba(15, 26, 46, .06);
  --sans: "Inter", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", Georgia, "Noto Serif KR", "Noto Serif CJK KR", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  word-break: keep-all;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(760px 460px at 92% -8%, rgba(26, 70, 200, .1), transparent 66%),
    radial-gradient(620px 380px at -6% 12%, rgba(13, 122, 102, .07), transparent 70%),
    var(--paper);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15, 26, 46, .035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 26, 46, .035) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(1100px 780px at 50% 0%, #000 6%, transparent 74%);
  mask-image: radial-gradient(1100px 780px at 50% 0%, #000 6%, transparent 74%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--blue); }
img, canvas { max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: 1.18; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--blue); color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: #fff; font-weight: 700;
  padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 16px; }

/* ---------------- header ---------------- */

.hdr {
  position: sticky; top: 0; z-index: 40;
  background: rgba(243, 240, 232, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 14px -8px rgba(15, 26, 46, .8);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-word { display: flex; align-items: baseline; gap: 8px; font-weight: 900; font-size: 18.5px; letter-spacing: -.045em; }
.brand-word em {
  font-style: normal; font-family: var(--mono);
  font-size: 10px; letter-spacing: .16em; color: var(--muted);
  text-transform: uppercase; font-weight: 600;
}
.hdr nav { display: flex; align-items: center; gap: 22px; font-size: 14.5px; color: var(--ink-2); font-weight: 600; }
.hdr nav a { padding: 6px 0; }
.hdr nav a:hover { color: var(--blue); }
.lang {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: rgba(255, 253, 248, .7);
  padding: 7px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  letter-spacing: .01em; white-space: nowrap;
}
.lang:hover { border-color: var(--ink); color: var(--ink); }
.lang b { color: var(--blue); }

.ratebar {
  border-bottom: 1px dashed var(--line-2);
  background: rgba(255, 253, 248, .55);
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  color: var(--muted);
}
.ratebar .wrap { height: 34px; display: flex; align-items: center; gap: 14px; overflow: hidden; white-space: nowrap; }
.ratebar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); flex: none; box-shadow: 0 0 0 3px rgba(15, 122, 79, .14); }
.ratebar strong { color: var(--ink-2); font-weight: 700; }
.ratebar .sep { color: var(--line-2); }

/* ---------------- hero ---------------- */

.hero { padding: 46px 0 26px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-soft); border: 1px solid var(--blue-line);
  padding: 5px 10px; border-radius: 6px; font-weight: 700; margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(30px, 4.6vw, 52px);
  letter-spacing: -.045em; line-height: 1.12; max-width: 16em;
}
.hero h1 .hl {
  background: linear-gradient(180deg, transparent 62%, rgba(26, 70, 200, .16) 62%);
  padding: 0 2px;
}
.hero p.lede { margin-top: 16px; color: var(--muted); font-size: 16.5px; max-width: 40em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.chip svg { width: 14px; height: 14px; color: var(--blue); flex: none; }
.chip .mono { font-size: 11.5px; color: var(--muted); }

/* ---------------- ad slots ---------------- */

.ad {
  margin: 22px 0;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, .55);
  min-height: 76px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--faint); font-size: 11.5px; letter-spacing: .02em;
  text-align: center; padding: 12px 16px;
}
.ad .ad-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em;
  border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 5px;
  color: var(--faint);
}
.ad--foot { min-height: 90px; }

/* ---------------- tabs ---------------- */

.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 6px;
  background: rgba(15, 26, 46, .055);
  border: 1px solid var(--line);
  border-radius: 14px;
  position: sticky; top: 64px; z-index: 30;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tab {
  appearance: none; border: 0; background: transparent;
  padding: 12px 10px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 14.5px; color: var(--ink-2);
  transition: background .15s, color .15s, box-shadow .15s;
  text-align: center; line-height: 1.25;
}
.tab .tab-no {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px;
  padding: 2px 4px; flex: none;
}
.tab:hover { color: var(--blue); background: rgba(255, 253, 248, .6); }
.tab[aria-selected="true"] {
  background: var(--ink); color: #fff; box-shadow: 0 8px 18px -12px rgba(15, 26, 46, .85);
}
.tab[aria-selected="true"] .tab-no { color: rgba(255, 255, 255, .66); border-color: rgba(255, 255, 255, .28); }

.panel { padding: 26px 0 8px; }
.panel[hidden] { display: none; }

/* ---------------- cards & layout ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 18px; align-items: start; }
.grid-2 + .grid-2, .card + .card, .grid-2 + .card, .card + .grid-2 { margin-top: 18px; }
.stack > * + * { margin-top: 18px; }

.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.kicker {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--blue); font-weight: 700;
}
.card-head h2 { font-size: 20px; letter-spacing: -.03em; }
.card-head .hint { margin-left: auto; font-size: 12px; color: var(--faint); }

/* ---------------- forms ---------------- */

.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.preset {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--paper-2);
  border-radius: 999px; padding: 7px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, background .15s;
}
.preset:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.preset span.flag { font-size: 14px; line-height: 1; }

.fields { display: grid; grid-template-columns: 1.35fr .8fr .8fr; gap: 10px; margin-bottom: 18px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .01em; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; height: 42px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; color: var(--ink);
  padding: 0 11px; font: inherit; font-size: 14.5px; font-weight: 600;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 70, 200, .12);
}

.stepper { display: flex; align-items: stretch; height: 42px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; overflow: hidden; }
.stepper button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  width: 36px; font-size: 18px; line-height: 1; color: var(--ink-2);
  display: grid; place-items: center;
}
.stepper button:hover { background: var(--blue-soft); color: var(--blue); }
.stepper input {
  flex: 1; min-width: 0; border: 0; height: 100%; text-align: center;
  font: inherit; font-size: 14.5px; font-weight: 700; color: var(--ink);
  background: transparent; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }
.stepper .unit { align-self: center; padding-right: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* expense rows */
.exp { border-top: 1px solid var(--line); }
.exp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.exp-head .lbl { font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.exp-head .pct { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.exp-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) 150px 56px;
  align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid rgba(222, 215, 200, .6);
}
.exp-row:last-child { border-bottom: 0; }
.exp-ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; flex: none;
}
.exp-ico svg { width: 15px; height: 15px; }
.exp-name { font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.exp-name small { font-size: 10.5px; color: var(--faint); font-weight: 500; }
.money {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  height: 38px; overflow: hidden;
}
.money .cur { padding: 0 8px; font-size: 11.5px; font-weight: 700; color: var(--faint); background: var(--paper-2); align-self: stretch; display: grid; place-items: center; border-right: 1px solid var(--line); }
.money input {
  flex: 1; min-width: 0; border: 0; height: 100%; text-align: right;
  padding: 0 10px 0 4px; font: inherit; font-size: 14px; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums; background: transparent;
  -moz-appearance: textfield;
}
.money input::-webkit-outer-spin-button, .money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.money input:focus { outline: none; }
.money:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 70, 200, .1); }
.exp-share { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }

.exp-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 0 4px; margin-top: 4px; border-top: 1px solid var(--ink);
}
.exp-total .k { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.exp-total .v { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

.budget-line { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); }
.budget-line label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.budget-line .money { flex: 1; }
.budget-line .money input { font-size: 15px; }

/* ---------------- result ticket ---------------- */

.ticket { position: relative; overflow: hidden; }
.ticket::before, .ticket::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line);
  top: 58%; transform: translateY(-50%);
}
.ticket::before { left: -12px; }
.ticket::after { right: -12px; }
.ticket-top { border-bottom: 1px dashed var(--line-2); padding-bottom: 16px; margin-bottom: 16px; }
.ticket-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.big {
  font-family: var(--mono); font-size: clamp(30px, 4.4vw, 40px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.1; margin-top: 4px;
}
.big .won { font-size: .52em; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.big.big--sm { font-size: clamp(24px, 3.4vw, 32px); }
.ticket-meta { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.duo > div { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.duo .k { font-size: 11px; color: var(--muted); font-weight: 600; }
.duo .v { font-family: var(--mono); font-size: 16px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; }

.status {
  display: flex; align-items: center; gap: 8px;
  border-radius: 10px; padding: 10px 12px; margin-top: 14px;
  font-size: 13px; font-weight: 700; line-height: 1.35;
}
.status svg { width: 16px; height: 16px; flex: none; }
.status.ok { background: var(--jade-soft); color: var(--jade); border: 1px solid #bfe2d2; }
.status.over { background: var(--rose-soft); color: var(--rose); border: 1px solid #f0cbc5; }
.status .amt { margin-left: auto; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

.split-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--slate-soft); margin: 18px 0 12px; }
.split-bar span { display: block; height: 100%; min-width: 0; transition: width .25s ease; }

.legend { display: grid; gap: 3px; }
.leg {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center; gap: 8px; padding: 3px 0;
  font-size: 12px; color: var(--ink-2);
}
.leg .sw { width: 8px; height: 8px; border-radius: 2px; }
.leg .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg .vl { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.leg .pc { font-family: var(--mono); font-size: 10.5px; color: var(--faint); width: 38px; text-align: right; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn {
  appearance: none; cursor: pointer; border: 0; border-radius: 10px;
  padding: 11px 15px; font-size: 13.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff;
  transition: transform .12s, background .15s, box-shadow .15s;
  box-shadow: 0 10px 20px -14px rgba(15, 26, 46, .9);
}
.btn:hover { background: #1b2b48; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn.ghost {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-2); box-shadow: none;
}
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink-2); }
.btn.blue { background: var(--blue); }
.btn.blue:hover { background: #163cb0; }
.btn.sm { padding: 8px 11px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- FX tab ---------------- */

.cur-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.cur {
  appearance: none; cursor: pointer; border: 1px solid var(--line-2);
  background: var(--paper-2); border-radius: 10px; padding: 9px 12px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  transition: all .15s;
}
.cur .code { font-family: var(--mono); font-size: 10.5px; color: var(--faint); font-weight: 600; }
.cur:hover { border-color: var(--blue); color: var(--blue); }
.cur[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cur[aria-pressed="true"] .code { color: rgba(255, 255, 255, .65); }

.rate-line {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px; border-radius: 12px;
  background: var(--paper-2); border: 1px dashed var(--line-2);
}
.rate-line .rate-eq { font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.rate-line .rate-eq .mono { font-size: 12px; color: var(--muted); }
.rate-line input {
  width: 120px; height: 38px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #fff; padding: 0 10px; text-align: right;
  font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--ink);
}
.rate-line input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 70, 200, .1); }
.rate-line .note { font-size: 11px; color: var(--faint); margin-left: auto; }
.rate-line .link-btn { white-space: nowrap; margin-left: 2px; }
.link-btn {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: var(--blue); text-decoration: underline;
  text-underline-offset: 2px;
}

.conv { display: grid; gap: 10px; margin-top: 16px; }
.conv-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.conv-row .swap { align-self: center; color: var(--faint); font-size: 16px; padding-bottom: 10px; }
.conv .money { height: 46px; }
.conv .money input { font-size: 16px; }
.conv-out {
  margin-top: 14px; border-radius: 12px; padding: 14px;
  background: var(--ink); color: #fff;
}
.conv-out .k { font-size: 11px; letter-spacing: .04em; color: rgba(255, 255, 255, .6); font-weight: 600; }
.conv-out .v { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; }
.conv-out .s { font-size: 11.5px; color: rgba(255, 255, 255, .55); margin-top: 2px; }

.fee-cards { display: grid; gap: 10px; margin-top: 14px; }
.fee {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: var(--paper-2);
}
.fee .fi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.fee .fi svg { width: 16px; height: 16px; }
.fee .fk { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.fee .fk small { display: block; font-size: 10.5px; color: var(--faint); font-weight: 500; }
.fee .fv { margin-left: auto; text-align: right; font-family: var(--mono); }
.fee .fv b { display: block; font-size: 14.5px; letter-spacing: -.02em; }
.fee .fv small { font-size: 10.5px; color: var(--faint); }
.fee.save { background: var(--jade-soft); border-color: #bfe2d2; }
.fee.save .fv b { color: var(--jade); font-size: 17px; }

.tip-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tip-btn {
  appearance: none; cursor: pointer; border: 1px solid var(--line-2);
  background: #fff; border-radius: 9px; padding: 9px 14px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.tip-btn:hover { border-color: var(--blue); color: var(--blue); }
.tip-btn[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

.split-people { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.split-people .lab { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.split-people .stepper { width: 132px; height: 38px; }

.checkline { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.checkline input { accent-color: var(--blue); width: 16px; height: 16px; }

.tip-out { margin-top: 16px; border-top: 1px dashed var(--line-2); padding-top: 14px; display: grid; gap: 8px; }
.tip-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.tip-line .v { font-family: var(--mono); font-weight: 700; }
.tip-line.total { font-size: 15px; font-weight: 800; color: var(--ink); padding-top: 8px; border-top: 1px solid var(--line); }
.tip-line.total .v { font-size: 19px; }
.tip-line .won { font-size: 11px; color: var(--faint); font-weight: 500; margin-left: 6px; }
.tip-line > span:first-child { color: var(--muted); }
.tip-line.total > span:first-child { color: var(--ink); }

/* ---------------- packing ---------------- */

.pack-top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.types { display: flex; gap: 6px; flex-wrap: wrap; }
.type {
  appearance: none; cursor: pointer; border: 1px solid var(--line-2);
  background: var(--paper-2); border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.type:hover { border-color: var(--blue); color: var(--blue); }
.type[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.progress-box { margin-left: auto; min-width: 220px; }
.progress-meta { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.progress-meta b { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.progress { height: 10px; border-radius: 5px; background: var(--slate-soft); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--blue), var(--sky)); transition: width .3s ease; }

.pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.pack-group { break-inside: avoid; }
.pack-group h3 {
  font-size: 13px; letter-spacing: -.01em; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.pack-group h3 .count { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--faint); font-weight: 600; }
.pack-group h3 .dot { width: 7px; height: 7px; border-radius: 50%; }

.pack-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 4px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; color: var(--ink-2);
  transition: background .12s;
}
.pack-item:hover { background: var(--paper-2); }
.pack-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.pack-box {
  width: 19px; height: 19px; border-radius: 5px; flex: none;
  border: 1.5px solid var(--line-2); background: #fff;
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.pack-box svg { width: 12px; height: 12px; color: #fff; opacity: 0; stroke-width: 3; }
.pack-item input:checked + .pack-box { background: var(--blue); border-color: var(--blue); }
.pack-item input:checked + .pack-box svg { opacity: 1; }
.pack-item input:focus-visible + .pack-box { outline: 2px solid var(--blue); outline-offset: 2px; }
.pack-item input:checked ~ .pack-label { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-2); }
.pack-label { flex: 1; }
.pack-item .must {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em;
  color: var(--rose); border: 1px solid #f0cbc5; background: var(--rose-soft);
  border-radius: 3px; padding: 1px 3px; font-weight: 700;
}
.pack-del {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--faint); font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.pack-del:hover { color: var(--rose); background: var(--rose-soft); }

.pack-add { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.pack-add input {
  flex: 1; min-width: 180px; height: 42px; border: 1px solid var(--line-2);
  border-radius: 10px; background: #fff; padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--ink);
}
.pack-add input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 70, 200, .1); }
.pack-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.pack-foot .note { font-size: 11.5px; color: var(--faint); }
.pack-foot .spacer { margin-left: auto; }

/* ---------------- affiliate ---------------- */

.section { padding: 40px 0 10px; }
.section-head { max-width: 46em; margin-bottom: 20px; }
.section-head .kicker { display: block; margin-bottom: 8px; }
.section-head h2 { font-size: clamp(22px, 3vw, 30px); }
.section-head p { color: var(--muted); margin-top: 8px; font-size: 14.5px; }

.aff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.aff {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm); position: relative;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.aff:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); color: inherit; }
.aff .aff-ico {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-size: 14px; font-weight: 800; letter-spacing: -.03em;
}
.aff h3 { font-size: 14.5px; letter-spacing: -.02em; }
.aff p { font-size: 12px; color: var(--muted); line-height: 1.5; }
.aff .go { font-size: 11.5px; font-weight: 700; color: var(--blue); margin-top: auto; display: inline-flex; align-items: center; gap: 4px; }
.aff .tag { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; color: var(--faint); border: 1px solid var(--line); padding: 1px 4px; border-radius: 3px; }
.aff-note { font-size: 11px; color: var(--faint); margin-top: 10px; line-height: 1.5; }

/* ---------------- guides teaser & crosslinks ---------------- */

.guide-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px;
  transition: transform .15s, box-shadow .15s;
}
.gcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.gcard .gk { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--blue); font-weight: 700; }
.gcard h3 { font-size: 14px; line-height: 1.4; letter-spacing: -.02em; }
.gcard p { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.gcard .gm { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: auto; padding-top: 6px; }

.xlinks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.xlink {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
  transition: border-color .15s, transform .15s;
}
.xlink:hover { border-color: var(--blue); transform: translateY(-1px); color: inherit; }
.xlink b { font-size: 13px; letter-spacing: -.02em; }
.xlink span { font-size: 11px; color: var(--muted); }

/* ---------------- FAQ ---------------- */

.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 28px 16px 0; position: relative;
  font-weight: 700; font-size: 15px; letter-spacing: -.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 14px;
  font-size: 18px; color: var(--faint); font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ---------------- footer ---------------- */

.ftr { margin-top: 48px; background: var(--ink); color: rgba(255, 255, 255, .72); padding: 34px 0 26px; }
.ftr a { color: rgba(255, 255, 255, .86); }
.ftr a:hover { color: #fff; }
.ftr-top { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.ftr .brand-mark { background: #fff; color: var(--ink); box-shadow: none; }
.ftr .brand-word { color: #fff; }
.ftr .brand-word em { color: rgba(255, 255, 255, .45); }
.ftr p { font-size: 12px; line-height: 1.65; max-width: 30em; color: rgba(255, 255, 255, .52); margin-top: 10px; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; font-weight: 600; max-width: 480px; }
.ftr-links a { padding: 2px 0; }
.ftr-bottom {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: 11px; color: rgba(255, 255, 255, .4); font-family: var(--mono);
}

/* ---------------- prose / guide pages ---------------- */

.doc-hero { padding: 44px 0 8px; max-width: 800px; }
.doc-hero h1 { font-size: clamp(27px, 4vw, 40px); }
.doc-hero .dek { margin-top: 12px; color: var(--muted); font-size: 16px; }
.doc-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--faint); font-family: var(--mono); letter-spacing: .02em; }
.prose { max-width: 760px; padding: 26px 0 20px; font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.prose > * + * { margin-top: 18px; }
.prose h2 { font-size: 22px; margin-top: 38px; letter-spacing: -.03em; color: var(--ink); }
.prose h3 { font-size: 17px; margin-top: 26px; color: var(--ink); }
.prose p { color: var(--ink-2); }
.prose ul, .prose ol { margin: 0; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--blue); }
.prose strong { color: var(--ink); }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.prose th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
.prose td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.prose .callout {
  background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 10px; padding: 14px 16px; font-size: 14px; color: var(--ink-2);
}
.prose .callout b { color: var(--ink); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cta-box {
  background: var(--ink); color: #fff; border-radius: 16px; padding: 22px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 30px 0 10px;
}
.cta-box .ct { flex: 1; min-width: 220px; }
.cta-box b { display: block; font-size: 17px; letter-spacing: -.02em; }
.cta-box span { font-size: 13px; color: rgba(255, 255, 255, .62); }
.cta-box .btn { background: #fff; color: var(--ink); }

.guide-list { display: grid; gap: 12px; max-width: 860px; }
.guide-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.guide-row:hover { border-color: var(--blue); transform: translateY(-1px); color: inherit; }
.guide-row .gnum { font-family: var(--mono); font-size: 15px; color: var(--faint); font-weight: 700; }
.guide-row h3 { font-size: 15.5px; letter-spacing: -.02em; }
.guide-row p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.guide-row .garrow { color: var(--faint); font-size: 18px; }

/* ---------------- toast ---------------- */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 16px; border-radius: 10px; z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 404 ---------------- */

.nf { min-height: 62vh; display: grid; place-content: center; text-align: center; padding: 40px 0; }
.nf .code { font-family: var(--mono); font-size: 64px; font-weight: 700; color: var(--blue); letter-spacing: -.06em; line-height: 1; }
.nf h1 { font-size: 24px; margin-top: 12px; }
.nf p { color: var(--muted); margin-top: 8px; }
.nf .actions { justify-content: center; margin-top: 22px; }

/* ---------------- responsive ---------------- */

@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .aff-grid, .guide-grid { grid-template-columns: repeat(2, 1fr); }
  .xlinks { grid-template-columns: repeat(3, 1fr); }
  .pack-grid { gap: 14px 20px; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .hdr-in { height: 56px; gap: 12px; }
  .hdr nav { display: none; }
  .brand-word { font-size: 17px; }
  .brand-word em { display: none; }
  .hero { padding: 24px 0 14px; }
  .hero h1 { font-size: clamp(26px, 8vw, 34px); }
  .hero p.lede { font-size: 14px; margin-top: 10px; line-height: 1.55; }
  .hero-meta { margin-top: 14px; gap: 6px; }
  .chip { padding: 5px 9px; font-size: 11.5px; }
  .eyebrow { margin-bottom: 10px; font-size: 9.5px; padding: 4px 8px; }
  .ad { margin: 14px 0; min-height: 56px; }
  .tabs { top: 56px; gap: 4px; padding: 5px; }
  .tab { padding: 10px 6px; font-size: 12.5px; gap: 6px; flex-direction: column; }
  .tab .tab-no { font-size: 9px; padding: 1px 3px; }
  .card { padding: 18px 16px; border-radius: 15px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .field:first-child { grid-column: 1 / -1; }
  .exp-row { grid-template-columns: 26px minmax(0, 1fr) 116px; gap: 8px; }
  .exp-row .exp-share { display: none; }
  .exp-ico { width: 26px; height: 26px; border-radius: 8px; }
  .exp-name { font-size: 13px; }
  .money input { font-size: 13px; }
  .money .cur { padding: 0 6px; font-size: 10.5px; }
  .pack-grid { grid-template-columns: 1fr; }
  .progress-box { margin-left: 0; width: 100%; min-width: 0; }
  .pack-top { gap: 10px; }
  .aff-grid, .guide-grid { grid-template-columns: 1fr; }
  .xlinks { grid-template-columns: repeat(2, 1fr); }
  .conv-row { grid-template-columns: 1fr; }
  .conv-row .swap { padding: 0; text-align: center; transform: rotate(90deg); }
  .duo { grid-template-columns: 1fr 1fr; }
  .actions .btn { flex: 1; justify-content: center; }
  .guide-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 14px; }
  .ftr-top { flex-direction: column; }
  .ad { min-height: 64px; }
  .ratebar .wrap { gap: 8px; font-size: 10px; }
  .cur-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rate-line { gap: 8px; }
  .rate-line .note { margin-left: 0; width: 100%; }
}

@media print {
  .hdr, .ratebar, .tabs, .ad, .aff-grid, .ftr, .actions, .pack-add, .pack-foot { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------------- doc pages ---------------- */
.narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }
.prose .lead { font-size: 17.5px; line-height: 1.7; color: var(--ink-2); }
.prose .lead strong { color: var(--ink); }
.doc-foot-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 38px 0 10px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.doc-foot-nav a { color: var(--blue); }
.guide-hero { padding: 42px 0 4px; }
.guide-hero .gk { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--blue); font-weight: 700; }
.guide-hero h1 { margin-top: 10px; font-size: clamp(26px, 3.8vw, 38px); }
.guide-hero .dek { margin-top: 12px; color: var(--muted); font-size: 16px; }
.guide-hero .meta { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .02em; }
.prose table { margin: 14px 0 6px; }
.prose table caption { caption-side: top; text-align: left; font-size: 11px; color: var(--faint); padding-bottom: 6px; }
@media (max-width: 700px) {
  .narrow { padding: 0 16px; }
  .guide-hero { padding: 28px 0 2px; }
  .prose { font-size: 15.5px; }
  .prose h2 { font-size: 20px; margin-top: 30px; }
}
