.guide-tools { display:flex; align-items:center; gap:.65rem; }
.guide-tools select { font:inherit; font-size:.85rem; color:var(--accent); background:white; border:1px solid #b6a8c9; border-radius:1rem; padding:.25rem .4rem; }
#speed { min-width:3.3em; font-variant-numeric:tabular-nums; }
#time,#speed { unicode-bidi:isolate; }
.menu-row { text-align:start; }
.popup { right:auto; inset-inline-end:5%; }
/* The sidebar scene demonstrates a hotspot configured on the physical right edge. */
@media(max-width:680px){.guide-tools{gap:.35rem}}


.tip-button { display:inline-flex; align-items:center; gap:.4em; width:fit-content; color:var(--accent); background:white; border:1px solid #b6a8c9; border-radius:14px; padding:.45em .7em; line-height:1.2; text-align:start; }
.tip-button svg { width:1.15em; height:1.15em; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#tip-saved { margin-block-start:10px; }
#tip-cue { position:absolute; z-index:5; font-size:clamp(10px,1vw,13px); max-width:90%; box-shadow:0 2px 8px #180f2a22; }
[data-chapter="quick"] #tip-cue { inset-inline-end:5%; bottom:70%; }
[data-chapter="sidebar"] #tip-cue { right:17px; top:calc(var(--pos) + 7.5%); transform:translateY(-50%); max-width:calc(100% - 32px); }
@media(prefers-reduced-motion:no-preference){#tip-cue:not([hidden]){animation:tip-arrive .55s ease-out} @keyframes tip-arrive{0%{opacity:.3;box-shadow:0 0 0 5px #653ca755}100%{opacity:1;box-shadow:0 0 0 0 transparent}}}
#tip-dialog { width:min(90vw,390px); border:0; border-radius:20px; padding:24px; color:var(--title); background:var(--surface); box-shadow:0 12px 40px #180f2a40; }
#tip-dialog::backdrop { background:#180f2a62; }
#tip-dialog form { margin-top:18px; text-align:end; }
#tip-dialog button { border:0; border-radius:18px; padding:7px 16px; background:var(--accent); color:white; }

footer #speed { border:1px solid #b6a8c9; border-radius:20px; background:transparent; color:var(--accent); padding:5px 9px; }
footer #seek { flex:1; min-width:48px; margin:0; height:32px; accent-color:var(--brand); cursor:pointer; }
footer #seek:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
footer:not(:has(#play[hidden])) .track,footer:has(#play[hidden]) #seek { display:none; }
@media(max-width:680px){
  footer { flex-wrap:wrap; gap:7px; }
  footer #mode { flex-basis:100%; }
}

.chapter-nav{display:grid;grid-template-columns:auto 1fr 1fr;align-items:start;gap:1rem;margin-block:16px 3px;font-size:.88rem}
.chapter-nav a{color:var(--accent);text-underline-offset:3px}
.chapter-nav a[rel]{display:grid;gap:2px;justify-self:start}
.chapter-nav a[rel=next]{grid-column:3;text-align:end;justify-self:end}
.chapter-nav small{font-size:.87em;color:var(--muted)}
@media(max-width:680px){
  .chapter-nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem 1rem}
  .chapter-nav>a:first-child{grid-column:1/-1}
  .chapter-nav a[rel=next]{grid-column:2}
}

.device .next-bar,.next-bar {display:flex;align-items:center;justify-content:space-around;gap:1px;align-self:stretch;margin-top:auto;padding:3px 1px;border-block-start:1px solid #977bb94a;background:var(--field,#f5f1fa);color:var(--ink,#30263b);border-radius:8px;flex-shrink:0}
.device .next-bar>* ,.next-bar>* {position:relative;display:grid;place-items:center;flex:1;min-width:0;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:inherit}
.next-bar svg{width:clamp(16px,5vw,22px);height:22px;fill:currentColor;stroke:none}
.device .next-bar button:hover,.device .next-bar button:focus-visible{background:var(--tint);color:var(--accent)}

.device .next-bar button.touch-target:after,.guided-touch:before{content:"";position:absolute;z-index:4;pointer-events:none;left:50%;top:50%;width:18px;height:18px;border:2px solid white;border-radius:50%;background:#a767db8c;box-shadow:0 0 0 2px var(--accent),0 0 0 5px #b19ad265;transform:translate(-50%,-50%)}
.command-art{width:20px;height:20px;fill:currentColor;flex:none}.sort-manual>span{flex:1}

/* Keep the grid slot and touch target, with a smaller mark than an app icon. */
#scene .tiles .grid-add {
  color:var(--muted);
  background:transparent;
  border-color:transparent;
}
.grid-add-mark {
  display:grid;
  place-items:center;
  height:var(--grid-icon-height,34px);
}
.grid-add-mark::before {
  content:"";
  width:18px;
  height:18px;
  border:1px dashed #a69fae;
  border-radius:50%;
  background:linear-gradient(currentColor,currentColor) center / 8px 1px no-repeat,
             linear-gradient(currentColor,currentColor) center / 1px 8px no-repeat;
}
[data-chapter="smart"] .grid-add { --grid-icon-height:30px }
#scene button.grid-add:is(:hover,:focus-visible) { color:var(--accent); background:var(--surface) }
@media(max-width:680px) {
  .grid-add { --grid-icon-height:27px }
  [data-chapter="smart"] .grid-add { --grid-icon-height:26px }
}

.launcher-pane{position:relative;display:flex;flex-direction:column;gap:8px;min-height:0;flex:1}
.launcher-home-apps{display:flex;justify-content:flex-end;gap:8px;pointer-events:none}
.launcher-home-apps>span{display:grid;justify-items:center;gap:3px;font-size:.84em}
.launcher-app-art{height:28px;width:28px;padding:4px;border-radius:9px;color:white;background:#207f83;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.launcher-home-apps>span+span .launcher-app-art{background:#8c478e}
button.launcher-space{position:relative;flex:1;min-height:64px;width:100%;border:0;background:transparent;touch-action:none;user-select:none;-webkit-touch-callout:none}
.launcher-menu{margin-top:auto;background:#fff;color:var(--title);border-radius:14px;padding:8px;box-shadow:0 3px 12px #29143c22}
.launcher-option,.provider-choice{position:relative;display:flex;width:100%;gap:8px;align-items:center;padding:8px;border:0;background:var(--surface);color:var(--ink,var(--title));border-radius:10px;font:inherit;text-align:start}
.launcher-option svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7}
.provider-mini{flex:none;display:grid;grid-template-columns:repeat(3,1fr);padding:4px;gap:2px;border-radius:6px;background:#dfd3f0;width:38px;height:28px;align-content:center}
.provider-mini.compact{width:29px;height:29px;grid-template-columns:repeat(2,1fr)}
.provider-mini i{height:7px;background:#7646a3;border-radius:2px}.provider-mini i:nth-child(even){background:#397c87}
.provider-choice{min-height:44px}.provider-choice+.provider-choice{margin-block-start:5px}
.launcher-space.guided-touch:before{width:30px;height:30px;background:conic-gradient(#9b64c9 var(--hold-angle,360deg),#d2bbec 0);mask:radial-gradient(circle,transparent 52%,black 58%);border:0}
.widget-launcher{display:flex;flex-direction:column;gap:5px;flex:1;min-height:0;padding:4px}
.widget-launcher>strong{font-size:.85em;color:var(--title)}
.widget-launcher .launcher-pane{border-radius:13px;padding:8px}
.widget-launcher [data-step=picker],.widget-launcher [data-step=collection]{background:var(--surface)}
.widget-launcher h3{margin:0}

.device .app-titlebar{display:flex;align-items:center;gap:4px;min-height:32px;flex-shrink:0;text-align:start}
.device .app-titlebar h3{margin:0!important}
.device .app-titlebar .app-up,.device #scene .app-titlebar .app-up{position:relative;display:grid;place-items:center;flex:none;width:32px;height:32px;min-width:0;margin:0;padding:0;background:transparent;color:inherit;border:0;border-radius:8px;cursor:pointer}
.app-up>span{display:block;font:normal 28px/1 "Segoe UI",sans-serif}
[dir=rtl] .app-up>span,[dir=rtl] .android-back svg{transform:scaleX(-1)}
.device .android-back{position:relative;display:grid;place-items:center;background:transparent;color:var(--muted);border:0;border-radius:6px;min-width:36px;height:24px;padding:0;align-self:flex-start}
.android-back svg{width:16px;height:16px}
footer :is(#play, #pause, #voice, #cc) {
  position:relative; flex: none; width:36px; height:36px; padding:7px; border:1px solid #b6a8c9; border-radius:50%;
  color:var(--accent); background:transparent; cursor:pointer;
}
footer #mode[data-msg="demo"], footer #play[hidden] + #pause { display:none; }
footer :is(#play, #pause) svg { display:block; width:100%; height:100%; fill:currentColor; }
footer :is(#play, #pause):disabled { opacity:.45; cursor:default; }
#voice svg { display:block; width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#voice[aria-pressed=false] .voice-on, #voice[aria-pressed=true] .voice-off { display:none; }
footer :is(#voice, #cc)[aria-pressed=true] { color:white; background:var(--accent); border-color:var(--accent); }
/* Keep the real speaker and its hint in view during the first-visit pause. */
footer:has(#voice-hint:not([hidden])) {
  position:sticky; bottom:0; z-index:7; background:var(--surface);
  padding-block-end:max(4px, env(safe-area-inset-bottom));
}
#voice-hint:not([hidden]) {
  position:absolute; z-index:6; bottom:calc(100% + 9px); left:50%; transform:translateX(-50%);
  width:max-content; max-width:155px; padding:7px 10px; border-radius:9px;
  color:white; background:var(--accent); font-size:.8rem; font-weight:500; line-height:1.3;
  text-align:center; pointer-events:none; box-shadow:0 2px 6px #180f2a28;
}
#voice-hint::after {
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:var(--accent);
}
footer :is(#voice, #play, #pause, #cc):focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

footer #cc { padding:0; font:700 13px/1 system-ui,sans-serif; }
#cc span { display:inline-block; padding:2px; border:1px solid currentColor; border-radius:3px; }
#subtitle {
  box-sizing:border-box; min-block-size:3.5em; padding:.55em 1em; margin-block-end:.6rem;
  display:grid; place-items:center; background:var(--surface); color:var(--title);
  border-inline-start:3px solid var(--accent); text-align:center; line-height:1.45;
}
#subtitle[hidden], .spoken-lines[hidden] { display:none; }
#transcript { margin-block:.85rem; }
#transcript summary { width:fit-content; color:var(--accent); cursor:pointer; }
#transcript summary:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.spoken-lines { max-inline-size:68ch; margin-block:.75rem; line-height:1.55; }
.spoken-lines p { margin-block:.4em; }
@media(max-width:440px) {
  footer #seek { flex-basis:calc(100% - 12ch); }
}
