/* Suitiee AI twin of Khalid, on the white HSD01 portrait screen (1080×1920 = 720×1280 CSS px, DPR 1.5), read from
   one to two metres at a busy stand and touched at arm's length.

   The design follows Apple's Human Interface Guidelines as far as a web page can:
   - Content fills the screen (Khalid, full bleed); navigation and controls float above it as capsules; everything
     else sits on a bottom sheet (HIG Layout, Materials, Sheets).
   - One accent colour, Suitiee's copper, and only on what can be tapped or is selected; one filled button per view
     (HIG Color, Buttons). Text uses three label levels on two background levels plus a fill (HIG Color).
   - iOS text styles at a kiosk scale: 1rem is the 17 pt body, so a HIG point is 1/17 rem (the root size follows
     the screen height). The smallest text is the 11 pt caption; touch targets are at least 44 pt.
   - A tab bar with five single-word places, one always selected (HIG Tab bars).
   - Motion is feedback only, never decoration, and off under reduced motion (HIG Motion).
   Brand (HIG Branding): Suitiee's mark once in the top bar, its copper as the tint, its own illustrations and
   photos in the cards; type is Inter and IBM Plex Sans Arabic.

   WebView rules of the kiosk (beside a WebRTC decode): no filter, backdrop-filter, mask, mix-blend-mode, clip-path
   or will-change; no animated box-shadow; only transform and opacity move. The "glass" of the floating capsules is
   therefore a translucent fill with a light edge, not a blur (the picture behind them is a plain studio backdrop).
   This file owns the tokens, the stage, the top bar, the home sheet, the card shell, the tab bar, the settings
   sheet, boot and access. The panes inside #presentation-body live in twin-panels.css. */
:root{
  color-scheme:light;
  /* Colour roles */
  --bg:#F6F0E6;                         /* the page and the sheet: the grouped background */
  --surface:#FFFFFF;                    /* cells, cards and bars on it */
  --fill:rgba(43,29,20,.055);           /* groups inside a white card */
  --fill-2:rgba(43,29,20,.09);          /* grey controls: steppers, the close button, secondary buttons */
  --fill-3:rgba(43,29,20,.16);          /* tracks, pressed greys */
  --separator:rgba(43,29,20,.12);
  --label:#2B1D14; --label-2:#6E5E53; --label-3:#9A8B80;
  --tint:#C2703D;                       /* filled buttons (white, bold, large labels only) */
  --tint-pressed:#A85A30;
  --tint-ink:#9C522B;                   /* tinted text and glyphs on light surfaces (at least 4.8:1) */
  --tint-soft:rgba(194,112,61,.14);     /* selection backgrounds */
  --green:#1F9D6B; --green-strong:#14724D; --green-soft:#E7F6EF;
  --red:#C23A2B; --red-soft:#FBEAE7; --orange:#B45309; --gold:#E0A33D;
  --backdrop:#BCB3B2;                   /* the studio backdrop of the avatar */
  --splash:#FCF7EF;                     /* the kiosk app's splash ground: boot and access start from it */
  /* Type: iOS text styles, 1rem = 17 pt */
  --font:'Inter','SF Pro Text',-apple-system,'Helvetica Neue',Arial,sans-serif;
  --font-ar:'IBM Plex Sans Arabic','SF Arabic','Noto Sans Arabic',Tahoma,sans-serif;
  --t-hero:2.35rem; --t-large:2rem; --t-title1:1.65rem; --t-title2:1.3rem; --t-title3:1.18rem;
  --t-body:1rem; --t-callout:.94rem; --t-subhead:.88rem; --t-footnote:.76rem; --t-caption:.71rem; --t-caption2:.65rem;
  /* Space: a 4 pt grid in rem */
  --s1:.2rem;--s2:.4rem;--s3:.6rem;--s4:.8rem;--s5:1rem;--s6:1.2rem;--s8:1.6rem;--s10:2rem;--s12:2.4rem;--s16:3.2rem;
  --gutter:1.4rem;
  /* Controls: 44 pt is 2.6rem */
  --hit:2.6rem; --control:3rem; --control-lg:3.4rem;
  /* Radii, concentric: sheet > card > cell > field; controls are capsules */
  --r-sheet:2.2rem; --r-card:1.4rem; --r-cell:1rem; --r-field:.8rem; --r-pill:999px;
  /* Elevation: only what floats casts a shadow */
  --e-float:0 .5rem 1.4rem rgba(43,29,20,.12),0 0 0 1px rgba(43,29,20,.05);
  --e-sheet:0 -.5rem 2.2rem rgba(43,29,20,.16);
  --e-tile:0 .8rem 2rem -.6rem rgba(43,29,20,.32),0 0 0 1px rgba(43,29,20,.06);
  --glass:rgba(255,255,255,.82);
  --fast:160ms;--normal:300ms;--slow:520ms;--ease:cubic-bezier(.32,.72,0,1);
  /* The page is always a 9:16 column: the full width on the kiosk and on phones, a centred column in a landscape
     preview window, so a Mac preview shows exactly what the display shows. */
  --frame-w:min(100vw,calc(100dvh * 9 / 16));
  --tile:calc(var(--frame-w) * .35);     /* Khalid's tile while a card is open: 3:4 */
}
html{font-size:calc(clamp(13px,1.6dvh,31px) * var(--text-scale,1))}   /* 20.48 px at 720×1280 */
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;background:var(--bg);color:var(--label);font-family:var(--font);letter-spacing:-.011em;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
[dir=rtl] body{font-family:var(--font-ar);letter-spacing:0}
body{overflow:hidden}
button,select,input{font:inherit;color:inherit;letter-spacing:inherit}
button{position:relative;overflow:hidden;margin:0;padding:0;border:0;background:none;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  transition:transform var(--fast) var(--ease),opacity var(--fast),background-color var(--fast),color var(--fast)}
button:disabled,select:disabled{opacity:.4;cursor:not-allowed}
/* Every button has a press state: it gives a little and dims (transform and opacity only). */
button:active:not(:disabled){transform:scale(.97);opacity:.8}
:focus-visible{outline:3px solid var(--tint);outline-offset:3px}
svg{width:1.25rem;height:1.25rem;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
svg.glyph{fill:currentColor;stroke:none}
[hidden]{display:none!important}
h1,h2,h3,h4,p{margin:0}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;white-space:nowrap;opacity:0}
/* The effects module still marks presses; the press state above is the feedback. */
.ripple{display:none}
button.pop{animation:none}
.pattern{display:none}
@keyframes rise{from{opacity:0;transform:translateY(.8rem)}}
@keyframes fade{from{opacity:0}}
@keyframes turn{to{transform:rotate(360deg)}}

