/* 화면 부품 (ui.js). 크기는 부모의 font-size(em)를 따른다.
   색: 부모의 .tone-sky / .tone-mint / .tone-rose / .tone-sand 가 --ac, --ac-soft 를 정한다. */
.tone-sky { --ac: #2b78e4; --ac-soft: #e6f0fd; --tone-bg: radial-gradient(70% 70% at 85% 90%, #c7dcf8 0%, transparent 70%), radial-gradient(60% 60% at 10% 10%, #f3f8fe 0%, transparent 70%), #e3eefb; }
.tone-mint { --ac: #2f8a5b; --ac-soft: #e1f3e8; --tone-bg: radial-gradient(70% 70% at 15% 90%, #cdeedb 0%, transparent 70%), radial-gradient(60% 60% at 90% 10%, #f2fbf5 0%, transparent 70%), #e4f4ea; }
.tone-rose { --ac: #c2477a; --ac-soft: #fbe6ef; --tone-bg: radial-gradient(70% 70% at 85% 15%, #f6d3e2 0%, transparent 70%), radial-gradient(60% 60% at 15% 90%, #efe4fb 0%, transparent 70%), #f8edf3; }
.tone-sand { --ac: #b8711a; --ac-soft: #fbeedb; --tone-bg: radial-gradient(70% 70% at 85% 85%, #f5ddbd 0%, transparent 70%), radial-gradient(60% 60% at 15% 15%, #fcf5e9 0%, transparent 70%), #f6ecdc; }

.ui { color: var(--text); line-height: 1.45; letter-spacing: -.015em; }
.ui .p { background: #fff; border-radius: .9em; border: 1px solid rgba(0, 0, 0, .05); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 .9em 2em -1em rgba(30, 40, 60, .28); padding: .9em 1em; }
.ui small { font-size: .78em; color: var(--grey); }
.ui b { font-weight: 650; color: var(--ink); }
.ui em { font-style: normal; }
.ui .t { display: block; margin-bottom: .5em; }
.ui svg { display: block; }
.ui .chips { display: flex; flex-wrap: wrap; gap: .35em; margin-top: .6em; }
.ui .chips span { font-size: .78em; padding: .15em .65em; border-radius: 99px; background: var(--ac-soft); color: var(--ac); font-weight: 600; transition: background .3s, color .3s; }
.ui .chips span.on { background: var(--ac); color: #fff; }
.ui-stack { display: grid; gap: .7em; }

.ui-chat { display: grid; gap: .6em; }
.ui-chat .me { margin-left: auto; width: fit-content; max-width: 88%; background: var(--ink); color: #fff; border-radius: 1em 1em .3em 1em; padding: .5em .8em; }
.ui-chat .ai { display: grid; gap: .3em; justify-items: start; padding-left: .9em; position: relative; }
.ui-chat .ai::before { content: ""; position: absolute; left: 0; top: .45em; width: .55em; height: .55em; border-radius: 50%; background: var(--ac); }
.ui-chat .ai small { font-weight: 600; color: var(--ac); }
.ui-chat .file { display: flex; align-items: center; gap: .6em; border: 1px solid var(--line); border-radius: .6em; padding: .45em .6em; font-size: .9em; }
.ui-chat .file b { font-size: .72em; color: #1f7a44; background: #e3f3e8; border-radius: .35em; padding: .2em .4em; }
.typing { display: inline-flex; gap: .25em; padding: .35em .1em; }
.typing i { width: .45em; height: .45em; border-radius: 50%; background: var(--grey); opacity: .35; animation: typing 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-.25em); } }

.ui-form label { display: grid; gap: .2em; font-size: .8em; color: var(--grey); margin-top: .45em; }
.ui-form label i { display: block; min-height: 1.9em; border: 1px solid var(--line); border-radius: .5em; padding: .3em .6em; font-style: normal; color: var(--ink); font-size: 1.15em; }
.ui-form .btn { display: block; margin-top: .8em; text-align: center; background: var(--ink); color: #fff; border-radius: 99px; padding: .5em; font-weight: 600; font-size: .9em; }

.ui-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55em; }
.ui-kpi .p { padding: .9em .8em; }
.ui-kpi small { display: block; }
.ui-kpi b { display: block; margin-top: .2em; font-size: 1.6em; letter-spacing: -.04em; line-height: 1.15; color: var(--ac); font-variant-numeric: tabular-nums; }

.ui-qa b { display: block; margin: .35em 0 .2em; font-size: 1.05em; }
.ui-qa p { margin: 0; padding-bottom: .35em; border-bottom: 1px dashed var(--line); }

.ui-steps ol { list-style: none; margin: .3em 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr); position: relative; }
.ui-steps ol::before, .ui-steps ol::after { content: ""; position: absolute; left: calc(50% / var(--n)); right: calc(50% / var(--n)); top: .72em; height: 2px; background: var(--line); }
.ui-steps ol::after { background: var(--ac); transform-origin: left; transform: scaleX(calc(var(--at) / (var(--n) - 1))); transition: transform .8s var(--glide, ease); }
.ui-steps li { position: relative; z-index: 1; text-align: center; font-size: .82em; color: var(--grey); }
.ui-steps li i { display: grid; place-items: center; width: 1.6em; height: 1.6em; margin: 0 auto .4em; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.ui-steps li i svg { width: 1em; height: 1em; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ui-steps li.done i { background: var(--ac); border-color: var(--ac); }
.ui-steps li.now { color: var(--ink); font-weight: 650; }
.ui-steps li.now i { border-color: var(--ac); box-shadow: 0 0 0 .3em var(--ac-soft); }
.ui-steps .note { display: block; margin-top: .7em; text-align: center; color: var(--ac); font-weight: 600; }

.ui-experts .who { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: .3em; }
.ui-experts .who i { display: grid; place-items: center; width: 2.3em; height: 2.3em; margin: 0 auto .3em; border-radius: 50%; background: var(--ac-soft); color: var(--ac); font-style: normal; font-weight: 700; }
.ui-experts .who b, .ui-experts .who small { display: block; }
.ui-experts .ask { margin-top: .7em; background: var(--panel); border-radius: .8em; padding: .5em .8em; font-size: .9em; }

.ui-table { padding: .5em .7em; }
.ui-table table { width: 100%; border-collapse: collapse; }
.ui-table th { text-align: left; font-size: .76em; color: var(--grey); font-weight: 500; padding: .35em .45em; border-bottom: 1px solid var(--line); }
.ui-table td { padding: .5em .45em; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.ui-table tr:last-child td { border-bottom: 0; }
.ui-table td:first-child { font-weight: 600; color: var(--ink); }
.ui-table tr.sel td { background: var(--ac-soft); }
.ui-table tr.sel td:first-child { box-shadow: inset .2em 0 0 var(--ac); }
.ui-table em { background: #fdecec; color: var(--danger); border-radius: .4em; padding: .1em .45em; font-weight: 600; }

.ui-chart svg { width: 100%; height: 5.4em; margin-top: .6em; }
.ui-chart polyline { fill: none; stroke: var(--ac); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ui-chart polygon { fill: var(--ac-soft); }

.ui-trio { border-radius: 1.1em 1.1em 1.1em .3em; padding: 1em 1.1em; max-width: 92%; }
.ui-trio.me { margin-left: auto; background: var(--ink); border-color: var(--ink); border-radius: 1.1em 1.1em .3em 1.1em; }
.ui-trio b { display: block; font-size: 1.3em; letter-spacing: 0; }
.ui-trio span { display: block; margin-top: .2em; color: var(--ac); font-weight: 600; }
.ui-trio small { display: block; margin-top: .2em; }
.ui-trio.me b, .ui-trio.me small { color: #fff; }
.ui-trio.me small { opacity: .7; }
.ui-trio.me span { color: #9cc3ff; }

.ui-list { padding: .3em .9em; }
.ui-list .row { display: grid; grid-template-columns: auto 1fr auto; gap: .7em; align-items: center; padding: .55em .3em; border-bottom: 1px solid var(--hair); border-radius: .5em; }
.ui-list .row:last-child { border-bottom: 0; }
.ui-list .row.sel { background: var(--ac-soft); border-bottom-color: transparent; }
.ui-list .a { font-weight: 650; color: var(--ink); }
.ui-list .a.mono { font: 600 .82em var(--mono); color: var(--ac); }
.ui-list .b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-list em { font-size: .78em; padding: .12em .6em; border-radius: 99px; background: var(--ac-soft); color: var(--ac); font-weight: 600; white-space: nowrap; }
.ui-list .row.sel em { background: #fff; }

.ui-check .row { display: flex; align-items: center; gap: .6em; padding: .35em 0; }
.ui-check .row i { display: grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; border: 2px solid var(--line); flex: none; transition: background .3s, border-color .3s; }
.ui-check .row i svg { width: .85em; height: .85em; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ui-check .row.ok i { background: var(--ac); border-color: var(--ac); }
.ui-check .row.ok span { color: var(--grey); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .2); }

.ui-bars .row { display: grid; grid-template-columns: 5em 1fr 3.4em; align-items: center; gap: .6em; padding: .28em 0; }
.ui-bars .row i { height: .65em; border-radius: 99px; background: var(--panel); position: relative; overflow: hidden; }
.ui-bars .row i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ac); border-radius: inherit; transition: width .8s var(--glide, ease); }
.ui-bars .row em { font-size: .82em; color: var(--grey); text-align: right; font-variant-numeric: tabular-nums; }

.ui-gantt .row { display: grid; grid-template-columns: 5.2em 1fr; align-items: center; gap: .6em; padding: .3em 0; font-size: .9em; }
.ui-gantt .track { position: relative; height: 1.1em; background: var(--panel); border-radius: .35em; }
.ui-gantt .track i { position: absolute; top: 0; bottom: 0; left: calc(var(--s) / 8 * 100%); width: calc(var(--n) / 8 * 100%); background: var(--ac); border-radius: .35em; transition: left .7s var(--spring, ease), width .7s var(--spring, ease); }
.ui-gantt .flag { text-align: right; margin-top: .3em; }
.ui-gantt .flag span { font-size: .78em; font-weight: 700; color: var(--danger); background: #fdecec; border-radius: .4em; padding: .15em .5em; }

.ui-merge { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6em; }
.ui-merge .from, .ui-merge .to { display: grid; gap: .45em; }
.ui-merge .from .p { padding: .45em .7em; font-weight: 600; color: var(--ink); font-size: .92em; }
.ui-merge .from small { display: block; font-weight: 500; }
.ui-merge .to .p { padding: .7em .8em; font-weight: 650; color: var(--ink); border-left: .3em solid var(--ac); }
.ui-merge .to .p.wait { border-left-color: var(--line); color: var(--muted); font-weight: 500; border-style: dashed; box-shadow: none; }
.ui-merge .arr { width: 2em; height: 2em; fill: none; stroke: var(--ac); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.ui-frames .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45em; }
.ui-frames .row span { aspect-ratio: 16 / 10; display: grid; place-items: center; border-radius: .5em; background: var(--panel); border: 1px dashed var(--line); color: var(--muted); font-size: .78em; font-weight: 600; position: relative; overflow: hidden; }
.ui-frames .row span.busy { border-style: solid; color: var(--ac); background: linear-gradient(110deg, var(--ac-soft) 30%, #fff 50%, var(--ac-soft) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
.ui-frames .row span.ready { border-style: solid; color: #fff; background: linear-gradient(135deg, var(--ac), color-mix(in srgb, var(--ac) 55%, #fff)); }
@keyframes shimmer { to { background-position: -220% 0; } }
.ui-frames .prog { margin-top: .8em; height: .45em; border-radius: 99px; background: var(--panel); overflow: hidden; }
.ui-frames .prog i { display: block; height: 100%; width: var(--w); background: var(--ac); transition: width .9s var(--glide, ease); }
.ui-frames small { display: block; margin-top: .4em; }

.ui-week .row { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .8em; color: var(--grey); }
.ui-week .row i { display: grid; place-items: center; width: 1.8em; height: 1.8em; margin: 0 auto .35em; border-radius: 50%; border: 2px solid var(--line); }
.ui-week .row i svg { width: 1em; height: 1em; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ui-week .row .on i { background: var(--ac); border-color: var(--ac); }
.ui-week .note { display: block; margin-top: .7em; text-align: center; color: var(--ac); font-weight: 600; }

.ui-files { display: grid; gap: .5em; }
.ui-files .p { display: flex; align-items: center; gap: .7em; padding: .75em .9em; font-weight: 600; color: var(--ink); }
.ui-files .p b { font-size: .72em; border-radius: .35em; padding: .25em .45em; }
.ui-files .p b.pptx { background: #fdeee6; color: #c4501a; }
.ui-files .p b.pdf { background: #fdecec; color: var(--danger); }
.ui-files .p b.xlsx { background: #e3f3e8; color: #1f7a44; }
.ui-files small { text-align: center; }

.ui-detail .hd { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding-bottom: .5em; border-bottom: 1px solid var(--line); }
.ui-detail .hd em { font-size: .76em; font-weight: 700; padding: .15em .6em; border-radius: 99px; background: var(--ac); color: #fff; white-space: nowrap; }
.ui-detail .row { display: grid; grid-template-columns: 6em 1fr; gap: .6em; padding: .45em 0; border-bottom: 1px solid var(--hair); }
.ui-detail .row:last-child { border-bottom: 0; }
.ui-detail .row span { color: var(--ink); font-weight: 500; }

.ui-sms { display: grid; gap: .45em; }
.ui-sms .to { font-weight: 600; }
.ui-sms .bubble { background: var(--ac); color: #fff; border-radius: 1.1em 1.1em 1.1em .3em; padding: .8em 1em; max-width: 92%; font-weight: 500; box-shadow: 0 .8em 1.6em -1em color-mix(in srgb, var(--ac) 70%, transparent); }

.ui-upload { display: flex; gap: .8em; align-items: center; }
.ui-upload .ico { display: grid; place-items: center; width: 2.6em; height: 2.6em; border-radius: .7em; background: var(--ac-soft); flex: none; }
.ui-upload .ico svg { width: 1.3em; height: 1.3em; fill: none; stroke: var(--ac); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ui-upload > div { flex: 1; min-width: 0; }
.ui-upload b, .ui-upload small { display: block; }
.ui-upload .bar { height: .4em; border-radius: 99px; background: var(--panel); overflow: hidden; margin-top: .5em; }
.ui-upload .bar i { display: block; height: 100%; width: 100%; background: var(--ac); }

.ui-slides { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5em; }
.ui-slides .p { aspect-ratio: 16 / 9; padding: .6em .7em; display: flex; flex-direction: column; justify-content: space-between; }
.ui-slides .p i { display: block; height: .45em; width: 60%; border-radius: 99px; background: var(--ac-soft); }
.ui-slides .p b { font-size: .85em; }

.ui-done { display: grid; justify-items: center; text-align: center; gap: .5em; padding: 1em 0; }
.ui-done .ring { width: 3.6em; height: 3.6em; }
.ui-done svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ui-done circle { stroke: var(--ac); stroke-width: 3; fill: var(--ac-soft); }
.ui-done path { stroke: var(--ac); stroke-width: 4; }
.ui-done b { font-size: 1.2em; }
.ui-done small { font-size: .9em; max-width: 24em; }

/* 움직임: 데모 화면이 바뀔 때(.demo-view.enter)와 카드 위에 올렸을 때(.cv.live)만 */
.enter .ui .p, .enter .ui-sms > *, .enter .ui-done > *, .live .ui .p { animation: uiIn .5s var(--glide, ease) both; }
.enter .ui-list .row, .enter .ui-table tbody tr, .enter .ui-check .row, .enter .ui-bars .row, .enter .ui-gantt .row, .enter .ui-merge .from .p, .enter .ui-slides .p, .enter .ui-chat > *,
.live .ui-list .row, .live .ui-table tbody tr, .live .ui-check .row, .live .ui-bars .row, .live .ui-gantt .row, .live .ui-merge .from .p { animation: uiIn .45s var(--glide, ease) both; }
.enter .ui-list .row:nth-child(2), .enter .ui-table tbody tr:nth-child(2), .enter .ui-check .row:nth-child(3), .enter .ui-bars .row:nth-child(3), .enter .ui-gantt .row:nth-child(2), .enter .ui-merge .from .p:nth-child(2), .enter .ui-slides .p:nth-child(2), .enter .ui-chat > :nth-child(2),
.live .ui-list .row:nth-child(2), .live .ui-table tbody tr:nth-child(2), .live .ui-check .row:nth-child(3), .live .ui-bars .row:nth-child(3), .live .ui-gantt .row:nth-child(2), .live .ui-merge .from .p:nth-child(2) { animation-delay: .09s; }
.enter .ui-list .row:nth-child(3), .enter .ui-table tbody tr:nth-child(3), .enter .ui-check .row:nth-child(4), .enter .ui-bars .row:nth-child(4), .enter .ui-gantt .row:nth-child(3), .enter .ui-merge .from .p:nth-child(3), .enter .ui-slides .p:nth-child(3), .enter .ui-chat > :nth-child(3),
.live .ui-list .row:nth-child(3), .live .ui-table tbody tr:nth-child(3), .live .ui-check .row:nth-child(4), .live .ui-bars .row:nth-child(4), .live .ui-gantt .row:nth-child(3), .live .ui-merge .from .p:nth-child(3) { animation-delay: .18s; }
.enter .ui-bars .row:nth-child(5), .enter .ui-gantt .row:nth-child(4), .enter .ui-slides .p:nth-child(4), .live .ui-bars .row:nth-child(5), .live .ui-gantt .row:nth-child(4) { animation-delay: .27s; }
.enter .ui-bars .row i::before, .live .ui-bars .row i::before { animation: barGrow .9s var(--glide, ease) .15s both; }
.enter .ui-chart polyline, .live .ui-chart polyline { stroke-dasharray: 1; animation: draw 1.1s var(--glide, ease) both; }
.enter .ui-steps li.now i, .live .ui-steps li.now i { animation: pulseRing 1.6s ease-out infinite; }
.enter .ui-steps ol::after, .live .ui-steps ol::after { animation: stepFill .9s var(--glide, ease) both; }
.enter .ui-merge.merged .to .p { animation: popIn .55s var(--spring, ease) both; }
.enter .ui-merge.merged .to .p:nth-child(2) { animation-delay: .12s; }
.enter .ui-merge.merged .from .p { animation: squeeze .6s var(--glide, ease) both; }
.enter .ui-merge .arr path, .live .ui-merge .arr path { stroke-dasharray: 30; animation: dash .6s var(--glide, ease) .2s both; }
.enter .ui-upload .bar i { animation: barGrow 1.2s var(--glide, ease) both; }
.enter .ui-sms .bubble { animation: popIn .6s var(--spring, ease) .1s both; transform-origin: 0 100%; }
.enter .ui-done circle { stroke-dasharray: 151; animation: dashCircle .7s var(--glide, ease) both; }
.enter .ui-done path { stroke-dasharray: 40; animation: dashCheck .45s var(--glide, ease) .45s both; }
.enter .ui-done .ring { animation: popIn .6s var(--spring, ease) both; }
.enter .ui-kpi .p:nth-child(2), .live .ui-kpi .p:nth-child(2) { animation-delay: .09s; }
.enter .ui-kpi .p:nth-child(3), .live .ui-kpi .p:nth-child(3) { animation-delay: .18s; }
.enter .ui-week .row span.on i { animation: popIn .45s var(--spring, ease) both; }
.enter .ui-week .row span:nth-child(2) i { animation-delay: .06s; } .enter .ui-week .row span:nth-child(3) i { animation-delay: .12s; } .enter .ui-week .row span:nth-child(4) i { animation-delay: .18s; } .enter .ui-week .row span:nth-child(5) i { animation-delay: .24s; }
.enter .ui-check .row.ok i { animation: popIn .45s var(--spring, ease) both; }
@keyframes uiIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.82); } }
@keyframes barGrow { from { width: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dash { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes dashCircle { from { stroke-dashoffset: 151; } to { stroke-dashoffset: 0; } }
@keyframes dashCheck { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes stepFill { from { transform: scaleX(0); } }
@keyframes squeeze { 60% { transform: translateX(.6em) scale(.96); } to { opacity: .55; transform: translateX(.6em) scale(.94); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac) 45%, transparent); } 100% { box-shadow: 0 0 0 .7em transparent; } }

@media (prefers-reduced-motion: reduce) {
  .ui *, .ui *::before, .ui *::after { animation: none !important; transition: none !important; }
}
