/* The Lyra app shown on a device screen (device-agnostic, sized in em) */

/* ------------------------------------------------------------ screen */
.screen {
  --fs: 15.5px;
  position: absolute; inset: 16px;
  background: #07050d; border-radius: 10px; overflow: hidden;
  font-size: var(--fs);
  opacity: 0;
}

.boot { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, #241638, #0d0916 70%); transition: opacity .6s; }

.boot img { animation: bootpulse 1.6s ease-in-out infinite; }

@keyframes bootpulse { 50% { transform: scale(1.08); } }

.app { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--void); opacity: 0; transition: opacity .7s; }

.screen.ready .app { opacity: 1; }

.screen.ready .boot { opacity: 0; }

.app-top { display: flex; align-items: center; justify-content: space-between; padding: .8em 1.1em; border-bottom: 1px solid var(--line); background: #0b0713; }

.app-brand { display: flex; align-items: center; gap: .55em; font-family: var(--display); font-size: 1.15em; }

.app-brand img { width: 1.4em; height: 1.4em; }

.app-net { display: flex; align-items: center; gap: .5em; font-family: var(--mono); font-size: .72em; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .35em .8em; }

.app-net i { width: .55em; height: .55em; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.chat {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .8em;
  padding: 1em 1.2em .6em; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent 0, #000 16%); mask-image: linear-gradient(transparent 0, #000 16%);
}

.msg { max-width: 88%; line-height: 1.5; font-size: 1em; animation: rise .35s ease both; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.msg.user { align-self: flex-end; background: #2a1d4a; border: 1px solid #4a3690; padding: .55em .9em; border-radius: 1em 1em .25em 1em; }

.msg.lyra { align-self: stretch; max-width: 100%; display: flex; gap: .7em; }

.avatar { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; background: #1d1330; border: 1px solid var(--line); display: grid; place-items: center; margin-top: .1em; }

.avatar img { width: 1.15em; height: 1.15em; }

.lyra-body { flex: 1; min-width: 0; }

.lyra-body p { margin: 0; color: var(--beige); }

.steps { display: flex; flex-direction: column; gap: .3em; margin-bottom: .55em; font-family: var(--mono); font-size: .76em; color: var(--muted); }

.step { display: flex; align-items: center; gap: .6em; animation: rise .3s ease both; }

.step .ic { width: 1em; height: 1em; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: spin .7s linear infinite; }

.step.done .ic { animation: none; border: none; background: var(--green); position: relative; }

.step.done .ic::after { content: ""; position: absolute; left: .3em; top: .12em; width: .25em; height: .5em; border: solid #06281c; border-width: 0 2px 2px 0; transform: rotate(40deg); }

.step.done { color: #b9f3d9; }

@keyframes spin { to { transform: rotate(360deg); } }

.think { display: inline-flex; gap: .3em; padding: .5em 0; }

.think i { width: .5em; height: .5em; border-radius: 50%; background: var(--accent); animation: bounce 1s ease-in-out infinite; }

.think i:nth-child(2) { animation-delay: .15s; }

.think i:nth-child(3) { animation-delay: .3s; }

@keyframes bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-.3em); } }

.chips { display: flex; flex-wrap: wrap; gap: .45em; margin-top: .65em; }

.chip { display: inline-flex; align-items: center; gap: .45em; font-family: var(--mono); font-size: .72em; padding: .35em .75em; border: 1px solid var(--line); border-radius: 999px; background: #150e20; animation: rise .3s ease both; }

.chip img { width: 1.3em; height: 1.3em; }

.tk-note { margin-top: .5em; font-family: var(--mono); font-size: .66em; color: var(--muted); }

.composer { display: flex; gap: .6em; padding: .7em 1.1em 1em; }

.input { position: relative; flex: 1; min-height: 2.9em; display: flex; align-items: center; padding: 0 1em; border: 1px solid var(--line); border-radius: .8em; background: #120b1c; font-size: 1em; white-space: nowrap; overflow: hidden; }

.caret { width: 2px; height: 1.2em; background: var(--accent-strong); margin-left: 2px; animation: blink 1s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

.composer-ph { position: absolute; left: 1em; color: var(--muted); opacity: .7; font-size: .95em; }

.input.has .composer-ph { display: none; }

.send { flex: none; width: 2.9em; height: 2.9em; display: grid; place-items: center; border-radius: .8em; background: var(--accent-deep); color: #fff; font-size: 1em; transition: background .2s, transform .2s; }

.send.go { background: var(--accent); transform: scale(.92); }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9em; text-align: center; color: var(--muted); }

.empty img { width: 3.2em; height: 3.2em; opacity: .9; filter: drop-shadow(0 0 18px #a78bfa88); }

.empty b { font-family: var(--display); font-weight: 600; font-size: 1.7em; color: var(--beige); }

.empty small { font-family: var(--mono); font-size: .78em; letter-spacing: .06em; }

.chat:has(.msg:not([hidden])) .empty { display: none; }

.app-dl { display: inline-flex; align-items: center; gap: .5em; font-family: var(--mono); font-weight: 600; font-size: .72em; letter-spacing: .06em; text-transform: uppercase; color: #150E20; background: var(--accent); border-radius: 999px; padding: .5em 1.1em; cursor: pointer; transition: background .2s, transform .2s; }

.app-dl em { background: #150E2022; border-radius: 999px; padding: .1em .55em; font-size: .85em; }

.app-dl:hover { background: var(--accent-strong); transform: translateY(-1px); }

.tk-note { text-align: center; }

.msg.agent .lyra-body p { color: var(--beige); }

.agent-tag { display: inline-block; margin-bottom: .25em; font-family: var(--mono); font-size: .62em; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); }

/* ------------------------------------------------ 3D mode preview (chapter "Switch to 3D") */
.m3d { margin-top: .8em; perspective: 38em; display: flex; justify-content: center; }
.m3d-stage { position: relative; width: 18em; height: 12em; }
.m3d-box {
  position: absolute; left: 50%; top: 0; width: 9.6em; height: 100%; margin-left: -4.8em;
  box-sizing: border-box; padding: .7em; display: flex; flex-direction: column; gap: .45em; overflow: hidden;
  border-radius: 1.1em; border: 1px solid rgba(167, 139, 250, .3);
  background: radial-gradient(circle at 85% 0%, rgba(167, 139, 250, .38), transparent 55%), linear-gradient(170deg, #241838 0%, #0f0a1b 60%);
  box-shadow: 0 1.2em 2.4em -1em #000b;
  transform: translateX(calc(var(--p, 0) * -3.2em)) rotateY(calc(var(--p, 0) * -17deg)) scale(calc(1 - var(--p, 0) * .1));
}
.m3d-star { width: 1.5em; height: 1.5em; filter: drop-shadow(0 0 .4em #c4b0ff99); }
.m3d-card, .m3d-ask { background: #150e20; border: 1px solid var(--line); border-radius: .6em; padding: .45em .55em; display: flex; flex-direction: column; gap: .12em; }
.m3d-card small { font-family: var(--mono); font-size: .42em; letter-spacing: .12em; color: var(--muted); }
.m3d-card b { font-family: var(--mono); font-size: 1.1em; color: var(--beige); line-height: 1; }
.m3d-card b i { font-style: normal; font-size: .5em; color: var(--muted); }
.m3d-card span { font-family: var(--mono); font-size: .42em; color: var(--muted); }
.m3d-ask { align-items: center; text-align: center; margin-top: auto; padding: .55em; }
.m3d-ask b { font-size: .62em; color: var(--beige); }
.m3d-ask span { font-size: .45em; color: var(--muted); }
.m3d-input { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: .7em; background: #120b1c; padding: .3em .35em .3em .55em; }
.m3d-input span { font-size: .5em; color: var(--muted); }
.m3d-input i { width: 1.1em; height: 1.1em; border-radius: 50%; background: #F3EBFF; }
.m3d-menu {
  position: absolute; right: .3em; top: 50%; width: 2.2em; height: 10em;
  display: flex; flex-direction: column; align-items: center; justify-content: space-evenly;
  border-radius: 999px; background: var(--panel2); border: 1px solid rgba(167, 139, 250, .32);
  box-shadow: 0 0 .9em .1em rgba(167, 139, 250, .35), 0 0 2.6em .1em rgba(167, 139, 250, .18);
  opacity: var(--p, 0); transform: translateY(-50%) translateX(calc((1 - var(--p, 0)) * 1.2em));
}
.m3d-menu span { width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; background: #241a38; color: var(--accent-strong); }
.m3d-menu svg { width: .9em; height: .9em; display: block; }


/* ------------------------------------------------ plan card (the wallet's new flow: plan, fingerprint, done) */
.plan { align-self: center; width: min(100%, 34em); display: flex; flex-direction: column; gap: .55em; animation: rise .4s ease both; }
.plan-head { display: flex; align-items: center; gap: .5em; }
.plan-head b { font-family: var(--display); font-weight: 600; font-size: 1.02em; color: var(--beige); }
.plan-star { width: .95em; height: .95em; color: #fff; filter: drop-shadow(0 0 .35em #c4b0ffaa); }
.plan-steps { position: relative; display: flex; flex-direction: column; gap: .4em; border-radius: 1em; transition: box-shadow .4s ease, background .4s ease; }
.plan-steps.grouped { gap: 0; padding: .25em; background: #150e20; border: 1px solid rgba(167, 139, 250, .55); box-shadow: 0 0 0 .2em rgba(167, 139, 250, .1), 0 0 2.4em -.7em rgba(167, 139, 250, .6); }
.plan.done .plan-steps.grouped { border-color: var(--line); box-shadow: none; }
.plan-step { display: flex; align-items: center; gap: .7em; padding: .6em .75em; border-radius: .85em; background: #150e20; border: 1px solid var(--line); animation: rise .35s ease both; }
.plan-steps.grouped .plan-step { background: transparent; border-color: transparent; }
.plan-ic { position: relative; flex: none; width: 2em; height: 2em; border-radius: .6em; display: grid; place-items: center; color: var(--accent-strong); background: rgba(167, 139, 250, .14); transition: background .3s, color .3s; }
.plan-ic svg { width: 1.05em; height: 1.05em; display: block; }
.plan-step.active .plan-ic { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff; }
.plan-ok { position: absolute; right: -.3em; bottom: -.3em; width: 1em; height: 1em; border-radius: 50%; display: grid; place-items: center; background: #3DDC84; color: #08140D; box-shadow: 0 0 0 .14em #150e20; transform: scale(0); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.plan-ok svg { width: .62em; height: .62em; }
.plan-step.ok .plan-ok { transform: scale(1); }
.plan-txt { min-width: 0; display: flex; flex-direction: column; gap: .1em; }
.plan-txt small { font-size: .68em; color: var(--muted); }
.plan-txt b { font-size: .86em; font-weight: 600; color: var(--beige); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-txt em { font-style: normal; color: var(--muted); font-weight: 400; }
.plan-scan { position: absolute; inset: 0; border-radius: 1em; display: grid; place-items: center; background: rgba(13, 9, 22, .6); backdrop-filter: blur(3px); }
.plan-scan > span { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35em; padding: .8em 1.1em .6em; border-radius: 1em; background: #1e162e; border: 1px solid var(--line); overflow: hidden; color: var(--accent-strong); }
.plan-scan svg { width: 2em; height: 2em; }
.plan-scan small { font-size: .62em; font-weight: 600; color: var(--beige); }
.plan-scan i { position: absolute; left: .8em; right: .8em; top: .8em; height: 2px; border-radius: 2px; background: var(--accent-strong); box-shadow: 0 0 .6em var(--accent); animation: plan-scan 1s ease-in-out infinite alternate; }
@keyframes plan-scan { to { top: 2.6em; } }
.plan-details { display: flex; flex-direction: column; border-radius: .85em; background: #150e20; border: 1px solid var(--line); padding: .15em .9em; }
.plan-details > div { display: flex; justify-content: space-between; gap: 1em; padding: .38em 0; font-size: .74em; }
.plan-details > div + div { border-top: 1px solid rgba(167, 139, 250, .08); }
.plan-details span { color: var(--muted); }
.plan-details strong { font-family: var(--mono); font-weight: 600; color: var(--beige); text-align: right; }
.plan-details strong.low { color: #6EE7B7; }
.plan-confirm { display: flex; align-items: center; justify-content: center; gap: .55em; padding: .95em 0; border-radius: 999px; font-weight: 600; font-size: .85em; color: #150e20; background: linear-gradient(135deg, #C4B0FF, #A78BFA); box-shadow: 0 .7em 2em -.8em rgba(167, 139, 250, .8); transition: opacity .3s, background .3s; }
.plan-confirm svg { width: 1.15em; height: 1.15em; }
.plan-confirm.busy { opacity: .8; }
.plan-confirm.done { background: linear-gradient(135deg, #F3EBFF, #D9D2E8); }