/*
 * 프로그램연구소 — AI 견적 상담 화면 (대화 · 사전 견적서 · 상담 신청)
 */

body[data-view="app"] { overflow: hidden; }
body[data-view="app"] main, body[data-view="app"] .ft { visibility: hidden; }

.app { position: fixed; z-index: 60; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--n1); color: var(--on); }
.app::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(50% 40% at 50% 0%, rgba(61, 87, 245, .18), transparent 70%); }

/* ── 왼쪽 메뉴 ── */
.rail { position: fixed; z-index: 72; top: 0; bottom: 0; left: 0; width: 288px; max-width: 86vw; display: flex; flex-direction: column; gap: 16px; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--n0); border-right: 1px solid var(--nl); overflow-y: auto; transform: translateX(-104%); transition: transform .3s var(--ease); }
.rail.is-open { transform: none; box-shadow: 30px 0 80px -30px #000; }
.rail-scrim { position: fixed; z-index: 71; inset: 0; background: rgba(4, 5, 12, .6); }
.rail-top { display: flex; align-items: center; justify-content: space-between; padding-left: 6px; }
.rail-top .logo { font-size: 17px; color: var(--on); }
.rail-top .logo img { width: 30px; height: 30px; }
.rail-new { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 14px; border-radius: 15px; background: rgba(255, 255, 255, .06); border: 1px solid var(--nl2); font-size: 15.5px; font-weight: 700; color: var(--on); transition: background-color .15s, border-color .15s; }
.rail-new:hover { background: rgba(255, 255, 255, .11); border-color: rgba(190, 200, 255, .45); }
.rail-new svg { color: var(--cy); stroke-width: 2.4; }
.rail-new kbd { margin-left: auto; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--nl2); font-family: var(--mono); font-size: 11px; color: var(--on3); }
.rail-sec { min-height: 0; }
.rail-label { padding: 0 10px 6px; font-size: 13px; font-weight: 700; color: var(--on3); }
.rail-empty { padding: 6px 10px; font-size: 14px; color: var(--on3); }
.recent-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.recent-list > li { min-width: 0; } /* 긴 제목이 칸을 넓혀 가로 스크롤이 생기지 않도록 말줄임 처리 */
.recent-list button { display: block; width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 500; color: var(--on2); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background-color .15s, color .15s; }
.recent-list button:hover, .recent-list button.is-on { background: rgba(255, 255, 255, .07); color: var(--on); }
.rail-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--nl); }
.rail-foot a, .rail-foot button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--on2); text-decoration: none; text-align: left; }
.rail-foot a:hover, .rail-foot button:hover { background: rgba(255, 255, 255, .06); color: var(--on); }
.rail-foot svg { width: 18px; height: 18px; color: var(--hi); }

/* ── 대화 ── */
.conv { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.conv-head { flex: none; display: flex; align-items: center; gap: 6px; height: 64px; padding: 0 12px 0 8px; border-bottom: 1px solid var(--nl); background: rgba(7, 9, 21, .7); backdrop-filter: blur(14px); }
.conv-title { flex: 1; min-width: 0; padding-left: 4px; }
.conv-title p { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-title span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--on3); }
.conv-title .live { width: 7px; height: 7px; }
.report-open { position: relative; }
.new-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--cy); box-shadow: 0 0 0 3px var(--n1); animation: ping-dot 1.6s ease-out 3; }
@keyframes ping-dot { 0% { box-shadow: 0 0 0 0 rgba(107, 233, 255, .7), 0 0 0 3px var(--n1); } 100% { box-shadow: 0 0 0 12px rgba(107, 233, 255, 0), 0 0 0 3px var(--n1); } }

.log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 16px 12px; }
.log:focus { outline: none; }
.dock { flex: none; padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(7, 9, 21, 0), var(--n1) 30%); }
.dock .composer-slot { max-width: 800px; margin: 0 auto; }
.dock .composer { padding: 12px 10px 8px 18px; border-radius: 22px; box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .9); }
.dock .composer::before { border-radius: 24px; }
.dock .composer:focus-within::before { border-radius: 25px; }
.dock .composer::after { border-radius: 22px; }
.dock .composer textarea { min-height: 28px; font-size: 17px; }
.dock .composer-bar { margin-top: 4px; }
.dock-note { max-width: 800px; margin: 8px auto 0; font-size: 12.5px; color: var(--on3); text-align: center; }

