/* FLIP 디자인 시스템 v3: 무채색 톤, 얇은 테두리, 라이트·다크 테마. 색은 뜻이 있을 때만(이익·손실·대기·정보). */
:root, :root[data-theme=dark] {
  color-scheme: dark;
  --bg: #0d0d0f; --panel: #101012; --surface: #19191c; --sunk: #141416; --hover: #1e1e22; --active: #1a1a1d; --hl: #222227;
  --line: #26262b; --line2: #34343b; --ink: #f4f4f5; --ink2: #c8c8ce; --mute: #8a8a93; --on-ink: #111113; --chip: #26262b;
  --pos: #5fd39a; --pos-bg: rgba(95, 211, 154, .13); --neg: #f47c70; --neg-bg: rgba(244, 124, 112, .14); --amber: #e5b455; --amber-bg: rgba(229, 180, 85, .14); --info: #7ea8f8; --info-bg: rgba(126, 168, 248, .14);
  --c-stock: #d9a441; --c-recv: #6f95ea; --c-chan: #9a86e6; --c-cash: #4fc48c;
  --ring: rgba(244, 244, 245, .16); --scrim: rgba(0, 0, 0, .62); --shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #f4f4f5; --panel: #fafafa; --surface: #fff; --sunk: #f6f6f7; --hover: #efeff1; --active: #fff; --hl: #f1f1f3;
  --line: #e6e6e9; --line2: #d4d4d9; --ink: #111113; --ink2: #3f3f46; --mute: #71717a; --on-ink: #fff; --chip: #ececef;
  --pos: #0a8a5b; --pos-bg: #e4f5ec; --neg: #c93a2f; --neg-bg: #fcebe9; --amber: #a15c07; --amber-bg: #fbf0da; --info: #2b59c7; --info-bg: #e7eefc;
  --c-stock: #e0a030; --c-recv: #5b83e6; --c-chan: #8f79e3; --c-cash: #19a974;
  --ring: rgba(17, 17, 19, .12); --scrim: rgba(17, 17, 19, .45); --shadow: 0 24px 70px rgba(17, 17, 19, .18);
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Pretendard Variable", Pretendard, Inter, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
a { color: inherit; }
h1, h2, h3, h4 { letter-spacing: -.02em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; }
.ico { width: 19px; height: 19px; flex: none; display: inline-flex; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: inherit; font-size: .74rem; color: var(--mute); background: var(--hover); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; line-height: 1.7; }

/* ---------- 골격 ---------- */
#app { display: flex; min-height: 100vh; }
.side { width: 264px; flex: none; background: var(--panel); border-right: 1px solid var(--line); color: var(--mute); padding: 14px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ws { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--sunk); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; }
.ws:hover { background: var(--hover); }
.ws .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--ink), var(--mute)); color: var(--panel); display: grid; place-items: center; font-weight: 900; font-size: .95rem; }
.ws b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ws small { display: block; font-size: .7rem; color: var(--mute); font-weight: 500; margin-top: -2px; }
.ws .ico { color: var(--mute); width: 16px; height: 16px; }
.side a.nv, .side .srow { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; color: var(--mute); font-size: .95rem; font-weight: 500; background: none; cursor: pointer; width: 100%; text-align: left; }
.side a.nv:hover, .side .srow:hover { background: var(--hover); color: var(--ink); }
.side a.nv.on { background: var(--active); border-color: var(--line2); color: var(--ink); font-weight: 600; }
.side .srow kbd, .side a.nv .badge { margin-left: auto; }
.navg { font-size: .7rem; font-weight: 600; color: var(--mute); opacity: .75; padding: 2px 10px 4px; }
.badge { background: var(--neg); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .7rem; font-weight: 700; line-height: 1.6; }
.side .grow { flex: 1; min-height: 12px; }
.promo { border: 1px solid var(--line); background: var(--sunk); border-radius: 14px; padding: 14px; position: relative; color: var(--mute); font-size: .88rem; }
.promo .pic { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--surface); display: grid; place-items: center; color: var(--ink); margin-bottom: 12px; }
.promo strong { display: block; color: var(--ink); font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.promo .btn { width: 100%; margin-top: 12px; }
.promo .x { position: absolute; right: 8px; top: 8px; border: 0; background: none; color: var(--mute); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.promo .x:hover { background: var(--hover); color: var(--ink); }
.page { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 8px; padding: 16px 28px 0; min-height: 56px; }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 1rem; font-weight: 500; flex: 1; min-width: 0; }
.menu, .only-m { display: none !important; }
.bnav { display: none; }
main { padding: 18px 28px 90px; max-width: 1280px; }
.phead { margin-bottom: 18px; }
.phead h1 { font-size: 1.55rem; font-weight: 600; margin: 0; line-height: 1.25; }
.phead p { color: var(--mute); font-size: .92rem; margin: 3px 0 0; }

/* ---------- 카드·그리드 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); margin-bottom: 14px; }
.grid .card { margin: 0; }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); align-items: start; }
.stat small { display: flex; align-items: center; gap: 8px; color: var(--mute); font-size: .86rem; font-weight: 500; margin-bottom: 8px; }
.stat small .ico { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--sunk); border: 1px solid var(--line); color: var(--ink2); }
.stat.t-pos small .ico { color: var(--pos); } .stat.t-amber small .ico { color: var(--amber); } .stat.t-info small .ico { color: var(--info); } .stat.t-lime small .ico { color: var(--ink); }
.stat .sub { font-size: .8rem; color: var(--mute); margin-top: 4px; }

/* ---------- 숫자: 확정은 잉크, 추정·미확정은 회색 기울임 + 표기. 누르면 근거 거래 ---------- */
.num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
button.num { background: none; border: 0; padding: 0 2px; margin: 0 -2px; cursor: pointer; border-radius: 6px; text-decoration: underline dotted var(--line2); text-underline-offset: 4px; text-decoration-thickness: 1px; }
button.num:hover { background: var(--hover); text-decoration-style: solid; }
.num.big { font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.25; }
.num.neg { color: var(--neg); }
.num.est { color: var(--mute); font-style: italic; }
.num em { font-style: normal; font-size: .66rem; font-weight: 600; margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: var(--chip); color: var(--ink2); vertical-align: middle; letter-spacing: 0; }

/* ---------- 버튼·태그 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--hover); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: .9rem; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); transition: background .12s, transform .06s; }
.btn:hover { background: var(--hl); border-color: var(--mute); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }
.btn.primary:hover { opacity: .88; background: var(--ink); }
.btn.danger { color: var(--neg); border-color: var(--neg-bg); background: var(--neg-bg); }
.btn.sm { padding: 4px 10px; font-size: .82rem; border-radius: 8px; }
.btn.icon { padding: 8px; background: none; border-color: transparent; color: var(--mute); }
.btn.icon:hover { background: var(--hover); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.actions.left { justify-content: flex-start; margin: 0 0 14px; }
.tag { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink2); white-space: nowrap; line-height: 1.5; }
.tag.pos { background: var(--pos-bg); color: var(--pos); }
.tag.warn, .tag.neg { background: var(--neg-bg); color: var(--neg); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.dark { background: var(--ink); color: var(--on-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line2); background: transparent; color: var(--ink2); border-radius: 999px; padding: 6px 13px; font-size: .86rem; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { background: var(--hover); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }
.chip b { font-weight: 600; opacity: .6; font-size: .8rem; }

/* ---------- 표 ---------- */
.scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .76rem; color: var(--mute); font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 500; color: var(--ink); }
.r { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
tr.best td { font-weight: 600; background: var(--hl); }
.empty { color: var(--mute); padding: 26px 12px; margin: 0; text-align: center; background: var(--sunk); border-radius: 12px; border: 1px dashed var(--line2); font-size: .9rem; }
.note { color: var(--mute); font-size: .84rem; margin: 0 0 10px; }
.alert { color: var(--neg); background: var(--neg-bg); border-radius: 12px; padding: 11px 14px; margin: 0 0 14px; font-size: .9rem; font-weight: 500; }
.notice { background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; margin: 0 0 14px; font-size: .88rem; color: var(--ink2); }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; background: var(--sunk); border: 1px solid var(--line); padding: 4px; border-radius: 12px; margin-bottom: 16px; width: fit-content; max-width: 100%; }
.tabs button { border: 1px solid transparent; background: none; padding: 6px 13px; cursor: pointer; color: var(--mute); border-radius: 9px; font-weight: 500; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.tabs button .ico { width: 16px; height: 16px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--surface); border-color: var(--line2); color: var(--ink); font-weight: 600; }

