        /* ---- v3 additions ---- */
        .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: inline-block; vertical-align: -3px; }
        .ic.ic-sm { width: 14px; height: 14px; }
        .prov-switch { margin-bottom: 0; padding: 2px; gap: 2px; }
        .prov-btn { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; font-size: 11px; }
        .mini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; background: #238636; border: 1px solid #2ea043; color: #fff; white-space: nowrap; }
        .mini-btn:active { transform: scale(0.97); }
        .mini-btn.blue { background: #0e639c; border-color: #1177bb; }
        .icon-btn { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #30363d; background: #21262d; color: #c9d1d9; }
        .icon-btn:active { background: #30363d; }
        .chip { display: flex; align-items: center; flex-shrink: 0; border: 1px solid #1f3a66; background: rgba(30,58,138,.25); border-radius: 999px; color: #93c5fd; font-size: 11px; font-weight: 700; }
        .chip.active { border-color: #58a6ff; background: rgba(30,58,138,.5); }
        .chip-name { display: flex; align-items: center; gap: 4px; padding: 5px 4px 5px 10px; }
        .chip-x { padding: 5px 8px 5px 4px; color: #8b949e; display: flex; align-items: center; }
        .chip-x:active { color: #ff7b72; }
        .html-mode { position: relative; min-height: 60vh; padding: 0 !important; overflow: hidden !important; background: #fff !important; }
        .html-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
        .seg { display: flex; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 2px; gap: 2px; }
        .seg button { flex: 1; padding: 8px 6px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #8b949e; display: flex; align-items: center; justify-content: center; gap: 6px; }
        .seg button.active { background: #21262d; color: #58a6ff; box-shadow: 0 0 0 1px #30363d inset; }
        .tgl { width: 40px; height: 22px; border-radius: 999px; background: #30363d; position: relative; flex-shrink: 0; transition: background .15s; }
        .tgl::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
        .tgl.on { background: #238636; }
        .tgl.on::after { left: 20px; }
        /* ---- v4 additions ---- */
        .markdown-preview [id] { scroll-margin-top: 8px; }
        .md-flash { background: rgba(88,166,255,.25); border-radius: 4px; transition: background .6s; }
        .spage { position: fixed; inset: 0; z-index: 1000; background: #0d1117; display: none; flex-direction: column; }
        .spage.open { display: flex; }
        .cmd-bar { display: flex; align-items: center; gap: 8px; background: #161b22; border: 1px solid #30363d; border-radius: 10px; padding: 6px; }
        .cmd-bar:focus-within { border-color: #58a6ff; }
        .cmd-slash { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; border: 1px solid #30363d; background: #0d1117; color: #58a6ff; font: 700 18px ui-monospace, SFMono-Regular, Menlo, monospace; display: flex; align-items: center; justify-content: center; }
        .cmd-slash.on { background: #1f3a66; border-color: #58a6ff; }
        .cmd-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #e6edf3; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
        .cmd-run { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; background: #238636; color: #fff; display: flex; align-items: center; justify-content: center; }
        .cmd-menu { background: #161b22; border: 1px solid #30363d; border-radius: 10px; margin-bottom: 6px; max-height: 34vh; overflow-y: auto; }
        .cmd-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 10px 12px; text-align: left; border-bottom: 1px solid #21262d; gap: 2px; }
        .cmd-item:last-child { border-bottom: 0; }
        .cmd-item:active { background: #21262d; }
        .cmd-item b { color: #58a6ff; font: 700 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
        .cmd-item span { color: #8b949e; font-size: 11px; }
        .cmd-replies { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
        .cmd-replies:empty { display: none; }
        .cmd-msg { background: #161b22; border: 1px solid #30363d; border-radius: 10px; padding: 10px; font-size: 12px; color: #c9d1d9; line-height: 1.5; flex-shrink: 0; }
        .cmd-msg.me { align-self: flex-end; background: #1f3a66; border-color: #1f3a66; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 10px; }
        .cmd-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
        .cmd-btn { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; background: #238636; border: 1px solid #2ea043; color: #fff; }
        .cmd-btn.no { background: #21262d; border-color: #30363d; color: #c9d1d9; }
        .cmd-btn:disabled { opacity: .45; }
        .cmd-btn.picked { opacity: 1; box-shadow: 0 0 0 2px rgba(88,166,255,.6); }
        .link-scroll { overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
        .link-scroll::-webkit-scrollbar { display: none; }
        /* toast: fully hidden until shown (it used to peek out at the bottom of the screen) */
        #toast { bottom: -80px; opacity: 0; visibility: hidden; pointer-events: none; transition: bottom .3s ease, opacity .2s ease, visibility .2s; }
        #toast.show { opacity: 1; visibility: visible; }
        /* editor keeps a fixed size; command replies make the page longer instead */
        :root { --ed-h: max(320px, calc(100svh - 300px)); }
        #panel-editor { flex: 0 0 auto; }
        #mobileEditor { flex: none; height: var(--ed-h); min-height: 0; }
        #mdPreviewBox { flex: none; height: var(--ed-h); min-height: 0; }
        .cmd-replies { max-height: 45vh; }