.msg { max-width: 800px; margin: 0 auto 26px; display: flex; gap: 12px; animation: msg-in .45s var(--ease-out) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.msg.me { justify-content: flex-end; }
.msg-bubble { max-width: 86%; padding: 12px 17px; border-radius: 20px 20px 6px 20px; background: #1E2650; border: 1px solid var(--nl2); color: var(--on); font-size: 16.5px; line-height: 1.6; white-space: pre-wrap; }
.msg-pics { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.msg-pics img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--nl2); }
.msg-pics span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 13px; color: var(--on2); }
.msg-me-col { display: flex; flex-direction: column; align-items: flex-end; max-width: 86%; }
.msg-me-col .msg-bubble { max-width: 100%; }
.msg-ava { flex: none; width: 36px; height: 36px; border-radius: 11px; overflow: hidden; box-shadow: 0 10px 20px -10px rgba(61, 87, 245, .9); }
.msg-ava img { display: block; width: 100%; height: 100%; }
.msg-body { flex: 1; min-width: 0; padding-top: 5px; }
.msg-name { margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: var(--on3); }
.msg-text { font-size: 16.5px; line-height: 1.8; color: #E4E8FA; }
.msg-text p + p, .msg-text p + ul, .msg-text ul + p { margin-top: 12px; }
.msg-text ul { display: grid; gap: 8px; }
.msg-text li { position: relative; padding-left: 20px; }
.msg-text li::before { content: ""; position: absolute; left: 4px; top: .74em; width: 7px; height: 7px; border-radius: 50%; background: var(--cy); }
.msg-text strong { color: #fff; font-weight: 700; }
.msg-text.is-typing > :last-child::after { content: ""; display: inline-block; width: 9px; height: 1.05em; margin-left: 3px; vertical-align: -0.18em; border-radius: 2px; background: var(--cy); animation: blink 1s steps(2) infinite; }
.msg-src { margin-top: 12px; font-size: 12.5px; color: var(--on3); }

/* 생각하는 단계 */
.think { display: grid; gap: 9px; margin-bottom: 6px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .035); border: 1px solid var(--nl); }
.think li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; font-weight: 600; color: var(--on3); transition: color .2s; }
.think li i { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(150, 165, 255, .3); }
.think li.is-now { color: var(--on); }
.think li.is-now i { border-color: rgba(107, 233, 255, .25); border-top-color: var(--cy); animation: spin .8s linear infinite; }
.think li.is-done { color: var(--on2); }
.think li.is-done i { border: 0; background: #34D399 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.3l3 3 6-6.3' fill='none' stroke='%2304130D' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; }
.think li small { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--on3); }
.think.is-folded { display: none; }

