/*
 * 모듈 소개 페이지의 «움직이는 화면». 움직임의 순서는 demo.js 가 대본대로 .is-깃발 을 붙여 가며 정하고,
 * 깃발마다 무엇이 보일지는 여기서 정한다. 숨길 때는 display 가 아니라 opacity 로 — 무대 높이가 변하지 않게.
 *
 * 1) 무대 공통(.demo*)  2) 화면 부품(.dm-*)  3) 모듈별 장면
 */

/* ---------- 1) 무대 공통 ---------- */
.demo {
  display: flex; flex-direction: column;
  border: 1px solid #E5E7EB; border-radius: 14px; background: #FFFFFF; overflow: hidden;
  box-shadow: 0 1px 2px rgba(10,10,10,.04), 0 12px 32px -12px rgba(10,10,10,.12);
  font-size: 14px; line-height: 1.45; color: #0A0A0A;
}
.demo-bar {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  background: #FAFAFA; border-bottom: 1px solid #E5E7EB;
}
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: #D1D5DB; }
.demo-bar span { margin-left: 8px; font-size: 12px; font-weight: 500; color: #6B7280; }
.demo-body { flex: 1; padding: 16px; background: #F4F5F7; }
.demo-cap {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 10px 10px 18px;
  background: #0A0A0A; color: #FFFFFF;
}
.demo-cap p { flex: 1; margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.demo-cap p.swap { animation: demo-swap .32s ease; }
@keyframes demo-swap { 0% { opacity: .2; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
.demo-cap button {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #374151;
  background: transparent; color: #D1D5DB; font-size: 16px; line-height: 1; cursor: pointer;
  transition: background-color .18s, color .18s;
}
.demo-cap button:hover { background: #1f1f1f; color: #FFFFFF; }

.demo-rest { visibility: hidden; }
.typing .demo-typed::after {
  content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -.14em;
  background: #0A0A0A; animation: demo-caret 1s steps(1) infinite;
}
@keyframes demo-caret { 50% { opacity: 0; } }

/* ---------- 2) 화면 부품 ---------- */
.dm-card { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 16px; }
.dm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dm-head b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

/* 상태 뱃지 — 같은 자리에 겹쳐 두고 깃발에 따라 하나만 보인다 */
.dm-badges { display: grid; justify-items: end; }
.dm-badges > * { grid-area: 1 / 1; opacity: 0; transform: scale(.9); transition: opacity .25s, transform .25s; }
.dm-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dm-badge.gray { background: #F3F4F6; color: #4B5563; }
.dm-badge.blue { background: #DBEAFE; color: #1E40AF; }
.dm-badge.green { background: #DCFCE7; color: #166534; }

.dm-fields { margin: 0; display: grid; gap: 8px; }
.dm-fields > div { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; }
.dm-fields dt { font-size: 12px; color: #6B7280; }
.dm-fields dd { margin: 0; font-size: 14px; }
.dm-input { min-height: 36px; padding: 7px 10px; border: 1px solid #E5E7EB; border-radius: 8px; transition: border-color .18s, box-shadow .18s; }
.dm-input.typing, .dm-input:has(.typing) { border-color: #0A0A0A; box-shadow: 0 0 0 3px rgba(217,249,157,.7); }

.dm-btn {
  position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 8px;
  background: #0A0A0A; color: #FFFFFF; font-size: 13px; font-weight: 600;
  transition: transform .15s, opacity .3s, filter .15s;
}
.dm-btn.pressed { transform: scale(.93); filter: brightness(1.5); }
/* 누르는 자리에 번지는 고리 — 누를 수 있는 것([data-p]) 공통 */
[data-p] { position: relative; }
[data-p]::before {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 2; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; background: #84CC16; opacity: 0; pointer-events: none;
}
[data-p].pressed::before { animation: demo-tap .5s ease-out; }
@keyframes demo-tap { 0% { opacity: .6; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.8); } }

.dm-check {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #D1D5DB; color: transparent; font-size: 13px; font-weight: 700; line-height: 1;
  transition: background-color .25s, border-color .25s, color .25s, transform .25s;
}
.dm-check::before { content: "✓"; }
[data-n] { display: inline-block; font-style: normal; transition: transform .2s, color .2s; }
[data-n].bump { transform: scale(1.25); color: #65A30D; }

/* 눌러서 고르는 칸 — 선택 상자·날짜 칸. 고르기 전 글은 흐리게, 고른 뒤 진하게 */
[data-v] { color: #9CA3AF; transition: color .2s; }
[data-v].filled { color: #0A0A0A; }
.dm-select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 7px 10px;
  border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF; transition: border-color .18s, box-shadow .18s;
}
.dm-select::after { content: ""; flex: none; width: 7px; height: 7px; margin: -3px 2px 0 0; border: solid #9CA3AF; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.dm-select.open, .dm-select.pressed, .dm-input.pressed, .dm-pick.open, .dm-pick.pressed { border-color: #0A0A0A; box-shadow: 0 0 0 3px rgba(217,249,157,.7); }
.dm-menu {
  position: absolute; left: -1px; top: calc(100% + 4px); z-index: 5; min-width: calc(100% + 2px); margin: 0; padding: 4px; list-style: none;
  background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 8px; box-shadow: 0 10px 24px -8px rgba(10,10,10,.25);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .16s, transform .16s;
}
.open > .dm-menu { opacity: 1; transform: none; }
.dm-menu li { padding: 6px 8px; border-radius: 6px; font-size: 13px; font-weight: 400; color: #374151; white-space: nowrap; transition: background-color .12s, color .12s; }
.dm-menu li.hit { background: #0A0A0A; color: #FFFFFF; }
.dm-pick {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid #D1D5DB; border-radius: 8px;
  background: #FFFFFF; font-size: 13px; font-weight: 500; transition: border-color .18s, box-shadow .18s, opacity .25s;
}
.dm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border: 1px solid #E5E7EB; border-radius: 999px;
  font-size: 12.5px; color: #374151; white-space: nowrap; transition: background-color .2s, border-color .2s, color .2s;
}

/* ---------- 3) 장면: 전자결재 — 양식 고르기 → 결재라인 → 눌러서 채우기 → 상신 → 결재 → 뒷처리 ---------- */
.dm-approval { display: grid; gap: 12px; }
@media (min-width: 640px) { .dm-approval { grid-template-columns: 1.6fr 1fr; } }
.dm-approval .dm-fields > div { grid-template-columns: 52px minmax(0, 1fr); }

.dm-approval .dm-badges .b-draft { opacity: 1; transform: none; }
.is-sent .dm-badges .b-draft { opacity: 0; transform: scale(.9); }
.is-sent .dm-badges .b-prog, .is-done .dm-badges .b-done { opacity: 1; transform: none; }
.is-done .dm-badges .b-prog { opacity: 0; transform: scale(.9); }

/* 양식을 고르면 그 양식의 칸이 나타난다 */
.dm-approval .f-leave { opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.is-form .f-leave { opacity: 1; transform: none; }
.is-form .f-leave:nth-of-type(4) { transition-delay: .08s; }
.is-form .f-leave:nth-of-type(5) { transition-delay: .16s; }

/* 결재선 — 「결재라인 선택」 자리에 결재자가 들어온다 */
.dm-linebox { display: grid; }
.dm-linebox > * { grid-area: 1 / 1; }
.dm-linebox .dm-pick { justify-self: start; }
.is-line .dm-linebox .dm-pick { opacity: 0; }
.dm-signers { display: flex; gap: 6px; }
.dm-signer {
  position: relative; flex: 1; min-width: 0; padding: 5px 10px; border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF;
  opacity: 0; transform: translateX(-8px); transition: opacity .35s, transform .35s, border-color .25s, box-shadow .25s;
}
.dm-signer small { display: block; font-size: 10.5px; line-height: 1.2; color: #6B7280; }
.dm-signer b { display: block; font-size: 13px; line-height: 1.25; font-weight: 600; white-space: nowrap; }
.is-line .dm-signer { opacity: 1; transform: none; }
.is-line .dm-signer.s2 { transition-delay: .18s, .18s, 0s, 0s; }
/* 지금 결재할 차례인 사람 */
.is-sent:not(.is-ok1) .dm-signer.s1, .is-ok1:not(.is-ok2) .dm-signer.s2 { border-color: #0A0A0A; box-shadow: 0 0 0 3px #D9F99D; }
/* 도장 — 위에서 찍히듯 */
.dm-stamp {
  position: absolute; right: 5px; top: 50%; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -15px;
  border: 2px solid #DC2626; border-radius: 50%; background: rgba(255,255,255,.9); color: #DC2626; font-size: 10.5px; font-weight: 700;
  opacity: 0; transform: rotate(-12deg) scale(1.9); transition: opacity .16s, transform .28s cubic-bezier(.2,1.4,.4,1);
}
.is-ok1 .s1 .dm-stamp, .is-ok2 .s2 .dm-stamp { opacity: 1; transform: rotate(-12deg) scale(1); }

.dm-dates { display: flex; align-items: center; gap: 6px; color: #9CA3AF; }
.dm-dates .dm-input { flex: 1; min-width: 0; padding: 7px 8px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.is-why .dm-chip[data-p="why"] { background: #0A0A0A; border-color: #0A0A0A; color: #FFFFFF; }

.dm-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.is-sent .dm-actions .dm-btn { opacity: .3; }

.dm-after { display: flex; flex-direction: column; gap: 10px; border-style: dashed; background: transparent; transition: background-color .35s, border-color .35s; }
.dm-after > p { margin: 0; font-size: 12px; font-weight: 600; color: #6B7280; }
.is-done .dm-after { background: #FFFFFF; border-style: solid; }
.dm-auto { display: flex; gap: 10px; align-items: flex-start; opacity: .35; transition: opacity .35s; }
.dm-auto > div { flex: 1; min-width: 0; }
.dm-auto b { display: block; font-size: 13px; font-weight: 600; }
.dm-auto .sub { display: block; margin-top: 2px; font-size: 13px; color: #6B7280; }
.dm-auto .big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #0A0A0A; }
.is-a1 .dm-auto.a1, .is-a2 .dm-auto.a2 { opacity: 1; }
.is-a1 .a1 .dm-check, .is-a2 .a2 .dm-check { background: #D9F99D; border-color: #A3E635; color: #1A2E05; transform: scale(1.08); }
.dm-week { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 6px; }
.dm-week span {
  padding: 4px 0 5px; border: 1px solid #E5E7EB; border-radius: 6px; text-align: center; font-size: 11px; color: #6B7280; line-height: 1.25;
  transition: background-color .3s, border-color .3s, color .3s;
}
.dm-week span i { display: block; font-style: normal; font-size: 10px; font-weight: 600; color: transparent; transition: color .3s; }
.is-a2 .dm-week .off { background: #D9F99D; border-color: #A3E635; color: #1A2E05; }
.is-a2 .dm-week .off i { color: #1A2E05; }
.is-a2 .dm-week .off + .off { transition-delay: .15s; }

/* ---------- 4) 깃발 연동 공통 — 장면 CSS 없이 대본의 깃발만으로 보이고·사라지고·켜진다 ---------- */
.demo-body { position: relative; }
[data-show] { opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
[data-show].shown { opacity: 1; transform: none; }
[data-hide] { transition: opacity .25s, transform .35s; }
[data-hide].gone { opacity: 0; }
.dm-stack { display: inline-grid; align-items: center; }
.dm-stack > * { grid-area: 1 / 1; }
.dm-split { display: grid; gap: 12px; }
@media (min-width: 640px) { .dm-split { grid-template-columns: 1.6fr 1fr; } .dm-split.even { grid-template-columns: 1fr 1fr; } }
.dm-sub { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: #6B7280; }
.dm-fields.w64 > div { grid-template-columns: 64px minmax(0, 1fr); }
.dm-fields.w52 > div { grid-template-columns: 52px minmax(0, 1fr); }
.dm-row { display: flex; align-items: center; gap: 8px; }
.dm-row .grow { flex: 1; min-width: 0; }
.dm-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.dm-btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.dm-btn.line { background: #FFFFFF; color: #0A0A0A; box-shadow: inset 0 0 0 1px #D1D5DB; }
.dm-btn.line.pressed { filter: none; box-shadow: inset 0 0 0 1px #0A0A0A, 0 0 0 3px rgba(217,249,157,.7); }
.dm-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: #ECFCCB; color: #3F6212; font-size: 11px; font-weight: 600; white-space: nowrap; }
.dm-badge.amber { background: #FEF3C7; color: #92400E; }
.dm-badge.red { background: #FEE2E2; color: #991B1B; }
.dm-badge.sm { height: 20px; padding: 0 7px; font-size: 11px; }

/* 오른쪽 «그러면 이렇게 됩니다» 패널 */
.dm-side { display: flex; flex-direction: column; gap: 10px; border-style: dashed; background: transparent; transition: background-color .35s, border-color .35s; }
.dm-side.lit { background: #FFFFFF; border-style: solid; }
.dm-auto.lit { opacity: 1; }
.dm-auto.lit .dm-check, .dm-check.lit { background: #D9F99D; border-color: #A3E635; color: #1A2E05; transform: scale(1.08); }
.dm-chip.lit { background: #0A0A0A; border-color: #0A0A0A; color: #FFFFFF; }

/* 알림 — 무대 왼쪽 아래 */
.dm-toasts { position: absolute; left: 12px; bottom: 12px; z-index: 7; display: grid; pointer-events: none; }
.dm-toasts > * { grid-area: 1 / 1; justify-self: start; }
.dm-toast { padding: 7px 11px; border-radius: 8px; background: #0A0A0A; color: #FFFFFF; font-size: 12px; font-weight: 500; box-shadow: 0 8px 20px -8px rgba(10,10,10,.5); }
.dm-toast::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #A3E635; vertical-align: 1px; }

/* 보드 — 칸과 카드. 카드는 대본의 move 로 칸 사이를 옮겨 다닌다 */
.dm-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.dm-col { min-height: 208px; padding: 8px; border-radius: 10px; background: #E9EBEE; }
.dm-col > h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-col [data-slot] { display: flex; flex-direction: column; gap: 6px; min-height: 150px; }
.dm-kcard {
  position: relative; z-index: 1; padding: 8px 9px; border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF;
  font-size: 12.5px; font-weight: 500; line-height: 1.35; box-shadow: 0 1px 1px rgba(10,10,10,.04);
}
.dm-kcard small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: #6B7280; }
.dm-kcard .dm-stack, .dm-kcard .dm-badge { margin-top: 5px; }
.dm-kcard.dragging { z-index: 6; border-color: #0A0A0A; box-shadow: 0 14px 28px -10px rgba(10,10,10,.4); }
.dm-kcard[data-hide].gone { transform: scale(.9); }
@media (max-width: 479px) { .dm-cols .sm-hide { display: none; } }

/* 대화 — 메신저·도토AI */
.dm-chat { display: flex; flex-direction: column; gap: 8px; }
.dm-msg { align-self: flex-start; max-width: 86%; padding: 8px 11px; border: 1px solid #E5E7EB; border-radius: 4px 12px 12px 12px; background: #FFFFFF; font-size: 13.5px; }
.dm-msg.me { align-self: flex-end; border-color: #0A0A0A; border-radius: 12px 4px 12px 12px; background: #0A0A0A; color: #FFFFFF; }
.dm-msg .who { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; color: #6B7280; }
.dm-msg .link { color: #2563EB; text-decoration: underline; word-break: break-all; }
.dm-msg ul { margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: #374151; }
.dm-msg li { padding: 2px 0; }
.dm-unfurl { margin-top: 8px; padding: 10px; border: 1px solid #E5E7EB; border-left: 3px solid #0A0A0A; border-radius: 8px; background: #FAFAFA; }
.dm-unfurl b { display: block; font-size: 13px; }
.dm-unfurl small { display: block; margin-top: 2px; font-size: 12px; color: #6B7280; }
.dm-unfurl .dm-stack { margin-top: 8px; justify-items: start; }
.dm-src { display: inline-flex; margin-top: 6px; padding: 3px 8px; border-radius: 6px; background: #F3F4F6; font-size: 11.5px; color: #374151; }
.dm-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dm-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9CA3AF; animation: demo-dot 1s infinite; }
.dm-dots i:nth-child(2) { animation-delay: .15s; } .dm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes demo-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.dm-composer { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 5px 5px 5px 14px; border: 1px solid #E5E7EB; border-radius: 22px; background: #FFFFFF; }
.dm-composer .dm-stack { flex: 1; min-width: 0; font-size: 13.5px; }
.dm-send { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #0A0A0A; color: #FFFFFF; font-size: 14px; transition: transform .15s; }
.dm-send.pressed { transform: scale(.88); }

/* 단계 줄 — 견적 → 주문 → 판매 → 매출 */
.dm-flow { display: flex; align-items: stretch; gap: 4px; }
.dm-flow > i { flex: none; align-self: center; font-style: normal; font-size: 12px; color: #D1D5DB; }
.dm-step { flex: 1; min-width: 0; padding: 7px 2px; border: 1px solid #E5E7EB; border-radius: 9px; background: #FFFFFF; text-align: center; font-size: 12.5px; font-weight: 600; color: #9CA3AF; transition: color .3s, border-color .3s, background-color .3s; }
.dm-step small { display: block; margin-top: 1px; font-size: 10.5px; font-weight: 500; color: transparent; white-space: nowrap; transition: color .3s; }
.dm-step.lit { border-color: #0A0A0A; color: #0A0A0A; }
.dm-step.lit small { color: #4D7C0F; }

/* 표 */
.dm-table { font-size: 12.5px; }
.dm-tr { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 8px; min-height: 36px; padding: 5px 2px; border-bottom: 1px solid #F0F1F3; }
.dm-tr.head { min-height: 0; padding-top: 0; font-size: 11px; color: #6B7280; }
.dm-tr:last-child { border-bottom: 0; }
.dm-tr .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dm-tr .ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-tr .dim { color: #9CA3AF; }
.dm-tr.old { color: #9CA3AF; text-decoration: line-through; }
.dm-star { font-size: 15px; line-height: 1; color: #D1D5DB; transition: color .2s, transform .2s; }
.dm-star.lit { color: #F59E0B; transform: scale(1.2); }
.dm-avs { display: flex; gap: 4px; }
.dm-avs span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #E5E7EB; font-size: 11px; font-weight: 600; color: #6B7280; transition: background-color .3s, color .3s; }
.dm-avs span.lit { background: #D9F99D; color: #1A2E05; }
.dm-avs span:nth-child(2) { transition-delay: .08s; } .dm-avs span:nth-child(3) { transition-delay: .16s; }
.dm-avs span:nth-child(4) { transition-delay: .24s; } .dm-avs span:nth-child(5) { transition-delay: .32s; }

/* 결과 막대 · 진척률 */
.dm-res { display: grid; gap: 7px; }
.dm-res > div { display: grid; grid-template-columns: 48px 1fr 14px; align-items: center; gap: 6px; font-size: 12px; }
.dm-res u, .dm-prog u { display: block; height: 10px; border-radius: 5px; background: #ECEEF1; overflow: hidden; text-decoration: none; }
.dm-res u i, .dm-prog u i { display: block; width: 0; height: 100%; border-radius: 5px; background: #0A0A0A; transition: width .6s; }
.dm-res u.lit i { width: var(--w); }
.dm-prog { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; color: #6B7280; }
.dm-prog b { color: #0A0A0A; font-variant-numeric: tabular-nums; }
.is-p1 .dm-prog u i { width: 33%; } .is-p2 .dm-prog u i { width: 67%; }

/* 예약 시간표 */
.dm-tt { display: grid; gap: 6px; }
.dm-tt > div { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 6px; }
.dm-tt b { font-size: 12px; font-weight: 500; white-space: nowrap; }
.dm-tt .hours, .dm-tt .track { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); }
.dm-tt .hours span { font-size: 10.5px; color: #9CA3AF; }
.dm-tt .track { height: 34px; border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF linear-gradient(to right, #F0F1F3 1px, transparent 1px) 0 0 / calc(100% / 9) 100%; }
.dm-tt .track > * { grid-row: 1; margin: 3px 2px; border-radius: 6px; }
.dm-book { display: flex; align-items: center; min-width: 0; padding: 0 6px; overflow: hidden; background: #374151; color: #FFFFFF; font-size: 11px; white-space: nowrap; }
.dm-book.new { background: #D9F99D; color: #1A2E05; font-weight: 600; box-shadow: inset 0 0 0 1px #A3E635; }
.dm-slot { border: 1.5px dashed transparent; transition: border-color .15s, background-color .15s; }
.dm-slot.pressed { border-color: #0A0A0A; background: rgba(217,249,157,.5); }
.is-dup .dm-book.new { animation: demo-shake .45s; }
@keyframes demo-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.dm-pop { position: absolute; left: 50%; top: 50%; z-index: 8; width: min(270px, 84%); box-shadow: 0 20px 40px -12px rgba(10,10,10,.35); pointer-events: none; }
.dm-pop[data-show] { transform: translate(-50%, -44%); }
.dm-pop[data-show].shown { transform: translate(-50%, -50%); }
.dm-pop[data-hide].gone { opacity: 0; }

/* 명함 사진 */
.dm-photo { position: relative; display: grid; place-items: center; height: 168px; border-radius: 10px; background: #D1D5DB; overflow: hidden; }
.dm-bizcard { width: 74%; padding: 12px 14px; border-radius: 6px; background: #FFFFFF; box-shadow: 0 8px 18px -6px rgba(10,10,10,.35); font-size: 10.5px; line-height: 1.5; color: #6B7280; transform: rotate(-9deg) scale(.9); transition: transform .55s cubic-bezier(.3,.9,.3,1), opacity .35s; }
.dm-bizcard b { display: block; font-size: 14px; color: #0A0A0A; }
.dm-bizcard em { display: block; margin-bottom: 8px; font-style: normal; font-weight: 600; color: #374151; }
.dm-bizcard.lit { transform: none; }
.dm-scanline { position: absolute; left: 0; right: 0; top: 8%; height: 2px; background: #84CC16; box-shadow: 0 0 12px 3px rgba(132,204,22,.6); opacity: 0; transition: opacity .2s; }
.dm-scanline.lit { opacity: 1; animation: demo-scan 1s ease-in-out infinite alternate; }
@keyframes demo-scan { from { top: 8%; } to { top: 92%; } }

/* ---------- 5) 장면 잔손질 ---------- */
span.dm-input { display: block; }
.dm-input.w48 { flex: none; width: 48px; text-align: center; }
.dm-row.wrap { flex-wrap: wrap; }
.dm-row.gap-b { margin-bottom: 10px; }
.dm-table.top, .dm-flow.top { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #E5E7EB; }
.dm-tr.lit { color: #9CA3AF; }
.dm-tr.lit .ell { text-decoration: line-through; }
.dm-head small { font-size: 12px; font-weight: 400; color: #6B7280; }
.dm-cols.short .dm-col { min-height: 172px; }
.dm-cols.short [data-slot] { min-height: 118px; }
.dm-line2 { display: block; font-size: 12.5px; }
.dm-line2 small { display: block; font-size: 11.5px; color: #6B7280; }
.dm-total { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 대화는 아래에서부터 쌓인다 — 새 말이 나오면 앞 말이 위로 밀려 올라간다 */
.dm-chat { justify-content: flex-end; overflow: hidden; }
.dm-chat [data-show]:not(.shown), .dm-chat [data-hide].gone { display: none; }
.dm-chat [data-show].shown { animation: demo-pop .3s ease; }
@keyframes demo-pop { from { opacity: 0; transform: translateY(8px); } }
.dm-ph { color: #9CA3AF; }
.dm-drop { display: flex; flex-direction: column; gap: 6px; min-height: 132px; padding: 8px; border: 1.5px dashed #D1D5DB; border-radius: 10px; }
.dm-tray { display: flex; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 10px; font-size: 12px; color: #6B7280; }
.dm-tray [data-slot] { flex: 1; min-width: 0; }
.dm-file { display: flex; align-items: center; gap: 8px; }
.dm-file::before { content: ""; flex: none; width: 14px; height: 18px; border-radius: 3px; background: #D1D5DB; }
.dm-file .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-stack > .dm-tag, .dm-stack > .dm-badge, .dm-stack > .dm-btn { justify-self: start; }
.dm-end .dm-stack > * { justify-self: end; }
.dm-kcard[data-hide].gone { height: 0; margin-bottom: -6px; padding: 0; border: 0; overflow: hidden; }
.dm-photo .dm-stack { display: grid; width: 100%; justify-items: center; }
.dm-photo .dm-stack > [data-show] { display: block; width: 74%; }
.dm-photo .dm-bizcard { width: 100%; }
.dm-tt { padding-bottom: 36px; }

/* ---------- 6) HR·근태·급여 장면 부품 ---------- */
/* 조직도 — 부서(폴더)와 직원이 한 줄씩, 끌어 옮긴다 */
.dm-tree { display: flex; flex-direction: column; gap: 6px; }
.dm-tree .kids { display: flex; flex-direction: column; gap: 6px; min-height: 34px; margin-left: 12px; padding-left: 12px; border-left: 1px solid #E5E7EB; }
.dm-node { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; }
.dm-node::before { content: ""; flex: none; width: 15px; height: 12px; border-radius: 2px 3px 3px 3px; background: #F5B93F; box-shadow: -4px -3px 0 -1px #F5B93F inset; }
.dm-node.top { padding: 2px 0; border: 0; background: transparent; box-shadow: none; font-weight: 600; }
.dm-node.person::before { content: none; }
.dm-node .av { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #6B7280; }
.dm-node.person { position: relative; }
.dm-node small { margin: 0 0 0 auto; }
.dm-node .dm-tag { margin-left: auto; }
.dm-node.person.pressed { border-color: #0A0A0A; box-shadow: 0 0 0 3px rgba(217,249,157,.7); }
/* 숫자 상자 */
.dm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dm-stats > div { padding: 9px 10px; border: 1px solid #E5E7EB; border-radius: 9px; }
.dm-stats small { display: block; font-size: 11px; color: #6B7280; }
.dm-stats b { display: block; margin-top: 2px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dm-stats b.s { font-size: 13.5px; }
.dm-stats b u { font-size: 12px; font-weight: 500; text-decoration: none; color: #6B7280; }
/* 출퇴근 */
.dm-clock { margin: 4px 0 10px; text-align: center; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.dm-stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: center; }
.dm-btn.wide { display: flex; justify-content: center; width: 100%; margin-top: 10px; }
.dm-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #22C55E; }
.dm-dot.kiosk { background: #A855F7; } .dm-dot.out { background: #9CA3AF; }
/* 근태 매트릭스 */
.dm-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; font-size: 11.5px; color: #6B7280; }
.dm-legend b { margin-right: 3px; }
.dm-mx { display: grid; grid-template-columns: minmax(64px, 1.4fr) repeat(5, minmax(0, 1fr)); font-size: 12.5px; }
.dm-mx > * { display: grid; place-items: center; min-height: 36px; border-bottom: 1px solid #F0F1F3; }
.dm-mx > .h { min-height: 30px; font-size: 11px; color: #6B7280; }
.dm-mx > .n { justify-items: start; font-weight: 500; white-space: nowrap; }
.dm-mx .o { color: #16A34A; font-weight: 700; }
.dm-mx .w { color: #D97706; font-weight: 700; }
.dm-mx .v { color: #2563EB; font-weight: 600; font-size: 11.5px; }
.dm-mx .cell { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 6px; transition: background-color .3s, box-shadow .3s; }
.dm-mx .cell.lit { background: #FEF3C7; box-shadow: inset 0 0 0 1.5px #F59E0B; }
.dm-mx .cell.v.lit { background: #DBEAFE; box-shadow: inset 0 0 0 1.5px #60A5FA; }
.dm-pad-b { padding-bottom: 38px; }

/* ---------- 7) 전자결재 장면 부품 ---------- */
/* 문서 본문 흉내 — 회색 줄 */
.dm-lines { display: grid; gap: 7px; margin: 4px 0 12px; }
.dm-lines i { display: block; height: 8px; border-radius: 4px; background: #ECEEF1; }
.dm-lines i:nth-child(2) { width: 92%; } .dm-lines i:nth-child(3) { width: 78%; } .dm-lines i:nth-child(4) { width: 85%; } .dm-lines i:nth-child(5) { width: 60%; }
.dm-note { padding: 10px 12px; border-radius: 9px; background: #F7FEE7; border: 1px solid #D9F99D; font-size: 12.5px; line-height: 1.6; }
.dm-note b { display: block; margin-bottom: 2px; font-size: 11.5px; color: #3F6212; }
.dm-note span { display: block; }
/* 서명 — 획이 그려진다 */
.dm-sign { display: grid; place-items: center; height: 132px; border: 1.5px dashed #D1D5DB; border-radius: 10px; background: #FFFFFF; }
.dm-sign svg { width: 70%; max-width: 240px; height: auto; overflow: visible; }
.dm-sign path, .dm-seal path { fill: none; stroke: #0A0A0A; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 520; stroke-dashoffset: 520; transition: stroke-dashoffset 1.7s ease-in-out; }
.dm-sign.lit path, .dm-seal.lit path { stroke-dashoffset: 0; }
.dm-seal { display: grid; place-items: center; height: 44px; }
.dm-seal svg { height: 34px; width: auto; max-width: 86%; overflow: visible; }
.dm-seal path { transition-duration: .01s; }
.dm-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #E5E7EB; border-radius: 9px; overflow: hidden; }
.dm-boxes > div { text-align: center; border-left: 1px solid #E5E7EB; }
.dm-boxes > div:first-child { border-left: 0; }
.dm-boxes small { display: block; padding: 4px 0; background: #FAFAFA; border-bottom: 1px solid #E5E7EB; font-size: 11px; color: #6B7280; }
.dm-boxes .skip { display: grid; place-items: center; height: 44px; font-size: 11.5px; color: #9CA3AF; }

/* ---------- 10) 프로젝트·업무·게시판·위키 장면 부품 ---------- */
.dm-cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.dm-cal > div { min-height: 104px; padding: 5px; border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF; }
.dm-cal small { display: block; margin-bottom: 4px; font-size: 11px; color: #6B7280; }
.dm-ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 4px; font-size: 10.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #E5E7EB; color: #374151; }
.dm-ev.dept { background: #DBEAFE; color: #1E40AF; } .dm-ev.co { background: #FEE2E2; color: #991B1B; } .dm-ev.off { background: #DCFCE7; color: #166534; } .dm-ev.work { background: #EDE9FE; color: #5B21B6; }
.dm-chip.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.dm-tt.wide > div { grid-template-columns: 84px minmax(0, 1fr); }
.dm-book.g1 { background: #0A0A0A; } .dm-book.g2 { background: #6B7280; } .dm-book.g3 { background: #D9F99D; color: #1A2E05; box-shadow: inset 0 0 0 1px #A3E635; }
.dm-hist { display: grid; gap: 8px; padding-left: 12px; border-left: 2px solid #E5E7EB; }
.dm-paper { padding: 12px 14px; border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF; font-size: 12.5px; }
.dm-paper b { display: block; margin-bottom: 6px; font-size: 13.5px; }
.dm-tree2 { display: grid; gap: 4px; font-size: 12.5px; }
.dm-tree2 span { display: block; padding: 5px 8px; border-radius: 6px; }
.dm-tree2 .d1 { font-weight: 600; } .dm-tree2 .d2 { margin-left: 14px; background: #F3F4F6; }

/* ---------- 11) 문서·영업·명함·도토AI 장면 부품 ---------- */
.dm-qr { width: 84px; height: 84px; border: 6px solid #FFFFFF; outline: 1px solid #E5E7EB; border-radius: 6px;
  background: conic-gradient(#0A0A0A 25%, #FFFFFF 0 50%, #0A0A0A 0 75%, #FFFFFF 0) 0 0 / 12px 12px, #FFFFFF; }
.dm-phone { margin: 0 auto; width: min(210px, 100%); padding: 10px; border: 2px solid #0A0A0A; border-radius: 20px; background: #FFFFFF; }
.dm-phone .dm-sign { height: 84px; }
.dm-flow.sm .dm-step { font-size: 11.5px; padding: 6px 2px; }
.dm-tr > .dm-tag { justify-self: start; }
.dm-tr[data-hide].gone { display: none; }

/* ---------- 12) 웹하드·설문·예약·자산 장비 장면 부품 ---------- */
.dm-book.wait { background: repeating-linear-gradient(135deg, #D1D5DB 0 5px, #E5E7EB 5px 10px); color: #374151; }
.dm-pic { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dm-pic > span { display: grid; place-items: center; height: 54px; border: 1.5px dashed #D1D5DB; border-radius: 8px; font-size: 11.5px; color: #9CA3AF; transition: background-color .3s, border-color .3s, color .3s; }
.dm-pic > span.lit { border-style: solid; border-color: #A3E635; background: #F7FEE7; color: #3F6212; }
.dm-input.bad { border-color: #DC2626; box-shadow: 0 0 0 3px rgba(254,202,202,.7); }
.dm-warn { display: block; margin-top: 4px; font-size: 11.5px; color: #DC2626; }

/* ---------- 9) 메신저·메일 장면 부품 ---------- */
.dm-switch { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: #D1D5DB; transition: background-color .25s; }
.dm-switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF; transition: transform .25s; }
.dm-switch.lit { background: #0A0A0A; } .dm-switch.lit::after { transform: translateX(14px); }
.dm-code { display: block; padding: 6px 8px; border-radius: 6px; background: #F3F4F6; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-mail { display: block; padding: 8px 2px; border-bottom: 1px solid #F0F1F3; font-size: 12.5px; }
.dm-mail:last-child { border-bottom: 0; }
.dm-mail b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.dm-mail small { display: block; margin-top: 1px; font-size: 11.5px; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 8) ERP 장면 부품 ---------- */
.dm-dot.warn { background: #F59E0B; } .dm-dot.bad { background: #EF4444; }
.dm-tr .red { color: #DC2626; font-weight: 600; }
.dm-doc { padding: 12px; border: 1px solid #E5E7EB; border-radius: 8px; background: #FFFFFF; }
.dm-doc h5 { margin: 0 0 8px; text-align: center; font-size: 14px; font-weight: 700; letter-spacing: .3em; }
.dm-doc .dm-lines { margin: 8px 0 0; }

/* ---------- 13) 외부 AI 연결·자재구매·추가 섹션 부품 ---------- */
.dm-shift { display: grid; grid-template-columns: minmax(48px, 1.2fr) repeat(7, minmax(0, 1fr)); gap: 3px; font-size: 12px; }
.dm-shift > * { display: grid; place-items: center; min-height: 32px; border-radius: 6px; }
.dm-shift .h { min-height: 24px; font-size: 11px; color: #6B7280; }
.dm-shift .n { justify-items: start; font-weight: 600; }
.dm-shift .d { background: #FEF9C3; color: #854D0E; } .dm-shift .nt { background: #1F2937; color: #FFFFFF; } .dm-shift .o { background: #F3F4F6; color: #9CA3AF; }
.dm-aging { display: grid; grid-template-columns: minmax(64px, 1.3fr) repeat(4, minmax(0, 1fr)); font-size: 12px; }
.dm-aging > * { display: grid; place-items: center end; min-height: 34px; padding: 0 6px; border-bottom: 1px solid #F0F1F3; font-variant-numeric: tabular-nums; }
.dm-aging .h { min-height: 28px; font-size: 11px; color: #6B7280; }
.dm-aging .n { place-items: center start; font-weight: 500; }
.dm-aging .old { color: #DC2626; font-weight: 700; background: #FEF2F2; border-radius: 6px; }
.dm-prod { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dm-prod > div { padding: 10px; border: 1px solid #E5E7EB; border-radius: 10px; background: #FFFFFF; font-size: 12.5px; }
.dm-prod i { display: block; height: 46px; margin-bottom: 8px; border-radius: 6px; background: #ECEEF1; }
.dm-prod b { display: block; } .dm-prod small { display: block; margin: 2px 0 8px; color: #6B7280; }

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