/* Interactive replica of the Flash Android app (downloads.html hero).
   The app is laid out at its real width of 360dp, with 1px = 1dp, and phone-demo.js
   scales it to fit the phone frame. That lets every size below be copied 1:1 from
   flash-android HomeUi.kt / MainActivity.kt / FloatingBubble.kt. */

.pd-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pd-phone {
  position: relative; width: min(340px, calc(100vw - 48px)); aspect-ratio: 9 / 19.5;
  border-radius: 46px; padding: 11px; background: #0b0d0f;
  box-shadow: 0 0 0 2px #2b3035, 0 0 0 9px #e9efed, 0 0 0 10px rgba(16, 52, 44, .12), 0 50px 100px -30px rgba(16, 52, 44, .55);
}
.pd-screen { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: #0E0E0E; }

.pd-app {
  position: absolute; left: 0; top: 0; width: 360px; transform-origin: 0 0;
  font-family: 'Roboto', 'IBM Plex Sans', system-ui, sans-serif; color: #E8E8E8;
  -webkit-font-smoothing: antialiased; user-select: none;
}
.pd-status { height: 30px; padding: 8px 22px 0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 500; color: #E8E8E8; background: #0E0E0E; position: relative; z-index: 3; }
.pd-status__icons { display: flex; gap: 6px; align-items: center; }
.pd-status__icons svg { width: 14px; height: 14px; }
.pd-cam { position: absolute; left: 50%; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: #000; transform: translateX(-50%); box-shadow: 0 0 0 2px #151515; }

.pd-scroll { position: absolute; left: 0; right: 0; top: 30px; bottom: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.pd-scroll::-webkit-scrollbar { display: none; }
.pd-root { padding: 14px 18px 24px; display: flex; flex-direction: column; min-height: 100%; }
.pd-root.pd-anim > * { animation: pdIn .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pdIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.pd-gap8 { margin-top: 8px; } .pd-gap10 { margin-top: 10px; } .pd-gap12 { margin-top: 12px; }
.pd-gap16 { margin-top: 16px; } .pd-gap20 { margin-top: 20px; } .pd-gap24 { margin-top: 24px; }

.pd-press { transition: transform .26s cubic-bezier(.3, 1.6, .5, 1); cursor: pointer; }
.pd-press:active { transform: scale(.96); transition-duration: .09s; }

/* top bar */
.pd-top { display: flex; align-items: center; }
.pd-top__logo { width: 28px; height: 29px; }
.pd-top__word { height: 15px; margin-left: 10px; }
.pd-avatar { margin-left: auto; width: 38px; height: 38px; border-radius: 50%; background: #161616; border: 1px solid #52CFA0; color: #52CFA0; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.pd-h { font-size: 22px; font-weight: 700; }
.pd-label { font-size: 12px; color: #8A8A8A; line-height: 1.25; }

/* status card */
.pd-status-card { display: flex; align-items: center; gap: 0; padding: 12px 12px 12px 14px; border-radius: 16px; background: #161616; border: 1px solid #252525; }
.pd-status-card.is-on { border-color: rgba(82, 207, 160, .3); }
.pd-orb { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.pd-orb__ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #52CFA0; animation: pdRing 1.8s linear infinite; }
@keyframes pdRing { from { transform: scale(1); opacity: .6; } to { transform: scale(1.35); opacity: 0; } }
.pd-orb__core { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: #1F1F1F; border: 1px solid #2E2E2E; color: #8A8A8A; }
.is-on .pd-orb__core { background: linear-gradient(135deg, #FF7300, #52CFA0); border: 0; color: #111; }
.pd-orb__core svg { width: 20px; height: 20px; }
.pd-status-card__text { flex: 1; min-width: 0; margin: 0 10px 0 12px; }
.pd-status-card__title { display: flex; align-items: center; font-size: 14px; font-weight: 500; }
.is-on .pd-status-card__title { color: #52CFA0; }
.pd-dots { display: inline-flex; gap: 3px; margin-left: 6px; }
.pd-dots i { width: 4px; height: 4px; border-radius: 50%; background: #52CFA0; animation: pdDot .45s ease-in-out infinite alternate; }
.pd-dots i:nth-child(2) { animation-delay: .18s; } .pd-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes pdDot { from { transform: scale(.6); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.pd-status-card__sub { font-size: 12px; color: #8A8A8A; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-pill-btn { height: 34px; padding: 0 16px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 0; font-family: inherit; }
.pd-pill-btn--start { background: linear-gradient(90deg, #FF7300, #52CFA0); color: #111; }
.pd-pill-btn--stop { background: transparent; color: #F87171; border: 1px solid #3A2626; }

/* row card */
.pd-row-card { display: flex; align-items: center; padding: 12px 14px; border-radius: 16px; background: #161616; border: 1px solid #252525; }
.pd-row-card__ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.pd-row-card__ico svg { width: 18px; height: 18px; }
.pd-row-card__text { flex: 1; margin: 0 8px 0 14px; min-width: 0; }
.pd-t14 { font-size: 14px; font-weight: 500; }
.pd-t12 { font-size: 12px; color: #8A8A8A; margin-top: 2px; }
.pd-chev { width: 18px; height: 18px; color: #6B6B6B; flex-shrink: 0; }

/* section header */
.pd-section { display: flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #8A8A8A; }
.pd-badge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #FBBF24; color: #111; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.pd-section__action { margin-left: auto; }

/* list card */
.pd-list { border-radius: 14px; background: #161616; border: 1px solid #252525; overflow: hidden; }
.pd-list > * + * { border-top: 1px solid #222; }
.pd-perm-row { display: flex; align-items: center; padding: 12px 14px; }
.pd-perm-row__dot { width: 8px; height: 8px; border-radius: 50%; background: #FBBF24; flex-shrink: 0; }
.pd-perm-row.is-done .pd-perm-row__dot { background: #52CFA0; }
.pd-perm-row__text { flex: 1; min-width: 0; margin: 0 10px 0 12px; }
.pd-outline-pill { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid #52CFA0; color: #52CFA0; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: transparent; font-family: inherit; }
.pd-perm-row.is-done .pd-outline-pill { border-color: #2E2E2E; color: #6B6B6B; }

.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-chip { padding: 6px 11px; border-radius: 999px; background: #161616; border: 1px solid #252525; font-size: 12px; color: #E8E8E8; }
.pd-chip:hover { border-color: #3a3a3a; }

.pd-short { display: flex; align-items: center; padding: 10px 14px; }
.pd-short b { width: 92px; flex-shrink: 0; font-size: 12px; color: #52CFA0; font-weight: 700; }
.pd-short span { font-size: 13px; color: #C8C8C8; }

.pd-icon-btn { width: 34px; height: 34px; border-radius: 10px; background: #161616; border: 1px solid #252525; display: grid; place-items: center; color: #A0A0A0; }
.pd-icon-btn svg { width: 16px; height: 16px; }
.pd-log { max-height: 240px; overflow-y: auto; scrollbar-width: thin; padding: 12px 14px; border-radius: 14px; background: #111; border: 1px solid #252525; font-family: 'IBM Plex Mono', monospace; font-size: 11px; line-height: 1.35; color: #8A8A8A; white-space: pre-wrap; user-select: text; }
.pd-version { font-size: 11px; color: #7A7A7A; text-align: center; }

/* example conversations (demo-only section) */
.pd-ex { padding: 12px; border-radius: 14px; background: #121212; border: 1px solid #222; display: flex; flex-direction: column; gap: 8px; }
.pd-ex__tag { font-size: 10px; letter-spacing: .08em; color: #6B6B6B; font-weight: 700; }

/* chat bubbles (HomeUi.bubble) */
.pd-msg { display: flex; align-items: flex-end; }
.pd-msg--user { justify-content: flex-end; }
.pd-msg__logo { width: 24px; height: 25px; margin-right: 8px; flex-shrink: 0; }
.pd-msg__body { max-width: 78%; padding: 10px 14px; font-size: 14px; line-height: 1.3; user-select: text; }
.pd-msg--user .pd-msg__body { background: rgba(82, 207, 160, .14); border: 1px solid rgba(82, 207, 160, .3); border-radius: 16px 16px 4px 16px; }
.pd-msg--flash .pd-msg__body { background: #161616; border: 1px solid #252525; border-radius: 16px 16px 16px 4px; }
.pd-ex .pd-msg__body { font-size: 13px; padding: 8px 12px; }

.pd-hint { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: #161616; border: 1px dashed #2E2E2E; font-size: 13px; color: #8A8A8A; }
.pd-hint svg { width: 18px; height: 18px; color: #52CFA0; flex-shrink: 0; }

/* page header */
.pd-page-head { display: flex; align-items: center; }
.pd-back { width: 38px; height: 38px; border-radius: 12px; background: #161616; border: 1px solid #252525; display: grid; place-items: center; }
.pd-back svg { width: 18px; height: 18px; }
.pd-page-head__t { margin-left: 12px; }
.pd-page-head__t b { display: block; font-size: 18px; font-weight: 700; }
.pd-page-head__t span { font-size: 12px; color: #8A8A8A; }

/* toggle row */
.pd-toggle-row { display: flex; align-items: center; padding: 12px 10px 12px 14px; }
.pd-toggle-row__text { flex: 1; margin-right: 10px; }
.pd-toggle-row__text p { font-size: 12px; color: #8A8A8A; margin-top: 3px; line-height: 1.2; }
.pd-switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; border-radius: 999px; background: #3A3A3A; border: 0; transition: background .2s; cursor: pointer; }
.pd-switch::after { content: ""; position: absolute; top: -2px; left: -2px; width: 24px; height: 24px; border-radius: 50%; background: #9A9A9A; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); transition: transform .2s, background .2s; }
.pd-switch.is-on { background: rgba(82, 207, 160, .43); }
.pd-switch.is-on::after { transform: translateX(16px); background: #52CFA0; }

.pd-account-head { display: flex; align-items: center; padding: 14px; }
.pd-account-head .pd-avatar { margin: 0; background: #0E0E0E; }
.pd-account-head div { margin-left: 12px; min-width: 0; }
.pd-menu-row { display: flex; align-items: center; padding: 13px 12px 13px 14px; font-size: 14px; font-weight: 500; }
.pd-menu-row .pd-chev { width: 16px; height: 16px; margin-left: auto; }
.pd-menu-row--red { color: #F87171; }
.pd-device { display: flex; align-items: center; padding: 12px 14px; }
.pd-usage { height: 8px; border-radius: 999px; background: #262626; overflow: hidden; }
.pd-usage i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FF7300, #52CFA0); transition: width .5s; }
.pd-notice { font-size: 13px; line-height: 1.25; color: #FBBF24; }
.pd-outline-btn { height: 46px; border-radius: 14px; border: 1px solid #52CFA0; color: #52CFA0; display: grid; place-items: center; font-size: 14px; font-weight: 500; }

/* account menu dialog (MainActivity.showAccountMenu) */
.pd-scrim { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); animation: pdFade .2s both; }
@keyframes pdFade { from { opacity: 0; } }
.pd-menu { position: absolute; top: 90px; right: 14px; width: 270px; z-index: 21; animation: pdMenu .22s cubic-bezier(.2, .8, .2, 1) both; transform-origin: top right; }
@keyframes pdMenu { from { opacity: 0; transform: scale(.92); } }

/* bottom sheet (demo-only explanations for permission rows) */
.pd-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; padding: 20px 20px 28px; background: #161616; border-top: 1px solid #2a2a2a; border-radius: 22px 22px 0 0; animation: pdSheet .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pdSheet { from { transform: translateY(100%); } }
.pd-sheet__grab { width: 36px; height: 4px; border-radius: 4px; background: #333; margin: -8px auto 14px; }
.pd-sheet h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.pd-sheet p { font-size: 13px; color: #A8A8A8; line-height: 1.45; }
.pd-sheet .pd-outline-btn { margin-top: 16px; }

/* floating bubble + caption overlay */
.pd-overlay { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.pd-bubble-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pd-bubble-hit { pointer-events: auto; cursor: grab; touch-action: none; }
.pd-bubble-hit:active { cursor: grabbing; }
.pd-bubble-icon { pointer-events: none; transition: opacity .2s; }
.pd-caption {
  position: absolute; max-width: 240px; padding: 10px 13px; border-radius: 14px;
  background: rgba(10, 10, 10, .92); border: 1px solid #2a2a2a; font-size: 13px; line-height: 1.4; color: #E8E8E8;
  pointer-events: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: pdIn .25s both;
}
.pd-caption b { color: #52CFA0; font-weight: 600; }
.pd-caption small { display: block; margin-top: 6px; font-size: 11px; color: #7A7A7A; }
.pd-caption a { color: #FF9A3D; }

/* type bar (browser fallback when voice is unavailable or not wanted) */
.pd-typebar { position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 12; display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: #161616; border: 1px solid #2E2E2E; pointer-events: auto; animation: pdIn .25s both; }
.pd-typebar input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #E8E8E8; font: inherit; font-size: 14px; padding: 0 12px; user-select: text; }
.pd-typebar input::placeholder { color: #6B6B6B; }
.pd-typebar button { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.pd-typebar .pd-mic { background: #1F1F1F; color: #52CFA0; }
.pd-typebar .pd-mic.is-live { background: linear-gradient(135deg, #FF7300, #52CFA0); color: #111; }
.pd-typebar .pd-send { background: linear-gradient(135deg, #FF7300, #52CFA0); color: #111; }
.pd-typebar svg { width: 18px; height: 18px; }

.pd-toast { position: absolute; left: 50%; bottom: 80px; z-index: 30; transform: translateX(-50%); max-width: 300px; padding: 10px 16px; border-radius: 12px; background: #2a2a2a; font-size: 13px; color: #eee; text-align: center; animation: pdIn .2s both; pointer-events: none; }

/* outside the phone */
.pd-meter { margin-top: 12px; display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono, monospace); font-size: .78rem; color: var(--muted, #5a6e6a); padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line, #ddd); box-shadow: var(--shadow); }
.pd-meter i { display: inline-flex; gap: 4px; }
.pd-meter i b { width: 8px; height: 8px; border-radius: 50%; background: var(--teal, #52cf9f); }
.pd-meter i b.used { background: var(--line-2, #ccc); }
.pd-tip { font-size: .82rem; color: var(--muted, #5a6e6a); text-align: center; max-width: 320px; }
.pd-tip strong { color: var(--text, #10221f); }
