/* 폰 화면 (docs/19). 기준: 갤럭시 S23+ 384×854, 디자인 시안 「폰 화면 시안」 */
:root { --ink: #17191C; --sub: #5F6875; --ground: #F3F4F6; --card: #fff; --line: #F0F1F3; --rail: #E4E7EB; --bar: #D3D8DE; --deal: #F08C00; --proj: #2F6FEB; --late: #D92D20; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: system-ui, 'Noto Sans KR', 'Malgun Gothic', sans-serif; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: contain; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
.page { padding: 30px 16px calc(180px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.page.plain { background: var(--card); min-height: 100dvh; padding-top: 22px; }
.head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.sub { font-size: 13px; color: var(--sub); }
.date { font-size: 14px; color: var(--sub); }
.card { background: var(--card); border-radius: 24px; }
.el { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 거름 */
.segs { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; background: var(--card); border-radius: 22px; padding: 4px; }
.seg button { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; font-weight: 500; color: var(--sub); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; }

/* 현황 맨 위 */
.hero { padding: 16px 20px; display: flex; align-items: flex-end; gap: 18px; }
.hero .n { font-size: 34px; font-weight: 700; letter-spacing: -1px; line-height: 1.2; }
.hero .n small { font-size: 17px; font-weight: 500; margin-left: 2px; }
.bars { flex: 1; display: flex; align-items: flex-end; gap: 4px; height: 58px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars i { display: block; width: 100%; border-radius: 3px; background: var(--bar); min-height: 2px; }
.bars i.on { background: var(--ink); }
.bars span { font-size: 11px; line-height: 1; height: 11px; color: var(--sub); }

/* 딜 줄 */
.list { padding: 14px 20px 0; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--sub); padding: 0 4px; }
.row { display: block; padding: 11px 0 10px; border-top: 1px solid var(--line); }
.row .top { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.row .name { font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -0.3px; }
.row .last { font-size: 13px; color: var(--sub); padding-left: 16px; margin-top: 1px; }
.track { position: relative; height: 16px; margin: 6px 4px 0; }
.track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rail); }
.track span { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.track .c { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.track .b { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; background: #fff; }
.track .o { width: 4px; height: 4px; border-radius: 50%; background: #C2C8D0; }
.track .r { width: 9px; height: 9px; background: var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.more { display: block; width: 100%; padding: 16px 0; font-size: 14px; color: var(--sub); border-top: 1px solid var(--line); }
.empty { padding: 28px 0 30px; text-align: center; font-size: 14px; color: var(--sub); }

/* 개인 파이프라인 줄 */
.lane { padding: 14px 20px 12px; display: block; }
.lane .top { display: flex; align-items: center; gap: 10px; }
.lane .name { font-size: 16px; font-weight: 500; flex: 1; }
.badge { background: var(--ink); color: #fff; border-radius: 12px; min-width: 24px; height: 24px; padding: 0 8px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin: -10px -12px -10px 0; color: var(--sub); }
.ghost { font-size: 13px; color: var(--sub); padding: 12px 6px; text-align: left; }

/* 줄 목록 (기록 · 히스토리 · 딜 고르기) */
.rows { padding: 6px 20px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.item:first-child, .row:first-child { border-top-color: transparent; }
.item .main { flex: 1; min-width: 0; }
.item .t { font-size: 16px; font-weight: 500; letter-spacing: -0.3px; }
.item .s { font-size: 13px; color: var(--sub); margin-top: 2px; }
.item .k { font-size: 13px; color: var(--sub); flex: none; }
.item .k.mine { color: var(--ink); font-weight: 700; }
.item .k.late { color: var(--late); }
.item .d { font-size: 13px; color: var(--sub); width: 40px; flex: none; }
.mark { width: 10px; height: 10px; flex: none; border: 2px solid currentColor; }
.mark.c { border-radius: 50%; background: currentColor; }
.mark.b { border-radius: 50%; background: #fff; }
.mark.o { border-radius: 50%; color: #C2C8D0; background: currentColor; }
.mark.r { border-radius: 1px; transform: rotate(45deg); color: var(--ink); background: currentColor; }
.mark.late { border-radius: 1px; transform: rotate(45deg); color: var(--late); background: #fff; }
.pill { flex: none; height: 40px; padding: 0 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.day { font-size: 13px; color: var(--sub); padding: 2px 6px 0; }

/* 딜 */
.back { width: 44px; height: 44px; display: flex; align-items: center; margin-left: 2px; }
.title { padding: 0 6px 6px; }
.title .who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sub); }
.title h1 { margin-top: 4px; font-size: 26px; letter-spacing: -0.6px; line-height: 1.3; }
.title p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--sub); }
.steps { padding: 20px 12px 18px; position: relative; display: flex; }
.steps::before { content: ''; position: absolute; left: 12%; right: 12%; top: 37px; height: 2px; background: var(--rail); }
.steps div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.steps b { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--bar); background: #fff; display: flex; align-items: center; justify-content: center; }
.steps .done b { background: var(--ink); border-color: var(--ink); }
.steps span { font-size: 13px; color: var(--sub); }
.steps .done span { color: var(--ink); font-weight: 700; }
.steps small { font-size: 11px; color: var(--sub); height: 12px; line-height: 1; }

/* 아래 고정: 큰 단추 · 탭 · 적기 단추 */
.foot { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; bottom: 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--ground) 70%, transparent); }
.plain .foot { background: var(--card); }
.cta { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border-radius: 18px; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700; }
.cta[disabled] { opacity: 0.35; }
.nav { position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; bottom: 0; background: var(--card); border-top: 1px solid #ECEEF1; display: flex; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--sub); }
.nav a.on { color: var(--ink); font-weight: 700; }
.fab { position: fixed; right: max(20px, calc(50% - 220px)); bottom: calc(92px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%; background: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(23, 25, 28, 0.25); }

/* 적기 */
.bar { display: flex; align-items: center; justify-content: space-between; }
.memo { border: 0; outline: 0; resize: none; width: 100%; height: 220px; padding: 4px 6px; font-size: 24px; font-weight: 500; line-height: 1.45; letter-spacing: -0.4px; background: transparent; }
.memo::placeholder { color: #B6BDC6; }
.kinds { display: flex; gap: 8px; padding: 0 2px; }
.kinds button { flex: 1; height: 48px; border-radius: 16px; background: var(--ground); font-size: 15px; font-weight: 500; }
.kinds button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; }
.field { background: var(--ground); border-radius: 18px; padding: 0 18px; height: 60px; display: flex; align-items: center; gap: 12px; margin: 0 2px; width: calc(100% - 4px); text-align: left; }
.field .l { font-size: 15px; color: var(--sub); width: 36px; flex: none; }
.field .v { font-size: 16px; font-weight: 500; flex: 1; }
.field .v.none { color: var(--sub); }
.field input { border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 500; flex: 1; min-width: 0; }

/* 아래에서 올라오는 창 */
#sheet { position: fixed; inset: 0; z-index: 10; background: rgba(23, 25, 28, 0.55); display: flex; align-items: flex-end; justify-content: center; }
#sheet[hidden], #toast[hidden] { display: none; }
.sheet { width: 100%; max-width: 480px; max-height: 86dvh; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.grip { width: 44px; height: 5px; border-radius: 3px; background: var(--bar); align-self: center; margin-bottom: 18px; flex: none; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.quote { background: var(--ground); border-radius: 16px; padding: 12px 16px; margin-top: 14px; }
.quote .t { font-size: 15px; font-weight: 500; letter-spacing: -0.3px; }
.search { display: flex; align-items: center; gap: 10px; height: 52px; border-radius: 16px; border: 1.5px solid var(--ink); padding: 0 16px; margin-top: 12px; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; }
.search input::placeholder { color: var(--sub); }
.picks { overflow-y: auto; margin-top: 6px; }
.picks .item { height: 58px; padding: 0; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(170px + env(safe-area-inset-bottom)); z-index: 20; background: var(--ink); color: #fff; font-size: 14px; padding: 12px 18px; border-radius: 14px; max-width: 88vw; }

/* 로그인 */
.auth { justify-content: center; gap: 16px; padding: 0 24px 80px; }
.auth h1 { text-align: center; margin-bottom: 24px; }
.code { height: 60px; border-radius: 18px; border: 1.5px solid var(--ink); padding: 0 18px; font-size: 22px; font-weight: 500; letter-spacing: 4px; text-align: center; outline: 0; width: 100%; }
.code::placeholder { letter-spacing: 0; font-size: 16px; color: var(--sub); }
.auth .ghost { text-align: center; }
.lane.fold { width: 100%; text-align: left; padding: 12px 20px; }
.lane.fold .name { color: var(--sub); font-size: 15px; }
.sheet.info { gap: 10px; overflow-y: auto; }
.sheet.info h2 { line-height: 1.35; }
.sheet.info .body { margin: 4px 0 0; font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.srcs { background: var(--ground); border-radius: 16px; padding: 10px 16px; }
.src { font-size: 13px; color: var(--sub); padding: 4px 0; }
.sheet.info .cta { margin-top: 10px; flex: none; }
button.main { min-width: 0; }
.cta.soft { background: var(--ground); color: var(--ink); }
