  :root { --bg: #0d1117; --fg: #e6edf3; --dim: #8b949e; --card: #161b22; --line: #30363d;
          --listen: #3fb950; --think: #d29922; --speak: #58a6ff; --err: #f85149; --accent: #f0883e; }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
    font-family: -apple-system, "SF Hebrew", system-ui, sans-serif; overscroll-behavior: none; }
  body { display: flex; flex-direction: column; height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }
  header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  header .who { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
  header img { width: 34px; height: 34px; border-radius: 9px; }
  #net { font-size: 13px; color: var(--dim); }
  #gear { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 10px; padding: 6px 10px; font-size: 15px; }
  #stage { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 10px; }
  #orb { position: relative; width: 190px; height: 190px; border-radius: 50%; border: none; color: #fff; font-size: 24px; font-weight: 600;
    background: radial-gradient(circle at 50% 40%, #2d333b, #161b22); box-shadow: 0 0 0 2px var(--line) inset; transition: box-shadow .25s, background .25s; }
  #orb { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  #confirm { display: none; position: fixed; inset: auto 0 0 0; z-index: 8; background: #2a1f0b; border-top: 2px solid var(--accent); border-radius: 18px 18px 0 0;
    padding: 18px 18px max(18px, env(safe-area-inset-bottom)); text-align: center; }
  #confirm.show { display: block; }
  #confirm .q { font-size: 15px; color: var(--dim); }
  #confirmText { font-size: 19px; font-weight: 600; margin: 8px 0 14px; line-height: 1.4; }
  #confirm .row { display: flex; gap: 12px; }
  #confirm button { flex: 1; padding: 16px; border-radius: 14px; border: none; font-size: 19px; font-weight: 700; }
  #confirmYes { background: var(--listen); color: #04210c; }
  #confirmNo { background: #30363d; color: var(--fg); }
  #orb .ring { position: absolute; inset: -10px; border-radius: 50%; border: 3px solid transparent; pointer-events: none; }
  #orb[data-s=connecting] .ring, #orb[data-s=reconnecting] .ring { border-color: var(--dim); animation: spin 1.2s linear infinite; border-top-color: transparent; }
  #orb[data-s=listening] { box-shadow: 0 0 0 3px var(--listen) inset, 0 0 40px #3fb95033; }
  #orb[data-s=hearing] { box-shadow: 0 0 0 3px var(--listen) inset, 0 0 40px #3fb95044; }
  #orb[data-s=thinking] .ring, #orb[data-s=acting] .ring { border-color: var(--think); border-left-color: transparent; animation: spin 1s linear infinite; }
  #orb[data-s=thinking], #orb[data-s=acting] { box-shadow: 0 0 0 3px var(--think) inset; }
  #orb[data-s=speaking] { box-shadow: 0 0 0 4px var(--speak) inset, 0 0 50px #58a6ff55; animation: pulse 1.1s ease-in-out infinite; }
  #orb[data-s=error] { box-shadow: 0 0 0 3px var(--err) inset; }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes pulse { 50% { transform: scale(1.04); } }
  #state { font-size: 22px; font-weight: 600; min-height: 1.3em; text-align: center; }
  #hint { font-size: 14px; color: var(--dim); min-height: 1.2em; text-align: center; }
  #end { display: none; background: var(--err); color: #fff; border: none; border-radius: 28px; padding: 12px 34px; font-size: 18px; font-weight: 600; }
  body.oncall #end { display: inline-block; }
  #mute { display: none; background: #444; color: #fff; border: none; border-radius: 50%; width: 56px; height: 56px; padding: 0; margin-bottom: 8px; align-items: center; justify-content: center; }
  #mute.on { background: #b8860b; }
  body.oncall #mute { display: inline-flex; }
  #photo { display: none; background: #444; color: #fff; border: none; border-radius: 50%; width: 56px; height: 56px; padding: 0; margin-bottom: 8px; align-items: center; justify-content: center; }
  body.oncall #photo { display: inline-flex; }
  #chat { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; -webkit-overflow-scrolling: touch; }
  .msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 17px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
  .me { align-self: flex-start; background: #1f6feb; color: #fff; border-bottom-right-radius: 5px; }
  .uzi { align-self: flex-end; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
  .uzi.cut { opacity: .6; }
  .sys { align-self: center; color: var(--dim); font-size: 13px; text-align: center; }
  .err { align-self: stretch; background: #3d1418; border: 1px solid #f8514966; color: #ffdcd7; border-radius: 12px; padding: 10px 12px; font-size: 15px; }
  #interim { min-height: 1.3em; color: #9ecbff; font-size: 16px; text-align: center; padding: 2px 8px; }
  #safari { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 10; padding: 40px 24px; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
  #safari.show { display: flex; }
  #safari a.big { display: block; width: 100%; max-width: 340px; background: var(--speak); color: #04111f; text-decoration: none; font-size: 22px; font-weight: 700; padding: 18px; border-radius: 16px; }
  #safari p { color: var(--dim); font-size: 16px; line-height: 1.5; margin: 0; max-width: 360px; }
  #safari button { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 12px; padding: 10px 16px; font-size: 15px; }
  #sheet { display: none; position: fixed; inset: auto 0 0 0; background: var(--card); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
    padding: 18px 18px max(18px, env(safe-area-inset-bottom)); z-index: 5; font-size: 16px; }
  #sheet.show { display: block; }
  #sheet label { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
  #sheet .small { color: var(--dim); font-size: 13px; line-height: 1.4; }
  #sheet button { margin-top: 10px; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #21262d; color: var(--fg); font-size: 16px; }
  .sheetTitle { font-weight: 600; margin-bottom: 6px; }
  .bigIcon { width: 84px; height: 84px; border-radius: 20px; }
  .bigTitle { font-size: 22px; font-weight: 700; }
  #login { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 9; padding: 40px 24px; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
  #login.show { display: flex; }
  #login p { color: var(--dim); font-size: 16px; line-height: 1.5; margin: 0; max-width: 360px; }
  #login button.big { display: block; width: 100%; max-width: 340px; background: var(--speak); color: #04111f; border: none; font-size: 22px; font-weight: 700; padding: 18px; border-radius: 16px; }
  #login button.big:disabled { opacity: .5; }
  #login button[hidden] { display: none; }
  #login .loginErr { color: #ffdcd7; min-height: 1.4em; }
  #request { display: none; position: fixed; inset: 0; background: var(--bg); z-index: 9; padding: 40px 24px; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
  #request.show { display: flex; }
  #request p { color: var(--dim); font-size: 16px; line-height: 1.5; margin: 0 auto; max-width: 360px; }
  #reqForm, #reqDone { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
  #reqForm[hidden], #reqDone[hidden] { display: none; }
  #request input { width: 100%; max-width: 340px; box-sizing: border-box; font-size: 18px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #161b22; color: var(--fg); }
  #request button.big { display: block; width: 100%; max-width: 340px; background: var(--speak); color: #04111f; border: none; font-size: 22px; font-weight: 700; padding: 18px; border-radius: 16px; }
  #request button.big:disabled { opacity: .5; }
  #request .loginErr { color: #ffdcd7; min-height: 1.4em; }
  #request .code { font-size: 44px; font-weight: 700; letter-spacing: 10px; direction: ltr; }
  button.link { background: none; border: none; color: var(--dim); font-size: 15px; text-decoration: underline; padding: 6px; }

  .wave { display: inline-block; vertical-align: middle; width: 120px; height: 44px; color: inherit; } /* one soft line drawn by app5.js */
