/* Animated demo phone (demo.js). Everything lives under .sd; the phone is drawn at a fixed size
   (stage 480 x 700) and scaled down to fit narrow screens. */
.sd { max-width: 560px; margin: 0 auto; text-align: center; }
.sd-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 6px; }
.sd-tab, .sd-start button {
  font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  color: #CBD5E1; background: #121829; border: 1px solid #1E2943; border-radius: 999px;
  transition: background .2s, border-color .2s, color .2s;
}
.sd-tab { font-size: .9rem; font-weight: 700; padding: 8px 15px; }
.sd-tab svg { width: 16px; height: 16px; fill: currentColor; }
.sd-tab:hover, .sd-start button:hover { border-color: #33446B; color: #fff; }
.sd-tab.on { background: linear-gradient(135deg, #38BDF8, #6366F1); border-color: transparent; color: #fff; }

.sd-wrap { position: relative; width: 100%; height: 700px; }
.sd-stage { position: absolute; left: 50%; top: 0; width: 480px; height: 700px; transform-origin: top center;
  transform: translateX(-50%) scale(var(--k, 1)); text-align: left; }

/* phone */
.sd-phone { position: absolute; left: 90px; top: 14px; width: 300px; height: 624px; border-radius: 44px; padding: 10px;
  background: linear-gradient(145deg, #3a3d45, #121318 40%, #2a2c33);
  box-shadow: 0 30px 70px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.07); }
.sd-key { position: absolute; width: 5px; background: #2f323a; transition: background .15s, box-shadow .15s, transform .15s; }
.sd-vu { left: -4px; top: 118px; height: 30px; border-radius: 3px 0 0 3px; }
.sd-vd { left: -4px; top: 152px; height: 30px; border-radius: 3px 0 0 3px; }
.sd-pw { right: -4px; top: 122px; height: 40px; border-radius: 0 3px 3px 0; }
.sd-key.on { background: #38BDF8; box-shadow: 0 0 14px 4px rgba(56,189,248,.75); }
.sd-vu.on, .sd-vd.on { transform: translateX(2px); }
.sd-pw.on { transform: translateX(-2px); }

.sd-screen { position: relative; width: 280px; height: 604px; border-radius: 34px; overflow: hidden; background: #0b0c0f;
  color: #fff; font-family: Roboto, "Segoe UI", Arial, sans-serif; isolation: isolate; line-height: 1.3; }
.sd-screen * { box-sizing: border-box; }
.sd-cam { position: absolute; top: 9px; left: 50%; margin-left: -6px; width: 12px; height: 12px; border-radius: 50%;
  background: #000; box-shadow: inset 0 0 0 2px #111827; z-index: 40; }
.sd-status { height: 26px; display: flex; align-items: center; justify-content: space-between; padding: 4px 24px 0;
  font-size: 10px; font-weight: 600; }
.sd-sig { display: flex; align-items: flex-end; gap: 2px; }
.sd-sig i { width: 2.5px; background: currentColor; border-radius: 1px; display: block; }
.sd-sig b { width: 17px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px; margin-left: 5px; position: relative; }
.sd-sig b::after { content: ""; position: absolute; inset: 1.5px; background: currentColor; border-radius: 1px; }

/* the apps on the phone */
.sd-app { position: absolute; inset: 0; display: none; }
.sd-app.on { display: block; }
.sd-appbar { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
  border-bottom: 1px solid #1f2128; }
.sd-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px 0; }
.sd-av { width: 28px; height: 28px; border-radius: 50%; background: #8e9096; flex: none; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 800; }
.sd-av.g { background: linear-gradient(135deg, #22c55e, #0e7490); }
.sd-av.o { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.sd-av.v { background: #2563eb; }
.sd-head b { display: block; font-size: 11px; }
.sd-head small { display: block; font-size: 9px; color: #9ca3af; }
.sd-say { padding: 6px 12px 0; font-size: 10.5px; color: #f3f4f6; }
.sd-card { margin: 7px 8px 0; height: 142px; border-radius: 12px; padding: 20px 16px 0; text-align: center;
  background: linear-gradient(160deg, #1e293b 0%, #3b0764 100%); }
.sd-card h4 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; margin: 0; color: #fff; }
.sd-card p { margin: 10px 0 0; font-size: 12px; color: #cbd5e1; }
.sd-card .sd-link { margin-top: 22px; font-size: 13px; color: #fff; }
.sd-acts { display: flex; gap: 14px; padding: 7px 13px 0; height: 22px; font-size: 10px; align-items: center; }
.sd-acts span { display: flex; align-items: center; gap: 4px; }
.sd-acts svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-photo { margin: 7px 8px 0; height: 190px; border-radius: 12px; overflow: hidden; position: relative; }
.sd-photo svg, .sd-plant svg { display: block; width: 100%; height: 100%; }

.sd-msgs { padding: 10px 10px 0; display: flex; flex-direction: column; gap: 7px; }
.sd-msgs p { margin: 0; max-width: 78%; padding: 8px 11px; border-radius: 14px; font-size: 11px; line-height: 1.4; }
.sd-msgs p.in { background: #262a33; align-self: flex-start; border-bottom-left-radius: 4px; }
.sd-msgs .out { background: #2563eb; align-self: flex-end; border-bottom-right-radius: 4px; color: #fff; max-width: 78%;
  padding: 8px 11px; border-radius: 14px; font-size: 11px; animation: sd-pop .3s ease-out; }
.sd-msgs .out.img { padding: 4px; width: 120px; height: 130px; border-radius: 14px; overflow: hidden; }
.sd-msgs .out.img .sd-plant { width: 100%; height: 100%; border-radius: 11px; overflow: hidden; }
.sd-msgs small { align-self: center; font-size: 9px; color: #8b8f98; }
.sd-code { font-weight: 800; letter-spacing: .5px; position: relative; display: inline-block; }
.sd-chathead { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid #1f2128; font-size: 12px; }
.sd-chathead svg { width: 18px; height: 18px; fill: #fff; }
.sd-inputbar { position: absolute; left: 8px; right: 8px; bottom: 22px; display: flex; gap: 6px; align-items: center; }
.sd-field { flex: 1; height: 34px; border-radius: 17px; background: #1f232b; padding: 0 12px; display: flex; align-items: center;
  font-size: 11px; color: #8b8f98; overflow: hidden; white-space: nowrap; }
.sd-field .val { color: #fff; }
.sd-send { width: 34px; height: 34px; border-radius: 50%; background: #2563eb; display: flex; align-items: center; justify-content: center; flex: none; }
.sd-send svg { width: 15px; height: 15px; fill: #fff; }
.sd-paste { position: absolute; left: 20px; bottom: 62px; background: #3a3f4a; color: #fff; font-size: 11px; font-weight: 600;
  padding: 8px 16px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.5); opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s; }
.sd-paste.show { opacity: 1; transform: none; }

/* effects on top of the screenshot */
.sd-dim { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .35s; z-index: 2; pointer-events: none; }
/* the app's activation glow (ScreenshotActivity activationPulse): a still rainbow sweep, shown only near the
   side edges; demo.js widens the edges inward and back out while it fades. Top and bottom 15% stay clear. */
.sd-rainbow { position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none;
  background: conic-gradient(from 90deg, red, yellow, lime, cyan, blue, magenta, red); }
.sd-hl, .sd-pix { position: absolute; inset: 0; z-index: 4; pointer-events: none; transition: opacity .3s; }
.sd-hl b { position: absolute; background: rgba(52,168,83,.42); border-radius: 3px; }
/* teardrop handles (18dp in the app): the end handle's point is top-left, the start handle's top-right */
.sd-hl i { position: absolute; width: 14px; height: 14px; background: #34A853; border-radius: 0 50% 50% 50%; box-shadow: 0 2px 3px rgba(0,0,0,.35); }
.sd-hl i.s { border-radius: 50% 0 50% 50%; }
.sd-pix i { position: absolute; }
.sd-ink { position: absolute; left: 0; top: 0; width: 280px; height: 604px; z-index: 5; pointer-events: none; overflow: visible; transition: opacity .3s; }
.sd-ink .core { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.sd-ink .tail { fill: none; stroke: #0091EA; stroke-width: 11; stroke-opacity: .55; stroke-linecap: round; stroke-linejoin: round; }
.sd-crop { position: absolute; z-index: 4; border: 1.2px solid rgba(255,255,255,.55); border-radius: 14px; opacity: 0;
  box-shadow: 0 0 0 600px rgba(0,0,0,.55); transition: opacity .3s; pointer-events: none; }
.sd-crop i { position: absolute; width: 19px; height: 19px; border: 0 solid #fff; }
.sd-crop i:nth-child(1) { left: -2px; top: -2px; border-width: 3px 0 0 3px; }
.sd-crop i:nth-child(2) { right: -2px; top: -2px; border-width: 3px 3px 0 0; }
.sd-crop i:nth-child(3) { left: -2px; bottom: -2px; border-width: 0 0 3px 3px; }
.sd-crop i:nth-child(4) { right: -2px; bottom: -2px; border-width: 0 3px 3px 0; }

/* the app's editor buttons */
.sd-ed { position: absolute; inset: 0; z-index: 6; opacity: 0; transition: opacity .35s; pointer-events: none; --edb: 22px; }
.sd-ed.show { opacity: 1; }
.sd-ed svg { fill: #fff; display: block; }
.sd-top { position: absolute; top: 30px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; }
.sd-right { display: flex; align-items: center; gap: 5px; }
.sd-rb { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center; transition: transform .12s, background .12s; }
.sd-rb svg { width: 19px; height: 19px; }
.sd-tb { display: flex; align-items: center; height: 30px; border-radius: 15px; background: rgba(0,0,0,.78); overflow: hidden;
  max-width: 0; padding: 0; transition: max-width .45s, padding .45s; }
.sd-tb.show { max-width: 200px; padding: 0 4px; }
.sd-tb span { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none;
  transition: background .15s, transform .12s; }
.sd-tb span svg { width: 13px; height: 13px; }
.sd-tb span.on { background: rgba(255,255,255,.32); }
.sd-tb .sep { width: 1px; height: 14px; background: rgba(255,255,255,.3); margin: 0 2px; border-radius: 0; }
.sd-tb .col { width: 17px; height: 17px; background: #f00; border: 1.5px solid #fff; margin-left: 2px; }
.sd-bot { position: absolute; left: 12px; right: 12px; bottom: var(--edb); height: 38px; transition: opacity .25s; }
.sd-x { position: absolute; left: 0; top: 2px; width: 34px; height: 34px; border-radius: 50%; background: rgba(30,34,45,.92);
  border: 1px solid rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.sd-x svg { width: 17px; height: 17px; }
.sd-mid { position: absolute; left: 50%; top: 3px; transform: translateX(-50%); display: flex; gap: 8px; }
.sd-pill { height: 32px; border-radius: 16px; padding: 0 12px; display: flex; align-items: center; gap: 5px; white-space: nowrap;
  background: rgba(30,34,45,.92); border: 1px solid rgba(255,255,255,.16); font-size: 10.5px; font-weight: 600;
  transition: transform .12s, background .12s; }
.sd-pill svg { width: 14px; height: 14px; }
.sd-lens { position: absolute; right: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.88);
  display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.sd-lens svg { width: 19px; height: 19px; fill: #000; }
.sd-bot2 { opacity: 0; }
.sd-ed.sel .sd-bot1 { opacity: 0; }
.sd-ed.sel .sd-bot2 { opacity: 1; }
.sd-chip { position: absolute; display: flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 14px;
  background: #1E222D; border: 1px solid rgba(255,255,255,.2); font-size: 10.5px; font-weight: 600; opacity: 0;
  transform: translateY(4px); transition: opacity .2s, transform .2s; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.sd-chip svg { width: 13px; height: 13px; }
.sd-chip.show { opacity: 1; transform: none; }
.sd-screen .press { transform: scale(.88); background: rgba(255,255,255,.4); }
.sd-screen .sd-lens.press { background: #fff; }

/* pages that open after a button */
.sd-page { position: absolute; inset: 0; z-index: 10; transform: translateX(102%); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.sd-page.show { transform: none; }
.sd-chat { background: #0b0c0f; }
.sd-search { background: #fff; color: #202124; }
.sd-url { margin: 4px 10px 0; height: 30px; border-radius: 15px; background: #f1f3f4; display: flex; align-items: center; gap: 6px;
  padding: 0 12px; font-size: 10.5px; color: #3c4043; }
.sd-url svg { width: 11px; height: 11px; fill: #5f6368; }
.sd-load { height: 2px; margin-top: 6px; overflow: hidden; }
.sd-load i { display: block; height: 100%; width: 0; background: #1a73e8; }
.sd-qbox { margin: 12px 12px 0; height: 36px; border-radius: 18px; border: 1px solid #dadce0; display: flex; align-items: center;
  gap: 8px; padding: 0 12px; font-size: 12px; box-shadow: 0 1px 4px rgba(32,33,36,.12); }
.sd-qbox svg { width: 15px; height: 15px; fill: #5f6368; flex: none; }
.sd-qbox .q::after { content: ""; display: inline-block; width: 1px; height: 13px; background: #1a73e8; margin-left: 1px; vertical-align: -2px; }
.sd-stabs { display: flex; gap: 16px; padding: 12px 16px 0; font-size: 10.5px; color: #5f6368; border-bottom: 1px solid #ebebeb; }
.sd-stabs span { padding-bottom: 7px; }
.sd-stabs b { color: #1a73e8; border-bottom: 2px solid #1a73e8; padding-bottom: 5px; }
.sd-res { padding: 4px 16px 0; }
.sd-res div { padding: 11px 0 0; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.sd-res div.show { opacity: 1; transform: none; }
.sd-res small { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: #4d5156; }
.sd-res small i { width: 14px; height: 14px; border-radius: 50%; background: #e8eaed; display: inline-block; }
.sd-res b { display: block; font-size: 13px; font-weight: 500; color: #1a0dab; margin: 3px 0 2px; }
.sd-res p { margin: 0; font-size: 10px; color: #4d5156; line-height: 1.45; }
.sd-lenspage { background: #111; transform: translateY(102%); }
.sd-lenstop { position: absolute; left: 0; right: 0; top: 26px; height: 250px; display: flex; align-items: center; justify-content: center; }
.sd-lensimg { position: relative; width: 150px; height: 190px; }
.sd-lensimg .sd-plant { width: 100%; height: 100%; border-radius: 10px; overflow: hidden; }
.sd-lensimg i { position: absolute; width: 22px; height: 22px; border: 0 solid #fff; }
.sd-lensimg i:nth-of-type(1) { left: -8px; top: -8px; border-width: 3px 0 0 3px; border-radius: 10px 0 0 0; }
.sd-lensimg i:nth-of-type(2) { right: -8px; top: -8px; border-width: 3px 3px 0 0; border-radius: 0 10px 0 0; }
.sd-lensimg i:nth-of-type(3) { left: -8px; bottom: -8px; border-width: 0 0 3px 3px; border-radius: 0 0 0 10px; }
.sd-lensimg i:nth-of-type(4) { right: -8px; bottom: -8px; border-width: 0 3px 3px 0; border-radius: 0 0 10px 0; }
.sd-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 290px; background: #fff; color: #202124; border-radius: 18px 18px 0 0;
  padding: 8px 12px 0; }
.sd-sheet .grab { display: block; width: 32px; height: 4px; border-radius: 2px; background: #dadce0; margin: 0 auto 10px; }
.sd-sheet > b { font-size: 13px; }
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sd-grid div { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.sd-grid div.show { opacity: 1; transform: none; }
.sd-grid span { display: block; height: 78px; border-radius: 10px; }
.sd-grid small { display: block; font-size: 9.5px; margin-top: 4px; color: #3c4043; line-height: 1.3; }

.sd-toast { position: absolute; left: 50%; bottom: 74px; transform: translate(-50%, 6px); background: rgba(60,62,68,.96); color: #fff;
  font-size: 10.5px; padding: 7px 14px; border-radius: 16px; opacity: 0; transition: opacity .25s, transform .25s; white-space: nowrap; z-index: 20; }
.sd-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* navigation: gesture bar, or three buttons when the demo uses Home */
.sd-nav { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; z-index: 15; pointer-events: none; }
.sd-nav .bar { position: absolute; left: 50%; bottom: 6px; width: 84px; height: 4px; margin-left: -42px; border-radius: 2px; background: rgba(255,255,255,.85); }
.sd-nav .btns { display: none; }
.sd-nav.three { height: 32px; background: #000; }
.sd-nav.three .bar { display: none; }
.sd-nav.three .btns { display: flex; height: 100%; align-items: center; justify-content: space-around; padding: 0 30px; }
.sd-nav .btns i { display: block; width: 12px; height: 12px; border: 1.8px solid #e5e7eb; transition: box-shadow .15s, background .15s; }
.sd-nav .btns .back { border: 0; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 10px solid #e5e7eb; }
.sd-nav .btns .home { width: 15px; height: 15px; border-radius: 50%; }
.sd-nav .btns .rec { border-radius: 2px; }
.sd-nav .btns .home.on { background: #38BDF8; border-color: #38BDF8; box-shadow: 0 0 12px 4px rgba(56,189,248,.8); }
.sd-nav.light .bar { background: rgba(0,0,0,.6); }

/* finger */
.sd-hand { position: absolute; left: 0; top: 0; width: 90px; height: 90px; z-index: 30; opacity: 0; pointer-events: none;
  transform-origin: 30px 8px; filter: drop-shadow(0 0 2px rgba(0,0,0,.9)) drop-shadow(0 5px 9px rgba(0,0,0,.6)); }
.sd-swipe { position: absolute; z-index: 29; pointer-events: none; left: 0; top: 0; width: 480px; height: 700px; overflow: visible; }

/* caption + start method */
.sd-cap { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin-top: 2px; }
.sd-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #38BDF8, #6366F1);
  color: #fff; font-weight: 800; font-size: .95rem; display: flex; align-items: center; justify-content: center; }
.sd-txt { font-size: 1.2rem; font-weight: 700; color: #fff; }
.sd-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0 16px; }
.sd-dots i { width: 24px; height: 4px; border-radius: 2px; background: #1E2943; transition: background .3s; }
.sd-dots i.done { background: #33446B; }
.sd-dots i.on { background: #38BDF8; }
.sd-start { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; font-size: .85rem; color: #94A3B8; }
.sd-start button { font-size: .8rem; font-weight: 600; padding: 5px 11px; }
.sd-start button.on { color: #fff; border-color: #38BDF8; background: rgba(56,189,248,.14); }
.sd-hint { font-size: .78rem; color: #64748B; margin-top: 8px; }
.sd-notr, .sd-notr * { transition: none !important; }

@keyframes sd-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