/* 대화 안의 견적 요약 */
.quote { display: grid; gap: 14px; width: 100%; margin-top: 18px; padding: 18px 20px; border-radius: 20px; background: linear-gradient(160deg, rgba(30, 38, 80, .9), rgba(14, 18, 40, .95)); border: 1px solid var(--nl2); text-align: left; color: var(--on); animation: pop .5s var(--ease) both; transition: border-color .2s, box-shadow .25s; }
button.quote:hover { border-color: rgba(157, 176, 255, .6); box-shadow: 0 24px 50px -24px rgba(61, 87, 245, .8); }
.quote-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quote-top p { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--on2); }
.quote-top p svg { width: 17px; height: 17px; color: var(--hi); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.quote .badge.t-ready, .quote .badge.t-scoped { background: rgba(52, 211, 153, .16); color: #6EE7B7; }
.quote .badge.t-consult, .quote .badge.t-manager { background: rgba(157, 176, 255, .18); color: #B9C6FF; }
.quote .badge.t-decline { background: rgba(255, 255, 255, .08); color: var(--on2); }
.quote-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quote-nums > div:first-child { grid-column: 1 / -1; }
.quote-nums p { font-size: 13px; font-weight: 600; color: var(--on3); }
.quote-nums b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.quote-nums > div:first-child b { font-family: var(--display); font-size: clamp(26px, 4vw, 32px); background: var(--grad-dark); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quote-more { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--hi); }
.quote-more svg { width: 15px; height: 15px; stroke-width: 2.4; }

.similar { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; width: 100%; margin-top: 12px; padding: 10px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--nl); text-align: left; color: var(--on); transition: border-color .2s, background-color .2s; animation: pop .5s .1s var(--ease) both; }
.similar:hover { border-color: var(--nl2); background: rgba(255, 255, 255, .07); }
.similar img { width: 120px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 10px; background: #F3F5F9; }
.similar small { display: block; font-size: 12.5px; font-weight: 700; color: var(--hi); }
.similar b { display: block; font-size: 15px; font-weight: 700; line-height: 1.4; }
.similar span { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--cy); }
.similar span svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quick button { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--nl2); background: rgba(255, 255, 255, .04); font-size: 15px; font-weight: 600; color: var(--on2); text-align: left; transition: border-color .15s, color .15s, background-color .15s; animation: pop .45s var(--ease) both; }
.quick button:nth-child(2) { animation-delay: .07s; }
.quick button:nth-child(3) { animation-delay: .14s; }
.quick button:hover { border-color: var(--hi); color: #fff; background: rgba(157, 176, 255, .12); }
.quick button.is-cta { background: var(--cta); border-color: transparent; color: #fff; }

/* ── 사전 견적서 패널 ── */
.report { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; background: #E9EDF6; color: var(--ink); transform: translateX(104%); transition: transform .34s var(--ease); }
.report.is-open { transform: none; box-shadow: -40px 0 90px -30px rgba(0, 0, 0, .7); }
.report-scrim { position: fixed; z-index: 69; inset: 0; background: rgba(4, 5, 12, .55); }
.report-top { flex: none; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 8px 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.report-top p { display: inline-flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 800; }
.report-top p svg { width: 19px; height: 19px; color: var(--brand); }
.report-top .icon-btn { color: var(--ink2); }
.report-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 28px; }
.report-body:focus { outline: none; }
.report-foot { flex: none; display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.report-foot .btn-cta { flex: 1; white-space: normal; }

.r-empty { display: grid; justify-items: center; gap: 22px; padding: 80px 24px; text-align: center; color: var(--ink3); font-size: 15px; }
.r-empty b { display: block; margin-bottom: 4px; font-size: 17px; color: var(--ink); }
.skel { display: grid; gap: 9px; width: 170px; padding: 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.skel i { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #E5E8F2 25%, #F3F5FA 50%, #E5E8F2 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel i:nth-child(2) { width: 72%; }
.skel i:nth-child(3) { width: 46%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.sheet { position: relative; background: #fff; border-radius: 8px 8px 18px 18px; border-top: 6px solid var(--ink); padding: 24px 18px 22px; box-shadow: 0 30px 60px -36px rgba(10, 12, 23, .5), 0 0 0 1px rgba(10, 12, 23, .05); }
.sheet-hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; min-height: 92px; }
.sheet-title { font-family: var(--display); font-weight: 800; font-size: 27px; letter-spacing: -0.035em; line-height: 1.25; }
.sheet-meta { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink3); line-height: 1.75; }
.stamp { flex: none; width: 92px; height: 92px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid var(--seal); outline: 1px solid var(--seal); outline-offset: -8px; color: var(--seal); font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.2; transform: rotate(-9deg); opacity: .92; }
.stamp.s-ink { border-color: var(--brand); outline-color: var(--brand); color: var(--brand); }
.stamp.s-off { border-color: var(--ink3); outline-color: var(--ink3); color: var(--ink3); border-style: dashed; }
.stamp.s-3 { font-size: 15.5px; }
.stamp.is-landing { animation: stamp-land .42s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes stamp-land { from { transform: rotate(-9deg) scale(1.9); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: .92; } }

.verdict { margin-top: 14px; padding: 15px 16px; border-radius: 14px; background: var(--p1); font-size: 15px; line-height: 1.6; color: var(--ink2); }
.verdict strong { display: block; margin-bottom: 3px; font-size: 16.5px; color: var(--ink); }
.verdict.t-ready, .verdict.t-scoped { background: #EEFAF4; }
.verdict.t-consult, .verdict.t-manager { background: var(--brand-w); }
.verdict-reasons { margin-top: 10px; padding-left: 18px; list-style: disc; font-size: 14.5px; color: var(--ink2); }
.req { margin-top: 16px; font-size: 15px; line-height: 1.65; }
.req dt { font-size: 12.5px; font-weight: 800; color: var(--ink3); }
.req dd + dt { margin-top: 10px; }

.s-sec { margin-top: 26px; }
.s-sec > h3 { display: flex; align-items: baseline; gap: 8px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.s-sec > h3 small { font-size: 12.5px; font-weight: 600; color: var(--ink3); }

/* AI 진단 (기능별 가능 여부) */
.diag { display: grid; }
.diag li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.diag b { font-size: 15px; font-weight: 700; }
.diag p { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink3); line-height: 1.55; }
.diag .loading p { width: 70%; height: 10px; margin-top: 6px; border-radius: 5px; background: linear-gradient(90deg, #E5E8F2 25%, #F3F5FA 50%, #E5E8F2 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.pillx { align-self: center; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.pillx::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pillx.ok { background: var(--ok-w); color: var(--ok); }
.pillx.check { background: var(--warn-w); color: var(--warn); }
.pillx.no { background: var(--bad-w); color: var(--bad); }
.pillx.wait { background: var(--p2); color: var(--ink3); }

/* 구성안 */
.bp { display: grid; margin-top: 14px; }
.bp li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 0 12px; padding-bottom: 14px; animation: pop .45s var(--ease) both; }
.bp li:nth-child(2) { animation-delay: .08s; } .bp li:nth-child(3) { animation-delay: .16s; } .bp li:nth-child(4) { animation-delay: .24s; } .bp li:nth-child(5) { animation-delay: .32s; }
.bp li > i { grid-row: 1 / 3; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-w); color: var(--brand-dk); font-family: var(--mono); font-size: 13px; font-weight: 700; font-style: normal; }
.bp li::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line2); }
.bp li:last-child { padding-bottom: 0; }
.bp li:last-child::before { display: none; }
.bp b { font-size: 15px; line-height: 1.5; }
.bp span { font-size: 13.5px; color: var(--ink3); line-height: 1.5; }
.bp.is-screens { grid-template-columns: 1fr 1fr; gap: 8px; }
.bp.is-screens li { display: block; padding: 12px; border-radius: 14px; background: var(--p1); border: 1px solid var(--line); }
.bp.is-screens li::before { display: none; }
.bp.is-screens li > i { display: flex; align-items: center; gap: 5px; width: auto; height: 50px; margin-bottom: 10px; padding: 0 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: transparent; font-size: 0; }
.bp.is-screens li > i::before { content: ""; width: 38%; height: 8px; border-radius: 4px; background: var(--brand); opacity: .8; }
.bp.is-screens li > i::after { content: ""; flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.bp.is-screens b { display: block; font-size: 14.5px; }
.s-note { margin-top: 10px; font-size: 12.5px; color: var(--ink3); }

.sim-card { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; width: 100%; margin-top: 12px; padding: 10px; border-radius: 16px; background: var(--p1); border: 1px solid var(--line); text-align: left; transition: border-color .2s; }
.sim-card:hover { border-color: var(--brand); }
.sim-card img { width: 112px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.sim-card small { display: block; font-size: 12.5px; font-weight: 700; color: var(--brand-dk); }
.sim-card b { display: block; font-size: 14.5px; line-height: 1.4; }
.sim-card span { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--brand-dk); }
.sim-card span svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }

/* 기능 고르기 */
.feat { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.feat .chip { min-height: 40px; padding: 0 12px; font-size: 14px; }
.scale { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; padding: 4px; border-radius: 14px; background: var(--p2); }
.scale button { min-height: 44px; padding: 6px; border-radius: 10px; font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--ink3); }
.scale button[aria-pressed="true"] { background: #fff; color: var(--brand-dk); box-shadow: 0 2px 8px rgba(10, 12, 23, .12); }

/* 금액 */
.rows { font-variant-numeric: tabular-nums; }
.rows > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows dt { font-weight: 600; }
.rows dt small { display: block; font-size: 13px; font-weight: 400; color: var(--ink3); line-height: 1.5; }
.rows dd { text-align: right; white-space: nowrap; font-weight: 700; }
.rows .wide dd { white-space: normal; max-width: 13em; color: var(--ink2); font-size: 14px; }
.rows .sum { border-bottom: 0; padding-top: 16px; align-items: baseline; }
.rows .sum dt { font-weight: 800; }
.rows .sum dd { font-family: var(--display); font-size: 27px; letter-spacing: -0.035em; color: var(--brand-dk); white-space: normal; }
.rows .sub { border-bottom: 0; padding-top: 0; color: var(--ink2); }
.rows .sub dd { white-space: normal; font-weight: 700; }
.stack { display: flex; height: 12px; margin-top: 14px; border-radius: 99px; overflow: hidden; background: var(--p2); }
.stack i { height: 100%; }
.stack i:nth-child(1) { background: #0A0C17; }
.stack i:nth-child(2) { background: #3D57F5; }
.stack i:nth-child(3) { background: #6C4CF0; }
.stack i:nth-child(4) { background: #0C7FCC; }
.stack i:nth-child(5) { background: #8EA2FF; }
.stack i:nth-child(6) { background: #C1A6FF; }
.stack i:nth-child(n+7) { background: #B7BEE0; }

/* 일정 */
.gantt { display: grid; gap: 10px; margin-top: 14px; }
.gantt li { display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: center; font-size: 13.5px; }
.gantt li > span { font-weight: 700; color: var(--ink2); line-height: 1.35; }
.gantt li > span small { display: block; font-family: var(--mono); font-size: 11.5px; font-weight: 500; color: var(--ink3); }
.gantt li > div { position: relative; height: 22px; border-radius: 7px; background: var(--p1); }
.gantt li > div i { position: absolute; top: 0; bottom: 0; left: var(--s); width: var(--w); border-radius: 7px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: grow-x .6s var(--ease-out) both; transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: none; } }
.gantt-axis { display: flex; justify-content: space-between; margin: 6px 0 0 120px; font-family: var(--mono); font-size: 11.5px; color: var(--ink3); }

/* 직접 만들면 막히는 곳 */
.risks { display: grid; gap: 8px; margin-top: 14px; }
.risks li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 13px 14px; border-radius: 14px; background: #FFF6F5; border: 1px solid #F5D2CE; }
.risks svg { grid-row: 1 / 3; width: 20px; height: 20px; color: var(--bad); margin-top: 1px; }
.risks b { font-size: 14.5px; }
.risks span { font-size: 13.5px; color: var(--ink2); line-height: 1.55; }
.risks-us { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; line-height: 1.55; }
.risks-us b { color: #9DB0FF; }

.notes { margin-top: 22px; padding: 16px; border: 1px dashed var(--line2); border-radius: 14px; }
.notes h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.notes ul { padding-left: 18px; list-style: disc; font-size: 14.5px; color: var(--ink2); line-height: 1.65; }
.notes li + li { margin-top: 4px; }
.fine { margin-top: 18px; font-size: 13px; color: var(--ink3); line-height: 1.65; }
.manager { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--brand-w); color: var(--brand-dk); font-size: 14.5px; font-weight: 600; line-height: 1.6; }
.manager b { display: block; font-size: 16px; color: var(--ink); }

/* ── 상담 신청 ── */
.btn-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ink2); }
.btn-back:hover { background: rgba(10, 12, 23, .06); color: var(--ink); }
.btn-back svg { width: 18px; height: 18px; stroke-width: 2.2; }
.lead { padding: 4px 6px 12px; }
.lead h3 { margin-top: 12px; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.035em; line-height: 1.35; }
.lead h3:focus { outline: none; }
.lead-lead { margin-top: 8px; font-size: 15.5px; color: var(--ink2); }
.field { margin-top: 20px; min-width: 0; }
.field > label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 700; }
.field-row { display: grid; gap: 0 12px; }
.opt { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--ink3); }
.req-mark, .lead .req { margin-left: 4px; font-size: 13px; font-weight: 800; color: var(--seal); }
.field input[type="text"], .field input[type="tel"], .field input[type="email"], .field select, .field textarea { display: block; width: 100%; min-height: 52px; padding: 13px 14px; background: #fff; border: 1.5px solid var(--line2); border-radius: 13px; font-size: 17px; line-height: 1.5; color: var(--ink); }
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-w); }
.field [aria-invalid="true"] { border-color: var(--seal); }
.field ::placeholder { color: #626A82; opacity: 1; }
.err { margin-top: 8px; font-size: 14.5px; font-weight: 600; color: var(--seal); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.agree-l { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 15.5px; font-weight: 700; cursor: pointer; }
.agree-l input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--brand); }
.agree-d { margin: 4px 0 0 36px; font-size: 13.5px; color: var(--ink3); line-height: 1.65; }
.agree-d a { color: var(--brand-dk); font-weight: 700; text-underline-offset: 3px; }
.agree .err { margin-left: 36px; }
.send-fail { margin-top: 20px; padding: 16px; border-radius: 14px; background: var(--bad-w); border: 1px solid var(--seal); }
.send-fail p { font-size: 15px; font-weight: 600; line-height: 1.6; }
.send-fail .btn { margin-top: 12px; white-space: normal; }
.lead .btn-lg { margin-top: 24px; }

.done { display: grid; justify-items: center; gap: 8px; padding: 64px 20px; text-align: center; }
.done .stamp { width: 116px; height: 116px; font-size: 23px; margin-bottom: 18px; }
.done h3 { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.035em; }
.done h3:focus { outline: none; }
.done p { color: var(--ink2); font-size: 15.5px; max-width: 24em; }
.done .btn { margin-top: 18px; }

/* ══ 넓은 화면 ══ */
@media (min-width: 560px) {
  .sheet { padding: 30px 28px 26px; }
  .report-body { padding: 22px 20px 32px; }
  .log { padding: 34px 24px 14px; }
  .field-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .app { grid-template-columns: 288px minmax(0, 1fr); }
  .rail { position: relative; z-index: 2; transform: none; max-width: none; height: 100vh; height: 100dvh; }
  .rail-close, .conv-menu, .rail-scrim { display: none !important; }
  .conv-head { padding: 0 18px 0 22px; }
}
@media (min-width: 1360px) {
  .app { grid-template-columns: 288px minmax(0, 1fr) 560px; }
  .report { position: relative; z-index: 2; width: auto; height: 100vh; height: 100dvh; transform: none; transition: none; box-shadow: none !important; }
  .report-scrim, #report-close, .report-open { display: none !important; }
}

/* ══ 인쇄 (견적서만 A4로) ══ */
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; }
  body > *:not(.app) { display: none !important; }
  body[data-view="app"] { overflow: visible; }
  .app { position: static; display: block; background: #fff; }
  .app::before, .rail, .rail-scrim, .conv, .report-top, .report-foot, .report-scrim { display: none !important; }
  .report { position: static; transform: none; width: auto; height: auto; background: #fff; box-shadow: none !important; }
  .report-body { overflow: visible; padding: 0; }
  .sheet { box-shadow: none; border-radius: 0; padding: 0; }
  .feat, .scale, .sim-card { display: none !important; }
  .stamp.is-landing { animation: none; }
}