/* Stage ------------------------------------------------------------------------------------------------
   Home: Khalid fills the column; the top bar floats over the backdrop above his head, the sheet covers him from the
   chest down. The column is a grid: top bar · open space over his face · conversation · tab bar. */
.display{position:relative;isolation:isolate;width:100%;max-width:var(--frame-w);height:100svh;height:100dvh;margin-inline:auto;overflow:hidden;
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;
  padding:0 var(--gutter) max(var(--s4),env(safe-area-inset-bottom));background:var(--bg)}
.portrait{position:absolute;inset:0;z-index:0;overflow:hidden;background:var(--backdrop);pointer-events:none}
.portrait-still,.portrait-media{position:absolute;display:block;object-fit:cover;object-position:50% 0}
/* Home: the 768×1152 frame at the column's width, from the top edge: his hair starts below the top bar, his face
   sits in the upper third, the sheet meets him below the collar. The box keeps the frame's 2:3, so the eye anchor
   of the glide (twin-display.mjs) holds. */
body:not(.presenting) .portrait-still,body:not(.presenting) .portrait-media{left:0;top:0;width:100%;height:auto;aspect-ratio:2/3}
.portrait-still{z-index:0}#idle-video{z-index:1}.live-video{z-index:2}
.live-video{opacity:0;transition:opacity var(--slow) var(--ease)}.live-video.playing{opacity:1}
.portrait:has(.live-video.playing) #idle-video{visibility:hidden}
.shade,.halo{display:none}
.portrait-tag{display:none}
.topbar,.conversation,.bottom-bar,.presentation{position:relative;z-index:3;grid-column:1/-1;min-width:0}
.topbar{grid-row:1}.presentation{grid-row:2}.conversation{grid-row:3}.bottom-bar{grid-row:4}
/* The sheet's surface: one plane from the sheet's top edge to the bottom of the screen, behind rows 3 and 4.
   Absolutely positioned inside that grid area, so it never takes a cell from the rows it lies under. */
.sheet-surface{position:absolute;grid-column:1/-1;grid-row:3/5;z-index:2;inset:0 calc(-1 * var(--gutter)) calc(-1 * max(var(--s4),env(safe-area-inset-bottom)));
  border-radius:var(--r-sheet) var(--r-sheet) 0 0;background:var(--bg);box-shadow:var(--e-sheet),inset 0 1px 0 rgba(255,255,255,.8)}
.presenting .sheet-surface{display:none}

/* Top bar: two floating groups. Leading: the Suitiee lockup with what this is. Trailing: the language. --------- */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);padding:calc(var(--s4) + env(safe-area-inset-top)) 0 var(--s3)}
.brand,.lang-switch,.topbar .icon-button{background:var(--glass);box-shadow:var(--e-float),inset 0 0 0 1px rgba(255,255,255,.6)}
.brand{display:inline-flex;align-items:center;gap:var(--s3);min-width:0;min-height:var(--hit);padding:0 var(--s5) 0 var(--s4);border-radius:var(--r-pill);
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default}
.brand-mark{display:block;width:auto;height:1.45rem;-webkit-user-drag:none;pointer-events:none}
.brand-word{font-size:var(--t-title3);font-weight:700;line-height:1;letter-spacing:-.02em}
.brand-sep{flex:none;width:1px;height:1.1rem;background:var(--separator)}
.brand-title{min-width:0;overflow:hidden;font-size:var(--t-subhead);font-weight:500;line-height:1.5;color:var(--label-2);white-space:nowrap;text-overflow:ellipsis;unicode-bidi:plaintext}
.top-actions{display:flex;align-items:center;gap:var(--s2);flex:none}
.demo-pill{display:none}
/* A two-segment control: the track is the capsule, the selected language a white segment. */
.lang-switch{display:inline-grid;grid-template-columns:1fr 1fr;align-items:center;min-height:var(--hit);padding:.2rem;border-radius:var(--r-pill)}
.lang-seg{display:grid;place-items:center;min-width:2.5rem;height:2.2rem;padding:0 var(--s3);border-radius:var(--r-pill);font-size:var(--t-subhead);font-weight:600;line-height:1;color:var(--label-2)}
.lang-seg[lang=ar]{font-family:var(--font-ar);font-size:var(--t-body)}
.lang-switch[data-lang=en] .lang-seg[data-l=en],.lang-switch[data-lang=ar] .lang-seg[data-l=ar]{background:var(--surface);color:var(--label);box-shadow:0 1px 3px rgba(43,29,20,.18)}
.icon-button{display:grid;place-items:center;flex:none;width:var(--hit);height:var(--hit);border-radius:50%;color:var(--label)}
/* The kiosk (html.kiosk: the app's WebView, app mode, ?kiosk=1): no fullscreen or settings button (the operator
   holds the lockup), and a left-to-right top bar in both languages, so the lockup stays in the top-left corner. */
