
:root, html[data-theme="dark"] {
        color-scheme: dark;
        --bg: #07070a;
        --bg-deep: #050508;
        --surface: #14141c;
        --surface-alt: #1e1e28;
        --border: #2d2d3a;
        --text: #f5f1e6;
        --dim: #b3ab93;
        --accent: #FFD700;
        --accent-strong: #FFD700;
        --accent-deep: #0b3d2e;
        --on-accent: #1a1400;
        --amber: #e8b34b;
        --amber-bg: #2b2110;
        --danger: #e5533f;
        --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
        --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
        --font-urdu: "Noto Nastaliq Urdu", serif;
      }
      html[data-theme="light"] {
        color-scheme: light;
        --bg: #f6f7f4;
        --bg-deep: #ecefe9;
        --surface: #ffffff;
        --surface-alt: #eef1ea;
        --border: #d9ded2;
        --text: #15211b;
        --dim: #5c6a61;
        --accent: #0b7a55;
        --accent-strong: #0e9c6c;
        --accent-deep: #0b3d2e;
        --on-accent: #ffffff;
        --amber: #b97a12;
        --amber-bg: #fdf3e0;
        --danger: #d63a2f;
        --shadow: 0 10px 30px rgba(11, 61, 46, 0.12);
        --font-ui: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
        --font-urdu: "Noto Nastaliq Urdu", serif;
      }
      * { box-sizing: border-box; }
      html, body { height: 100%; }
      body {
        margin: 0;
        background: var(--bg);
        color: var(--text);
        font-family: var(--font-ui);
        -webkit-font-smoothing: antialiased;
      }
      button, [role="button"], select, summary,
      input:not([type="checkbox"], [type="radio"]) { min-height: 2.25rem; }
      button { font-family: inherit; cursor: pointer; }
      button:focus-visible, textarea:focus-visible, select:focus-visible {
        outline: 2px solid var(--accent-strong);
        outline-offset: 2px;
      }
      .urdu { font-family: var(--font-urdu); line-height: 2.1; }

      /* ---------- App frame ---------- */
      .app {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        max-width: 780px;
        margin: 0 auto;
        background: var(--bg);
      }
      @media (min-width: 860px) {
        .app {
          border-left: 1px solid var(--border);
          border-right: 1px solid var(--border);
        }
      }
      /* PC / badi screen: side panel + wasee chat area */
      .side { display: none; }
      @media (min-width: 1024px) {
        .app {
          max-width: 1240px;
          display: grid;
          grid-template-columns: 330px minmax(0, 1fr);
          grid-template-rows: auto minmax(0, 1fr) auto;
          grid-template-areas: "side top" "side chat" "side composer";
          border-left: 1px solid var(--border);
          border-right: 1px solid var(--border);
        }
        .topbar { grid-area: top; }
        .scroll { grid-area: chat; }
        .composer { grid-area: composer; }
        .side {
          grid-area: side;
          display: flex;
          flex-direction: column;
          gap: 22px;
          overflow-y: auto;
          background: var(--surface);
          border-right: 1px solid var(--border);
          padding: 26px 22px 22px;
        }
        .side-orb {
          width: 64px; height: 64px; border-radius: 50%;
          overflow: hidden;
          background: var(--accent-deep);
          box-shadow: 0 12px 26px rgba(11, 61, 46, 0.3);
        }
        .side-orb img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 18%; }
        .side h2 { margin: 14px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
        .side .side-lede { margin: 8px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--dim); }
        .side h3 {
          margin: 0 0 10px; font-size: 12px; font-weight: 800;
          letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim);
        }
        .side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
        .side-list li { display: flex; gap: 10px; font-size: 14px; line-height: 1.55; }
        .side-list .ic {
          width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
          display: inline-flex; align-items: center; justify-content: center;
          background: var(--surface-alt); color: var(--accent); border: 1px solid var(--border);
        }
        .side-list b { font-weight: 700; }
        .side-list span.txt { color: var(--text); }
        .side-prompts { display: flex; flex-direction: column; gap: 8px; }
        .side-prompt {
          text-align: left; border: 1px solid var(--border); background: var(--bg);
          color: var(--text); border-radius: 12px; padding: 10px 12px;
          font-size: 13.5px; line-height: 1.5; min-height: 42px;
        }
        .side-prompt:hover { background: var(--surface-alt); }
        .side-device {
          border: 1px solid var(--border); background: var(--bg);
          border-radius: 14px; padding: 14px;
          font-size: 13.5px; line-height: 1.65; color: var(--dim);
        }
        .side-device b { color: var(--text); }
        .side-keys { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--dim); }
        .side-keys div { display: flex; align-items: center; gap: 8px; }
        kbd {
          font-family: var(--font-ui); font-size: 12px; font-weight: 700; color: var(--text);
          background: var(--surface-alt); border: 1px solid var(--border);
          border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; white-space: nowrap;
        }
      }

      /* ---------- Top bar ---------- */
      .topbar {
        flex: 0 0 auto;
        border-bottom: 1px solid var(--border);
        background: var(--bg);
        padding-top: env(safe-area-inset-top);
      }
      .topbar-in {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
      }
      .avatar {
        width: 44px; height: 44px;
        flex: 0 0 auto;
        border-radius: 50%;
        overflow: hidden;
        position: relative;
        background: var(--accent-deep);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
      }
      .avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 18%; transition: opacity 0.4s ease; }
      /* Living header avatar — same state machine as welcome/call orbs */
      @keyframes headerGlow {
        from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 0 0 0 rgba(44, 201, 141, 0.20); }
        to { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 18px 5px rgba(44, 201, 141, 0.48); }
      }
      .avatar.orb-idle { animation: breathe 4.5s ease-in-out infinite alternate, headerGlow 4.5s ease-in-out infinite alternate; }
      .avatar.orb-listening { animation: breathe 2.6s ease-in-out infinite alternate, headerGlow 3.5s ease-in-out infinite alternate; }
      .avatar.orb-speaking, .avatar.tts-speaking { animation: speakPulse 0.56s ease-in-out infinite, headerGlow 1.8s ease-in-out infinite alternate; }
      .avatar.orb-thinking img { animation: kenZoom 6s ease-in-out infinite alternate; }
      .avatar.orb-working img { animation: kenPan 7s ease-in-out infinite alternate; }
      .avatar.switching img { opacity: 0; }
      .avatar::after {
        content: ""; position: absolute; inset: 0; border-radius: 50%;
        background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.38) 50%, transparent 68%);
        transform: translateX(-130%); pointer-events: none;
      }
      .avatar.orb-idle::after { animation: shineSweep 7s ease-in-out infinite; }
      .avatar.orb-working::after {
        background: linear-gradient(180deg, transparent 30%, rgba(255, 255, 255, 0.30) 50%, transparent 70%);
        animation: scanSweep 3s linear infinite;
      }
      .version-label { font-size: 11.5px; line-height: 1.5; color: var(--dim); opacity: 0.85; }
      .side-version { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
      .settings-version { margin-top: 18px; text-align: center; }
      .who { min-width: 0; flex: 1 1 auto; }
      .who h1 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
      .who p {
        margin: 2px 0 0; font-size: 12.5px; color: var(--dim);
        display: flex; align-items: center; gap: 6px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      }
      .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); flex: 0 0 auto; }
      .dot.busy { background: var(--amber); }
      .icon-btn {
        width: 44px; height: 44px; flex: 0 0 auto;
        border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        border: 1px solid var(--border);
        background: var(--surface); color: var(--text);
      }
      .icon-btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
      .icon-btn:active { transform: scale(0.96); }

      /* ---------- Chat scroll ---------- */
      .scroll {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 16px 16px 8px;
        scroll-behavior: smooth;
      }
      @media (min-width: 1024px) {
        .scroll { padding: 26px 34px 10px; }
        .msgs { max-width: 820px; margin: 0 auto; width: 100%; }
        .bubble { max-width: 76%; font-size: 16px; }
        .empty { padding-top: 12px; }
        .chips { display: grid; grid-template-columns: 1fr 1fr; max-width: 640px; }
        .chip:hover { background: var(--surface-alt); }
        .install-card { max-width: 640px; }
      }
      @media (hover: hover) {
        .icon-btn:hover, .round-btn:hover, .mini-btn:hover { background: var(--surface-alt); }
        .icon-btn.primary:hover, .round-btn.send:hover { background: var(--accent-strong); }
        .call-cta:hover { background: var(--border); }
        .install-tab:hover { border-color: var(--accent); }
      }
      .msgs { display: flex; flex-direction: column; gap: 12px; }
      .row { display: flex; }
      .row.user { justify-content: flex-end; }
      .row.ai { justify-content: flex-start; align-items: flex-end; gap: 8px; }
      .bubble {
        max-width: 86%;
        padding: 10px 14px;
        font-size: 15.5px;
        line-height: 1.55;
        white-space: pre-wrap;
        word-break: break-word;
        border-radius: 20px;
      }
      .row.user .bubble {
        background: var(--accent);
        color: var(--on-accent);
        border-bottom-right-radius: 6px;
      }
      .row.ai .bubble {
        background: var(--surface);
        border: 1px solid var(--border);
        border-bottom-left-radius: 6px;
        min-width: 0;
      }
      .msg-avatar {
        width: 30px; height: 30px;
        flex: 0 0 auto;
        border-radius: 50%;
        object-fit: cover; object-position: 50% 18%;
        border: 1px solid var(--border);
        background: var(--surface-alt);
        animation: msgBreathe 4.5s ease-in-out infinite alternate;
      }
      @keyframes msgBreathe { from { transform: scale(1); } to { transform: scale(1.045); } }
      .bubble .chat-img {
        display: block; max-width: 100%; width: 320px; height: auto;
        border-radius: 12px; margin-top: 8px; background: var(--surface-alt);
      }
      .bubble .img-loading { font-size: 13.5px; color: var(--dim); margin-top: 2px; }
      .bubble .img-prompt { font-size: 13px; color: var(--dim); margin-top: 8px; line-height: 1.5; }
      .bubble.error {
        background: var(--amber-bg);
        border: 1px solid var(--amber);
        color: var(--text);
      }
      /* Markdown formatting in assistant bubbles (renderMarkdown) */
      .bubble .md-h { font-weight: 800; margin: 7px 0 3px; line-height: 1.4; }
      .bubble .md-h:first-child { margin-top: 0; }
      .bubble .md-h1 { font-size: 1.2em; }
      .bubble .md-h2 { font-size: 1.12em; }
      .bubble .md-h3 { font-size: 1.04em; }
      .bubble .md-gap { height: 0.55em; }
      .bubble code {
        background: var(--surface-alt);
        border: 1px solid var(--border);
        border-radius: 6px;
        padding: 0 5px;
        font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
        font-size: 0.88em;
      }
      .mini-btn {
        width: 36px; height: 36px; flex: 0 0 auto;
        border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        border: 1px solid var(--border);
        background: var(--surface); color: var(--dim);
      }
      .retry-btn {
        margin-top: 8px;
        border: 1px solid var(--amber);
        background: transparent; color: var(--amber);
        border-radius: 999px; padding: 6px 14px;
        font-size: 13px; font-weight: 700;
        min-height: 36px;
      }
      .typing { display: inline-flex; gap: 5px; padding: 14px 16px; align-items: center; flex-wrap: wrap; }
      .typing .tdot {
        width: 8px; height: 8px; border-radius: 50%;
        background: var(--dim);
        animation: blink 1.2s infinite ease-in-out;
        flex: 0 0 auto;
      }
      .typing .tdot:nth-child(2) { animation-delay: 0.15s; }
      .typing .tdot:nth-child(3) { animation-delay: 0.3s; }
      .typing-status {
        font-size: 13.5px; line-height: 1.45; color: var(--dim);
        width: auto !important; height: auto !important; background: transparent !important;
        border-radius: 0 !important; animation: none !important;
      }
      .typing-status:empty { display: none; }
      .stop-btn {
        border: 1px solid var(--border); background: var(--surface); color: var(--text);
        border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700;
        min-height: 32px; cursor: pointer;
      }
      .stop-btn:active { transform: scale(0.97); }
      @keyframes blink {
        0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
        40% { opacity: 1; transform: translateY(-2px); }
      }

      /* ---------- Empty state ---------- */
      .empty { text-align: center; padding: 26px 6px 10px; }
      .orb-wrap { position: relative; width: 104px; height: 104px; margin: 0 auto; }
      .orb {
        position: absolute; inset: 0; border-radius: 50%;
        overflow: hidden;
        background: var(--accent-deep);
        box-shadow: 0 14px 34px rgba(11, 61, 46, 0.35);
        animation: breathe 4.5s ease-in-out infinite alternate, orbGlow 4.5s ease-in-out infinite alternate;
      }
      .orb img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 18%; }
      .orb-ring {
        position: absolute; inset: 0; border-radius: 50%;
        border: 2px solid var(--accent);
        animation: ripple 3.6s ease-out infinite;
        pointer-events: none;
      }
      @keyframes breathe { from { transform: scale(1) translateY(0); } to { transform: scale(1.035) translateY(-2px); } }
      @keyframes orbGlow {
        from { box-shadow: 0 14px 34px rgba(11, 61, 46, 0.35), 0 0 0 0 rgba(44, 201, 141, 0.22); }
        to { box-shadow: 0 14px 34px rgba(11, 61, 46, 0.35), 0 0 30px 7px rgba(44, 201, 141, 0.48); }
      }
      @keyframes callGlow {
        from { box-shadow: 0 0 46px rgba(44, 201, 141, 0.32); }
        to { box-shadow: 0 0 78px rgba(44, 201, 141, 0.52); }
      }
      @keyframes ripple { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
      .empty h2 { margin: 22px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
      .empty .lede {
        margin: 10px auto 0; max-width: 460px;
        font-size: 14.5px; line-height: 1.65; color: var(--dim);
      }
      .chips { display: flex; flex-direction: column; gap: 8px; max-width: 460px; margin: 22px auto 0; }
      .chip {
        text-align: left;
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text);
        border-radius: 14px;
        padding: 12px 14px;
        font-size: 14.5px; line-height: 1.5;
        min-height: 44px;
      }
      .chip:active { background: var(--surface-alt); }

      .install-card {
        max-width: 460px; margin: 26px auto 6px;
        text-align: left;
        border: 1px solid var(--border);
        background: var(--surface);
        border-radius: 16px;
        padding: 16px;
      }
      .install-card h3 { margin: 0; font-size: 15px; font-weight: 800; }
      .install-card p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--dim); }
      .install-steps { margin: 10px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; color: var(--text); }
      .install-tabs { display: flex; gap: 8px; margin-top: 12px; }
      .install-tab {
        flex: 1; border-radius: 999px; padding: 8px 10px;
        border: 1px solid var(--border); background: var(--surface-alt);
        color: var(--text); font-size: 13.5px; font-weight: 700; min-height: 40px;
      }
      .install-tab.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }

      /* ---------- Composer ---------- */
      .composer {
        flex: 0 0 auto;
        border-top: 1px solid var(--border);
        background: var(--bg);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
      }
      .note {
        margin: 0 0 8px;
        border: 1px solid var(--amber);
        background: var(--amber-bg);
        border-radius: 12px;
        padding: 9px 12px;
        font-size: 13px; line-height: 1.55;
      }
      .note[hidden] { display: none; }
      .composer-row { display: flex; align-items: flex-end; gap: 8px; }
      .composer textarea {
        flex: 1 1 auto;
        min-height: 44px; max-height: 130px;
        resize: none;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: var(--surface);
        color: var(--text);
        padding: 11px 16px;
        font: inherit; font-size: 15.5px; line-height: 1.45;
      }
      .composer textarea::placeholder { color: var(--dim); }
      .round-btn {
        width: 44px; height: 44px; flex: 0 0 auto;
        border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        border: 1px solid var(--border);
        background: var(--surface); color: var(--text);
      }
      .round-btn.send { background: var(--accent); border-color: transparent; color: var(--on-accent); }
      .round-btn.send:disabled { opacity: 0.45; }
      .round-btn.live { background: var(--amber); border-color: transparent; color: #1c1503; }
      .kbd-hint { display: none; }
      @media (min-width: 1024px) {
        .composer { padding-left: 34px; padding-right: 34px; }
        .composer-row, .call-cta, .note { max-width: 820px; margin-left: auto; margin-right: auto; }
        .call-cta { margin-top: 10px; }
        .kbd-hint {
          display: block; max-width: 820px; margin: 8px auto 0;
          font-size: 12.5px; color: var(--dim); text-align: center;
        }
      }
      .call-cta {
        margin-top: 10px;
        width: 100%;
        display: flex; align-items: center; justify-content: center; gap: 8px;
        border: none; border-radius: 999px;
        background: var(--surface-alt); color: var(--text);
        padding: 11px 14px; font-size: 14px; font-weight: 700;
        min-height: 44px;
      }

      /* ---------- Sheets & overlays ---------- */
      .sheet-back {
        position: fixed; inset: 0; z-index: 40;
        background: rgba(4, 10, 7, 0.55);
        display: flex; align-items: flex-end; justify-content: center;
      }
      .sheet-back[hidden] { display: none; }
      .sheet {
        width: 100%; max-width: 520px;
        background: var(--surface);
        border-radius: 24px 24px 0 0;
        padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
        max-height: 88dvh; overflow-y: auto;
      }
      @media (min-width: 640px) {
        .sheet-back { align-items: center; padding: 20px; }
        .sheet { border-radius: 24px; }
      }
      .sheet-head { display: flex; align-items: center; justify-content: space-between; }
      .sheet-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
      .field-label { display: block; margin-top: 20px; font-size: 14px; font-weight: 700; }
      .field-help { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--dim); }
      .sheet select {
        margin-top: 8px; width: 100%;
        border: 1px solid var(--border); border-radius: 12px;
        background: var(--bg); color: var(--text);
        padding: 10px 12px; font: inherit; font-size: 15px;
      }
      .switch-row {
        margin-top: 20px;
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        min-height: 44px;
      }
      .switch-row .t { font-size: 14px; font-weight: 700; }
      .switch-row .d { font-size: 12.5px; color: var(--dim); margin-top: 2px; line-height: 1.5; }
      .switch {
        width: 52px; height: 32px; flex: 0 0 auto;
        border-radius: 999px; border: 1px solid var(--border);
        background: var(--surface-alt); position: relative; padding: 0;
      }
      .switch::after {
        content: ""; position: absolute; top: 3px; left: 3px;
        width: 24px; height: 24px; border-radius: 50%;
        background: var(--dim); transition: all 0.18s ease;
      }
      .switch[aria-checked="true"] { background: var(--accent); border-color: transparent; }
      .switch[aria-checked="true"]::after { left: 23px; background: #fff; }
      .danger-btn {
        margin-top: 24px; width: 100%;
        border: 1px solid var(--border); background: transparent;
        color: var(--amber); border-radius: 999px;
        padding: 11px; font-size: 14px; font-weight: 700; min-height: 44px;
        display: flex; align-items: center; justify-content: center; gap: 8px;
      }

      /* ---------- Call overlay ---------- */
      .call {
        position: fixed; inset: 0; z-index: 50;
        background: linear-gradient(180deg, #0b3d2e 0%, #092b20 45%, #050f0a 100%);
        color: #eefaf3;
        display: flex; flex-direction: column;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
      }
      .call[hidden] { display: none; }
      html[data-theme="light"] .call { color: #eefaf3; }
      .call-top { text-align: center; padding: 34px 24px 0; }
      .call-top h2 { margin: 0; font-size: 22px; font-weight: 800; }
      .call-top .timer { margin-top: 4px; font-size: 14px; opacity: 0.75; font-variant-numeric: tabular-nums; }
      .call-mid {
        flex: 1 1 auto; display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        padding: 16px 24px; overflow-y: auto; width: 100%;
      }
      .call-orb-wrap { position: relative; width: 168px; height: 168px; flex: 0 0 auto; }
      .call-orb {
        position: absolute; inset: 0; border-radius: 50%;
        overflow: hidden;
        background: var(--accent-deep);
        box-shadow: 0 0 70px rgba(44, 201, 141, 0.45);
        animation: breathe 3.5s ease-in-out infinite alternate, callGlow 3.5s ease-in-out infinite alternate;
      }
      .call-orb img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 18%; }
      .call-orb.speaking { animation: breathe 1.1s ease-in-out infinite alternate, callGlow 1.8s ease-in-out infinite alternate; }
      .call-orb.listening { animation: breathe 2.6s ease-in-out infinite alternate, callGlow 3.5s ease-in-out infinite alternate; }
      .call-status { margin-top: 26px; font-size: 16.5px; font-weight: 700; text-align: center; }
      .call-heard {
        margin-top: 10px; max-width: 420px; text-align: center;
        font-size: 14px; line-height: 1.6; opacity: 0.8;
      }
      .call-note {
        margin-top: 10px; max-width: 420px; text-align: center;
        font-size: 14px; line-height: 1.6; color: #ffd98a;
      }
      .call-note[hidden] { display: none; }
      .call-last { margin-top: 18px; max-width: 440px; text-align: center; width: 100%; }
      .call-last .u { font-size: 13.5px; opacity: 0.75; line-height: 1.6; margin: 0 0 6px; }
      .call-last .a { font-size: 15.5px; line-height: 1.65; margin: 0; }
      .call-type {
        padding: 0 20px 6px;
        width: 100%; max-width: 560px; margin: 0 auto;
        display: flex; align-items: flex-end; gap: 8px;
      }
      .call-type textarea {
        flex: 1 1 auto; min-height: 44px; max-height: 110px; resize: none;
        border-radius: 22px; padding: 11px 16px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.12); color: #fff;
        font: inherit; font-size: 15px; line-height: 1.45;
      }
      .call-type textarea::placeholder { color: rgba(255, 255, 255, 0.65); }
      .call-send {
        width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
        border: none; background: var(--accent-strong); color: #06231a;
        display: inline-flex; align-items: center; justify-content: center;
      }
      .call-controls {
        display: flex; align-items: center; justify-content: center; gap: 26px;
        padding: 14px 24px 30px;
      }
      .call-btn {
        width: 58px; height: 58px; border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.4);
        background: rgba(255, 255, 255, 0.14); color: #fff;
      }
      .call-btn.on { background: #f4b942; border-color: transparent; color: #241a02; }
      .call-btn.listening-on { background: var(--accent-strong); border-color: transparent; color: #06231a; }
      .call-btn.end {
        width: 66px; height: 66px;
        background: var(--danger); border-color: transparent; color: #fff;
      }
      .sr-only {
        position: absolute; width: 1px; height: 1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
      }

      /* ---------- Living avatar (sirf CSS motion, koi video nahi) ---------- */
      .orb-wrap::before, .call-orb-wrap::before {
        content: ""; position: absolute; inset: -6px; border-radius: 50%;
        border: 2px solid transparent; pointer-events: none;
      }
      .orb-wrap.orb-idle::before, .call-orb-wrap.orb-idle::before {
        border-color: color-mix(in srgb, var(--accent) 45%, transparent);
        animation: ringPulse 4.5s ease-in-out infinite alternate;
      }
      .orb-wrap.orb-speaking::before, .call-orb-wrap.orb-speaking::before,
      .orb-wrap.tts-speaking::before, .call-orb-wrap.tts-speaking::before {
        border-color: var(--accent-strong);
        animation: ringPulse 0.56s ease-in-out infinite alternate;
      }
      @keyframes ringPulse { from { opacity: 0.35; transform: scale(1); } to { opacity: 0.8; transform: scale(1.03); } }
      .orb::after, .call-orb::after {
        content: ""; position: absolute; inset: 0; border-radius: 50%;
        background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.38) 50%, transparent 68%);
        transform: translateX(-130%); pointer-events: none;
      }
      .orb-wrap.orb-idle .orb::after, .call-orb-wrap.orb-idle .call-orb::after { animation: shineSweep 7s ease-in-out infinite; }
      .orb-wrap.orb-working .orb::after, .call-orb-wrap.orb-working .call-orb::after {
        background: linear-gradient(180deg, transparent 30%, rgba(255, 255, 255, 0.30) 50%, transparent 70%);
        animation: scanSweep 3s linear infinite;
      }
      @keyframes shineSweep { 0%, 55% { transform: translateX(-130%); } 85%, 100% { transform: translateX(130%); } }
      @keyframes scanSweep { 0% { transform: translateY(-130%); } 100% { transform: translateY(130%); } }
      .orb-wrap .orb-ring, .call-orb-wrap .orb-ring { animation: none; opacity: 0; }
      .orb-wrap.orb-listening .orb-ring, .call-orb-wrap.orb-listening .orb-ring { animation: ripple 3.6s ease-out infinite; }
      .orb-wrap.orb-listening .orb-ring.r2, .call-orb-wrap.orb-listening .orb-ring.r2 { animation-delay: 1.2s; }
      .orb-wrap.orb-listening .orb-ring.r3, .call-orb-wrap.orb-listening .orb-ring.r3 { animation-delay: 2.4s; }
      .orb-orbit { position: absolute; inset: -12px; border-radius: 50%; opacity: 0; pointer-events: none; }
      .orb-orbit span {
        position: absolute; width: 7px; height: 7px; border-radius: 50%;
        background: var(--accent-strong); box-shadow: 0 0 8px rgba(44, 201, 141, 0.7);
      }
      .orb-orbit span:nth-child(1) { top: 0; left: 50%; margin-left: -3px; }
      .orb-orbit span:nth-child(2) { bottom: 5%; left: 7%; }
      .orb-orbit span:nth-child(3) { bottom: 5%; right: 7%; }
      .orb-wrap.orb-thinking .orb-orbit, .call-orb-wrap.orb-thinking .orb-orbit { opacity: 1; animation: orbitSpin 6s linear infinite; }
      @keyframes orbitSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
      .orb img, .call-orb img { transition: opacity 0.4s ease; }
      .orb-wrap.switching .orb img, .call-orb-wrap.switching .call-orb img { opacity: 0; }
      .orb-wrap.orb-thinking .orb img, .call-orb-wrap.orb-thinking .call-orb img { animation: kenZoom 6s ease-in-out infinite alternate; }
      .orb-wrap.orb-working .orb img, .call-orb-wrap.orb-working .call-orb img { animation: kenPan 7s ease-in-out infinite alternate; }
      @keyframes kenZoom { from { transform: scale(1); } to { transform: scale(1.06); } }
      @keyframes kenPan { from { transform: scale(1.08) translate(-1.5%, 1.5%); } to { transform: scale(1.08) translate(1.5%, -1.5%); } }
      .orb-wrap.orb-speaking .orb, .call-orb-wrap.orb-speaking .call-orb,
      .orb-wrap.tts-speaking .orb, .call-orb-wrap.tts-speaking .call-orb {
        animation: speakPulse 0.56s ease-in-out infinite, callGlow 1.8s ease-in-out infinite alternate;
      }
      @keyframes speakPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
      .orb-eq {
        position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
        display: flex; align-items: flex-end; gap: 3px; height: 16px;
        opacity: 0; pointer-events: none; z-index: 2;
      }
      .orb-eq span {
        width: 4px; height: 6px; border-radius: 2px;
        background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
        transform-origin: bottom;
      }
      .orb-eq span:nth-child(1) { animation-delay: 0s; }
      .orb-eq span:nth-child(2) { animation-delay: 0.09s; }
      .orb-eq span:nth-child(3) { animation-delay: 0.18s; }
      .orb-eq span:nth-child(4) { animation-delay: 0.05s; }
      .orb-eq span:nth-child(5) { animation-delay: 0.13s; }
      .orb-wrap.orb-speaking .orb-eq, .call-orb-wrap.orb-speaking .orb-eq,
      .orb-wrap.tts-speaking .orb-eq, .call-orb-wrap.tts-speaking .orb-eq { opacity: 1; }
      .orb-wrap.orb-speaking .orb-eq span, .call-orb-wrap.orb-speaking .orb-eq span,
      .orb-wrap.tts-speaking .orb-eq span, .call-orb-wrap.tts-speaking .orb-eq span { animation: eqBounce 0.45s ease-in-out infinite alternate; }
      @keyframes eqBounce { from { transform: scaleY(0.4); } to { transform: scaleY(2.4); } }

      @media (prefers-reduced-motion: reduce) {
        .orb, .orb-ring, .call-orb, .call-orb.speaking, .call-orb.listening, .typing .tdot,
        .orb-wrap::before, .call-orb-wrap::before, .orb::after, .call-orb::after, .orb-orbit,
        .orb-wrap.orb-thinking .orb img, .call-orb-wrap.orb-thinking .call-orb img,
        .orb-wrap.orb-working .orb img, .call-orb-wrap.orb-working .call-orb img,
        .orb-wrap.orb-speaking .orb, .call-orb-wrap.orb-speaking .call-orb,
        .orb-wrap.tts-speaking .orb, .call-orb-wrap.tts-speaking .call-orb,
        .avatar, .avatar::after, .avatar.orb-thinking img, .avatar.orb-working img,
        .avatar.orb-speaking, .avatar.tts-speaking, .msg-avatar,
        .orb-eq span { animation: none !important; }
        .orb-orbit, .orb-eq { display: none; }
      }

      /* ---------- Day / Night toggle (owner standard) ---------- */
      .theme-toggle svg { width: 20px; height: 20px; display: block; }
      .theme-toggle .icon-moon { display: none; }
      html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
      html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
      html[data-theme="light"] .theme-toggle { background: #fff; }

      /* ---------- Cookie consent banner ---------- */
      .cookie-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10002; max-width: 640px; margin: 0 auto; background: #14141b; border: 1px solid rgba(255, 215, 0, 0.6); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7); padding: 16px 18px; color: #f5f1e6; font-size: 0.9rem; line-height: 1.55; }
      .cookie-banner p { margin: 0 0 12px; }
      .cookie-banner a { color: #ffd98a; font-weight: 700; }
      .cookie-banner .btn-row { display: flex; gap: 10px; }
      .cookie-banner .btn { border: 1px solid #FFD700; background: #FFD700; color: #1a1400; border-radius: 999px; padding: 10px 18px; font-size: 0.9rem; font-weight: 700; min-height: 40px; }
      .cookie-banner .btn.ghost { background: transparent; color: #f5f1e6; border-color: #55555f; }
      html[data-theme="light"] .cookie-banner { background: #ffffff; color: #15211b; border-color: rgba(11, 122, 85, 0.5); }
      html[data-theme="light"] .cookie-banner a { color: #0b7a55; }
      html[data-theme="light"] .cookie-banner .btn.ghost { color: #15211b; border-color: #b9c2b2; }

      /* ---------- Site footer (below the app) ---------- */
      .site-footer { background: var(--bg-deep); border-top: 1px solid var(--border); padding: 28px 18px 90px; }
      .site-footer .foot-inner { max-width: 960px; margin: 0 auto; }
      .site-footer h4 { margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--text); }
      .site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; }
      .site-footer li { font-size: 13.5px; line-height: 1.5; }
      .site-footer li a { color: var(--text); font-weight: 700; text-decoration: none; }
      .site-footer li a:hover { text-decoration: underline; }
      .site-footer .site-icon { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; border-radius: 5px; }
      .site-footer .muted { color: var(--dim); }
      .site-footer .privacy-note { font-size: 13.5px; line-height: 1.65; color: var(--dim); max-width: 720px; margin: 0 0 22px; }
      .site-footer .privacy-note a { color: var(--accent-strong); font-weight: 700; }
      .site-footer .foot-bottom { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--dim); }
      .site-footer .foot-bottom a { color: var(--text); font-weight: 700; }