/* ---------- 폼 ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; position: relative; }
.field.full { grid-column: 1 / -1; }
.field.chk { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.field.chk input, .picker input[type=checkbox], .picker input[type=radio] { width: 17px; height: 17px; accent-color: var(--ink); flex: none; }
.field label { font-size: .82rem; color: var(--ink2); font-weight: 500; }
.field.chk label { font-size: .92rem; color: var(--ink); }
.field small { color: var(--mute); font-size: .76rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; background: var(--sunk); color: var(--ink); width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus, select:focus, textarea:focus { outline: 0; border-color: var(--mute); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .7; }
input[type=file] { font-size: .85rem; color: var(--mute); }
select option { background: var(--surface); color: var(--ink); }
input.bad, select.bad, textarea.bad { border-color: var(--neg); box-shadow: 0 0 0 3px var(--neg-bg); }
select.sr { position: absolute; opacity: 0; pointer-events: none; width: 1px !important; height: 1px; padding: 0 !important; }
details.more { border-top: 1px dashed var(--line2); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--ink2); font-size: .88rem; font-weight: 500; margin-bottom: 10px; }
.preview { margin-top: 14px; font-size: .88rem; display: grid; gap: 8px; }
.preview:empty { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto !important; }
.filters input[type=search] { min-width: 220px; }

/* ---------- 조각들 ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0 0 12px; font-size: .9rem; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.bar { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar.warn i { background: var(--neg); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.list li:last-child { border: 0; }
button.link { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 500; color: var(--ink); }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.picker { border: 1px solid var(--line2); border-radius: 12px; max-height: 190px; overflow-y: auto; padding: 4px; margin-bottom: 12px; background: var(--sunk); }
.picker label { display: flex; gap: 9px; align-items: center; padding: 7px 8px; font-size: .88rem; border-radius: 8px; cursor: pointer; }
.picker label:hover { background: var(--hover); }
.picker input[type=number] { width: 64px !important; padding: 3px 6px !important; }
pre.draft { white-space: pre-wrap; background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: .9rem; margin: 6px 0; }

/* ---------- 홈 ---------- */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 14px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.hero .cap { color: var(--mute); font-size: .88rem; font-weight: 500; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero .cap input, .hero .cap select { padding: 4px 9px !important; width: auto !important; border-radius: 8px !important; font-size: .82rem; }
.hero .amt { margin: 8px 0 2px; }
.hero .amt .num.big { font-size: 2.4rem; font-style: normal; color: var(--ink); }
.hero .amt .num.big.neg { color: var(--neg); }
.hero .sub { color: var(--mute); font-size: .86rem; }
.hero .sub b { color: var(--ink); font-weight: 600; }
.acts { display: grid; grid-template-columns: repeat(2, minmax(132px, 1fr)); gap: 8px; }
.act { border: 1px solid var(--line2); border-radius: 12px; padding: 11px 14px; background: var(--sunk); color: var(--ink); cursor: pointer; text-align: left; font-weight: 600; font-size: .93rem; display: flex; align-items: center; gap: 10px; transition: background .12s, transform .06s; }
.act small { display: block; font-weight: 400; color: var(--mute); font-size: .74rem; }
.act:hover { background: var(--hover); border-color: var(--mute); }
.act:active { transform: scale(.98); }
.act.main { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.act.main small { color: inherit; opacity: .6; }
.act.main:hover { opacity: .88; }
.todo { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border: 0; }
.todo .what { flex: 1; min-width: 0; }
.todo .what button.link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.todo .amt { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.todoh { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 500; color: var(--mute); margin: 14px 0 2px; }
.todoh:first-of-type { margin-top: 0; }
.seg { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--chip); margin: 4px 0 14px; gap: 2px; }
.seg i { display: block; height: 100%; min-width: 3px; border-radius: 3px; }
.legend { display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend span { flex: 1; color: var(--ink2); }
.c-stock { background: var(--c-stock); } .c-recv { background: var(--c-recv); } .c-chan { background: var(--c-chan); } .c-cash { background: var(--c-cash); }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 22px; }
.chart button { flex: 1; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; font-size: .74rem; color: var(--mute); font-weight: 500; }
.chart button i { display: block; width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: var(--line2); min-height: 3px; transition: background .12s; }
.chart button.cur i { background: var(--ink); }
.chart button.neg i { background: var(--neg); }
.chart button:hover i { background: var(--mute); }
.chart button b { font-size: .72rem; color: var(--ink2); font-weight: 500; font-variant-numeric: tabular-nums; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 14px 0; }
.steps3 div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.steps3 b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line2); background: var(--sunk); color: var(--ink); margin-bottom: 10px; font-weight: 600; }
.steps3 strong { display: block; font-weight: 600; }
.steps3 span { color: var(--mute); font-size: .86rem; }

.verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); }
.verdict .tag { font-size: .86rem; padding: 4px 12px; }

/* ---------- 모달 ---------- */
.overlay { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; z-index: 70; }
.modal { background: var(--surface); border: 1px solid var(--line2); border-radius: 18px; width: 100%; max-width: 580px; box-shadow: var(--shadow); animation: rise .2s cubic-bezier(.2, .8, .3, 1); }
.modal.wide { max-width: 900px; }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.mhead h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.mhead .x { border: 0; background: var(--hover); color: var(--mute); width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.mhead .x:hover { color: var(--ink); background: var(--hl); }
.mbody { padding: 16px 22px 22px; }
.mbody h4 { margin: 20px 0 8px; font-size: .9rem; font-weight: 600; color: var(--ink2); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 11px 18px; border-radius: 12px; z-index: 99; font-size: .9rem; font-weight: 500; max-width: 92vw; box-shadow: var(--shadow); animation: toastin .2s; }
/* ---------- 움직임: 짧고 부드럽게. '동작 줄이기' 설정이면 아래 미디어 쿼리가 전부 끈다 ---------- */
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes sheet { from { transform: translateY(100%); } }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes pulse { 50% { transform: scale(1.18); } }
.overlay { animation: fadein .16s ease-out; }
/* 화면을 옮겼을 때만(main.enter) 위에서부터 차례로 올라온다. 저장할 때마다 다시 움직이지는 않는다 */
main.enter > * { animation: up .38s cubic-bezier(.2, .7, .2, 1) both; }
main.enter > :nth-child(2) { animation-delay: .04s; } main.enter > :nth-child(3) { animation-delay: .08s; } main.enter > :nth-child(4) { animation-delay: .12s; } main.enter > :nth-child(n+5) { animation-delay: .16s; }
main.enter .grid > * { animation: up .42s cubic-bezier(.2, .7, .2, 1) both; }
main.enter .grid > :nth-child(1) { animation-delay: .08s; } main.enter .grid > :nth-child(2) { animation-delay: .12s; } main.enter .grid > :nth-child(3) { animation-delay: .16s; } main.enter .grid > :nth-child(n+4) { animation-delay: .2s; }
main.enter .bar i, main.enter .seg i { transform-origin: left; animation: growx .7s .18s cubic-bezier(.2, .7, .2, 1) both; }
main.enter .chart button i { transform-origin: bottom; animation: growy .6s cubic-bezier(.2, .7, .2, 1) both; }
main.enter .chart button:nth-child(1) i { animation-delay: .1s; } main.enter .chart button:nth-child(2) i { animation-delay: .15s; } main.enter .chart button:nth-child(3) i { animation-delay: .2s; } main.enter .chart button:nth-child(4) i { animation-delay: .25s; } main.enter .chart button:nth-child(5) i { animation-delay: .3s; } main.enter .chart button:nth-child(6) i { animation-delay: .35s; }
main.enter .todo { animation: up .32s .2s both; }
.swap > * { animation: up .22s cubic-bezier(.2, .7, .2, 1) both; }
.side a.nv .badge { animation: pulse .5s .3s 1; }
/* 눌렀을 때·올렸을 때의 반응 */
.side a.nv, .side .srow, .ws, .chip, .tabs button, .card, .act, .promo, tr.click td, .picker label, .mhead .x, button.num, .bar i { transition: background-color .14s, border-color .14s, color .14s, transform .14s, box-shadow .14s, opacity .14s; }
.side a.nv .ico, .side .srow .ico { transition: transform .16s; }
.side a.nv:hover .ico, .side .srow:hover .ico { transform: scale(1.08); }
.act:hover { transform: translateY(-1px); }
.chip:active, .tabs button:active, .side a.nv:active { transform: scale(.97); }
.grid .card.stat:hover, .steps3 div:hover { border-color: var(--line2); transform: translateY(-2px); }
.steps3 div { transition: border-color .14s, transform .14s; }
.thumbs img { transition: transform .16s; } .thumbs a:hover img { transform: scale(1.04); }
details.more[open] > .form { animation: up .2s both; }
/* 테마를 바꾸는 순간에만 색이 부드럽게 넘어간다 */
html.theming *, html.theming *::before { transition: background-color .28s, border-color .28s, color .28s !important; }
@media (max-width: 860px) { .modal, .modal.wide { animation: sheet .26s cubic-bezier(.2, .8, .3, 1); } }

/* ---------- 모바일 ---------- */
@media (max-width: 860px) {
  .side { position: fixed; left: -280px; z-index: 60; transition: left .18s; }
  body.navopen .side { left: 0; box-shadow: 0 0 0 100vw var(--scrim); }
  .menu, .only-m { display: inline-flex !important; }
  .top { padding: 10px 12px 0; }
  main { padding: 12px 16px 110px; }
  .phead h1 { font-size: 1.3rem; }
  .cols { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 18px; }
  .hero .amt .num.big { font-size: 2rem; }
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 40; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bnav a, .bnav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 500; color: var(--mute); text-decoration: none; cursor: pointer; padding: 4px 0; }
  .bnav a.on { color: var(--ink); }
  .bnav .plus { width: 48px; height: 48px; border-radius: 15px; background: var(--ink); color: var(--on-ink); justify-content: center; margin: -18px auto 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }
  .bnav .plus .ico { width: 24px; height: 24px; }
  .toast { bottom: 84px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { border-radius: 20px 20px 0 0; max-width: none; max-height: 94vh; overflow-y: auto; }
  /* 표는 카드 목록으로 */
  .scroll table thead { display: none; }
  .scroll table, .scroll tbody { display: block; }
  .scroll tr { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--sunk); }
  .scroll tr.best { background: var(--hl); }
  .scroll td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 3px 0; text-align: right; background: none !important; }
  .scroll td::before { content: attr(data-label); color: var(--mute); font-size: .78rem; font-weight: 500; text-align: left; flex: none; }
  .scroll td:first-child { font-size: 1rem; font-weight: 600; text-align: left; padding-bottom: 6px; }
  .scroll td:first-child::before, .scroll td[data-label=""]::before { display: none; }
  .scroll td:empty { display: none; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.printbox { display: none; }
@media print {
  :root, :root[data-theme=dark] { --bg: #fff; --surface: #fff; --sunk: #fff; --ink: #000; --ink2: #222; --mute: #555; --line: #ccc; --line2: #bbb; --chip: #eee; --hl: #f3f3f3; color-scheme: light; }
  body.printing #app, body.printing .overlay, body.printing .toast { display: none !important; }
  body.printing .printbox { display: block; }
  .side, .top, .btn, .tabs, .filters, .bnav, .hero .acts { display: none !important; }
  .card { border: 0; padding: 0; break-inside: avoid; }
}

/* ---------- 로고와 시작 설정 ---------- */
.ws .logo, .ob .logo { background: var(--ink); color: var(--panel); }
.logo svg { width: 66%; height: 66%; display: block; }
.ob { min-height: 100vh; width: 100%; display: grid; place-items: center; padding: 32px 20px; }
.ob .box { width: 100%; max-width: 560px; animation: up .35s cubic-bezier(.2, .7, .2, 1) both; }
.ob .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; margin-bottom: 36px; }
.ob .logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.ob .steps { display: flex; gap: 6px; margin-bottom: 26px; }
.ob .steps i { height: 3px; flex: 1; border-radius: 9px; background: var(--line2); transition: background .2s; }
.ob .steps i.on { background: var(--ink); }
.ob h1 { font-size: 1.85rem; font-weight: 600; margin: 0 0 6px; line-height: 1.25; }
.ob .lead { color: var(--mute); margin: 0 0 26px; }
.ob h2 { font-size: .92rem; font-weight: 600; margin: 26px 0 10px; color: var(--ink2); }
.ob .field { margin-bottom: 16px; }
.ob .chip { padding: 9px 16px; font-size: .95rem; }
.ob .nav { display: flex; align-items: center; gap: 10px; margin-top: 34px; }
.ob .nav .sp { flex: 1; }
.ob .nav .btn { padding: 11px 22px; font-size: .98rem; }
.ob .skip { background: none; border: 0; color: var(--mute); cursor: pointer; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; }