html.kiosk #fullscreen,html.kiosk #settings{display:none}
html.kiosk .topbar{direction:ltr}

/* The home sheet: who this is, three ways in, the one filled button ------------------------------------------ */
.conversation{padding:var(--s6) 0 var(--s4)}
.status-line{display:flex;align-items:center;gap:var(--s2);min-height:1.3rem;margin-bottom:var(--s2);font-size:var(--t-subhead);font-weight:600;line-height:1.3;color:var(--label-2)}
.status-dot{position:relative;flex:none;width:.5rem;height:.5rem;border-radius:50%;background:var(--label-3)}
/* The live ring is its own circle that grows and fades (transform and opacity only). */
.status-dot::after{content:'';position:absolute;inset:0;border-radius:50%;background:var(--green);opacity:0;pointer-events:none}
body[data-state=connecting] .status-dot{background:var(--orange);animation:waiting 1s ease-in-out infinite alternate}
body[data-state=live] .status-dot{background:var(--green)}
body[data-state=live] .status-dot::after{animation:dot-ring 2.4s ease-out infinite}
body[data-state=error] .status-dot{background:var(--red)}
@keyframes waiting{to{opacity:.3}}@keyframes dot-ring{from{opacity:.7;transform:scale(1)}to{opacity:0;transform:scale(3.4)}}
.status-line.flash{animation:flash .9s var(--ease)}@keyframes flash{25%{opacity:.35}}
.wave{display:inline-flex;align-items:center;gap:.15rem;height:1.1rem;margin-inline-start:var(--s1)}
.wave i{display:block;width:.2rem;height:1.1rem;border-radius:.1rem;background:var(--green);transform:scaleY(.14)}
.wave[data-state=idle],.wave[data-state=error]{display:none}.wave[data-state=muted] i{background:var(--label-3)}
h1{font-size:var(--t-hero);font-weight:700;line-height:1.08;letter-spacing:-.03em;color:var(--label)}
h1 em{font-style:normal}
.intro{margin-top:var(--s2);font-size:var(--t-title3);line-height:1.3;color:var(--label-2)}
/* Three ways in: white cells on the sheet, each with one of Suitiee's own illustrations. */
.start-menu{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s3);margin-top:var(--s5);animation:rise var(--normal) var(--ease) both}
.start-card{display:grid;align-content:start;justify-items:start;gap:var(--s1);min-height:6rem;padding:var(--s4);border-radius:var(--r-card);background:var(--surface);color:var(--label);text-align:start}
.start-art{display:block;width:2.3rem;height:2.3rem;margin-bottom:var(--s1);object-fit:contain;pointer-events:none}
.start-card b{font-size:var(--t-body);font-weight:600;line-height:1.2;text-wrap:balance}
.start-card small{font-size:var(--t-footnote);line-height:1.3;color:var(--label-2);text-wrap:balance}
.hint{min-height:1.35em;margin-top:var(--s5);font-size:var(--t-subhead);line-height:1.35;color:var(--label-2);text-align:center;opacity:0;transform:translateY(.3rem);transition:opacity var(--normal) var(--ease),transform var(--normal) var(--ease)}
.hint.show{opacity:1;transform:none}
/* On the home screen the three cells already say what to ask; beside a card the hint says what that card wants. */
body:not(.presenting) .hint{display:none}
/* What was heard and what he says: two bubbles, the visitor's on the trailing side. The newest words stay in view. */
.caption{display:flex;flex-direction:column;justify-content:flex-end;gap:var(--s2);max-height:8.2em;margin-top:var(--s4);overflow:hidden;font-size:var(--t-body);line-height:1.35}
.caption>span{display:block;max-width:94%;padding:var(--s3) var(--s4);border-radius:1.1rem;overflow-wrap:anywhere}
.caption>span:empty{display:none}
.caption-user{align-self:flex-end;border-end-end-radius:.35rem;background:var(--tint-soft);color:var(--label)}
.caption-twin{align-self:flex-start;border-end-start-radius:.35rem;background:var(--surface);color:var(--label)}
.notice{margin-top:var(--s4);padding:var(--s3) var(--s4);border-radius:var(--r-cell);background:var(--surface);font-size:var(--t-subhead);line-height:1.4;color:var(--label)}
.conversation-actions{display:flex;align-items:center;gap:var(--s3);margin-top:var(--s5)}
/* Talk: the one filled button of the page. */
.primary-button{display:flex;align-items:center;justify-content:center;gap:var(--s3);flex:1 1 100%;min-height:var(--control-lg);padding:0 var(--s8);border-radius:var(--r-pill);
  background:var(--tint);color:#FFFFFF;font-size:var(--t-title3);font-weight:600;letter-spacing:-.015em;box-shadow:0 .6rem 1.4rem -.5rem rgba(194,112,61,.75),inset 0 1px 0 rgba(255,255,255,.28)}
.primary-button:active:not(:disabled){background:var(--tint-pressed);opacity:1}
.talk-glyph{position:relative;display:grid;place-items:center;width:1.5rem;height:1.5rem}
.talk-glyph svg{width:1.45rem;height:1.45rem;stroke-width:2}
/* While nobody talks to him, a soft ring breathes out of the microphone: the stand's one invitation. */
body[data-state=idle] #talk:not(:disabled) .talk-glyph::after{content:'';position:absolute;inset:-.3rem;border-radius:50%;border:2px solid rgba(255,255,255,.75);opacity:0;animation:beckon 3.2s var(--ease) infinite}
@keyframes beckon{0%{opacity:.85;transform:scale(.7)}60%,100%{opacity:0;transform:scale(1.9)}}
/* Connecting: the button stays where it is, says so and shows an activity indicator instead of the glyph. */
.spinner{display:none;width:1.3rem;height:1.3rem;border-radius:50%;border:.16rem solid rgba(255,255,255,.35);border-top-color:#FFFFFF;animation:turn .8s linear infinite}
.primary-button[aria-busy=true]{opacity:1;cursor:progress}
.primary-button[aria-busy=true] .talk-glyph{display:none}.primary-button[aria-busy=true] .spinner{display:block}
/* During a conversation: grey capsules, and red for ending it. */
.interrupt-button,.conversation-actions .quiet-button,.end-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--s2);flex:1 1 0;min-width:0;min-height:var(--control);padding:0 var(--s5);border-radius:var(--r-pill);font-size:var(--t-body);font-weight:600;white-space:nowrap}
.interrupt-button,.conversation-actions .quiet-button{background:var(--fill-2);color:var(--label)}
.interrupt-button svg{width:1.1rem;height:1.1rem;fill:currentColor;stroke:none}
.conversation-actions .quiet-button[aria-pressed=true]{background:var(--label);color:#FFFFFF}
.end-button{background:var(--red);color:#FFFFFF}
body[data-state=connecting] #end{flex:0 0 auto;background:none;color:var(--label-2);font-weight:500}
#mute .mic-off,#mute[aria-pressed=true] .mic-on{display:none}#mute[aria-pressed=true] .mic-off{display:block}
.privacy{margin-top:var(--s3);font-size:var(--t-footnote);line-height:1.4;color:var(--label-2);text-align:center}
body[data-state=live] h1{font-size:var(--t-title1)}body[data-state=live] .intro{display:none}
/* Whose turn it is (body[data-turn], set by the controller): the microphone may be closed while he speaks, so a
   visitor at a metre must see when to talk. Colour and words together. */
body[data-turn=listening] .status-line{align-self:flex-start;display:inline-flex;padding:var(--s2) var(--s4);border-radius:var(--r-pill);background:var(--green-strong);color:#FFFFFF}
body[data-turn=listening] .status-line .status-dot,body[data-turn=listening] .status-line .wave i{background:#FFFFFF}
body[data-turn=listening] .status-line .status-dot::after{background:#FFFFFF}

/* Tab bar: five places in one floating capsule; the selected one carries the tint ------------------------------ */
.bottom-bar{display:grid;justify-items:center;gap:var(--s3)}
.explore-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.1rem;width:100%;min-width:0;padding:.25rem;border-radius:var(--r-pill);background:var(--surface);box-shadow:var(--e-float)}
.nav-button{display:grid;justify-items:center;align-content:center;gap:.2rem;min-width:0;min-height:var(--control);padding:.25rem var(--s2);border-radius:var(--r-pill);color:var(--label-2);font-size:var(--t-caption2);font-weight:600;line-height:1.2}
.nav-button svg{width:1.3rem;height:1.3rem}
.nav-button span{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.nav-button[aria-pressed=true]{background:var(--tint-soft);color:var(--tint-ink)}
.nav-face{display:block;width:1.4rem;height:1.4rem;border-radius:50%;object-fit:cover;object-position:50% 16%;box-shadow:0 0 0 .1rem var(--surface),0 0 0 .18rem currentColor;pointer-events:none}
[dir=rtl] .nav-button{font-size:var(--t-caption)}
.footer-line{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.1rem var(--s3);font-size:var(--t-caption2);line-height:1.4;color:var(--label-3)}
.footer-by{display:inline-flex;align-items:center;gap:var(--s2)}
.footer-carve{display:block;width:auto;height:.85rem;opacity:.55;-webkit-user-drag:none;pointer-events:none}

/* The card: a sheet that takes the lower part of the screen while Khalid steps into a tile ---------------------- */
body:not(.presenting) .presentation{display:none}
.presentation{display:flex;flex-direction:column;overflow:hidden;border-radius:var(--r-sheet);background:var(--surface);box-shadow:var(--e-float)}
.presentation-head{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"kicker close" "title close";column-gap:var(--s4);align-items:start;flex-shrink:0;padding:var(--s6) var(--s6) var(--s3)}
.presentation.is-scrolled .presentation-head{box-shadow:inset 0 -1px 0 var(--separator)}
.presentation-head>.presentation-kicker{grid-area:kicker}.presentation-head>h2{grid-area:title}.presentation-head>#presentation-close{grid-area:close}
.presentation-kicker{margin-bottom:var(--s1);font-size:var(--t-subhead);font-weight:600;line-height:1.3;color:var(--label-2);overflow-wrap:anywhere}
.presentation-kicker:empty{display:none}
h2{font-size:var(--t-title1);font-weight:700;line-height:1.15;letter-spacing:-.025em;overflow-wrap:anywhere}
h3{font-size:var(--t-body);font-weight:600;line-height:1.3}
/* Close: the standard round button; its touch area reaches 44 pt around the 30 pt circle. */
#presentation-close,#close-settings{width:2.2rem;height:2.2rem;overflow:visible;background:var(--fill-2);color:var(--label-2);box-shadow:none}
#presentation-close::after,#close-settings::after{content:'';position:absolute;inset:-.25rem}
#presentation-close svg,#close-settings svg{width:1.05rem;height:1.05rem;stroke-width:2.4}
.presentation-feedback{flex-shrink:0;margin:0 var(--s6) var(--s2);font-size:var(--t-subhead);line-height:1.4;color:var(--label-2)}.presentation-feedback:empty{display:none}
.presentation-body{position:relative;flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  padding:var(--s2) var(--s6) var(--s8);font-size:var(--t-body);line-height:1.4;scrollbar-width:none}
.presentation-body::-webkit-scrollbar{display:none}
.presentation-body>*{min-width:0}
.presentation-body:focus-visible{outline-offset:-4px}
/* More below: the card's lower edge fades and a round chevron sits on it; the cut-off content is the hint. */
.presentation-more{position:absolute;z-index:2;inset-inline:0;bottom:var(--s3);display:grid;place-items:center;width:var(--hit);height:var(--hit);margin-inline:auto;border-radius:50%;background:var(--surface);color:var(--label);box-shadow:var(--e-float)}
.presentation-more svg{width:1.2rem;height:1.2rem;stroke-width:2.2}
.presentation:has(.presentation-more:not([hidden]))::after{content:'';position:absolute;z-index:1;inset:auto 0 0;height:3.4rem;border-radius:0 0 var(--r-sheet) var(--r-sheet);
  background:linear-gradient(rgba(255,255,255,0),var(--surface));pointer-events:none}

/* Presenting: Khalid in a tile beside the conversation, the card below ------------------------------------------
   The <video> elements never move in the DOM (that would interrupt playback); only .portrait and the media boxes
   are repositioned, anchored on his eye line so the still, the idle loop and the live stream (all 768×1152, one
   framing) stay aligned: --k is CSS px per image px, --ax/--ay place image point (383, 390) in the tile. The
   controller glides him between the two places (a FLIP on .portrait, transform only). */
.presenting .display{grid-template-columns:var(--tile) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;column-gap:var(--s6);row-gap:var(--s4)}
.presenting .topbar{grid-column:1/-1;grid-row:1}
.presenting .portrait{grid-column:1;grid-row:2;position:relative;inset:auto;align-self:start;width:var(--tile);height:calc(var(--tile) * 4 / 3);border-radius:var(--r-card);box-shadow:var(--e-tile);
  --k:calc(var(--tile) / 476);--ax:50%;--ay:calc(var(--tile) * .52)}
.presenting .portrait-still,.presenting .portrait-media{inset:auto;left:calc(var(--ax) - 383 * var(--k));top:calc(var(--ay) - 390 * var(--k));width:calc(768 * var(--k));height:calc(1152 * var(--k));object-fit:cover;object-position:50% 50%}
/* The tile's edge says whose turn it is: his copper while he speaks (it breathes), green while he listens. A ring
   that is switched, never an animated shadow. */
.presenting .portrait::after{content:'';position:absolute;inset:0;z-index:5;border-radius:inherit;box-shadow:inset 0 0 0 .2rem var(--tint);opacity:0;pointer-events:none}
body[data-speaking=true].presenting .portrait::after{opacity:1;animation:breathe 1.4s ease-in-out infinite alternate}
body[data-turn=listening].presenting .portrait::after{box-shadow:inset 0 0 0 .2rem var(--green);opacity:1}
@keyframes breathe{from{opacity:.4}to{opacity:1}}
/* In the tile a small tag says who (and what) he is; on the home screen the greeting does. */
.presenting .portrait-tag{position:absolute;z-index:6;inset-inline-start:var(--s2);bottom:var(--s2);display:inline-flex;align-items:center;max-width:calc(100% - 2 * var(--s2));min-height:1.7rem;padding:0 var(--s3);
  border-radius:var(--r-pill);background:rgba(255,255,255,.88);color:var(--label);font-size:var(--t-caption);font-weight:600;line-height:1.2;box-shadow:0 1px 4px rgba(43,29,20,.2)}
body[data-turn=listening].presenting .portrait-tag{background:var(--green-strong);color:#FFFFFF}
body[data-turn=muted].presenting .portrait-tag{background:var(--label);color:#FFFFFF}
.presenting .conversation{grid-column:2;grid-row:2;align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding:0;animation:fade var(--normal) var(--ease) both}
/* Beside a card the greeting is not repeated: this column is for whose turn it is, the words and the controls. */
.presenting .conversation h1,.presenting .intro,.presenting #start-menu{display:none}
.presenting .hint{min-height:0;margin:0 0 var(--s3);text-align:start}
.presenting .status-line{flex-wrap:wrap;row-gap:var(--s1)}
.presenting .caption{max-height:9.6em;margin-top:var(--s2);font-size:var(--t-subhead)}
.presenting .caption>span{padding:var(--s2) var(--s3)}
.presenting .caption-twin{background:var(--surface)}
.presenting .notice{margin-top:var(--s3);font-size:var(--t-footnote)}
.presenting .conversation-actions{flex-wrap:nowrap;gap:var(--s2);margin-top:var(--s4)}
.presenting .primary-button{min-height:var(--control);padding:0 var(--s5);font-size:var(--t-body)}
/* One row beside a card: Interrupt (while he speaks) takes the room, the microphone is an icon, End stays short. */
.presenting .conversation-actions>button{flex:0 0 auto}
.presenting .conversation-actions>#talk,.presenting .conversation-actions>#interrupt{flex:1 1 auto}
.presenting #mute{width:var(--control);padding:0}
.presenting #mute-label{position:absolute;width:1px;height:1px;overflow:hidden;white-space:nowrap;opacity:0}
.presenting #end{padding:0 var(--s5)}
.presenting .privacy{margin-top:var(--s2);text-align:start}
body[data-state=idle].presenting .privacy,body[data-state=error].presenting .privacy,body[data-state=connecting].presenting .privacy,body[data-turn=listening].presenting .privacy{display:none}
.presenting .presentation{grid-column:1/-1;grid-row:3;min-height:0;align-self:stretch;animation:rise var(--normal) 60ms var(--ease) both}
.presenting .bottom-bar{grid-column:1/-1;grid-row:4}

/* Settings sheet (operators): grouped sections on the sheet ---------------------------------------------------- */
.settings-sheet{position:fixed;inset:auto 0 0 0;width:min(100%,var(--frame-w));max-width:none;max-height:min(88dvh,54rem);margin:0 auto;padding:0;
  border:0;border-radius:var(--r-sheet) var(--r-sheet) 0 0;background:var(--bg);color:var(--label);box-shadow:var(--e-sheet);overflow:hidden}
.settings-sheet[open]{display:flex;flex-direction:column;animation:sheet var(--normal) var(--ease)}@keyframes sheet{from{transform:translateY(1.2rem);opacity:0}}
.settings-sheet::backdrop{background:rgba(43,29,20,.4)}
.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s4);flex-shrink:0;padding:var(--s6) var(--gutter) var(--s4)}
.sheet-body{display:grid;gap:var(--s4);min-height:0;overflow-y:auto;padding:0 var(--gutter) max(var(--s6),env(safe-area-inset-bottom));scrollbar-width:thin}
.sheet-section{display:grid;gap:var(--s3);padding:var(--s5);border-radius:var(--r-card);background:var(--surface)}
.muted{font-size:var(--t-subhead);line-height:1.45;color:var(--label-2)}.small{font-size:var(--t-footnote)}
.segmented{display:grid;gap:var(--s2)}.segmented.compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:.15rem;padding:.2rem;border-radius:var(--r-field);background:var(--fill-2)}
.segment{display:grid;gap:var(--s1);min-height:var(--control);padding:var(--s3) var(--s4);border-radius:var(--r-cell);background:var(--fill);color:var(--label);text-align:start}
.segment b{font-size:var(--t-body);font-weight:600}.segment small{font-size:var(--t-footnote);line-height:1.4;color:var(--label-2)}
.segment[aria-checked=true]{background:var(--tint-soft);box-shadow:inset 0 0 0 .1rem var(--tint)}.segment[aria-checked=true] b{color:var(--tint-ink)}
.segmented.compact .segment{justify-items:center;min-height:2.2rem;padding:0 var(--s3);border-radius:calc(var(--r-field) - .2rem);background:none;text-align:center}
.segmented.compact .segment b{font-size:var(--t-subhead)}
.segmented.compact .segment[aria-checked=true]{background:var(--surface);box-shadow:0 1px 3px rgba(43,29,20,.18)}.segmented.compact .segment[aria-checked=true] b{color:var(--label)}
.sheet-row{display:grid;gap:var(--s2)}.sheet-row>span{font-size:var(--t-subhead);color:var(--label-2)}
label{display:block;font-size:var(--t-subhead);color:var(--label-2)}
select{width:100%;min-height:var(--hit);padding:0 var(--s4);border:0;border-radius:var(--r-field);background:var(--fill-2);color:var(--label);font-size:var(--t-body)}
.mic-test-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:var(--s3)}
.presenter-button,.secondary-button{min-height:var(--hit);padding:0 var(--s5);border-radius:var(--r-pill);background:var(--fill-2);color:var(--label);font-size:var(--t-subhead);font-weight:600;white-space:nowrap}
.presenter-button.small{min-height:2.2rem;font-size:var(--t-footnote)}
meter{display:block;width:100%;height:.7rem;accent-color:var(--green)}
.audio-result{font-size:var(--t-footnote);line-height:1.5;overflow-wrap:anywhere;color:var(--label-2)}.audio-result:empty{display:none}
.audio-result[data-state=good]{color:var(--green-strong)}.audio-result[data-state=ok]{color:var(--orange)}
.audio-result[data-state=slow],.audio-result[data-state=failed]{color:var(--red)}
.diagnostics{min-height:1.5em;font:500 .66rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0;color:var(--label-2);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.audio-features{margin:0;font-size:var(--t-subhead)}.audio-features>div{display:flex;justify-content:space-between;gap:var(--s4);padding-block:var(--s2);border-bottom:1px solid var(--separator)}.audio-features>div:last-child{border-bottom:0}
dt{color:var(--label)}dd{margin:0;color:var(--label-2);font-variant-numeric:tabular-nums}
/* On/off settings are iOS switches at the end of their row (HIG, toggles), the same size as the card switch. */
.check{display:flex;align-items:center;justify-content:space-between;gap:var(--s4);min-height:var(--hit);font-size:var(--t-body);color:var(--label)}
.check input{order:2;position:relative;flex:none;width:3rem;height:1.8rem;margin:0;border-radius:var(--r-pill);background:var(--fill-3);-webkit-appearance:none;appearance:none;cursor:pointer}
.check input::before{content:'';position:absolute;top:.12rem;inset-inline-start:.12rem;width:1.56rem;height:1.56rem;border-radius:50%;background:#FFFFFF;box-shadow:0 .1rem .3rem rgba(43,29,20,.3);transition:transform var(--fast) var(--ease)}
.check input:checked{background:var(--green)}
.check input:checked::before{transform:translateX(1.2rem)}
[dir=rtl] .check input:checked::before{transform:translateX(-1.2rem)}
#room-reset,#reset-demo,#sheet-fullscreen,#sign-out,#speaker-test,#speed-test{justify-self:start}
.operator-section{box-shadow:inset 0 0 0 .1rem var(--gold)}
.operator-section .presentation-kicker{color:var(--label-2)}#operator-title{font-size:var(--t-title3)}#operator-title:focus,#audio-title:focus{outline:none}
.operator-section h4{margin-top:var(--s2);font-size:var(--t-subhead);font-weight:600;color:var(--label-2)}
.operator-log{max-height:14rem;overflow:auto;padding:var(--s3) var(--s4);border-radius:var(--r-field);background:var(--fill);font:500 .66rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0;color:var(--label);font-variant-numeric:tabular-nums;direction:ltr;text-align:left}
.operator-log p{overflow-wrap:anywhere}.operator-log .log{color:var(--label-2)}
#sign-out{min-width:12rem}
#sign-out.armed{background:var(--red-soft);color:var(--red)}
.setup-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s2)}
.setup-card{display:grid;align-content:start;justify-items:start;gap:var(--s2);min-height:8.5rem;padding:var(--s4);border-radius:var(--r-cell);background:var(--fill);color:var(--label);text-align:start}
.setup-card svg{width:1.7rem;height:1.7rem;color:var(--label-2)}.setup-card b{font-size:var(--t-body);font-weight:600;line-height:1.2}.setup-card small{font-size:var(--t-footnote);line-height:1.4;color:var(--label-2)}
.setup-card[aria-checked=true]{background:var(--tint-soft);box-shadow:inset 0 0 0 .1rem var(--tint)}.setup-card[aria-checked=true] b,.setup-card[aria-checked=true] svg{color:var(--tint-ink)}
.badge{display:inline-block;margin-inline-start:var(--s2);padding:.05rem .45rem;border-radius:var(--r-pill);font:600 .6rem/1.5 var(--font);letter-spacing:0;font-style:normal;color:var(--green-strong);background:var(--green-soft);vertical-align:.15em}
.badge.muted-badge{background:var(--fill-2);color:var(--label-2)}
.slider-row{display:flex;justify-content:space-between;align-items:baseline}.slider-row output{color:var(--label);font-weight:600;font-variant-numeric:tabular-nums}
.volume{width:100%;height:2rem;margin:0;accent-color:var(--tint)}
.diagnostics-panel{position:absolute;z-index:30;top:calc(4.6rem + env(safe-area-inset-top));inset-inline-end:var(--gutter);width:min(26rem,calc(100% - 2 * var(--gutter)));padding:var(--s3) var(--s4);
  border-radius:var(--r-field);background:rgba(255,255,255,.94);box-shadow:var(--e-float);font:500 .62rem/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0;color:var(--label);pointer-events:none}
.diagnostics-panel p{overflow-wrap:anywhere}.diagnostics-panel .log{color:var(--label-2)}
.no-script{position:fixed;inset:20% 10% auto;padding:var(--s8);border-radius:var(--r-card);background:var(--surface)}

/* Boot: shown until /status answers, so the access card never flashes on a cold start. It starts from the kiosk
   app's splash colour; the mark, the name and one line of status (no logo wall, no slogan). -------------------- */
.boot-screen,.access-screen{min-height:100dvh;background:var(--splash)}
.boot-screen{position:fixed;inset:0;z-index:60;display:grid;place-content:center;justify-items:center;gap:var(--s6);padding:var(--s8);text-align:center}
.boot-screen>*{animation:rise .6s .15s var(--ease) both}
.boot-mark{display:grid;justify-items:center;gap:var(--s5)}
.boot-mark img{display:block;width:5rem;height:5rem;border-radius:1.15rem;box-shadow:0 .8rem 1.8rem -.6rem rgba(194,112,61,.6)}
.boot-mark>span,.access-brand>span{font-size:var(--t-large);font-weight:700;line-height:1;letter-spacing:-.03em;color:var(--label)}
.boot-mark small,.access-brand small{display:block;margin-top:var(--s2);font-size:var(--t-subhead);font-weight:500;letter-spacing:0;color:var(--label-2)}
.boot-line{position:relative;width:9rem;height:.2rem;overflow:hidden;border-radius:.1rem;background:var(--fill-2)}
.boot-line i{position:absolute;inset:0;width:40%;border-radius:inherit;background:var(--tint);transform:translateX(-100%);animation:boot-glide 1.6s .6s var(--ease) infinite}
@keyframes boot-glide{to{transform:translateX(250%)}}
[dir=rtl] .boot-line i{animation-direction:reverse}
.boot-status{font-size:var(--t-subhead);font-weight:500;color:var(--label-2)}
.boot-note{max-width:30ch;font-size:var(--t-subhead);line-height:1.5;color:var(--label-2)}
.boot-demo{display:none}

/* Access (not activated yet): one card, one button ------------------------------------------------------------- */
.access-screen{display:grid;place-items:center;padding:var(--s8)}
.access-card{width:min(100%,30rem);padding:var(--s10) var(--s8) var(--s8);border-radius:var(--r-sheet);background:var(--surface);box-shadow:var(--e-float)}
.access-brand{display:flex;align-items:center;gap:var(--s4);margin-bottom:var(--s10)}
.access-brand img{display:block;width:3.2rem;height:3.2rem;border-radius:.75rem}
.access-brand>span{font-size:var(--t-title1);text-align:start}
.access-card h1{margin-bottom:var(--s3);font-size:var(--t-large);line-height:1.1}
.access-card p{font-size:var(--t-body);line-height:1.5;color:var(--label-2)}
.access-card p.presentation-kicker{margin-bottom:var(--s2);font-size:var(--t-subhead)}
.access-card label{margin-top:var(--s6);margin-bottom:var(--s2)}
.access-card input{width:100%;min-height:var(--control);padding:0 var(--s4);border:0;border-radius:var(--r-field);background:var(--fill-2);color:var(--label);font:inherit;font-size:var(--t-title3)}
.access-card .primary-button{width:100%;margin-top:var(--s4)}
.access-card #login-error{min-height:1.5em;margin-top:var(--s4);font-size:var(--t-subhead);color:var(--red)}
.activate-panel{margin-top:var(--s10);animation:rise var(--normal) var(--ease)}.access-card .activate-panel .primary-button{margin-top:0}
.check-again[aria-busy=true]{opacity:1;cursor:progress}
.access-card .access-note{display:flex;align-items:center;gap:var(--s2);margin-top:var(--s4);font-size:var(--t-subhead);line-height:1.4}.access-note svg{width:1.1rem;height:1.1rem;color:var(--green)}
.access-waiting{margin-top:var(--s4)}.access-card .access-waiting p{max-width:34ch}
.quiet-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--s2);min-height:var(--hit);padding:0 var(--s5);border-radius:var(--r-pill);background:var(--fill-2);color:var(--label);font-size:var(--t-subhead);font-weight:600}
.check-again{margin-top:var(--s6)}.check-again svg{width:1rem;height:1rem}
.check-again[aria-busy=true] svg{animation:turn .9s linear infinite}
.access-card .access-waiting .access-connection{display:flex;align-items:center;gap:var(--s2);margin-top:var(--s4);font-size:var(--t-subhead);line-height:1.4}
.access-connection::before{content:"";flex:none;width:.5rem;height:.5rem;border-radius:50%;background:var(--orange)}
.access-card .access-connection[hidden]{display:none}
[dir=rtl] .check-again svg{transform:scaleX(-1)}[dir=rtl] .check-again[aria-busy=true] svg{animation:none}
.access-card #login-form{margin-top:var(--s8);padding-top:var(--s6);border-top:1px solid var(--separator)}
.access-card .access-footer{margin-top:var(--s8);padding-top:var(--s5);border-top:1px solid var(--separator);font-size:var(--t-footnote);color:var(--label-3)}

/* Arabic: no tracking, a little more line height (the dots under ي fall below a tight line box) ------------- */
[dir=rtl] h1,[dir=rtl] h2,[dir=rtl] .brand-word,[dir=rtl] .primary-button,[dir=rtl] .boot-mark>span,[dir=rtl] .access-brand>span{letter-spacing:0}
[dir=rtl] h1{line-height:1.3}[dir=rtl] h2{line-height:1.35}
[dir=rtl] .brand-title{line-height:1.7}
[dir=rtl] .access-brand>span{text-align:end}

/* Landscape preview window: the page stays the kiosk's 9:16 column, centred, with a quiet frame. ---------- */
@media(orientation:landscape){
  html:not(.kiosk) .display{box-shadow:0 0 0 1px var(--separator),0 1.6rem 3.2rem -1.6rem rgba(43,29,20,.3)}
  html:not(.kiosk) #fullscreen{display:none}  /* the column is narrow here; Settings keeps its Fullscreen button */
}
/* Phones and narrow windows (never the kiosk): the start cards stack as rows. ------------------------------ */
@media(max-width:520px){
  html:not(.kiosk){--gutter:1rem}
  html:not(.kiosk) .start-menu{grid-template-columns:minmax(0,1fr)}
  html:not(.kiosk) .start-card{grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;column-gap:var(--s4);row-gap:0;align-items:center;min-height:var(--control-lg);padding:var(--s3) var(--s4)}
  html:not(.kiosk) .start-art{grid-row:1/span 2;margin:0}
  html:not(.kiosk) .brand-title,html:not(.kiosk) .brand-sep{display:none}
  html:not(.kiosk) .setup-grid{grid-template-columns:minmax(0,1fr)}
  html:not(.kiosk) .setup-card{min-height:0;grid-template-columns:auto 1fr;align-items:center}html:not(.kiosk) .setup-card small{grid-column:2}
}
/* Reduced motion: nothing animates, and the idle loop never plays (the aligned still shows instead). */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}#idle-video{visibility:hidden}}
