/* ==========================================================================
   Demo screen: a fixed 1120×700 "desktop" scaled to fit its frame (see demo.js).
   The widget, top bar and voice screen reuse the real app's styles
   (frontend/quickpanel.html, overlay.html, style.css).
   ========================================================================== */

.canvas {
  position: absolute; left: 0; top: 0; width: var(--cw, 1120px); height: var(--ch, 700px); overflow: hidden;
  transform: scale(var(--scale, 0.8)); transform-origin: 0 0;
  font-family: "Segoe UI", "Segoe UI Variable", var(--font-body);
  color: #e8faf1; text-align: left;
}
.canvas svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.canvas img { max-width: none; }

/* ---------- The invented "work" app ---------- */
.work { position: absolute; inset: 0 0 44px 0; display: flex; background: #0e1319; color: #dfe6ee; }
.work-side { width: 68px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0; background: #0a0e13; border-right: 1px solid rgba(255, 255, 255, 0.05); }
.work-side .wl { width: 28px; height: 28px; margin-bottom: 12px; border-radius: 8px; background: linear-gradient(135deg, #7aa2ff, #9b7bff); }
.work-side .wi { width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, 0.07); }
.work-side .wi.on { background: rgba(122, 162, 255, 0.25); box-shadow: inset 0 0 0 1px rgba(122, 162, 255, 0.5); }
.work-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 22px 28px; }
.work-top { display: flex; align-items: center; gap: 12px; }
.work-top b { font-size: 20px; font-weight: 600; }
.wpill { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; color: #9fb0c3; background: rgba(255, 255, 255, 0.06); }
.wav { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #f6a96b, #e06a8a); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kpi { padding: 14px 16px; border-radius: 12px; background: #121922; border: 1px solid rgba(255, 255, 255, 0.05); }
.kpi small { display: block; font-size: 12px; color: #7d8b9a; }
.kpi strong { display: block; margin: 2px 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.kpi em { font-style: normal; font-size: 12px; }
.kpi em.up { color: #4ade9b; } .kpi em.dn { color: #ff7a85; }
.chart-card { padding: 16px 18px 12px; border-radius: 14px; background: #121922; border: 1px solid rgba(255, 255, 255, 0.05); }
.chart-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.chart-head b { font-weight: 600; } .chart-head span { color: #7d8b9a; font-size: 12px; }
.chart-box { position: relative; }
#chart { display: block; width: 100%; height: 205px; }
.grid-lines line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
#chart, #chartArea { stroke: none; }
#chartLine { vector-effect: non-scaling-stroke; }
.js #chart { clip-path: inset(0 100% 0 0); }
.js .canvas.chart-in #chart { clip-path: inset(0 0 0 0); transition: clip-path 1.9s var(--ease); }
.months { display: flex; margin-top: 6px; font-size: 11px; color: #667380; }
.months i { flex: 1; text-align: center; font-style: normal; }
.rows { display: grid; gap: 10px; }
.rows i { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); }
.rows i:nth-child(1) { width: 78%; } .rows i:nth-child(2) { width: 92%; } .rows i:nth-child(3) { width: 60%; }

.spot { position: absolute; width: 0; height: 0; opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.spot.on { opacity: 1; }
.spot-ring { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); box-shadow: 0 0 26px rgba(31, 227, 161, 0.85), inset 0 0 14px rgba(31, 227, 161, 0.35); }
.spot-ring.r2 { animation: spotPing 1.8s ease-out infinite; border-width: 1.5px; }
@keyframes spotPing { from { transform: scale(0.7); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.spot-chip { position: absolute; left: 34px; top: -50px; display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 7px 13px; border-radius: 999px; font: 600 12.5px/1 "Segoe UI", var(--font-body); color: #e8faf1; background: rgba(7, 10, 14, 0.94); border: 1px solid rgba(31, 227, 161, 0.55); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); transform: translateY(8px) scale(0.9); transition: transform 0.6s var(--ease-spring) 0.2s; }
.spot.on .spot-chip { transform: none; }
.spot-chip img { width: 14px; height: auto; }

/* ---------- Overlays ---------- */
.dim { position: absolute; inset: 0; background: rgba(5, 7, 10, 0.74); backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.7s; pointer-events: none; }
.canvas.show-dim .dim { opacity: 1; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flashGo 0.7s ease-out; }
@keyframes flashGo { 0% { opacity: 0; } 12% { opacity: 0.45; } 100% { opacity: 0; } }

.keytoast { position: absolute; left: 50%; bottom: 110px; translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-radius: 20px; background: rgba(8, 12, 11, 0.82); border: 1px solid var(--line-accent); backdrop-filter: blur(14px); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6); opacity: 0; transform: translateY(24px) scale(0.92); transition: opacity 0.45s, transform 0.55s var(--ease-spring); pointer-events: none; }
.keytoast.on { opacity: 1; transform: none; }
.keytoast kbd { height: 56px; min-width: 72px; font-size: 15px; border-radius: 13px; transition: transform 0.12s, border-bottom-width 0.12s, box-shadow 0.2s, color 0.2s; }
.keytoast kbd.down { transform: translateY(3px); border-bottom-width: 1px; color: #fff; box-shadow: 0 0 30px rgba(31, 227, 161, 0.75); }

/* Top bar: mirrors frontend/overlay.html */
.obar {
  position: absolute; left: 50%; top: 24px; translate: -50% 0; scale: 1.14;
  width: 520px; height: 50px; overflow: hidden; border-radius: 999px;
  background: rgba(7, 10, 14, 0.94); border: 1px solid rgba(31, 227, 161, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-120px); transition: transform 0.75s var(--ease-spring), opacity 0.4s;
}
.obar.on { opacity: 1; transform: none; }
.obar.pulse { animation: barPulse 0.68s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes barPulse { 0% { transform: scaleX(0.82) scaleY(0.9); } 55% { transform: scaleX(1.025) scaleY(1.01); } 100% { transform: none; } }
.obar-glow { position: absolute; top: 50%; left: 50%; width: 0; height: 34px; border-radius: 999px; filter: blur(9px); opacity: 0; translate: -50% -50%; pointer-events: none; background: radial-gradient(ellipse at center, rgba(110, 255, 205, 0.6) 0%, rgba(31, 227, 161, 0.28) 45%, transparent 75%); }
.obar[data-state="listening"] .obar-glow, .obar[data-state="thinking"] .obar-glow, .obar[data-state="answering"] .obar-glow { animation: droplet 2.4s cubic-bezier(0.45, 0, 0.3, 1) infinite; }
@keyframes droplet { 0% { width: 0; opacity: 0; } 16% { width: 40px; opacity: 1; } 62% { width: 96%; opacity: 0.5; } 100% { width: 100%; opacity: 0; } }
.obar-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; height: 100%; padding: 0 20px; }
.obar-ring { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid #1fe3a1; border-top-color: transparent; animation: spinR 2.2s linear infinite; }
.obar[data-state="thinking"] .obar-ring { animation-duration: 0.7s; } .obar[data-state="answering"] .obar-ring { animation-duration: 1.4s; }
@keyframes spinR { to { rotate: 360deg; } }
.obar-text { font-size: 12.5px; letter-spacing: 0.01em; color: #e8faf1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.obar-wave { display: flex; align-items: center; gap: 2.5px; height: 16px; flex-shrink: 0; }
.obar-wave span { width: 2.5px; height: 4px; border-radius: 2px; background: #7cffce; opacity: 0.55; animation: bounceW 1.1s ease-in-out infinite; animation-play-state: paused; }
.obar-wave span:nth-child(1) { animation-delay: -1s; } .obar-wave span:nth-child(2) { animation-delay: -0.8s; } .obar-wave span:nth-child(3) { animation-delay: -0.6s; }
.obar-wave span:nth-child(4) { animation-delay: -0.4s; } .obar-wave span:nth-child(5) { animation-delay: -0.2s; } .obar-wave span:nth-child(6) { animation-delay: -0.9s; } .obar-wave span:nth-child(7) { animation-delay: -0.5s; }
.obar[data-state="listening"] .obar-wave span { animation-play-state: running; opacity: 1; }
@keyframes bounceW { 0%, 100% { height: 4px; } 50% { height: 15px; } }
.obar-live { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: #7cffce; }
.obar-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #1fe3a1; animation: dotP 1.6s ease-in-out infinite; }
@keyframes dotP { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.obar-stop { flex-shrink: 0; padding: 6px 12px; border-radius: 999px; font-size: 11.5px; color: #e8faf1; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); }

/* Quick-access widget: mirrors frontend/quickpanel.html */
.qp, .live-card {
  position: absolute; right: 30px; bottom: 64px; width: 352px; padding: 16px; border-radius: 18px;
  background: rgba(9, 13, 12, 0.95); border: 1px solid rgba(31, 227, 161, 0.24);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.4); backdrop-filter: blur(14px);
  opacity: 0; transform: scale(0.94) translateY(12px); transform-origin: bottom right; pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.34, 1.2, 0.64, 1), transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.qp { display: flex; flex-direction: column; gap: 10px; }
.qp.on, .live-card.on { opacity: 1; transform: none; }
.qp-head { display: flex; align-items: center; gap: 8px; }
.qp-head img { width: 18px; height: auto; }
.qp-head span { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: #e8faf1; }
.qp-head .x { margin-left: auto; width: 13px; height: 13px; color: #6b8a80; }
.qp-row { display: flex; gap: 8px; }
.qp-input { position: relative; flex: 1; min-width: 0; height: 38px; display: flex; align-items: center; padding: 0 11px; border-radius: 10px; font-size: 13px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); overflow: hidden; white-space: nowrap; transition: border-color 0.2s; }
.qp-input.focus { border-color: rgba(31, 227, 161, 0.5); }
.qp-input .ph { color: #6b7a75; }
.qp-input.has-text .ph { display: none; }
.qp-input .txt { color: #e8faf1; }
.qp-input .caret { display: none; width: 1px; height: 16px; margin-left: 1px; background: #7cffce; animation: blinkC 1s steps(2) infinite; }
.qp-input.focus .caret { display: block; }
@keyframes blinkC { 50% { opacity: 0; } }
.qp-send { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: #1fe3a1; color: #06110d; transition: transform 0.15s, background 0.15s; }
.qp-send svg { width: 15px; height: 15px; }
.qp-send.press { transform: scale(0.88); background: #37f0b4; }
.qp-mic { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); color: #e8faf1; }
.qp-mic svg { width: 15px; height: 15px; }
.qp-sel { flex: 1; min-width: 0; height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-radius: 10px; font-size: 11px; color: #cfe9df; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.qp-sel.off { opacity: 0.5; }
.qp-sel svg { width: 12px; height: 12px; }
.qp-answer { min-height: 148px; }
.qp-status { min-height: 15px; margin-bottom: 4px; font-size: 11px; color: #6b8a80; }
.qp-text { font-size: 12.5px; line-height: 1.55; color: #e8faf1; white-space: pre-wrap; }
.qp-open { font-size: 11px; color: #7cffce; }

/* Voice conversation: mirrors the app's voice overlay */
.voice { position: absolute; inset: 0 0 44px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; opacity: 0; transform: scale(0.97); pointer-events: none; transition: opacity 0.7s, transform 0.8s var(--ease); }
.voice.on { opacity: 1; transform: none; }
.v-ringwrap { position: relative; width: 150px; height: 150px; display: grid; place-items: center; }
.v-ringwrap img { position: relative; width: 112px; height: auto; filter: drop-shadow(0 0 30px rgba(31, 227, 161, 0.6)); animation: ringFloat 8s ease-in-out infinite; }
.v-pulse { position: absolute; inset: 14px; border-radius: 50%; border: 1px solid rgba(31, 227, 161, 0.55); animation: vPulse 2.4s ease-out infinite; }
.v-pulse.p2 { animation-delay: 0.8s; } .v-pulse.p3 { animation-delay: 1.6s; }
.voice[data-state="thinking"] .v-pulse { animation-duration: 1.2s; }
@keyframes vPulse { from { transform: scale(0.7); opacity: 1; } to { transform: scale(2.1); opacity: 0; } }
.v-status { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #7cffce; }
.v-lines { width: 600px; text-align: center; }
.v-you { min-height: 58px; font: 600 23px/1.35 var(--font-display); letter-spacing: -0.02em; color: #eef4f1; }
.v-ai { min-height: 84px; margin-top: 8px; font-size: 16px; line-height: 1.65; color: #9fb5ad; }
.v-end { padding: 10px 20px; border-radius: 999px; font-size: 13px; color: #e8faf1; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16); }

/* Compact live widget */
.live-card { display: block; }
.lc-head { display: flex; align-items: center; gap: 8px; }
.lc-head img { width: 16px; height: auto; }
.lc-head span { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.lc-head em { margin-left: auto; display: flex; align-items: center; gap: 5px; font-style: normal; font-size: 11.5px; font-weight: 600; color: #7cffce; }
.lc-head .dot { width: 6px; height: 6px; border-radius: 50%; background: #1fe3a1; animation: dotP 1.6s ease-in-out infinite; }
.lc-you { min-height: 18px; margin: 12px 0 8px; font-size: 12px; font-style: italic; color: #6b8a80; }
.lc-ai { min-height: 88px; font-size: 13px; line-height: 1.55; color: #e8faf1; }

/* Taskbar with the Oculiz tray icon */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: rgba(10, 14, 18, 0.94); border-top: 1px solid rgba(255, 255, 255, 0.06); backdrop-filter: blur(10px); }
.tb-start { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #7aa2ff, #4f6fd8); }
.tb-i { width: 26px; height: 26px; border-radius: 7px; background: rgba(255, 255, 255, 0.08); }
.tb-i.on { box-shadow: inset 0 -3px 0 #7aa2ff; }
.tb-gap { flex: 1; }
.tb-tray { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; }
.tb-tray img { width: 16px; height: auto; filter: drop-shadow(0 0 6px rgba(31, 227, 161, 0.7)); }
.canvas[data-active="1"] .tb-tray { background: rgba(31, 227, 161, 0.16); }
.tb-clock { margin-left: 6px; font-size: 11.5px; color: #9aa7b4; }

/* ---------- Guided help scene ---------- */
.wbtn { margin-left: auto; margin-right: 12px; padding: 7px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: #c9d6e6; background: rgba(122, 162, 255, 0.14); border: 1px solid rgba(122, 162, 255, 0.35); transition: transform 0.15s, background 0.15s; }
.wbtn.pressed { transform: scale(0.94); background: rgba(122, 162, 255, 0.34); }
.wmenu { position: absolute; left: 0; top: 0; width: 156px; padding: 6px; border-radius: 12px; background: #151c26; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); opacity: 0; transform: translateY(-6px) scale(0.97); transform-origin: top right; transition: opacity 0.25s, transform 0.3s var(--ease); pointer-events: none; z-index: 3; }
.wmenu.on { opacity: 1; transform: none; }
.wmenu i { display: block; padding: 9px 12px; border-radius: 8px; font-style: normal; font-size: 13px; color: #cdd7e3; transition: background 0.15s; }
.wmenu i.pressed { background: rgba(122, 162, 255, 0.3); }
.say { position: absolute; left: 50%; bottom: 92px; translate: -50% 0; max-width: 80%; padding: 12px 22px; border-radius: 999px; font: 500 16px/1.3 var(--font-display); color: #eef4f1; white-space: nowrap; background: rgba(8, 12, 11, 0.9); border: 1px solid var(--line-accent); backdrop-filter: blur(12px); opacity: 0; transform: translateY(14px); transition: opacity 0.4s, transform 0.5s var(--ease); z-index: 6; }
.say.on { opacity: 1; transform: none; }
.gring { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: left 0.85s var(--ease), top 0.85s var(--ease), opacity 0.4s; pointer-events: none; z-index: 4; }
.gring.on { opacity: 1; }
.gring i { position: absolute; left: calc(var(--rw, 72px) / -2); top: calc(var(--rh, 44px) / -2); width: var(--rw, 72px); height: var(--rh, 44px); border-radius: 12px; border: 2px solid var(--accent); box-shadow: 0 0 30px rgba(31, 227, 161, 0.8), inset 0 0 16px rgba(31, 227, 161, 0.3); }
.gring i + i { border-width: 1.5px; animation: spotPing 1.8s ease-out infinite; }
.gcursor { position: absolute; left: 560px; top: 330px; width: 28px; height: 28px; opacity: 0; transition: left 1s var(--ease), top 1s var(--ease), opacity 0.3s, scale 0.15s; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); pointer-events: none; z-index: 5; }
.gcursor.on { opacity: 1; }
.gcursor.click { scale: 0.8; }
.gcursor svg { width: 28px; height: 28px; fill: #fff; stroke: #05070a; stroke-width: 1.4; }
.gcard { position: absolute; left: 0; top: 0; width: 262px; padding: 14px 16px; border-radius: 16px; background: rgba(9, 13, 12, 0.97); border: 1px solid rgba(31, 227, 161, 0.38); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); opacity: 0; transform: translate(-50%, 8px) scale(0.96); transition: opacity 0.35s, transform 0.45s var(--ease-spring), left 0.85s var(--ease), top 0.85s var(--ease); pointer-events: none; z-index: 6; }
.gcard.on { opacity: 1; transform: translate(-50%, 0); }
.gc-head { display: flex; align-items: center; gap: 8px; font: 400 9.5px/1 var(--font-brand); letter-spacing: 0.18em; text-transform: uppercase; color: #7cffce; }
.gc-head img { width: 16px; height: auto; }
.gc-text { margin-top: 9px; font-size: 14px; line-height: 1.45; color: #eef4f1; }
.gc-text b { color: #7cffce; font-weight: 600; }
.dtoast { position: absolute; right: 64px; top: 100px; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #04110c; background: var(--accent); box-shadow: 0 14px 40px rgba(31, 227, 161, 0.4); opacity: 0; transform: translateY(-10px); transition: opacity 0.3s, transform 0.4s var(--ease-spring); z-index: 7; }
.dtoast.on { opacity: 1; transform: none; }

/* Phones: a narrower, taller desktop (480px wide) so the widget text stays readable once scaled to fit */
@media (max-width: 720px) {
  .screen { --cw: 480px; --ch: 700px; --ar: 480 / 700; }
  .work-side { display: none; }
  .work-main { padding: 88px 18px 18px; gap: 14px; }   /* room for the top bar to float above the content */
  .dtoast { right: 22px; top: 134px; }
  .work-top b { font-size: 17px; }
  .kpis { gap: 10px; }
  .kpi { padding: 11px 12px; }
  .kpi small { font-size: 11px; }
  .kpi strong { font-size: 21px; }
  .chart-card { padding: 14px 14px 10px; }
  .spot-chip { left: -108px; top: -54px; }
  .qp, .live-card { width: 332px; right: 10px; bottom: 60px; }
  .qp-input, .qp-text { font-size: 14px; }
  .qp-status { font-size: 12px; }
  .lc-ai { font-size: 14.5px; min-height: 100px; }
  .obar { width: 456px; scale: 1; }
  .obar-wave { display: none; }
  .v-lines { width: 420px; }
  .v-you { font-size: 20px; min-height: 54px; }
  .v-ai { font-size: 15px; }
  .say { font-size: 14px; max-width: 94%; padding: 10px 16px; bottom: 80px; }
  .gcard { width: 232px; }
  .wbtn { margin-right: 8px; padding: 6px 12px; }
  .keytoast { bottom: 90px; padding: 12px 14px; }
  .keytoast kbd { height: 42px; min-width: 52px; font-size: 12px; }
}
