/* ==========================================================================
   Interactive demos: shared controls + Ledger, Maya and Ledger Mobile replicas
   ========================================================================== */

.dt { --dt-progress: 0; margin-top: 8px; }
.dt-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dt-modes { display: inline-flex; gap: 6px; padding: 4px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.dt-modes button, .dt-pause { all: unset; cursor: pointer; box-sizing: border-box; min-height: 38px; padding: 0 14px; border-radius: 9px; font: 700 13.5px/38px var(--font-sans); color: var(--text-2); transition: background 0.2s, color 0.2s; }
.dt-modes button[aria-pressed="true"] { background: var(--accent, var(--gold)); color: #0b0c0b; }
.dt-modes button:focus-visible, .dt-pause:focus-visible, .dt-chapters button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.dt-pause { border: 1px solid var(--line-2); }
.dt.is-try .dt-pause { visibility: hidden; }

.dt-chapters { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.dt-chapters::-webkit-scrollbar { display: none; }
.dt-chapters button { all: unset; cursor: pointer; box-sizing: border-box; position: relative; overflow: hidden; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: 600 13px/1.25 var(--font-sans); color: var(--text-3); display: flex; gap: 9px; align-items: center; flex: 1 0 150px; scroll-snap-align: start; transition: color 0.2s, border-color 0.2s; }
.dt-chapters button span { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font: 600 11px var(--font-mono); }
.dt-chapters button:hover { color: var(--text); }
.dt-chapters button[aria-selected="true"] { color: var(--text); border-color: color-mix(in oklab, var(--accent, var(--gold)) 55%, transparent); background: color-mix(in oklab, var(--accent, var(--gold)) 10%, var(--surface)); }
.dt-chapters button[aria-selected="true"] span { background: var(--accent, var(--gold)); color: #0b0c0b; border-color: transparent; }
.dt-chapters button.done span { background: color-mix(in oklab, var(--accent, var(--gold)) 35%, transparent); }
.dt-bar-fill { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent, var(--gold)); }
.dt.is-playing .dt-chapters button[aria-selected="true"] .dt-bar-fill { width: calc(var(--dt-progress) * 100%); transition: width 0.8s linear; }

.dt-frame { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85); }
.dt-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.dt-spacer { position: relative; overflow: hidden; margin: 0 auto; }
.dt-stage { position: relative; transform-origin: 0 0; }
.dt-caption { margin: 14px 0 0; min-height: 1.6em; font-size: clamp(16px, 1.6vw, 19px); color: var(--text); font-weight: 600; }
.dt-note { margin: 4px 0 0; font: 500 12px var(--font-mono); color: var(--text-3); }
.dt-badge { position: absolute; top: 12px; right: 12px; z-index: 30; background: #0b0c0b; color: #f0ece2; border: 1px solid rgba(240, 236, 226, 0.2); border-radius: 999px; padding: 8px 8px 8px 14px; font: 600 13px var(--font-sans); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); display: flex; align-items: center; gap: 8px; }
.dt-badge button { all: unset; cursor: pointer; background: var(--accent, var(--gold)); color: #0b0c0b; border-radius: 999px; padding: 6px 12px; font-weight: 800; }
.dt-badge[hidden] { display: none; }

.dt-cursor { position: absolute; left: 0; top: 0; z-index: 25; width: 26px; height: 26px; margin: -3px 0 0 -3px; pointer-events: none; opacity: 0; transition: transform 0.65s cubic-bezier(0.45, 0, 0.2, 1), opacity 0.3s; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35)); }
.dt-cursor.on { opacity: 1; }
.dt-cursor svg { width: 100%; height: 100%; transition: transform 0.12s; }
.dt-cursor.press svg { transform: scale(0.82); }

/* --------------------------------------------------------------- Ledger copy */
.lg-stage { font-family: Inter, "Segoe UI", system-ui, sans-serif; color: #111827; background: #fff; font-size: 14px; line-height: 1.45; }
.lg-app { position: absolute; inset: 0; display: grid; grid-template-columns: 250px 1fr; }
.lg-stage button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.lg-side { border-right: 1px solid #e5e7eb; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.lg-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 12px; font-size: 18px; color: #374151; }
.lg-brand img { width: 34px; height: 34px; border-radius: 8px; }
.lg-brand b { color: #111827; }
.lg-co { padding: 8px 10px 12px; border-bottom: 1px solid #f1f2f4; margin-bottom: 6px; }
.lg-co small { display: block; font-size: 10.5px; letter-spacing: 0.08em; color: #6b7280; }
.lg-co b { font-size: 13px; }
.lg-sec { font-size: 10.5px; letter-spacing: 0.1em; color: #6b7280; font-weight: 700; padding: 12px 12px 4px; }
.lg-nav { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; color: #374151 !important; }
.lg-nav span { width: 18px; text-align: center; font-size: 12px; opacity: 0.8; }
.lg-nav em { margin-left: auto; font-style: normal; background: #b8860b; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 20px; height: 20px; display: grid; place-items: center; }
.lg-nav:hover { background: #f6f7f9; }
.lg-nav.on { background: #f3f4f6; font-weight: 700; color: #111827 !important; }
.lg-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-top: 1px solid #f1f2f4; }
.lg-user i { width: 34px; height: 34px; border-radius: 50%; background: #111827; color: #fff; font-style: normal; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.lg-user b { display: block; font-size: 13px; } .lg-user small { color: #6b7280; font-size: 11.5px; }
.lg-main { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.lg-top { height: 58px; flex: none; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 12px; padding: 0 20px; font-size: 12.5px; color: #374151; white-space: nowrap; }
.lg-title { font-size: 16px; color: #111827; min-width: 130px; }
.lg-search { flex: 1; max-width: 330px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 7px 12px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; }
.lg-k, .lg-view, .lg-co2 { border: 1px solid #e5e7eb; border-radius: 999px; padding: 5px 10px; }
.lg-new { background: #111827; color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.lg-bell { position: relative; } .lg-bell em { position: absolute; top: -8px; right: -10px; background: #dc2626; color: #fff; font-style: normal; font-size: 10px; border-radius: 999px; padding: 0 5px; }
.lg-body { flex: 1; overflow: hidden; }
.lg-tabs { display: flex; gap: 4px; padding: 10px 24px 0; border-bottom: 1px solid #e5e7eb; }
.lg-tabs button { padding: 9px 12px; color: #6b7280 !important; border-bottom: 2px solid transparent; font-size: 13.5px; }
.lg-tabs button.on { color: #111827 !important; border-bottom-color: #0f5c52; font-weight: 600; }
.lg-pad { padding: 18px 26px; display: flex; flex-direction: column; gap: 12px; }
.lg-pad h2 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 12px; letter-spacing: -0.01em; margin: 0; }
.lg-pad h2 small { font-size: 13.5px; font-weight: 400; color: #6b7280; }
.lg-note { display: flex; gap: 12px; background: #eaf5f2; border: 1px solid #a8d5ca; border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #1f2937; }
.lg-note b { color: #0f766e; } .lg-note p { margin: 0 0 4px; } .lg-note small { color: #6b7280; font-size: 11.5px; }
.lg-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.lg-card h3 { margin: 0; font-size: 15px; }
.lg-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.lg-row label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.lg-input { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 12px; min-width: 190px; font-weight: 400; }
.muted { color: #6b7280; font-size: 12.5px; margin: 0; } .muted.lg-input { color: #9ca3af; }
.lg-btn { border: 1px solid #e5e7eb !important; border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; background: #fff !important; transition: transform 0.12s; }
.lg-btn:hover { background: #f9fafb !important; }
.lg-btn:active { transform: scale(0.97); }
.lg-btn.dark { background: #111827 !important; color: #fff !important; border-color: #111827 !important; }
.lg-btn.teal { background: #0f5c52 !important; color: #fff !important; border-color: #0f5c52 !important; }
.lg-btn.got { color: #15803d !important; border-color: #86efac !important; background: #f0fdf4 !important; }
.lg-table { width: 100%; border-collapse: collapse; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.lg-table th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; }
.lg-table td { padding: 12px 14px; border-bottom: 1px solid #f1f2f4; }
.lg-table .r { text-align: right; }
.lg-pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: #f3f4f6; color: #374151; }
.lg-approved { background: #dcfce7; color: #15803d; } .lg-in-review { background: #fef3c7; color: #92400e; } .lg-locked { background: #e0e7ff; color: #3730a3; }
span.lg-locked { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.lg-back { color: #374151 !important; font-size: 13.5px; }
.lg-warn { background: #fdf0f0; border: 1px solid #f3b4b4; border-radius: 10px; padding: 10px 16px; color: #991b1b; font-size: 13px; }
.lg-warn b { font-size: 12.5px; letter-spacing: 0.04em; } .lg-warn p { margin: 4px 0 0; }
.lg-chip { border: 1px solid #f3b4b4; border-radius: 999px; padding: 1px 8px; background: #fff; font-size: 12px; }
.lg-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.lg-stats div { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; transition: background 0.4s, border-color 0.4s; }
.lg-stats div.hi { background: #f0faf6; }
.lg-stats small { color: #6b7280; font-size: 12.5px; } .lg-stats b { font-size: 19px; }
.lg-stats.flash div { animation: lgFlash 1.2s ease; }
@keyframes lgFlash { 0% { background: #d1fae5; border-color: #34d399; } 100% { } }
.lg-draft { background: #f2fbf6; border: 1px solid #bfe6cf; border-radius: 12px; padding: 12px 16px; display: grid; gap: 8px; font-size: 13px; }
.lg-draft > b { color: #15803d; }
.ok { color: #15803d; } .amber { color: #b45309; }
.lg-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #9ca3af; border-top-color: #0f5c52; border-radius: 50%; animation: lgSpin 0.7s linear infinite; vertical-align: -2px; }
@keyframes lgSpin { to { transform: rotate(360deg); } }
.lg-actions { margin-top: 2px; }
.lg-flow { list-style: none; display: flex; gap: 0; padding: 0; margin: 0; font-size: 12.5px; color: #9ca3af; }
.lg-flow li { padding: 6px 14px 6px 22px; position: relative; }
.lg-flow li::before { content: ""; position: absolute; left: 6px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; border: 2px solid #d1d5db; }
.lg-flow li.on { color: #0f5c52; font-weight: 700; } .lg-flow li.on::before { background: #0f5c52; border-color: #0f5c52; }
.lg-leave { flex-direction: row; justify-content: space-between; align-items: center; gap: 24px; }
.lg-leave h3 { font-size: 20px; margin: 4px 0; } .lg-leave small { font-weight: 700; font-size: 12px; }
.lg-leave dl { display: flex; gap: 26px; margin: 0; } .lg-leave dt { color: #6b7280; font-size: 12px; } .lg-leave dd { margin: 2px 0 0; font-weight: 600; }
.lg-leave.done { border-color: #86efac; background: #f0fdf4; }
.lg-files { display: grid; gap: 10px; }
.lg-file { display: flex; align-items: center; gap: 14px; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 16px; }
.lg-file div { flex: 1; display: grid; } .lg-file small { color: #6b7280; }
.lg-fi { font-size: 20px; }
.lg-toast { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); animation: fadeUp 0.25s ease; }

/* ---------------------------------------------------------------- Maya copy */
.my-stage { font-family: Inter, "Segoe UI", system-ui, sans-serif; background: #f6f5f1; color: #14202b; font-size: 15px; line-height: 1.5; }
.my-app { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 400px; }
.my-chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #e4e1d8; background: #fbfaf7; }
.my-chat header { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid #e4e1d8; }
.my-chat header img { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid #e4e1d8; padding: 4px; }
.my-chat header b { display: block; font-size: 17px; } .my-chat header small { color: #6b7280; }
.my-msgs { flex: 1; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.my-m { max-width: 78%; padding: 11px 15px; border-radius: 16px; animation: fadeUp 0.3s ease; }
.my-m.maya { background: #fff; border: 1px solid #e4e1d8; align-self: flex-start; border-bottom-left-radius: 6px; }
.my-m.me { background: #155e57; color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.my-file { display: block; font-size: 12.5px; opacity: 0.9; margin-bottom: 4px; }
.my-m.typing { display: flex; gap: 5px; padding: 15px; }
.my-m.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5b1; animation: myDot 1s infinite; }
.my-m.typing i:nth-child(2) { animation-delay: 0.15s; } .my-m.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes myDot { 50% { transform: translateY(-4px); opacity: 0.5; } }
.my-prop { margin-top: 10px; border: 1px solid #f0c36d; background: #fffaf0; border-radius: 12px; padding: 12px 14px; color: #14202b; display: grid; gap: 6px; }
.my-prop small { font-size: 11px; letter-spacing: 0.08em; color: #b45309; font-weight: 700; }
.my-prop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 14px; } .my-prop dt { color: #6b7280; } .my-prop dd { margin: 0; }
.my-prop p { margin: 0; font-size: 14px; }
.my-prop.sent { border-color: #86efac; background: #f0fdf4; color: #15803d; font-weight: 600; } .my-prop.sent small { color: #4b5563; letter-spacing: 0; font-weight: 400; }
.my-row { display: flex; gap: 8px; }
.my-btn { font: 700 14px Inter, system-ui, sans-serif; border: 0; border-radius: 9px; padding: 8px 14px; background: #155e57; color: #fff; cursor: pointer; }
.my-btn.ghost { background: #fff; color: #14202b; border: 1px solid #e4e1d8; }
.my-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 12px; }
.my-chips button { font: 600 13px Inter, system-ui, sans-serif; border: 1px solid #d9d5ca; background: #fff; color: #155e57; border-radius: 999px; padding: 7px 13px; cursor: pointer; }
.my-chips button:hover { border-color: #155e57; }
.my-input { display: flex; gap: 10px; margin: 0 22px 18px; background: #fff; border: 1px solid #d9d5ca; border-radius: 14px; padding: 6px 6px 6px 16px; }
.my-input input { flex: 1; border: 0; outline: 0; font: 15px Inter, system-ui, sans-serif; background: transparent; color: #14202b; }
.my-input button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: #155e57; color: #fff; font-size: 18px; cursor: pointer; }
.my-trace { padding: 20px 22px; background: #10171d; color: #e6edf3; overflow: hidden; }
.my-trace h4 { margin: 0 0 14px; font: 600 12px "JetBrains Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: #8b98a5; }
.my-trace ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.my-trace li { display: flex; gap: 12px; padding: 10px 12px; border: 1px solid #1f2a33; border-radius: 12px; color: #6b7a87; transition: all 0.35s; }
.my-trace li span { font: 600 11px "JetBrains Mono", monospace; padding-top: 3px; }
.my-trace li b { font-size: 14.5px; }
.my-trace li p { margin: 4px 0 0; font-size: 13px; color: #b8c4cf; line-height: 1.45; animation: fadeUp 0.35s ease; }
.my-trace li.done { color: #c9d4de; border-color: #23313b; }
.my-trace li.on { color: #fff; border-color: #5ec8d0; background: rgba(94, 200, 208, 0.1); box-shadow: 0 0 24px rgba(94, 200, 208, 0.18); }
.my-trace li.on span { color: #5ec8d0; }

/* ------------------------------------------------------- Ledger Mobile phone */
.dt-mobile .dt-frame { background: radial-gradient(70% 90% at 50% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%), var(--surface); border-color: var(--line); padding: 26px 0 22px; }
.mb-wrap { display: grid; justify-items: center; gap: 10px; }
.mb-phone { width: clamp(230px, 28vw, 300px); aspect-ratio: 9 / 19.5; border-radius: 36px; background: #050505; padding: 8px; border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 40px 70px -24px rgba(0, 0, 0, 0.8); }
.mb-stage { width: 100%; height: 100%; border-radius: 28px; overflow: hidden; background: #f5f3ee; cursor: pointer; }
.mb-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out); }
.mb-stage img.on { opacity: 1; }
.mb-stage img.out { opacity: 0; transform: translateX(-14px); }
.mb-target { position: absolute; width: 2px; height: 2px; pointer-events: none; }
.mb-ripple { position: absolute; z-index: 20; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(15, 92, 82, 0.35); border: 2px solid rgba(15, 92, 82, 0.6); pointer-events: none; animation: mbRipple 0.65s ease-out forwards; }
@keyframes mbRipple { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.mb-count { font-size: 12px; color: var(--text-3); }
.dt-mobile .dt-cursor { width: 34px; height: 34px; }

@media (max-width: 760px) {
  .dt-chapters button { flex-basis: 136px; font-size: 12.5px; }
}

/* Maya on narrow screens: trace stacked under the chat */
.my-stage.narrow .my-app { grid-template-columns: 1fr; grid-template-rows: 640px 1fr; }
.my-stage.narrow .my-chat { border-right: 0; border-bottom: 1px solid #e4e1d8; }
.my-stage.narrow .my-m { max-width: 88%; }

.tag.demo-tag { color: #0b0c0b; background: var(--accent, var(--gold)); border-color: transparent; font-weight: 700; }

/* Try the real Ledger (public demo login) */
.real-login { display: grid; grid-template-columns: 1fr minmax(300px, 420px); gap: 24px; align-items: center; margin-bottom: 18px; padding: 24px; border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent); background: radial-gradient(90% 120% at 0% 0%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 60%), var(--surface); }
.real-login h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 3.6vw, 42px); margin: 8px 0; }
.real-login p { margin: 0; color: var(--text-2); }
.rl-live { display: inline-flex; gap: 8px; align-items: center; font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ok); }
.rl-box { display: grid; gap: 10px; }
.rl-field { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 8px 8px 14px; background: var(--bg-2); }
.rl-field small { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.rl-field code { font: 600 14.5px var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.rl-copy { all: unset; cursor: pointer; font: 700 12.5px var(--font-sans); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--text-2); min-height: 20px; }
.rl-copy:hover { color: var(--text); border-color: var(--text-3); }
.rl-copy.done { color: var(--ok); border-color: var(--ok); }
.rl-copy:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.rl-box .btn { justify-content: center; }
.rl-or { margin: 0 0 6px; color: var(--text-3); font-size: 14px; }
@media (max-width: 860px) { .real-login { grid-template-columns: 1fr; } }

/* Ledger: the real app in an iframe */
.dt-ledger-live .dt-frame { background: #f5f4f0; }
.lg-live { display: block; border: 0; transform-origin: 0 0; background: #f5f4f0; }
.dt-ledger-live.is-try .dt-chapters { opacity: 0.55; }
