/* =====================================================================
   Hythm UI v3 — calm chat-first layout, dark + light themes.
   Every colour comes from the tokens below; nothing decorative.
   ===================================================================== */
html[data-ui="v2"] {
  --ui-font: "Manrope", "Readex Pro", system-ui, sans-serif;
  --ui-r-sm: 10px; --ui-r-md: 14px; --ui-r-lg: 22px; --ui-r-pill: 999px;
  --ui-blue: #1f7aff;
}
html[data-ui="v2"][data-theme="dark"], html[data-ui="v2"]:not([data-theme]) {
  --ui-bg: #212121;          /* conversation */
  --ui-side: #171717;        /* sidebar */
  --ui-field: #303030;       /* composer */
  --ui-pop: #353535;         /* menus, popovers */
  --ui-modal: #2f2f2f;
  --ui-card: #2a2a2a;
  --ui-hover: rgba(255,255,255,.07);
  --ui-active: rgba(255,255,255,.1);
  --ui-line: rgba(255,255,255,.08);
  --ui-line-2: rgba(255,255,255,.14);
  --ui-text: #ececec;
  --ui-muted: #b4b4b4;
  --ui-subtle: #8a8a8a;
  --ui-bubble: #303030;
  --ui-shadow: 0 16px 48px -12px rgba(0,0,0,.7);
  color-scheme: dark;
}
html[data-ui="v2"][data-theme="light"] {
  --ui-bg: #ffffff;
  --ui-side: #f9f9f9;
  --ui-field: #ffffff;
  --ui-pop: #ffffff;
  --ui-modal: #ffffff;
  --ui-card: #f4f4f4;
  --ui-hover: rgba(0,0,0,.05);
  --ui-active: rgba(0,0,0,.07);
  --ui-line: rgba(0,0,0,.08);
  --ui-line-2: rgba(0,0,0,.14);
  --ui-text: #0d0d0d;
  --ui-muted: #5d5d5d;
  --ui-subtle: #8f8f8f;
  --ui-bubble: #f1f1f1;
  --ui-shadow: 0 12px 40px -12px rgba(0,0,0,.2);
  color-scheme: light;
}
/* the old stylesheet reads these, so everything follows the theme */
html[data-ui="v2"] {
  --bg: var(--ui-bg); --surface: var(--ui-bg); --surface-2: var(--ui-card); --border: var(--ui-line);
  --text: var(--ui-text); --text-muted: var(--ui-muted); --text-subtle: var(--ui-subtle);
  --primary: var(--ui-blue); --primary-hover: #3b8bff; --on-primary: #fff;
  --shadow-md: var(--ui-shadow); --shadow-lg: var(--ui-shadow);
}
html[data-ui="v2"] body { background: var(--ui-bg); color: var(--ui-text); }

/* ---------- strip old decoration ---------- */
html[data-ui="v2"] .app.is-empty .chat::before, html[data-ui="v2"] .app.is-empty .chat::after,
html[data-ui="v2"] .sidebar::before, html[data-ui="v2"] .sidebar::after { display: none !important; }
html[data-ui="v2"] .cloud-logo { filter: none; }
html[data-ui="v2"] .h-mark { background: var(--ui-card) !important; box-shadow: inset 0 0 0 1px var(--ui-line) !important; }
html[data-ui="v2"] .h-mark::after { display: none; }
html[data-ui="v2"] :is(.app.is-empty .chat, .working, .cloud-logo, .sidebar, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item, .msg-user .bubble, .omni-modal) { filter: none !important; }

/* ---------- sidebar ---------- */
html[data-ui="v2"] .sidebar { background: var(--ui-side); border-inline-end: 0; padding: 10px 8px 8px; gap: 1px; }
html[data-ui="v2"] .brand-name { font-weight: 700; color: var(--ui-text); }
html[data-ui="v2"] .brand-sub { display: none; }
html[data-ui="v2"] .side-nav { gap: 1px; margin-top: 8px; }
html[data-ui="v2"] .side-item { height: 36px; padding: 0 10px; gap: 10px; border-radius: var(--ui-r-sm); color: var(--ui-text); font-weight: 400; font-size: .875rem; background: none !important; box-shadow: none !important; }
html[data-ui="v2"] .side-item svg { width: 18px; height: 18px; color: var(--ui-text); }
html[data-ui="v2"] .side-item:hover { background: var(--ui-hover) !important; }
html[data-ui="v2"] .omni-link .cloud-logo { width: 18px; height: 18px; }
html[data-ui="v2"] .side-search { height: 36px; margin: 2px 0; border-radius: var(--ui-r-sm); border: 0; background: transparent; padding: 0 10px; color: var(--ui-muted); }
html[data-ui="v2"] .side-search:focus-within { background: var(--ui-hover); }
html[data-ui="v2"] .side-search input { color: var(--ui-text); font-size: .875rem; }
html[data-ui="v2"] .side-search kbd { background: transparent; color: var(--ui-subtle); border: 0; }
html[data-ui="v2"] .side-label { font-size: .78rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ui-subtle); padding: 18px 10px 6px; }
html[data-ui="v2"] .projects { gap: 0; }
html[data-ui="v2"] .project-open { color: var(--ui-text); border-radius: var(--ui-r-sm); font-size: .875rem; }
html[data-ui="v2"] .project-open small, html[data-ui="v2"] .project-open time { display: none; }
html[data-ui="v2"] .project-open:hover { background: var(--ui-hover); }
html[data-ui="v2"] .projects .active .project-open { background: var(--ui-active); box-shadow: none; }
html[data-ui="v2"] .projects-empty { color: var(--ui-subtle); }
html[data-ui="v2"] .side-foot-wrap { position: relative; margin-top: 6px; }
html[data-ui="v2"] .side-foot { width: 100%; border: 0; background: transparent; border-radius: var(--ui-r-sm); padding: 8px; }
html[data-ui="v2"] .side-foot:hover, html[data-ui="v2"] .side-foot[aria-expanded="true"] { background: var(--ui-hover); }
html[data-ui="v2"] .side-user b { color: var(--ui-text); font-weight: 500; }
html[data-ui="v2"] .side-user small { color: var(--ui-subtle); }
html[data-ui="v2"] .avatar-btn { background: #10a37f; color: #fff; box-shadow: none; }
html[data-ui="v2"] .credit-pill { background: transparent; color: var(--ui-text); box-shadow: inset 0 0 0 1px var(--ui-line-2); border-radius: var(--ui-r-pill); }
html[data-ui="v2"] .credit-pill:hover { background: var(--ui-hover); }

/* ---------- menus / popovers ---------- */
html[data-ui="v2"] .menu { background: var(--ui-pop); border: 1px solid var(--ui-line); border-radius: var(--ui-r-md); box-shadow: var(--ui-shadow); padding: 6px; backdrop-filter: none; color: var(--ui-text); }
html[data-ui="v2"] .menu-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--ui-r-sm); background: transparent; color: var(--ui-text); font: inherit; font-size: .875rem; text-align: start; cursor: pointer; }
html[data-ui="v2"] .menu-row:hover { background: var(--ui-hover); }
html[data-ui="v2"] .menu-row svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
html[data-ui="v2"] .menu-row span { flex: 1; }
html[data-ui="v2"] .menu-row kbd { font-family: var(--mono); font-size: .68rem; color: var(--ui-subtle); background: none; border: 0; }
html[data-ui="v2"] .menu-row[aria-pressed="true"] { color: var(--ui-blue); }
html[data-ui="v2"] .menu-sep { height: 1px; margin: 6px 4px; background: var(--ui-line); }
html[data-ui="v2"] .menu-label { color: var(--ui-subtle); }
html[data-ui="v2"] .menu-item { border-radius: var(--ui-r-sm); color: var(--ui-text); }
html[data-ui="v2"] .menu-item:hover { background: var(--ui-hover); }
html[data-ui="v2"] .menu-item[aria-checked="true"] { background: var(--ui-active); box-shadow: none; }
html[data-ui="v2"] .menu-item small { color: var(--ui-subtle); }
html[data-ui="v2"] .user-menu { position: absolute; inset-inline: 0; bottom: calc(100% + 6px); z-index: 40; }
html[data-ui="v2"] .um-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
html[data-ui="v2"] .um-head b { display: block; font-weight: 500; font-size: .9rem; }
html[data-ui="v2"] .um-head small { color: var(--ui-subtle); font-size: .75rem; }
html[data-ui="v2"] .um-head .avatar-btn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; }

/* ---------- header ---------- */
html[data-ui="v2"] .chat { background: var(--ui-bg); border: 0; }
html[data-ui="v2"] .chat-head { min-height: 52px; padding: 8px 14px; border: 0 !important; background: var(--ui-bg) !important; position: relative; }
html[data-ui="v2"] .chat-title { font-size: 1rem; font-weight: 500; color: var(--ui-text); }
html[data-ui="v2"] .app.is-empty .chat-title { visibility: hidden; }
html[data-ui="v2"] .view-seg { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: inline-flex; padding: 3px; border-radius: var(--ui-r-pill); background: var(--ui-card); box-shadow: inset 0 0 0 1px var(--ui-line); }
html[data-ui="v2"] .app:not(.is-empty) .view-seg { display: none; }
html[data-ui="v2"] .view-seg button { border: 0; background: transparent; color: var(--ui-muted); font: inherit; font-size: .82rem; font-weight: 500; padding: 6px 18px; border-radius: var(--ui-r-pill); cursor: pointer; }
html[data-ui="v2"] .view-seg button[aria-selected="true"] { background: var(--ui-field); color: var(--ui-text); box-shadow: 0 1px 2px rgba(0,0,0,.25), inset 0 0 0 1px var(--ui-line); }
html[data-ui="v2"] .icon-btn { color: var(--ui-muted); border-radius: var(--ui-r-sm); }
html[data-ui="v2"] .icon-btn:hover { background: var(--ui-hover); color: var(--ui-text); }

/* ---------- home ---------- */
html[data-ui="v2"] .app.no-design .messages { width: 100%; max-width: 768px; margin-inline: auto; padding: 24px 24px 12px; gap: 24px; }
html[data-ui="v2"] .app.no-design .composer { width: 100%; max-width: 768px; margin-inline: auto; padding: 4px 24px 12px; border: 0; }
html[data-ui="v2"] .greeting { font-size: 1.75rem; font-weight: 500; letter-spacing: -.01em; color: var(--ui-text); }
html[data-ui="v2"] .greeting span, html[data-ui="v2"] .greeting b { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ui-text) !important; }
html[data-ui="v2"] .greeting-sub { display: none; }
html[data-ui="v2"] .home-actions { display: flex !important; flex-direction: column; align-items: center; gap: 2px; max-width: 768px; margin: 14px auto 0; padding: 0; }
html[data-ui="v2"] .app.images-view .home-actions { display: none !important; }
html[data-ui="v2"] .home-action { display: inline-flex; align-items: center; gap: 10px; min-width: 200px; padding: 9px 14px; border: 0; border-radius: var(--ui-r-sm); background: transparent; color: var(--ui-muted); font: inherit; font-size: .9rem; cursor: pointer; }
html[data-ui="v2"] .home-action:hover { background: var(--ui-hover); color: var(--ui-text); }
html[data-ui="v2"] .home-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
html[data-ui="v2"] .app:not(.is-empty) .home-actions, html[data-ui="v2"] .app:not(.is-empty) .images-page { display: none !important; }

/* ---------- images page ---------- */
html[data-ui="v2"] .images-page { width: 100%; max-width: 768px; margin: 8px auto 24px; padding: 0 24px; overflow-y: auto; }
html[data-ui="v2"] .images-page[hidden] { display: none; }
html[data-ui="v2"] .ip-head { display: flex; justify-content: flex-start; margin-bottom: 12px; }
html[data-ui="v2"] .ip-pill { padding: 6px 14px; border-radius: var(--ui-r-pill); background: var(--ui-card); color: var(--ui-text); font-size: .82rem; font-weight: 600; }
html[data-ui="v2"] .ip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
html[data-ui="v2"] .ip-card { position: relative; aspect-ratio: 4 / 5; border: 0; border-radius: 18px; overflow: hidden; cursor: pointer; font: inherit;
  background: radial-gradient(90% 70% at 30% 20%, var(--a, #888), transparent 70%), radial-gradient(80% 80% at 80% 90%, color-mix(in srgb, var(--a, #888) 60%, #fff), transparent 60%), var(--b, #222);
  transition: transform .2s ease, box-shadow .2s ease; }
html[data-ui="v2"] .ip-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
html[data-ui="v2"] .ip-card b { position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px; text-align: start; font-size: .85rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
html[data-ui="v2"] .ip-upload { background: var(--ui-card); box-shadow: inset 0 0 0 1px var(--ui-line); }
html[data-ui="v2"] .ip-upload b { color: var(--ui-muted); background: none; }
html[data-ui="v2"] .ip-plus { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; font-weight: 300; color: var(--ui-muted); }

/* ---------- composer: one pill ---------- */
html[data-ui="v2"] .composer-box { background: var(--ui-field); border: 0; border-radius: 28px; padding: 6px 8px; box-shadow: 0 0 0 1px var(--ui-line), 0 2px 8px -2px rgba(0,0,0,.15) !important; backdrop-filter: none; }
html[data-ui="v2"][data-theme="light"] .composer-box { box-shadow: 0 0 0 1px var(--ui-line-2), 0 4px 16px -6px rgba(0,0,0,.12) !important; }
html[data-ui="v2"] .composer-row { display: flex; align-items: flex-end; gap: 4px; padding: 0; flex-wrap: nowrap; }
html[data-ui="v2"] #input { flex: 1; min-width: 0; align-self: center; padding: 9px 6px; margin: 0; max-height: 200px; font-size: 1rem; line-height: 1.5; color: var(--ui-text); background: transparent; }
html[data-ui="v2"] #input::placeholder { color: var(--ui-subtle); }
html[data-ui="v2"] .cbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--ui-r-pill); background: transparent; color: var(--ui-muted); font: inherit; font-size: .85rem; cursor: pointer; flex: none; }
html[data-ui="v2"] .cbtn.round { width: 36px; padding: 0; justify-content: center; }
html[data-ui="v2"] .cbtn:hover { background: var(--ui-hover); color: var(--ui-text); }
html[data-ui="v2"] .cbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
html[data-ui="v2"] .think-btn[aria-pressed="true"] { color: var(--ui-blue); background: color-mix(in srgb, var(--ui-blue) 12%, transparent); }
html[data-ui="v2"] .plus-wrap { position: relative; flex: none; }
html[data-ui="v2"] .plus-menu { position: absolute; bottom: calc(100% + 10px); inset-inline-start: 0; width: 250px; z-index: 30; }
html[data-ui="v2"] .img-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-bottom: 2px; padding: 0 8px 0 10px; border: 0; border-radius: var(--ui-r-pill); background: color-mix(in srgb, var(--ui-blue) 14%, transparent); color: var(--ui-blue); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; flex: none; align-self: center; }
html[data-ui="v2"] .img-chip[hidden] { display: none; }
html[data-ui="v2"] .img-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
html[data-ui="v2"] .img-chip .x { font-size: 1rem; line-height: 1; opacity: .8; }
html[data-ui="v2"] #pickerBtn { height: 36px; padding: 0 10px; border-radius: var(--ui-r-pill); background: transparent; color: var(--ui-muted); box-shadow: none; font-weight: 500; }
html[data-ui="v2"] #pickerBtn:hover { background: var(--ui-hover); color: var(--ui-text); }
html[data-ui="v2"] #pickerBtn .picker-dot, html[data-ui="v2"] #pickerMode { display: none; }
html[data-ui="v2"] .send-btn { width: 36px; min-width: 36px; height: 36px; padding: 0; border-radius: 50%; justify-content: center; background: var(--ui-blue); color: #fff; box-shadow: none; flex: none; }
html[data-ui="v2"] .send-btn:hover { background: #3b8bff; }
html[data-ui="v2"] .send-btn .send-cost { display: none; }
html[data-ui="v2"] .send-btn.stop { background: var(--ui-text); color: var(--ui-bg); }
html[data-ui="v2"] .composer-hint { display: none; }
html[data-ui="v2"] .attach-row { padding: 6px 6px 4px; }
html[data-ui="v2"] .img-opts { margin-top: 10px; gap: 8px; }
html[data-ui="v2"] .img-row button, html[data-ui="v2"] .style-chip { border-radius: var(--ui-r-pill); background: transparent; border: 1px solid var(--ui-line-2); color: var(--ui-muted); box-shadow: none; font-size: .8rem; }
html[data-ui="v2"] .img-row button:hover, html[data-ui="v2"] .style-chip:hover { color: var(--ui-text); background: var(--ui-hover); }
html[data-ui="v2"] .img-row button.on, html[data-ui="v2"] .style-chip.active { background: var(--ui-text); color: var(--ui-bg); border-color: transparent; }
html[data-ui="v2"] .engine-chip { background: transparent; border: 0; color: var(--ui-subtle); font-size: .72rem; }
html[data-ui="v2"] .quick-edits button { background: var(--ui-card); color: var(--ui-muted); border: 0; border-radius: var(--ui-r-pill); }
html[data-ui="v2"] .edit-context { background: var(--ui-card); color: var(--ui-muted); border: 0; border-radius: var(--ui-r-md); }

/* ---------- messages ---------- */
html[data-ui="v2"] .msg-user { align-items: flex-end; }
html[data-ui="v2"] .msg-user .bubble { background: var(--ui-bubble) !important; color: var(--ui-text) !important; box-shadow: none !important; border-radius: 22px !important; padding: 10px 16px; max-width: 72%; line-height: 1.6; }
html[data-ui="v2"] .bubble-meta { opacity: 0; transition: opacity .15s; }
html[data-ui="v2"] .msg-user:hover .bubble-meta { opacity: 1; }
html[data-ui="v2"] .tag { background: transparent; color: var(--ui-subtle); box-shadow: none; border: 0; }
html[data-ui="v2"] .ai-head { display: none; }
html[data-ui="v2"] .msg-ai { color: var(--ui-text); font-size: 1rem; line-height: 1.75; }
html[data-ui="v2"] .ai-meta, html[data-ui="v2"] .msg-meta { color: var(--ui-subtle); }
html[data-ui="v2"] .notes pre, html[data-ui="v2"] .md pre { background: var(--ui-card) !important; color: var(--ui-text); border: 0; border-radius: var(--ui-r-md); }
html[data-ui="v2"][data-theme="dark"] .notes pre, html[data-ui="v2"][data-theme="dark"] .md pre { background: #171717 !important; }
html[data-ui="v2"] .code-bar { background: transparent; border-bottom: 1px solid var(--ui-line); color: var(--ui-subtle); }
html[data-ui="v2"] .notes :not(pre) > code { background: var(--ui-card); color: var(--ui-text); border-radius: 6px; padding: .12em .4em; }
html[data-ui="v2"] .notes a { color: var(--ui-blue); }
html[data-ui="v2"] .notes table { border-color: var(--ui-line); }
html[data-ui="v2"] .notes th, html[data-ui="v2"] .notes td { border-color: var(--ui-line); }
html[data-ui="v2"] .thinking { background: transparent; border: 0; color: var(--ui-subtle); }
html[data-ui="v2"] .notice { border-radius: var(--ui-r-md); background: var(--ui-card); border: 0; color: var(--ui-text); }
html[data-ui="v2"] .notice.error { background: color-mix(in srgb, #ef4444 10%, var(--ui-bg)); }
html[data-ui="v2"] .notice.credits { background: color-mix(in srgb, #f59e0b 10%, var(--ui-bg)); }
html[data-ui="v2"] .btn-soft, html[data-ui="v2"] .mini-btn { border-radius: var(--ui-r-pill); background: transparent; color: var(--ui-text); border: 1px solid var(--ui-line-2); box-shadow: none; }
html[data-ui="v2"] .btn-soft:hover, html[data-ui="v2"] .mini-btn:hover { background: var(--ui-hover); }
html[data-ui="v2"] .img-frame-gen { border-radius: 18px; overflow: hidden; border: 0; max-width: 480px; }
html[data-ui="v2"] .img-dream { background: var(--ui-card); }
html[data-ui="v2"] .img-dream .dream-msg { background: color-mix(in srgb, var(--ui-bg) 70%, transparent); color: var(--ui-text); }
html[data-ui="v2"] .img-card .ai-head { display: none; }
html[data-ui="v2"] .bubble-imgs img { border-radius: 16px; box-shadow: none; }
html[data-ui="v2"] .toast { background: var(--ui-text); color: var(--ui-bg); border: 0; box-shadow: var(--ui-shadow); }

/* ---------- dialogs ---------- */
html[data-ui="v2"] .modal, html[data-ui="v2"] .omni-modal { background: var(--ui-modal); color: var(--ui-text); border: 0; border-radius: 18px; box-shadow: var(--ui-shadow), 0 0 0 1px var(--ui-line); }
html[data-ui="v2"] .modal::backdrop, html[data-ui="v2"] .omni-modal::backdrop { background: rgba(0,0,0,.5); backdrop-filter: none; }
html[data-ui="v2"] .modal-head { border-bottom: 1px solid var(--ui-line); }
html[data-ui="v2"] .modal-title { font-size: 1.05rem; font-weight: 600; }
html[data-ui="v2"] .modal-title svg { display: none; }
/* settings: side list + panel */
html[data-ui="v2"] .settings-modal { width: min(760px, calc(100vw - 24px)); }
html[data-ui="v2"] .settings-modal .modal-head { display: none; }
html[data-ui="v2"] .settings-shell { min-height: 520px; }
html[data-ui="v2"] .set-tabs { background: var(--ui-modal); border: 0; border-inline-end: 1px solid var(--ui-line); padding: 12px 8px; gap: 2px; }
html[data-ui="v2"][data-theme="dark"] .set-tabs { background: #262626; }
html[data-ui="v2"][data-theme="light"] .set-tabs { background: #f9f9f9; }
html[data-ui="v2"] .set-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin-bottom: 8px; border-radius: var(--ui-r-pill); box-shadow: inset 0 0 0 1px var(--ui-line-2); color: var(--ui-subtle); }
html[data-ui="v2"] .set-search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
html[data-ui="v2"] .set-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ui-text); font: inherit; font-size: .85rem; outline: 0; }
html[data-ui="v2"] .set-tabs button { justify-content: flex-start; border-radius: var(--ui-r-sm); color: var(--ui-text); font-weight: 400; background: transparent; box-shadow: none; }
html[data-ui="v2"] .set-tabs button:hover { background: var(--ui-hover); }
html[data-ui="v2"] .set-tabs button.on { background: var(--ui-active); color: var(--ui-text); }
html[data-ui="v2"] .settings-body { padding: 8px 22px 22px; }
html[data-ui="v2"] .set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ui-line); }
html[data-ui="v2"] .set-row[hidden], html[data-ui="v2"] .set-col[hidden] { display: none; }
html[data-ui="v2"] .set-label { font-size: .9rem; color: var(--ui-text); }
html[data-ui="v2"] .set-label small { display: block; margin-top: 2px; font-size: .75rem; color: var(--ui-subtle); line-height: 1.5; }
html[data-ui="v2"] .set-col { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--ui-line); }
html[data-ui="v2"] .set-col textarea { width: 100%; resize: vertical; min-height: 96px; padding: 12px; border: 0; border-radius: var(--ui-r-md); background: var(--ui-card); color: var(--ui-text); font: inherit; font-size: .9rem; line-height: 1.6; outline: 0; box-shadow: inset 0 0 0 1px var(--ui-line); }
html[data-ui="v2"] .set-col textarea:focus { box-shadow: inset 0 0 0 1px var(--ui-blue); }
html[data-ui="v2"] .set-opts { gap: 2px; padding: 3px; border-radius: var(--ui-r-pill); background: var(--ui-card); flex-wrap: wrap; justify-content: flex-end; }
html[data-ui="v2"] .set-opts button { border: 0; border-radius: var(--ui-r-pill); background: transparent; color: var(--ui-muted); box-shadow: none; font-size: .8rem; padding: 5px 12px; }
html[data-ui="v2"] .set-opts button.on { background: var(--ui-modal); color: var(--ui-text); box-shadow: 0 1px 3px rgba(0,0,0,.2), inset 0 0 0 1px var(--ui-line); }
html[data-ui="v2"] .set-opts .mini-btn { border: 1px solid var(--ui-line-2); }
html[data-ui="v2"] .set-opts.set-themes, html[data-ui="v2"] .set-opts.set-fonts { background: transparent; }
html[data-ui="v2"] .set-preview { display: none; }
html[data-ui="v2"] .model-compare > div { background: var(--ui-card); border: 0; box-shadow: none; border-radius: var(--ui-r-md); }
html[data-ui="v2"] .shortcuts li { background: var(--ui-card); }
html[data-ui="v2"] .shortcuts kbd { background: var(--ui-modal); box-shadow: inset 0 0 0 1px var(--ui-line-2); color: var(--ui-text); }
/* wallet = plan card */
html[data-ui="v2"] .wallet { background: transparent; border: 0; }
html[data-ui="v2"] .wallet-main { background: var(--ui-card) !important; color: var(--ui-text) !important; box-shadow: inset 0 0 0 1px var(--ui-line) !important; border-radius: 16px; }
html[data-ui="v2"] .wallet-main::before, html[data-ui="v2"] .wallet-main::after { display: none !important; }
html[data-ui="v2"] .wallet-main *:not(svg):not(use) { color: inherit; }
html[data-ui="v2"] .wallet-label, html[data-ui="v2"] .wallet-note, html[data-ui="v2"] .wallet-perks { color: var(--ui-muted) !important; }
html[data-ui="v2"] .wallet-bar { background: var(--ui-line-2); }
html[data-ui="v2"] .wallet-bar i { background: var(--ui-blue); }
html[data-ui="v2"] .wallet-stats > div, html[data-ui="v2"] .pricing > div { background: transparent; border: 1px solid var(--ui-line); border-radius: var(--ui-r-md); box-shadow: none; color: var(--ui-text); }
html[data-ui="v2"] .fair { background: transparent; border: 0; color: var(--ui-subtle); }
html[data-ui="v2"] .ledger li { border-color: var(--ui-line); }
html[data-ui="v2"] .acc-tabs button, html[data-ui="v2"] .modal-tabs button { border-radius: var(--ui-r-pill); }
/* explore */
html[data-ui="v2"] .omni-sky { display: none; }
html[data-ui="v2"] .omni-hero h2, html[data-ui="v2"] .omni-hero p { color: var(--ui-text); }
html[data-ui="v2"] .omni-hero h2 span { background: none; -webkit-text-fill-color: currentColor; color: var(--ui-muted); }
html[data-ui="v2"] .omni-kicker { background: var(--ui-card); color: var(--ui-muted); box-shadow: none; }
html[data-ui="v2"] .xp-tabs { background: var(--ui-card); box-shadow: none; }
html[data-ui="v2"] .xp-tab { color: var(--ui-muted); }
html[data-ui="v2"] .xp-tab[aria-selected="true"] { background: var(--ui-modal); color: var(--ui-text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
html[data-ui="v2"] .omni-cap, html[data-ui="v2"] .om-card, html[data-ui="v2"] .omni-stats > div, html[data-ui="v2"] .mc-empty { background: var(--ui-card); box-shadow: none; border: 0; color: var(--ui-text); }
html[data-ui="v2"] .omni-cap p, html[data-ui="v2"] .om-card small, html[data-ui="v2"] .omni-stats span { color: var(--ui-muted); }
html[data-ui="v2"] .oc-ico { background: var(--ui-modal); box-shadow: none; color: var(--ui-text); }
html[data-ui="v2"] .omni-cta { background: var(--ui-text); color: var(--ui-bg); box-shadow: none; }
html[data-ui="v2"] .omni-strengths li { color: var(--ui-text); }
html[data-ui="v2"] .field input, html[data-ui="v2"] #loginName, html[data-ui="v2"] #adminToken { background: var(--ui-card); color: var(--ui-text); border: 1px solid var(--ui-line-2); }
html[data-ui="v2"] .btn-primary, html[data-ui="v2"] #loginSubmit { background: var(--ui-text); color: var(--ui-bg); box-shadow: none; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  html[data-ui="v2"] .app.no-design .messages { padding: 16px 14px 8px; }
  html[data-ui="v2"] .app.no-design .composer { padding: 4px 10px 10px; }
  html[data-ui="v2"] .think-btn span, html[data-ui="v2"] #pickerModel { display: none; }
  html[data-ui="v2"] .ip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-ui="v2"] .images-page { padding: 0 14px; }
  html[data-ui="v2"] .view-seg { top: 60px; }
  html[data-ui="v2"] .settings-shell { flex-direction: column; min-height: 0; }
  html[data-ui="v2"] .set-row { flex-direction: column; align-items: flex-start; }
  html[data-ui="v2"] .msg-user .bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) { html[data-ui="v2"] * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
html[data-ui="v2"] .explore-text { color: var(--ui-text) !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
html[data-ui="v2"] .projects:empty { flex: 0 0 auto; }
html[data-ui="v2"] .projects-empty { flex: 1 1 auto; padding: 4px 10px; font-size: .8rem; }
html[data-ui="v2"] .brand-mark { background: transparent !important; box-shadow: none !important; }

/* ---- composer: same calm pill in every mode / model / theme (kills the old spinning borders & glows) ---- */
html[data-ui="v2"] .composer .composer-box,
html[data-ui="v2"] .composer.is-x .composer-box,
html[data-ui="v2"] .composer.is-ultra .composer-box,
html[data-ui="v2"] .composer[data-mode="max"] .composer-box,
html[data-ui="v2"] .composer[data-task="image"] .composer-box,
html[data-ui="v2"] .app.is-empty .composer .composer-box {
  background: var(--ui-field) !important; border: 0 !important; animation: none !important;
  box-shadow: 0 0 0 1px var(--ui-line-2), 0 2px 10px -4px rgba(0,0,0,.25) !important;
}
html[data-ui="v2"] .composer .composer-box:focus-within { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui-blue) 55%, var(--ui-line-2)), 0 2px 10px -4px rgba(0,0,0,.25) !important; }
html[data-ui="v2"] .composer::before, html[data-ui="v2"] .composer::after,
html[data-ui="v2"] .composer-box::before, html[data-ui="v2"] .composer-box::after,
html[data-ui="v2"] .max-embers { display: none !important; }
html[data-ui="v2"] .composer.is-x .send-btn, html[data-ui="v2"] .composer.is-ultra .send-btn,
html[data-ui="v2"] .composer[data-mode="max"] .send-btn { background: var(--ui-blue) !important; box-shadow: none !important; animation: none !important; }
html[data-ui="v2"] .composer[data-mode="max"] .think-btn { color: var(--ui-blue); }
html[data-ui="v2"] .picker-model, html[data-ui="v2"] .composer.is-x .picker-model, html[data-ui="v2"] .composer.is-ultra .picker-model,
html[data-ui="v2"] .mode-label, html[data-ui="v2"] .mi-text b { background: none !important; -webkit-text-fill-color: currentColor !important; color: inherit !important; animation: none !important; }
/* the cloud logo is drawn in light strokes: darken it on white so it stays visible */
html[data-ui="v2"][data-theme="light"] .cloud-logo { filter: brightness(.42) saturate(1.8) !important; }
html[data-ui="v2"] .projects li::before, html[data-ui="v2"] .projects li::after,
html[data-ui="v2"] .projects .active::before, html[data-ui="v2"] .projects .active::after { display: none !important; }
html[data-ui="v2"] .projects li, html[data-ui="v2"] .projects .active { box-shadow: none !important; border: 0 !important; background: none; }
html[data-ui="v2"] .project { border-radius: var(--ui-r-sm); }
html[data-ui="v2"] .project:hover { background: var(--ui-hover) !important; }
html[data-ui="v2"] .project.active { background: var(--ui-active) !important; }
html[data-ui="v2"] .project.active::before { display: none !important; }
html[data-ui="v2"][data-theme="light"] body .cloud-logo.cloud-logo.cloud-logo.cloud-logo { filter: brightness(.42) saturate(1.8) !important; }
html[data-ui="v2"] .projects .project-open, html[data-ui="v2"] .projects .active .project-open, html[data-ui="v2"] .project-open:hover { background: transparent !important; }

/* ---------- answers: smooth reveal ---------- */
html[data-ui="v2"] .md-in { animation: mdIn .5s cubic-bezier(.2,.8,.2,1) both; }
html[data-ui="v2"] .md-in-done { animation: none; }
@keyframes mdIn { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
html[data-ui="v2"] .msg.settled { animation: none !important; }
html[data-ui="v2"] .msg-chat .typing { margin: 6px 0; }

/* ---------- answer actions / follow-ups / sources ---------- */
html[data-ui="v2"] .ans-actions { display: flex; gap: 2px; margin-top: 2px; opacity: .85; }
html[data-ui="v2"] .ans-actions button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ui-subtle); cursor: pointer; transition: background .15s, color .15s; }
html[data-ui="v2"] .ans-actions button:hover { background: var(--ui-hover); color: var(--ui-text); }
html[data-ui="v2"] .ans-actions button.on, html[data-ui="v2"] .ans-actions button.done { color: var(--ui-blue); }
html[data-ui="v2"] .ans-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-ui="v2"] .ans-next { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
html[data-ui="v2"] .ans-next button { max-width: 100%; text-align: start; padding: 8px 14px; border: 1px solid var(--ui-line-2); border-radius: 16px; background: transparent; color: var(--ui-text); font: inherit; font-size: .88rem; cursor: pointer; animation: mdIn .4s ease both; }
html[data-ui="v2"] .ans-next button:nth-child(2) { animation-delay: .06s; } html[data-ui="v2"] .ans-next button:nth-child(3) { animation-delay: .12s; }
html[data-ui="v2"] .ans-next button:hover { background: var(--ui-hover); }
html[data-ui="v2"] .ans-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
html[data-ui="v2"] .ans-sources a { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--ui-card); color: var(--ui-muted); font-size: .76rem; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-ui="v2"] .ans-sources a:hover { color: var(--ui-text); }
html[data-ui="v2"] .ans-sources b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ui-modal); font-size: .68rem; flex: none; }

/* ---------- send button: dim when empty, strong when ready ---------- */
html[data-ui="v2"] .composer .send-btn { background: var(--ui-text) !important; color: var(--ui-bg) !important; opacity: .28; transition: opacity .2s, transform .15s; }
html[data-ui="v2"] .composer.has-text .send-btn, html[data-ui="v2"] .composer .send-btn.stop { opacity: 1; }
html[data-ui="v2"] .composer.has-text .send-btn:hover { transform: scale(1.06); }
html[data-ui="v2"] .composer .send-btn:active { transform: scale(.94); }
html[data-ui="v2"] .composer .send-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }
html[data-ui="v2"] .composer .send-btn .i-stop { width: 14px; height: 14px; fill: currentColor; }
html[dir="rtl"][data-ui="v2"] .composer .send-btn .i-send { transform: none; }
html[data-ui="v2"] #micBtn.on { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, transparent); animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #ef4444 12%, transparent); } }
html[data-ui="v2"] .composer.web-on #plusMenuBtn { color: var(--ui-blue); }

/* ---------- file chips ---------- */
html[data-ui="v2"] .att-file { width: auto; min-width: 150px; max-width: 240px; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 30px 0 8px; background: var(--ui-card); }
html[data-ui="v2"] .att-file b { font-size: .8rem; font-weight: 500; color: var(--ui-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-ui="v2"] .att-ico, html[data-ui="v2"] .bubble-files i { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px; background: #e0473c; color: #fff; font-size: .62rem; font-weight: 700; font-style: normal; }
html[data-ui="v2"] .bubble-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
html[data-ui="v2"] .bubble-files span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--ui-card); font-size: .8rem; }
html[data-ui="v2"] .bubble-files i { min-width: 28px; height: 28px; }

/* ---------- run code ---------- */
html[data-ui="v2"] .run-code { margin-inline-start: auto; margin-inline-end: 6px; border: 0; background: transparent; color: var(--ui-blue); font: inherit; font-size: .75rem; cursor: pointer; }
html[data-ui="v2"] .run-modal { width: min(900px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 40px)); display: none; flex-direction: column; overflow: hidden; }
html[data-ui="v2"] .run-modal[open] { display: flex; }
html[data-ui="v2"] .run-modal iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---- menus always follow the theme (old navy menu background) ---- */
html[data-ui="v2"] .menu, html[data-ui="v2"] .picker .menu, html[data-ui="v2"] .plus-menu, html[data-ui="v2"] .user-menu { background: var(--ui-pop) !important; color: var(--ui-text) !important; border: 1px solid var(--ui-line) !important; backdrop-filter: none !important; }
html[data-ui="v2"] .menu .menu-row, html[data-ui="v2"] .menu .menu-row span { color: var(--ui-text) !important; }

/* ---- Explore window: readable in light & dark ---- */
html[data-ui="v2"] .omni-hero h2 { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ui-text) !important; text-shadow: none !important; }
html[data-ui="v2"] .omni-hero h2 span { color: var(--ui-subtle) !important; }
html[data-ui="v2"] .omni-hero::before, html[data-ui="v2"] .omni-hero::after, html[data-ui="v2"] .omni-logo::before, html[data-ui="v2"] .omni-logo::after { display: none !important; }
html[data-ui="v2"] .omni-logo { filter: none !important; animation: none !important; }
html[data-ui="v2"] .omni-stats b { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ui-text) !important; }
html[data-ui="v2"] .omni-h { color: var(--ui-text) !important; font-weight: 600; }
html[data-ui="v2"] .omni-cap b, html[data-ui="v2"] .om-card b { color: var(--ui-text); }
html[data-ui="v2"] .omni-kicker { color: var(--ui-muted) !important; }
html[data-ui="v2"] .om-card span { color: var(--ui-subtle); }
html[data-ui="v2"] .omni-strengths svg { color: #10a37f; }

/* ---------- image generation: a living canvas + progress, then the picture "develops" ---------- */
html[data-ui="v2"] .img-dream { background: var(--ui-card) !important; justify-content: flex-start; }
html[data-ui="v2"] .img-dream .dream-glow { inset: -40%; filter: blur(40px); opacity: .9;
  background:
    radial-gradient(35% 30% at 25% 30%, rgba(99,132,255,.55), transparent 70%),
    radial-gradient(30% 28% at 75% 70%, rgba(255,120,190,.40), transparent 70%),
    radial-gradient(28% 26% at 65% 25%, rgba(80,220,255,.35), transparent 70%),
    radial-gradient(30% 30% at 30% 80%, rgba(255,190,90,.30), transparent 70%);
  animation: dreamMorph 6s ease-in-out infinite alternate; }
html[data-ui="v2"][data-theme="light"] .img-dream .dream-glow { opacity: .55; }
@keyframes dreamMorph {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(12deg) scale(1.12) translate(3%, -2%); }
  100% { transform: rotate(-8deg) scale(1.05) translate(-3%, 3%); }
}
html[data-ui="v2"] .img-dream .dream-grain { position: absolute; inset: 0; opacity: .12; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grainShift .6s steps(3) infinite; }
@keyframes grainShift { 33% { transform: translate(-2%, 1%); } 66% { transform: translate(1%, -2%); } }
html[data-ui="v2"] .img-dream .dream-shine { animation-duration: 2.6s; opacity: .8; }
html[data-ui="v2"] .img-dream .dream-msg { margin-top: 14px; }
html[data-ui="v2"] .img-dream .dream-bar { position: absolute; inset: auto 16px 14px 16px; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--ui-text) 12%, transparent); overflow: hidden; }
html[data-ui="v2"] .img-dream .dream-bar b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6f8cff, #c58bff, #ff8fc8); animation: dreamProgress 14s cubic-bezier(.1,.7,.2,1) forwards; }
@keyframes dreamProgress { 0% { width: 2%; } 30% { width: 55%; } 70% { width: 82%; } 100% { width: 94%; } }

/* the finished picture develops like a photo: blur → sharp, desaturated → full colour, one light sweep */
html[data-ui="v2"] .fresh-img .img-frame-gen { position: relative; }
html[data-ui="v2"] .fresh-img .img-frame-gen img { animation: develop 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes develop { 0% { opacity: .2; filter: blur(22px) saturate(.3) brightness(1.25); transform: scale(1.05); } 60% { opacity: 1; filter: blur(2px) saturate(.9); } 100% { opacity: 1; filter: none; transform: none; } }
html[data-ui="v2"] .fresh-img .img-frame-gen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%); background-size: 260% 100%;
  animation: developSweep 1.1s .5s ease-out both; }
@keyframes developSweep { from { background-position: 160% 0; } to { background-position: -60% 0; opacity: 0; } }
html[data-ui="v2"] .img-vote { min-width: 34px; justify-content: center; padding-inline: 8px; }
html[data-ui="v2"] .img-vote.on { border-color: var(--ui-blue); background: color-mix(in srgb, var(--ui-blue) 12%, transparent); }
@media (prefers-reduced-motion: reduce) { html[data-ui="v2"] .fresh-img .img-frame-gen img, html[data-ui="v2"] .img-dream * { animation: none !important; } }

/* ---------- voice conversation ---------- */
html[data-ui="v2"] .voice-btn svg { stroke-width: 2.2; }
html[data-ui="v2"] .voice-modal { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; background: var(--ui-bg); color: var(--ui-text); display: none; flex-direction: column; align-items: center; }
html[data-ui="v2"] .voice-modal[open] { display: flex; animation: vIn .35s ease both; }
@keyframes vIn { from { opacity: 0; } }
.voice-modal::backdrop { background: rgba(0,0,0,.6); }
.v-top { align-self: stretch; display: flex; justify-content: flex-end; padding: 14px 18px; }
.v-icon, .v-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--ui-card, #2a2a2a); color: var(--ui-text, #eee); }
.v-icon { width: 40px; height: 40px; background: transparent; }
.v-icon svg, .v-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.v-stage { flex: 1; display: grid; place-items: center; width: 100%; }
.v-orb { --lvl: 0; position: relative; width: 190px; height: 190px; transform: scale(calc(1 + var(--lvl) * .35)); transition: transform .08s linear; }
.v-orb i { position: absolute; inset: 0; border-radius: 50%; filter: blur(2px); animation: vSpin 9s linear infinite;
  background: radial-gradient(60% 60% at 35% 35%, #9fd0ff, transparent 60%), radial-gradient(60% 60% at 70% 65%, #7b8cff, transparent 60%), radial-gradient(70% 70% at 50% 50%, #3b5bff, #1a237e); }
.v-orb i:nth-child(2) { inset: 8%; opacity: .7; animation-duration: 6s; animation-direction: reverse; mix-blend-mode: screen; background: radial-gradient(50% 50% at 30% 70%, #c7f0ff, transparent 60%), radial-gradient(50% 50% at 70% 30%, #b18cff, transparent 60%); }
.v-orb i:nth-child(3) { inset: -10%; filter: blur(30px); opacity: calc(.25 + var(--lvl) * .6); animation: none; background: radial-gradient(closest-side, #5b7cff, transparent); }
@keyframes vSpin { to { transform: rotate(360deg); } }
.voice-modal[data-state="thinking"] .v-orb, .voice-modal[data-state="transcribing"] .v-orb { animation: vThink 1.4s ease-in-out infinite; }
@keyframes vThink { 50% { transform: scale(.9); filter: saturate(.6); } }
.voice-modal[data-state="speaking"] .v-orb i:first-child { background: radial-gradient(60% 60% at 35% 35%, #ffe0b5, transparent 60%), radial-gradient(60% 60% at 70% 65%, #ff9f7a, transparent 60%), radial-gradient(70% 70% at 50% 50%, #7b8cff, #2a1a6e); }
.voice-modal[data-state="muted"] .v-orb { filter: grayscale(1) opacity(.5); }
.v-status { font-size: 1rem; color: var(--ui-muted, #aaa); min-height: 1.5em; }
.v-lines { width: min(640px, 92vw); min-height: 96px; margin: 14px 0 6px; text-align: center; }
.v-lines p { margin: 6px 0; line-height: 1.7; }
.v-you { color: var(--ui-subtle, #888); font-size: .9rem; }
.v-ai { font-size: 1.05rem; max-height: 22vh; overflow: auto; }
.v-settings { width: min(640px, 92vw); padding: 12px; border-radius: 16px; background: var(--ui-card, #2a2a2a); margin-bottom: 10px; }
.v-settings[hidden] { display: none; }
.v-row { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0; }
.v-row b { min-width: 52px; font-size: .85rem; padding-top: 6px; }
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v-chips button { border: 1px solid var(--ui-line-2, #444); background: transparent; color: var(--ui-text, #eee); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; cursor: pointer; }
.v-chips button span { opacity: .6; margin-inline-end: 4px; }
.v-chips button.on { background: var(--ui-text, #eee); color: var(--ui-bg, #111); border-color: transparent; }
.v-controls { display: flex; gap: 18px; padding: 18px 0 32px; }
.v-btn.on { background: #f59e0b; color: #111; }
.v-end { background: #ef4444 !important; color: #fff !important; }
@media (prefers-reduced-motion: reduce) { .v-orb i { animation: none !important; } }
.v-note { margin: 8px 0 0; font-size: .72rem; color: var(--ui-subtle, #888); line-height: 1.6; }
.v-ptt { width: auto !important; padding: 0 22px; border-radius: 999px !important; font: inherit; font-weight: 600; user-select: none; touch-action: none; }
.v-ptt:active { background: var(--ui-blue, #1f7aff) !important; color: #fff !important; transform: scale(1.05); }
.voice-modal[data-state="recording"] .v-ptt { background: var(--ui-blue, #1f7aff); color: #fff; }

.v-badge { margin-inline-end: auto; margin-inline-start: 4px; align-self: center; font-size: .7rem; font-weight: 800; letter-spacing: .1em; padding: 3px 9px; border-radius: 999px; background: #ef4444; color: #fff; animation: dreamPulse 1.6s ease-in-out infinite; }
.voice-modal.live .v-top { justify-content: space-between; }

/* ---- Omni Nova 4.0 ---- */
.nova-card[aria-checked="true"] { background: linear-gradient(120deg, #1a0b2e, #3b1263 45%, #0b2a4a) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 12px 34px -12px rgba(190,120,255,.9) !important; color: #fff; }
.nova-card[aria-checked="true"] small { color: rgba(255,255,255,.75) !important; }
.m-nova { background: conic-gradient(from 200deg, #7c3aed, #ec4899, #f59e0b, #22d3ee, #7c3aed) !important; color: #fff; }
.nova-tag { background: linear-gradient(90deg, #7c3aed, #ec4899); color: #fff !important; }
.new-pill { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; margin-inline-start: 4px; border-radius: 999px; background: linear-gradient(90deg, #7c3aed, #ec4899); color: #fff; vertical-align: 1px; }
.composer.is-nova { box-shadow: 0 0 0 1px rgba(168, 85, 247, .45), 0 10px 40px -18px rgba(168, 85, 247, .8); }
.img-quality button[data-v="pro"].on { background: linear-gradient(90deg, #7c3aed, #ec4899); color: #fff; border-color: transparent; }

/* ---- Hythm Live 1.0: avatar that talks ---- */
.voice-modal .v-brand { margin-inline-end: auto; font-weight: 600; letter-spacing: .2px; opacity: .9; }
.voice-modal .v-brand b { background: linear-gradient(90deg, #8b9bff, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.voice-modal .v-top { display: flex; align-items: center; }
.voice-modal .v-stage { position: relative; }
.v-avatar { position: absolute; inset: 50% auto auto 50%; width: 62%; height: 62%; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 10px 30px rgba(139,155,255,.45)); }
.v-avatar .va-head { transform-origin: 100px 110px; animation: va-bob 4s ease-in-out infinite; }
.v-avatar .va-mouth { transform-origin: 101px 104px; transform: scaleY(calc(.18 + var(--mouth, 0) * 1.25)) scaleX(calc(.9 + var(--mouth, 0) * .25)); transition: transform 60ms linear; }
.v-avatar .va-eye { transform-box: fill-box; transform-origin: center; animation: va-blink 5s infinite; }
.voice-modal[data-state="thinking"] .v-avatar .va-eyes, .voice-modal[data-state="transcribing"] .v-avatar .va-eyes { transform: translate(4px, -5px); transition: transform .4s; }
.voice-modal[data-state="recording"] .v-avatar .va-head { animation: va-nod 1.2s ease-in-out infinite; }
.voice-modal[data-state="speaking"] .v-avatar .va-head { animation: va-talk 2.4s ease-in-out infinite; }
@keyframes va-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes va-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes va-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg) translateY(2px); } }
@keyframes va-talk { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(1.5deg); } 70% { transform: rotate(-1.5deg); } }
@media (prefers-reduced-motion: reduce) { .v-avatar * { animation: none !important; } }

/* ---- Explore · Hythm 2 models page ---- */
.hx { display: flex; flex-direction: column; gap: 18px; }
.hx-hero { position: relative; overflow: hidden; padding: 34px 30px; border-radius: 26px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3b1263 0%, transparent 55%), radial-gradient(90% 120% at 0% 100%, #0b3a66 0%, transparent 60%), linear-gradient(135deg, #0c0a1f, #1a1036); }
.hx-hero h2 { font-size: clamp(30px, 5vw, 48px); line-height: 1.05; margin: 10px 0 8px; letter-spacing: -.5px; }
.hx-hero h2 span { background: linear-gradient(90deg, #c4b5fd, #f472b6, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-hero p { max-width: 560px; color: rgba(255,255,255,.82); line-height: 1.8; margin: 0 0 18px; position: relative; z-index: 1; }
.hx-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.hx-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hx-btn { border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.hx-btn:hover { transform: translateY(-1px); }
.hx-hero .hx-btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.hx-btn.hx-primary, .hx-hero .hx-btn.hx-primary { background: linear-gradient(90deg, #7c3aed, #ec4899); color: #fff; border-color: transparent; box-shadow: 0 10px 30px -10px rgba(236,72,153,.8); }
.hx-orbit { position: absolute; inset-inline-end: -40px; top: 50%; width: 260px; height: 260px; transform: translateY(-50%); opacity: .9; }
.hx-orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); animation: hx-spin 18s linear infinite; }
.hx-orbit i:nth-child(2) { inset: 30px; border-color: rgba(244,114,182,.35); animation-duration: 12s; animation-direction: reverse; }
.hx-orbit i:nth-child(3) { inset: 60px; border-color: rgba(196,181,253,.45); animation-duration: 8s; }
.hx-orbit i::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: #f9a8d4; box-shadow: 0 0 14px #f472b6; }
.hx-orbit .cloud-logo { position: absolute; inset: 95px; width: 70px; height: 70px; color: #fff; filter: drop-shadow(0 0 20px rgba(196,181,253,.9)); }
@keyframes hx-spin { to { transform: rotate(360deg); } }
.hx-h { margin: 8px 0 0; font-size: 16px; color: var(--ui-muted); font-weight: 600; }
.hx-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.hx-model { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; border: 1px solid var(--ui-line); background: var(--ui-card); transition: transform .25s, box-shadow .25s; }
.hx-model:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(0,0,0,.6); }
.hx-model header { display: flex; align-items: center; gap: 10px; }
.hx-model header div { flex: 1; min-width: 0; } .hx-model header b { display: block; } .hx-model header small { color: var(--ui-muted); font-size: 12px; }
.hx-model header em { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ui-field); }
.hx-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.hx-ico .cloud-logo { width: 22px; height: 22px; }
.hx-model p { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.7; flex: 1; }
.hx-model dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; font-size: 12px; align-items: center; }
.hx-model dt { color: var(--ui-muted); } .hx-model dd { margin: 0; height: 6px; border-radius: 9px; background: var(--ui-field); overflow: hidden; }
.hx-model dd i { display: block; height: 100%; width: var(--v); border-radius: 9px; background: linear-gradient(90deg, #60a5fa, #a78bfa); }
.hx-flag { border-color: transparent; background: linear-gradient(var(--ui-card), var(--ui-card)) padding-box, linear-gradient(135deg, #7c3aed, #ec4899, #f59e0b) border-box; border: 1.5px solid transparent; }
.hx-flag dd i { background: linear-gradient(90deg, #7c3aed, #ec4899, #f59e0b); }
.hx-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hx-tile { padding: 16px; border-radius: 20px; border: 1px solid var(--ui-line); background: var(--ui-card); }
.hx-tile.hx-wide { grid-column: span 2; background: linear-gradient(135deg, color-mix(in srgb, #7c3aed 14%, var(--ui-card)), var(--ui-card)); }
.hx-tile span { font-size: 24px; } .hx-tile b { display: block; margin: 6px 0 4px; } .hx-tile p { margin: 0; color: var(--ui-muted); font-size: 13px; line-height: 1.7; }
.hx-table-wrap { overflow: auto; border: 1px solid var(--ui-line); border-radius: 16px; }
.hx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hx-table th, .hx-table td { padding: 10px 12px; border-bottom: 1px solid var(--ui-line); text-align: center; }
.hx-table td:first-child, .hx-table th:first-child { text-align: start; color: var(--ui-muted); }
.hx-table th:last-child, .hx-table td:last-child { background: color-mix(in srgb, #7c3aed 12%, transparent); font-weight: 700; }
@media (max-width: 720px) { .hx-bento { grid-template-columns: 1fr; } .hx-tile.hx-wide { grid-column: auto; } .hx-orbit { opacity: .35; } .hx-hero { padding: 26px 20px; } }
@media (prefers-reduced-motion: reduce) { .hx-orbit i { animation: none; } }
.hx-ico { position: relative; overflow: hidden; }
.hx-ico .cloud-logo { position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; width: 22px !important; height: 22px !important; opacity: 1 !important; }
.hx-models { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.hx-model header { flex-wrap: wrap; }
.hx-model header small { display: block; white-space: normal; }
.hx-model { position: relative; }
.hx-model header { flex-wrap: nowrap; padding-inline-end: 34px; }
.hx-model header em { position: absolute; top: 14px; inset-inline-end: 14px; }
.hx-model header b { font-size: 14px; line-height: 1.3; }

/* =====================================================================
   Calm UI: one neutral look everywhere (no gradients, no neon) — like ChatGPT.
   Only the app's own tokens: --ui-text / --ui-muted / --ui-card / --ui-field / --ui-line / --ui-hover
   ===================================================================== */
/* model picker */
.model-card[aria-checked="true"], .ultra-card[aria-checked="true"], .x-card[aria-checked="true"], .nova-card[aria-checked="true"] {
  background: var(--ui-hover) !important; box-shadow: none !important; border-color: transparent !important; color: var(--ui-text) !important; }
.model-card[aria-checked="true"] small, .nova-card[aria-checked="true"] small { color: var(--ui-muted) !important; }
.m-omni, .m-ultra, .m-x, .m-nova, .hx-ico { background: var(--ui-field) !important; box-shadow: none !important; border-radius: 9px; color: var(--ui-text) !important; }
.m-x::after { display: none !important; }
.m-omni .cloud-logo, .m-ultra .cloud-logo, .m-x .cloud-logo, .m-nova .cloud-logo { filter: none !important; width: 60% !important; height: 60% !important; color: var(--ui-text) !important; }
.omni-tag, .ultra-tag, .x-tag, .nova-tag { background: var(--ui-field) !important; color: var(--ui-muted) !important; box-shadow: none !important; }
.new-pill { background: var(--ui-field) !important; color: var(--ui-text) !important; border: 1px solid var(--ui-line); font-weight: 600; }
.menu-item.mode .mode-ico, .menu-item.mode-max .mode-ico { background: var(--ui-field) !important; color: var(--ui-text) !important; }
.menu-item.mode-max .mode-ico svg { filter: none !important; }
.menu-item.mode[aria-checked="true"] { background: var(--ui-hover) !important; box-shadow: none !important; border-color: transparent !important; }
/* composer never glows */
.composer.is-ultra .composer-box, .composer.is-x .composer-box, .composer.is-nova, .composer.is-nova .composer-box { box-shadow: none !important; background: var(--ui-field) padding-box !important; border-color: var(--ui-line) !important; }
.composer.is-ultra .picker-model, .composer.is-x .picker-model { background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--ui-text) !important; animation: none !important; }
.img-quality button[data-v="pro"].on { background: var(--ui-text) !important; color: var(--ui-bg) !important; }

/* Explore page */
.hx-hero { background: var(--ui-card) !important; color: var(--ui-text) !important; border: 1px solid var(--ui-line); }
.hx-hero h2 span { background: none !important; -webkit-text-fill-color: currentColor; color: var(--ui-muted) !important; }
.hx-hero p { color: var(--ui-muted) !important; }
.hx-badge { background: var(--ui-field) !important; border-color: var(--ui-line) !important; color: var(--ui-text); backdrop-filter: none; }
.hx-hero .hx-btn, .hx-btn { background: var(--ui-field) !important; color: var(--ui-text) !important; border-color: var(--ui-line) !important; box-shadow: none !important; }
.hx-btn.hx-primary, .hx-hero .hx-btn.hx-primary { background: var(--ui-text) !important; color: var(--ui-bg) !important; border-color: transparent !important; }
.hx-orbit { display: none; }
.hx-flag { background: var(--ui-card) !important; border: 1px solid var(--ui-text) !important; }
.hx-model dd i, .hx-flag dd i { background: var(--ui-text) !important; opacity: .75; }
.hx-model:hover { transform: none; box-shadow: none; border-color: var(--ui-muted); }
.hx-tile.hx-wide { background: var(--ui-card) !important; }
.hx-table th:last-child, .hx-table td:last-child { background: var(--ui-hover) !important; }
/* voice */
.voice-modal .v-brand b { background: none !important; -webkit-text-fill-color: currentColor; color: var(--ui-muted); }
/* file cards / console already neutral */

.hx-specs { display: flex; flex-direction: column; gap: 8px; }
.hx-spec { border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-card); padding: 0 16px; }
.hx-spec summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; cursor: pointer; list-style: none; }
.hx-spec summary::-webkit-details-marker { display: none; }
.hx-spec summary span { color: var(--ui-muted); font-size: 13px; }
.hx-spec summary::after { content: "+"; color: var(--ui-muted); font-size: 18px; margin-inline-start: 8px; }
.hx-spec[open] summary::after { content: "−"; }
.hx-spec ul { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; }
.hx-spec li { font-size: 13px; line-height: 1.7; color: var(--ui-text); }
.hx-spec li em { font-style: normal; display: inline-block; min-width: 92px; color: var(--ui-muted); }
.hx-tips { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.7; color: var(--ui-muted); }
.hx-tips code { background: var(--ui-field); padding: 1px 6px; border-radius: 6px; color: var(--ui-text); }
.hx-ico { display: none !important; }
.hx-model header { padding-inline-end: 34px; }
.menu-item.mode .mode-ico svg, .menu-item.mode .mode-ico svg * { color: var(--ui-text) !important; stroke: currentColor !important; filter: none !important; }
.menu-item.mode, .menu-item.mode-max { border-color: transparent !important; box-shadow: none !important; background-image: none !important; }
.menu-item.mode[aria-checked="true"] { background-color: var(--ui-hover) !important; }
.menu-item.mode::before, .menu-item.mode::after, .menu-item.mode-max::before, .menu-item.mode-max::after,
.model-card::before, .model-card::after, .composer-box::before, .composer-box::after { display: none !important; }

/* style picker with real previews made by Micro Cloud */
[data-img-set="style"] { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
[data-img-set="style"] button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 5px 5px 7px !important; border-radius: 12px !important; height: auto !important; font-size: 12px; }
[data-img-set="style"] .sty-prev { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--ui-field); }
[data-img-set="style"] button.on { outline: 2px solid var(--ui-text); outline-offset: -2px; }
@media (max-width: 520px) { [data-img-set="style"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; } [data-img-set="style"] button { font-size: 11px; } }
/* gallery: click a picture to try the idea */
.mc-shot { cursor: pointer; position: relative; }
.mc-shot .mc-try { display: block; margin-top: 6px; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.mc-shot:hover img { filter: brightness(1.06); }
.img-surprise { border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; margin: 4px 0; }
.img-surprise:hover { background: var(--ui-hover); }

/* trending: real images instead of blurry placeholders */
html[data-ui="v2"] .ip-card.has-img { background-size: cover !important; background-position: center !important; }
html[data-ui="v2"] .ip-card.has-img::before, html[data-ui="v2"] .ip-card.has-img::after { display: none !important; }
/* compact style picker: one row of small tiles */
[data-img-set="style"] { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; gap: 6px !important; }
[data-img-set="style"] button { padding: 3px 3px 5px !important; font-size: 11px !important; gap: 3px !important; border-radius: 10px !important; min-width: 0; }
[data-img-set="style"] button span, [data-img-set="style"] button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-img-set="style"] .sty-prev { border-radius: 7px; }
@media (max-width: 640px) { [data-img-set="style"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
.img-surprise { display: inline-block; width: auto !important; }
/* home / images view: when content is taller than the screen, scroll from the top instead of clipping it */
html[data-ui="v2"] section.chat:has(#imagesPage:not([hidden])),
html[data-ui="v2"] section.chat:has(#imgOpts:not([hidden])):not(:has(.messages .msg)) { justify-content: safe center; overflow-y: auto; }
html[data-ui="v2"] section.chat:has(#imagesPage:not([hidden])) { justify-content: flex-start; padding-top: 12px; }
html[data-ui="v2"] #imagesPage:not([hidden]) { flex: none; overflow: visible; max-height: none; height: auto; padding-bottom: 24px; }
html[data-ui="v2"] section.chat:has(#imagesPage:not([hidden])) { padding-top: 64px !important; }

/* wider conversation on big screens (less empty space left and right) */
@media (min-width: 1300px) {
  html[data-ui="v2"] .app.no-design .messages, html[data-ui="v2"] .app.no-design .composer { max-width: 920px; }
}
@media (min-width: 1700px) {
  html[data-ui="v2"] .app.no-design .messages, html[data-ui="v2"] .app.no-design .composer { max-width: 1040px; }
}
/* during a conversation the image options become one compact strip, so the text box stays low and close */
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts [data-img-set="style"] { width: 100%; grid-template-columns: repeat(8, minmax(0, 1fr)) !important; gap: 5px !important; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts [data-img-set="style"] .sty-prev { aspect-ratio: 16 / 9; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts [data-img-set="style"] button { font-size: 10.5px !important; padding: 2px 2px 3px !important; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts .engine-chip { display: none; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts .img-surprise { margin: 0; padding: 4px 12px; font-size: 12px; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts .img-row:not([data-img-set="style"]) { margin: 0; }

/* ---------- image generation v2: the picture "forms" out of noise (calm, neutral) ---------- */
html[data-ui="v2"] .img-dream { background: var(--ui-card) !important; overflow: hidden; position: absolute !important; inset: 0 !important; }
/* dot matrix that lights up in slow waves, like pixels deciding their colour */
html[data-ui="v2"] .img-dream .dream-glow { inset: 0 !important; filter: none !important; opacity: 1 !important; animation: none !important;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ui-text) 55%, transparent) 1.1px, transparent 1.6px) !important;
  background-size: 14px 14px !important;
  -webkit-mask-image: radial-gradient(circle at var(--mx, 30%) var(--my, 40%), #000 0%, rgba(0,0,0,.35) 30%, transparent 62%);
          mask-image: radial-gradient(circle at var(--mx, 30%) var(--my, 40%), #000 0%, rgba(0,0,0,.35) 30%, transparent 62%);
  animation: dotWave 7s ease-in-out infinite alternate !important; }
@property --mx { syntax: "<percentage>"; inherits: false; initial-value: 30%; }
@property --my { syntax: "<percentage>"; inherits: false; initial-value: 40%; }
@keyframes dotWave { 0% { --mx: 25%; --my: 30%; } 33% { --mx: 75%; --my: 45%; } 66% { --mx: 40%; --my: 80%; } 100% { --mx: 65%; --my: 20%; } }
/* soft light behind the dots */
html[data-ui="v2"] .img-dream::before { content: ""; position: absolute; inset: -30%; pointer-events: none;
  background: radial-gradient(40% 35% at 50% 50%, color-mix(in srgb, var(--ui-text) 10%, transparent), transparent 70%);
  animation: dreamBreath 4s ease-in-out infinite; }
@keyframes dreamBreath { 0%, 100% { transform: scale(.9); opacity: .6; } 50% { transform: scale(1.1); opacity: 1; } }
/* grain = noise that slowly clears while the picture is being made */
html[data-ui="v2"] .img-dream .dream-grain { opacity: .28; animation: grainShift .6s steps(3) infinite, denoise 16s ease-out forwards !important; }
@keyframes denoise { from { opacity: .32; } to { opacity: .06; } }
/* a thin scan line of light moving down the frame */
html[data-ui="v2"] .img-dream .dream-shine { position: absolute; inset: 0; pointer-events: none; opacity: 1 !important;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--ui-text) 16%, transparent) 49%, color-mix(in srgb, var(--ui-text) 30%, transparent) 50%, transparent 51%) !important;
  background-size: 100% 220% !important; animation: scanDown 3.2s cubic-bezier(.45,.05,.55,.95) infinite !important; }
@keyframes scanDown { from { background-position: 0 110%; } to { background-position: 0 -10%; } }
/* status pill with a breathing dot */
html[data-ui="v2"] .img-dream .dream-msg { position: relative; z-index: 2; margin-top: 16px; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; color: var(--ui-text); background: color-mix(in srgb, var(--ui-card) 70%, transparent);
  border: 1px solid var(--ui-line); backdrop-filter: blur(8px); }
html[data-ui="v2"] .img-dream .dream-msg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ui-text); animation: dotPulse 1.2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
/* neutral progress bar with a moving highlight */
html[data-ui="v2"] .img-dream .dream-bar { z-index: 2; height: 3px; background: color-mix(in srgb, var(--ui-text) 10%, transparent) !important; }
html[data-ui="v2"] .img-dream .dream-bar b { background: var(--ui-text) !important; opacity: .8; position: relative; overflow: hidden; }
html[data-ui="v2"] .img-dream .dream-bar b::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: barGlint 1.4s linear infinite; }
@keyframes barGlint { from { background-position: -60% 0; } to { background-position: 160% 0; } }
/* finish: pixels settle into the picture (blur → sharp, a soft zoom out) */
@keyframes develop { 0% { opacity: 0; filter: blur(18px) contrast(1.1); transform: scale(1.04); } 55% { opacity: 1; filter: blur(3px); } 100% { opacity: 1; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { html[data-ui="v2"] .img-dream * , html[data-ui="v2"] .img-dream::before { animation: none !important; } }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts > *:not([data-img-set="style"]) { width: auto !important; flex: none; margin: 0 !important; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts { justify-content: center; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts [data-img-set="style"] button { flex-direction: row !important; gap: 5px !important; align-items: center; justify-content: flex-start; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts [data-img-set="style"] .sty-prev { width: 26px; height: 26px; aspect-ratio: 1; flex: none; border-radius: 6px; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts { flex-direction: row !important; flex-wrap: wrap !important; }
/* a quiet aurora under the dots (low saturation, slowly drifting) */
html[data-ui="v2"] .img-dream::before { inset: -20%;
  background:
    radial-gradient(35% 30% at 30% 35%, rgba(120,150,255,.22), transparent 70%),
    radial-gradient(30% 28% at 72% 65%, rgba(236,140,190,.16), transparent 70%),
    radial-gradient(30% 30% at 60% 25%, rgba(120,220,210,.14), transparent 70%) !important;
  filter: blur(30px); animation: auroraDrift 9s ease-in-out infinite alternate !important; }
@keyframes auroraDrift { 0% { transform: translate(-4%, -2%) rotate(0deg) scale(1); } 100% { transform: translate(4%, 3%) rotate(10deg) scale(1.1); } }
html[data-ui="v2"] .img-dream .dream-glow { background-image: radial-gradient(circle, color-mix(in srgb, var(--ui-text) 75%, transparent) 1.2px, transparent 1.7px) !important; }
html[data-ui="v2"] .img-dream { justify-content: center !important; }
html[data-ui="v2"] .img-dream .dream-msg { margin-top: 0 !important; }
html[data-ui="v2"] .img-frame-gen { position: relative; }

[data-img-set="style"] { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
html[data-ui="v2"] section.chat:has(.msg-user) #imgOpts [data-img-set="style"] { grid-template-columns: repeat(9, minmax(0, 1fr)) !important; }
@media (max-width: 640px) { [data-img-set="style"] { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; } }

/* send button: white arrow in every theme, on a calm dark circle */
html[data-ui="v2"] .composer .send-btn, html[data-ui="v2"] .composer .send-btn.stop {
  background: #0d0d0d !important; color: #ffffff !important; border: 1px solid rgba(255,255,255,.14) !important; box-shadow: none !important; }
html[data-ui="v2"] .composer .send-btn svg, html[data-ui="v2"] .composer .send-btn svg * { color: #ffffff !important; stroke: #ffffff !important; }
html[data-ui="v2"] .composer .send-btn svg [fill]:not([fill="none"]) { fill: #ffffff !important; }
html[data-ui="v2"] .composer.has-text .send-btn:hover { background: #262626 !important; }

/* ---------- image options: a light tray ABOVE the text box (keeps the input clean and simple) ---------- */
html[data-ui="v2"] .composer { display: flex !important; flex-direction: column; }
html[data-ui="v2"] #imgOpts:not([hidden]) { order: -1; display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center; justify-content: center; gap: 6px 8px;
  margin: 0 12px -1px !important; padding: 8px 10px 10px !important; border: 1px solid var(--ui-line); border-bottom: 0; border-radius: 16px 16px 0 0;
  background: color-mix(in srgb, var(--ui-field) 70%, transparent); backdrop-filter: blur(10px); animation: trayIn .22s ease-out; }
@keyframes trayIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* styles: one horizontal strip of small chips that scrolls if needed */
html[data-ui="v2"] #imgOpts [data-img-set="style"] { display: flex !important; width: 100%; gap: 5px !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; grid-template-columns: none !important; }
html[data-ui="v2"] #imgOpts [data-img-set="style"]::-webkit-scrollbar { display: none; }
html[data-ui="v2"] #imgOpts [data-img-set="style"] button { flex: none; flex-direction: row !important; align-items: center; gap: 6px !important; height: 30px !important; padding: 2px 10px 2px 3px !important;
  border-radius: 999px !important; font-size: 12px !important; border: 1px solid var(--ui-line) !important; background: transparent !important; color: var(--ui-muted) !important; outline: none !important; }
html[data-ui="v2"] #imgOpts [data-img-set="style"] button:hover { background: var(--ui-hover) !important; color: var(--ui-text) !important; }
html[data-ui="v2"] #imgOpts [data-img-set="style"] button.on { background: var(--ui-text) !important; color: var(--ui-bg) !important; border-color: transparent !important; }
html[data-ui="v2"] #imgOpts [data-img-set="style"] .sty-prev { width: 24px !important; height: 24px !important; aspect-ratio: 1 !important; border-radius: 50% !important; flex: none; }
/* second line: quality · size · surprise — small pills */
html[data-ui="v2"] #imgOpts > *:not([data-img-set="style"]) { width: auto !important; flex: none; margin: 0 !important; }
html[data-ui="v2"] #imgOpts .img-row:not([data-img-set="style"]) button, html[data-ui="v2"] #imgOpts .img-surprise { height: 26px; padding: 0 10px !important; font-size: 11.5px !important; border-radius: 999px !important; }
html[data-ui="v2"] #imgOpts .engine-chip { display: none !important; }
html[data-ui="v2"] #imgOpts .img-row:not([data-img-set="style"]) + .img-row::before { content: ""; width: 1px; height: 16px; background: var(--ui-line); margin: 0 4px; align-self: center; }
html[data-ui="v2"] #imgOpts [data-img-set="style"] { flex-wrap: nowrap !important; justify-content: flex-start; mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }

/* "/" command menu (sits above the text box, like the image tray) */
.slash-menu { order: -2; margin: 0 12px 6px; padding: 6px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-pop, var(--ui-card)); box-shadow: 0 12px 34px -14px rgba(0,0,0,.5); display: grid; gap: 2px; max-height: 300px; overflow: auto; animation: trayIn .16s ease-out; }
.slash-menu[hidden] { display: none; }
.slash-menu button { display: grid; grid-template-columns: 26px auto 1fr; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ui-text); font: inherit; text-align: start; cursor: pointer; }
.slash-menu button b { font-weight: 600; font-size: 13.5px; }
.slash-menu button small { color: var(--ui-muted); font-size: 12.5px; }
.slash-menu button.on, .slash-menu button:hover { background: var(--ui-hover); }

/* quick options next to the input + blue chips while active */
html[data-ui="v2"] .quick-opt { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ui-line); background: transparent; color: var(--ui-muted); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
html[data-ui="v2"] .quick-opt svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
html[data-ui="v2"] .quick-opt:hover { background: var(--ui-hover); color: var(--ui-text); }
html[data-ui="v2"] .quick-opt[aria-pressed="true"] { background: color-mix(in srgb, #3b82f6 18%, transparent); color: #60a5fa; border-color: color-mix(in srgb, #3b82f6 45%, transparent); }
html[data-ui="v2"][data-theme="light"] .quick-opt[aria-pressed="true"] { color: #1d4ed8; }
@media (max-width: 720px) { html[data-ui="v2"] .quick-opt span { display: none; } html[data-ui="v2"] .quick-opt { padding: 0 8px; } }
html[data-ui="v2"] .opt-chip { animation: trayIn .18s ease-out; }
html[data-ui="v2"] #input { min-width: 140px; flex: 1 1 auto; }
@media (max-width: 1250px) { html[data-ui="v2"] .quick-opt span { display: none; } html[data-ui="v2"] .quick-opt { padding: 0 8px; width: 32px; justify-content: center; } }

/* ---------- model & mode picker v2: clean list + segmented modes ---------- */
#pickerMenu.p2 { width: 330px; padding: 10px !important; border-radius: 18px !important; background: var(--ui-pop, var(--ui-card)) !important; border: 1px solid var(--ui-line) !important; box-shadow: 0 18px 50px -18px rgba(0,0,0,.6) !important; }
#pickerMenu.p2 .menu-sep, #pickerMenu.p2 .menu-label, #pickerMenu.p2 .task-grid { display: none !important; }
#pickerMenu.p2 .p2-head { font-size: 11.5px; font-weight: 600; color: var(--ui-muted); padding: 4px 6px 6px; letter-spacing: .2px; }
#pickerMenu.p2 .p2-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 12px; background: var(--ui-field); }
#pickerMenu.p2 .p2-seg .mode { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 9px; cursor: pointer; color: var(--ui-muted); font-size: 13px; transition: background .15s, color .15s; }
#pickerMenu.p2 .p2-seg .mode b { font-weight: 600; }
#pickerMenu.p2 .p2-seg .mode .mode-cost { font-size: 11px; opacity: .7; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--ui-text) 10%, transparent); }
#pickerMenu.p2 .p2-seg .mode:hover { color: var(--ui-text); }
#pickerMenu.p2 .p2-seg .mode[aria-checked="true"] { background: var(--ui-card); color: var(--ui-text); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--ui-line); }
#pickerMenu.p2 .p2-seg .mode::before, #pickerMenu.p2 .p2-seg .mode::after { display: none !important; }
#pickerMenu.p2 .p2-hint { margin: 6px 6px 12px; font-size: 12px; color: var(--ui-muted); }
#pickerMenu.p2 .p2-list { display: grid; gap: 2px; }
#pickerMenu.p2 .p2-row { display: grid !important; grid-template-columns: 1fr auto 18px; align-items: center; gap: 10px; padding: 9px 10px !important; border-radius: 12px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; cursor: pointer; transform: none !important; color: var(--ui-text) !important; }
#pickerMenu.p2 .p2-row::before, #pickerMenu.p2 .p2-row::after { display: none !important; }
#pickerMenu.p2 .p2-row:hover, #pickerMenu.p2 .p2-row:focus-visible { background: var(--ui-hover) !important; outline: none; }
#pickerMenu.p2 .p2-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#pickerMenu.p2 .p2-txt b { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
#pickerMenu.p2 .p2-txt small { font-size: 12px; color: var(--ui-muted) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block !important; }
#pickerMenu.p2 .p2-x { font-size: 11.5px; color: var(--ui-muted); }
#pickerMenu.p2 .p2-new { font-style: normal; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--ui-line); color: var(--ui-muted); }
#pickerMenu.p2 .p2-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ui-line); display: grid; place-items: center; }
#pickerMenu.p2 .p2-row[aria-checked="true"] .p2-check { border-color: var(--ui-text); background: var(--ui-text); }
#pickerMenu.p2 .p2-row[aria-checked="true"] .p2-check::after { content: ""; width: 5px; height: 9px; border: solid var(--ui-bg); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
#pickerMenu.p2 .p2-row[aria-checked="true"] { background: color-mix(in srgb, var(--ui-text) 5%, transparent) !important; }
#pickerMenu.p2 { top: auto !important; bottom: calc(100% + 10px) !important; height: auto !important; max-height: min(560px, 72vh); overflow: auto !important; }
/* the composer wrapper itself never gets a background (only the input pill does) */
html[data-ui="v2"] .composer, html[data-ui="v2"] .composer.is-nova, html[data-ui="v2"] .composer.is-x, html[data-ui="v2"] .composer.is-ultra { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }

#pickerMenu.p2.p2-down { bottom: auto !important; top: calc(100% + 10px) !important; }

/* ================= phones & tablets ================= */
@media (max-width: 640px) {
  /* the input gets its own full line; buttons sit on a second line (like ChatGPT mobile) */
  html[data-ui="v2"] .composer-row { flex-wrap: wrap !important; row-gap: 6px; }
  html[data-ui="v2"] #input { order: -2; flex: 1 0 100% !important; width: 100% !important; min-width: 0 !important; min-height: 40px; font-size: 16px; padding-inline: 6px; }
  html[data-ui="v2"] .composer-row > .img-chip:not([hidden]) { order: -3; }
  html[data-ui="v2"] .plus-wrap { margin-inline-end: auto; }
  html[data-ui="v2"] .think-btn span, html[data-ui="v2"] .picker-dot, html[data-ui="v2"] #pickerMode { display: none !important; }
  html[data-ui="v2"] .picker-model { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-ui="v2"] .composer-box { border-radius: 22px !important; padding: 8px 10px !important; }
  html[data-ui="v2"] .app.no-design .composer { padding: 4px 8px 10px !important; }
  html[data-ui="v2"] .app.no-design .messages { padding: 16px 12px 8px !important; }
  /* menus stay on screen */
  #pickerMenu.p2 { position: fixed !important; left: 10px !important; right: 10px !important; width: auto !important; bottom: 84px !important; top: auto !important; max-height: 70vh; }
  #pickerMenu.p2.p2-down { top: auto !important; bottom: 84px !important; }
  html[data-ui="v2"] .menu:not(.p2) { max-width: calc(100vw - 20px); }
  .slash-menu { margin: 0 4px 6px; }
  /* image tray + trending grid */
  html[data-ui="v2"] #imgOpts:not([hidden]) { margin: 0 6px -1px !important; }
  html[data-ui="v2"] .ip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  /* big modals use the whole screen */
  .omni-modal, .hu, dialog.modal { width: 100vw !important; max-width: 100vw !important; height: 100dvh; max-height: 100dvh !important; margin: 0 !important; border-radius: 0 !important; }
  .hx-models { grid-template-columns: 1fr 1fr !important; }
  .hx-hero { padding: 22px 16px !important; }
  .hu-grid { grid-template-columns: 1fr !important; }
  /* voice call full screen */
  .voice-modal { width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  /* tablets: comfortable column, labels trimmed */
  html[data-ui="v2"] .app.no-design .messages, html[data-ui="v2"] .app.no-design .composer { max-width: 760px; }
  html[data-ui="v2"] .think-btn span { display: none; }
  html[data-ui="v2"] .ip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* touch devices: bigger tap targets, no hover-only UI */
@media (pointer: coarse) {
  html[data-ui="v2"] .cbtn, html[data-ui="v2"] .quick-opt, html[data-ui="v2"] .send-btn { min-width: 38px; min-height: 38px; }
  html[data-ui="v2"] .ans-actions button { width: 36px; height: 36px; }
  html[data-ui="v2"] .ans-actions { opacity: 1 !important; }
}
/* respect iPhone notches / home bar */
@supports (padding: env(safe-area-inset-bottom)) {
  html[data-ui="v2"] .app.no-design .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important; }
}
/* narrow screens: when there is no design preview, the chat owns the whole height (no empty half) */
@media (max-width: 1060px) {
  html[data-ui="v2"] .app.no-design { grid-template-rows: 1fr !important; grid-template-columns: 1fr !important; height: 100dvh; }
  html[data-ui="v2"] .app.no-design section.chat { height: 100dvh; min-height: 0; grid-row: 1; }
}

/* ================= fluid sizes for every screen ================= */
html[data-ui="v2"] .greeting { font-size: clamp(22px, 2.2vw + 14px, 36px) !important; line-height: 1.25; }
html[data-ui="v2"] .msg .notes, html[data-ui="v2"] .msg-user .bubble { font-size: clamp(14.5px, .25vw + 13.5px, 16px); }
@media (max-width: 640px) {
  /* the model name stays visible (short) */
  html[data-ui="v2"] #pickerModel, html[data-ui="v2"] .picker-model { display: inline-block !important; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; vertical-align: middle; }
  /* home screen like ChatGPT mobile: greeting in the middle, suggestions as a sideways row, the input docked at the bottom */
  html[data-ui="v2"] .app.is-empty section.chat { justify-content: flex-start !important; }
  html[data-ui="v2"] .app.is-empty section.chat > .messages { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; }
  html[data-ui="v2"] .app.is-empty section.chat > .suggestions { order: 3; display: flex !important; flex-direction: row !important; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding: 4px 12px 8px; justify-content: flex-start; scrollbar-width: none; height: auto !important; }
  html[data-ui="v2"] .app.is-empty section.chat > .suggestions::-webkit-scrollbar { display: none; }
  html[data-ui="v2"] .app.is-empty .home-action { flex: none; padding: 8px 14px !important; border: 1px solid var(--ui-line) !important; border-radius: 999px !important; font-size: 13px !important; white-space: nowrap; }
  html[data-ui="v2"] .app.is-empty section.chat > .composer { order: 4; margin-top: 0 !important; }
  html[data-ui="v2"] .app.is-empty .chat-head { flex: none; }
  html[data-ui="v2"] .composer-box .cbtn, html[data-ui="v2"] .composer-box .quick-opt { width: 36px; height: 36px; min-width: 36px; }
  html[data-ui="v2"] .ip-card b { font-size: 12.5px; }
}
/* very small phones (≤ 360px) */
@media (max-width: 360px) {
  html[data-ui="v2"] .voice-btn, html[data-ui="v2"] #quickImg { display: none !important; }
  html[data-ui="v2"] #pickerModel, html[data-ui="v2"] .picker-model { max-width: 64px; }
}
/* large screens: a little more air */
@media (min-width: 1800px) {
  html[data-ui="v2"] .composer-box { padding: 10px 14px !important; }
  html[data-ui="v2"] #input { font-size: 16.5px; }
}
@media (max-width: 640px) {
  html[data-ui="v2"] .composer-row { column-gap: 3px !important; }
  html[data-ui="v2"] .composer-box .cbtn, html[data-ui="v2"] .composer-box .quick-opt, html[data-ui="v2"] .composer-box .send-btn { width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important; padding: 0 !important; }
  html[data-ui="v2"] .picker > button, html[data-ui="v2"] .picker-btn { padding: 0 6px !important; gap: 2px !important; max-width: 96px; }
  html[data-ui="v2"] #pickerModel, html[data-ui="v2"] .picker-model { max-width: 66px !important; font-size: 11.5px; }
  html[data-ui="v2"] .composer-row > .send-btn { margin-inline-start: auto; }
}

@media (max-width: 640px) {
  /* keep the send button on the first line on 360–430px phones */
  html[data-ui="v2"] .voice-btn { display: none !important; }
  html[data-ui="v2"] #pickerModel, html[data-ui="v2"] .picker-model { direction: ltr; unicode-bidi: plaintext; }
}
/* phone & tablet sidebar: ONE drawer rule set — right side in Arabic, left side in English */
@media (max-width: 1060px) {
  html[data-ui="v2"] body .app .sidebar { position: fixed !important; top: 0 !important; bottom: 0 !important; width: min(300px, 86vw) !important; height: 100dvh !important;
    z-index: 60 !important; transition: transform .28s cubic-bezier(.2,.8,.2,1) !important; overflow-y: auto; grid-column: auto !important; inset-inline: auto !important; }
  html[data-ui="v2"][dir="rtl"] body .app .sidebar { right: 0 !important; left: auto !important; transform: translateX(110%) !important; }
  html[data-ui="v2"][dir="ltr"] body .app .sidebar { left: 0 !important; right: auto !important; transform: translateX(-110%) !important; }
  html[data-ui="v2"][dir] body .app.side-open .sidebar { transform: none !important; box-shadow: 0 0 50px -10px rgba(0,0,0,.6); }
  html[data-ui="v2"] .scrim { z-index: 55 !important; }
}

/* share / install buttons in the header, rename + edit */
html[data-ui="v2"] .chat-head .head-share, html[data-ui="v2"] .chat-head .head-install { width: 34px; height: 34px; display: inline-grid; place-items: center; }
html[data-ui="v2"] .chat-head .head-share[hidden], html[data-ui="v2"] .chat-head .head-install[hidden] { display: none; }
html[data-ui="v2"] .chat-head .head-share svg, html[data-ui="v2"] .chat-head .head-install svg { width: 18px; height: 18px; }
html[data-ui="v2"] .project-ren { opacity: 0; border: 0; background: none; color: var(--ui-muted); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
html[data-ui="v2"] .project-ren svg { width: 15px; height: 15px; }
html[data-ui="v2"] .project:hover .project-ren, html[data-ui="v2"] .project:focus-within .project-ren { opacity: 1; }
html[data-ui="v2"] .project-ren:hover { background: var(--ui-hover); color: var(--ui-text); }
@media (pointer: coarse) { html[data-ui="v2"] .project-ren { opacity: .7; } }
html[data-ui="v2"] .project-rename { width: 100%; font: inherit; font-size: 13.5px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); }
html[data-ui="v2"] .msg-user { position: relative; }
html[data-ui="v2"] .msg-edit { position: absolute; inset-inline-end: calc(100% + 6px); top: 50%; transform: translateY(-50%); opacity: 0; border: 0; background: none; color: var(--ui-muted); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: opacity .15s; }
html[data-ui="v2"] .msg-user:hover .msg-edit, html[data-ui="v2"] .msg-edit:focus-visible { opacity: 1; }
html[data-ui="v2"] .msg-edit:hover { background: var(--ui-hover); color: var(--ui-text); }
html[data-ui="v2"] .msg-edit svg { width: 15px; height: 15px; }
@media (pointer: coarse) { html[data-ui="v2"] .msg-edit { opacity: .6; position: static; transform: none; margin-top: 4px; } }

/* live code runner + diagrams */
#runDialog .run-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--ui-line); }
#runDialog .run-bar .run-status { color: var(--ui-muted); font-size: 12.5px; }
#runDialog iframe { background: #111; }
html[data-ui="v2"] .code-bar .dl-code { border: 0; background: none; color: inherit; cursor: pointer; opacity: .75; font: inherit; }
html[data-ui="v2"] .code-bar .dl-code:hover { opacity: 1; }
.mermaid-box { margin: 8px 0 14px; padding: 12px; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-card); overflow: auto; text-align: center; }
.mermaid-box svg { max-width: 100%; height: auto; }
pre.mermaid-src { display: none; }

/* memory panel */
.mem-panel { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-card); }
.mem-panel ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.mem-panel li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--ui-field); font-size: 13.5px; }
.mem-panel li span { flex: 1; }
.mem-panel li button { border: 0; background: none; color: var(--ui-muted); font-size: 18px; cursor: pointer; width: 26px; height: 26px; border-radius: 8px; }
.mem-panel li button:hover { background: var(--ui-hover); color: var(--ui-text); }
.mem-panel .mem-empty { color: var(--ui-muted); background: none; }
.mem-add { display: flex; gap: 6px; }
.mem-add input { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); }
.mem-add button, .mem-clear { border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.mem-clear { margin-top: 10px; color: #f87171; }
.mem-meta { margin-top: 8px; font-size: 12px; color: var(--ui-muted); }
@media (max-width: 640px) {
  /* suggestion chips: as wide as their text, one tidy row that scrolls sideways */
  html[data-ui="v2"] .app.is-empty .home-action { width: auto !important; min-width: 0 !important; max-width: none !important; height: 34px; padding: 0 12px !important; gap: 6px; font-size: 12.5px !important; }
  html[data-ui="v2"] .app.is-empty .home-action svg { width: 15px; height: 15px; }
  html[data-ui="v2"] .app.is-empty section.chat > .suggestions { gap: 6px !important; padding: 2px 10px 8px !important; mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent); }
  /* header: tighter */
  html[data-ui="v2"] .chat-head { height: 50px; padding: 0 8px !important; }
  html[data-ui="v2"] .view-seg button { padding: 5px 12px !important; font-size: 13px; }
}

/* input sits a little higher, not glued to the bottom edge */
html[data-ui="v2"] .app:not(.is-empty) .composer-wrap, html[data-ui="v2"] .app:not(.is-empty) section.chat > form, html[data-ui="v2"] .app:not(.is-empty) .composer { margin-bottom: 22px !important; }
@media (max-width: 640px) { html[data-ui="v2"] .app:not(.is-empty) .composer-wrap, html[data-ui="v2"] .app:not(.is-empty) section.chat > form, html[data-ui="v2"] .app:not(.is-empty) .composer { margin-bottom: max(12px, env(safe-area-inset-bottom)) !important; } }

/* ===== Hythm Live v2: a clean conversation — messages · cloud orb · bar ===== */
html[data-ui="v2"] .voice-modal.v2 { align-items: stretch; }
.voice-modal.v2 .v-stage, .voice-modal.v2 .v-lines, .voice-modal.v2 .v-avatar { display: none !important; }
.voice-modal.v2 .v-top { padding: 12px 18px; }
.voice-modal.v2 .v-status { text-align: center; font-size: .8rem; min-height: 1.3em; }
.v-chat { flex: 1; overflow-y: auto; width: 100%; padding: 8px max(16px, calc(50% - 340px)) 24px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.v-hello { margin: auto; color: var(--ui-muted); font-size: .95rem; }
.v-msg { max-width: 86%; }
.v-msg p { margin: 0; line-height: 1.75; white-space: pre-wrap; }
.v-me { align-self: flex-start; background: color-mix(in srgb, #3b82f6 16%, var(--ui-card)); color: var(--ui-text); padding: 9px 15px; border-radius: 20px; }
[dir="ltr"] .v-me { align-self: flex-end; }
.v-me p:empty::after { content: "…"; opacity: .5; }
.v-me img { display: block; max-width: 220px; max-height: 220px; border-radius: 14px; margin-bottom: 6px; }
.v-me:has(p:empty) img { margin: 0; }
.v-bot { align-self: stretch; font-size: 1.02rem; }
[dir="rtl"] .v-bot { align-self: stretch; }
.v-copy { margin-top: 6px; border: 0; background: none; color: var(--ui-muted); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; opacity: .7; }
.v-copy:hover { background: var(--ui-hover); opacity: 1; }
.v-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.v-dock { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 16px max(18px, env(safe-area-inset-bottom)); }
/* the blue cloud orb: breathes when idle, swells and swirls with your voice */
.voice-modal.v2 .v-orb { width: 62px; height: 62px; transform: scale(calc(1 + var(--lvl) * .55)); border-radius: 50%; overflow: visible; }
.voice-modal.v2 .v-orb i:first-child { inset: 0; filter: none; border-radius: 50%; animation: vSpin 7s linear infinite;
  background: radial-gradient(40% 30% at 30% 62%, rgba(255,255,255,.95), transparent 70%), radial-gradient(45% 28% at 68% 48%, rgba(255,255,255,.85), transparent 70%), radial-gradient(35% 22% at 50% 30%, rgba(236,242,255,.8), transparent 70%), linear-gradient(180deg, #4f5dff 0%, #6f8bff 45%, #b9c9ff 100%); box-shadow: inset 0 -6px 14px rgba(40,50,180,.35); }
.voice-modal.v2 .v-orb i:nth-child(2) { inset: 0; border-radius: 50%; opacity: .65; filter: blur(1px); animation-duration: 11s;
  background: radial-gradient(50% 30% at 60% 70%, rgba(255,255,255,.9), transparent 70%), radial-gradient(40% 25% at 30% 35%, rgba(255,255,255,.7), transparent 70%); }
.voice-modal.v2 .v-orb i:nth-child(3) { inset: -30%; filter: blur(18px); opacity: calc(.15 + var(--lvl) * .8); background: radial-gradient(closest-side, #5b7cff, transparent); }
.voice-modal.v2[data-state="listening"] .v-orb { animation: vBreath 3s ease-in-out infinite; }
@keyframes vBreath { 50% { filter: brightness(1.08); } }
.voice-modal.v2[data-state="speaking"] .v-orb i:first-child { animation-duration: 3s; }
.v-bar { display: flex; align-items: center; gap: 8px; width: min(680px, 100%); padding: 6px 6px 6px 8px; border: 1px solid var(--ui-line); border-radius: 999px; background: var(--ui-card); box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.v-type { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ui-text); font: inherit; font-size: .95rem; padding: 8px 4px; }
.v-plus { width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--ui-text); cursor: pointer; display: grid; place-items: center; }
.v-plus:hover { background: var(--ui-hover); }
.v-plus svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.v-bar .v-btn { width: 38px; height: 38px; flex: none; background: var(--ui-hover); }
.v-bar .v-btn svg { width: 18px; height: 18px; }
.v-bar .v-end { background: var(--ui-text) !important; color: var(--ui-bg) !important; }
.v-bar .v-btn.on { background: #f59e0b; color: #111; }
.v-bar .v-ptt { width: auto; }
/* send ↔ stop: the hidden icon really hides (a display rule used to keep the arrow visible while answering) */
html[data-ui="v2"] .send-btn svg[hidden] { display: none !important; }
html[data-ui="v2"] .composer .send-btn.stop { opacity: 1 !important; background: var(--ui-text) !important; color: var(--ui-bg) !important; }

/* ===== one look on every device (iPhone · Samsung · Android) ===== */
html[data-ui="v2"] { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
html[data-ui="v2"] body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-family: var(--font, "Manrope", "Readex Pro", system-ui, sans-serif); font-synthesis: none; overscroll-behavior-y: none; }
/* form controls: no native (grey, rounded, bevelled) styles from each browser, same font as the page */
html[data-ui="v2"] :is(button, input, select, textarea) { font-family: inherit; }
html[data-ui="v2"] :is(button, textarea, input[type="text"], input[type="search"], input:not([type])) { -webkit-appearance: none; appearance: none; }
html[data-ui="v2"] button { touch-action: manipulation; background-clip: padding-box; }
html[data-ui="v2"] input[type="checkbox"], html[data-ui="v2"] input[type="radio"] { -webkit-appearance: auto; appearance: auto; }
html[data-ui="v2"] input[type="color"] { -webkit-appearance: auto; appearance: auto; }
/* iPhone zooms into any field under 16px — keep fields at 16px on touch screens */
@media (hover: none) and (pointer: coarse) {
  html[data-ui="v2"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), html[data-ui="v2"] textarea, html[data-ui="v2"] select { font-size: 16px !important; }
}
/* Samsung Internet / Android: scrollbars and selection in the theme colours */
html[data-ui="v2"] ::selection { background: color-mix(in srgb, var(--ui-blue, #1f7aff) 40%, transparent); }
html[data-ui="v2"] * { scrollbar-color: var(--ui-line-2) transparent; scrollbar-width: thin; }
/* notches, rounded corners and the home bar on every phone */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 1060px) {
    html[data-ui="v2"] .chat-head { padding-top: env(safe-area-inset-top) !important; height: calc(50px + env(safe-area-inset-top)) !important; }
    html[data-ui="v2"] body .app .sidebar { padding-top: env(safe-area-inset-top) !important; padding-bottom: env(safe-area-inset-bottom) !important; }
  }
}
/* the same emoji look everywhere (Samsung/iOS/Android draw their own otherwise) */
html[data-ui="v2"] .hf-ico, html[data-ui="v2"] .v-chips span { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

/* ===================== Explore · Made with Hythm ===================== */
.hx-show { display: flex; flex-direction: column; gap: 34px; margin: 10px 0 16px; }
.hxs-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.hxs-head .hx-h { margin: 0; font-size: 20px; color: var(--ui-text); font-weight: 700; letter-spacing: -.2px; }
.hxs-head p { margin: 0; color: var(--ui-muted); font-size: 13.5px; }
.hx-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.hx-reveal.in { opacity: 1; transform: none; }
.hx-reveal.in [style*="--d"] { animation: hxPop .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d); }
@keyframes hxPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* Hythm Live hero */
.hx-live { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; align-items: center; padding: 30px; border-radius: 26px; border: 1px solid var(--ui-line);
  background: radial-gradient(60% 80% at 20% 30%, rgba(91,124,255,.22), transparent 70%), radial-gradient(50% 60% at 90% 100%, rgba(236,72,153,.12), transparent 70%), var(--ui-card); overflow: hidden; }
.hx-live-stage { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 10px 0; }
.hx-live-orb { --lvl: 0; position: relative; width: 170px; height: 170px; transform: scale(calc(1 + var(--lvl) * .35)); transition: transform .06s linear; isolation: isolate; }
.hx-live-orb i { position: absolute; border-radius: 50%; }
.hx-live-orb i:nth-child(1) { inset: 0; animation: vSpin 8s linear infinite; box-shadow: inset 0 -14px 30px rgba(40,50,180,.4), 0 20px 60px -10px rgba(79,93,255,.6);
  background: radial-gradient(40% 30% at 30% 62%, rgba(255,255,255,.95), transparent 70%), radial-gradient(45% 28% at 68% 48%, rgba(255,255,255,.85), transparent 70%), radial-gradient(35% 22% at 50% 30%, rgba(236,242,255,.8), transparent 70%), linear-gradient(180deg, #4f5dff 0%, #6f8bff 45%, #b9c9ff 100%); }
.hx-live-orb i:nth-child(2) { inset: 0; opacity: .7; filter: blur(1.5px); animation: vSpin 12s linear infinite reverse;
  background: radial-gradient(50% 30% at 60% 72%, rgba(255,255,255,.9), transparent 70%), radial-gradient(40% 25% at 28% 35%, rgba(255,255,255,.75), transparent 70%); }
.hx-live-orb i:nth-child(3) { inset: -35%; filter: blur(36px); opacity: calc(.25 + var(--lvl) * 1.1); background: radial-gradient(closest-side, #5b7cff, transparent); z-index: -1; }
.hx-live-orb[data-talk="ai"] i:nth-child(1) { animation-duration: 2.6s; }
.hx-live-wave { display: flex; gap: 4px; align-items: center; height: 44px; }
.hx-live-wave b { width: 4px; height: 100%; border-radius: 4px; background: linear-gradient(#8ea2ff, #5b7cff); transform: scaleY(.1); transition: transform .08s linear; }
.hx-live-copy h3 { margin: 10px 0 8px; font-size: 24px; line-height: 1.35; }
.hx-live-copy > p { margin: 0 0 14px; color: var(--ui-muted); line-height: 1.8; font-size: 14px; }
.hx-live-chat { display: flex; flex-direction: column; gap: 8px; min-height: 128px; margin-bottom: 14px; }
.hx-lc { max-width: 88%; padding: 8px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.6; animation: hxPop .45s cubic-bezier(.2,.8,.2,1) both; }
.hx-lc.me { align-self: flex-start; background: color-mix(in srgb, #3b82f6 22%, var(--ui-field)); }
.hx-lc.ai { align-self: flex-end; background: var(--ui-field); }
.hx-live-feats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; color: var(--ui-muted); }

/* gallery */
.hx-masonry { columns: 4 190px; column-gap: 10px; }
.hx-shot { position: relative; margin: 0 0 10px; break-inside: avoid; border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--ui-field); }
.hx-shot img { display: block; width: 100%; height: auto; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.hx-shot figcaption { position: absolute; inset: auto 0 0; padding: 26px 12px 10px; font-size: 12.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transform: translateY(8px); transition: .3s; }
.hx-shot:hover img { transform: scale(1.06); }
.hx-shot:hover figcaption { opacity: 1; transform: none; }

/* ads */
.hx-ads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hx-ads { align-items: start; }
.hx-ad { margin: 0; position: relative; border-radius: 18px; overflow: hidden; background: var(--ui-field); min-height: 200px; }
.hx-ad.on { min-height: 0; }
.hx-ad canvas { width: 100%; height: auto; display: block; opacity: 0; transform: scale(1.04); transition: opacity .8s, transform 1.2s cubic-bezier(.2,.8,.2,1); }
.hx-ad.on canvas { opacity: 1; transform: none; }
.hx-ad:not(.on)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.08) 50%, transparent 70%); background-size: 200% 100%; animation: hxShine 1.2s linear infinite; }
@keyframes hxShine { to { background-position: -200% 0; } }
.hx-ad figcaption { position: absolute; top: 10px; inset-inline-start: 10px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px); }

/* documents */
.hx-docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hx-doc { border: 1px solid var(--ui-line); border-radius: 18px; background: var(--ui-card); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s, box-shadow .3s; }
.hx-doc:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); }
.hx-pv { height: 190px; position: relative; background: var(--ui-field); display: grid; place-items: center; overflow: hidden; }
.hx-doc footer { display: flex; align-items: center; gap: 10px; padding: 12px; }
.hx-doc footer > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hx-doc footer b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-doc footer small { color: var(--ui-muted); font-size: 12px; }
.hx-doc footer .hx-btn { padding: 7px 12px; font-size: 12.5px; }
.hx-doc .hf-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; }
.hx-deck { position: relative; width: 78%; height: 70%; }
.hx-slide { position: absolute; inset: 0; border-radius: 8px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.55); overflow: hidden; transition: transform .5s cubic-bezier(.2,.8,.2,1); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.hx-slide.s3 { transform: translate(14%, -14%) rotate(6deg) scale(.9); }
.hx-slide.s2 { transform: translate(7%, -7%) rotate(3deg) scale(.95); }
.hx-doc:hover .hx-slide.s3 { transform: translate(24%, -20%) rotate(10deg) scale(.9); }
.hx-doc:hover .hx-slide.s2 { transform: translate(12%, -10%) rotate(5deg) scale(.95); }
.hx-slide > i { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 5px; }
.hx-slide u { text-decoration: none; font-weight: 700; font-size: 12px; }
.hx-slide.s1 { color: #fff; justify-content: flex-end; }
.hx-slide.s1 b { font-size: 14px; position: relative; z-index: 1; }
.hx-slide.s1 small { font-size: 10px; opacity: .8; position: relative; z-index: 1; margin-bottom: 26px; }
.hx-slide .band { position: absolute; inset: auto 0 0; height: 28%; }
.mini-table { display: grid; gap: 3px; margin-top: 4px; }
.mini-table span { height: 9px; border-radius: 2px; background: var(--s); }
.mini-table span:first-child { background: var(--p); }
.hx-page { width: 62%; height: 88%; background: #fff; border-radius: 6px; box-shadow: 0 10px 24px -8px rgba(0,0,0,.55); padding: 12px; color: #333; font-size: 9px; display: flex; flex-direction: column; gap: 4px; transform: rotate(-2deg); transition: transform .4s; }
.hx-doc:hover .hx-page { transform: rotate(0) scale(1.04); }
.hx-page.pdf { padding: 0; overflow: hidden; }
.hx-page .cover { height: 100%; position: relative; color: #fff; display: flex; align-items: flex-start; padding: 22px 12px; overflow: hidden; }
.hx-page .cover b { position: relative; font-size: 13px; line-height: 1.4; }
.hx-page .cband { position: absolute; inset: auto -20% -20% -20%; height: 55%; transform: rotate(-8deg); }
.hx-page.doc b { font-size: 12px; }
.hx-page.doc hr { margin: 2px 0 4px; border: 0; border-top: 2px solid; }
.hx-page.doc p { margin: 0; }

/* code */
.hx-code { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hx-term { border-radius: 16px; background: #0d1117; border: 1px solid #1f2733; overflow: hidden; display: flex; flex-direction: column; }
.hx-term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #161b22; color: #8b949e; font-size: 12px; direction: ltr; }
.hx-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.hx-term-bar i:nth-child(2) { background: #febc2e; }
.hx-term-bar i:nth-child(3) { background: #28c840; }
.hx-term-bar span { margin-left: 8px; color: #c9d1d9; }
.hx-term-bar em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #21262d; }
.hx-term pre { margin: 0; padding: 14px 16px; min-height: 210px; font: 12.5px/1.65 var(--mono, ui-monospace, monospace); color: #c9d1d9; text-align: left; white-space: pre-wrap; }
.hx-term pre b { color: #ff7b72; font-weight: 500; }
.hx-term pre s { color: #a5d6ff; text-decoration: none; }
.hx-term pre i { color: #8b949e; }
.hx-term pre u { color: #79c0ff; text-decoration: none; }
.hx-caret { display: inline-block; width: 7px; height: 15px; background: #58a6ff; vertical-align: -3px; animation: hxBlink 1s steps(1) infinite; }
@keyframes hxBlink { 50% { opacity: 0; } }
.hx-term-out { padding: 0 16px; max-height: 0; overflow: hidden; color: #3fb950; font: 12.5px var(--mono, monospace); transition: max-height .4s, padding .4s; }
.hx-term.ran .hx-term-out { max-height: 50px; padding: 10px 16px 14px; border-top: 1px solid #1f2733; }

/* 3D */
.hx-3d { position: relative; border-radius: 22px; overflow: hidden; height: 320px; background: radial-gradient(70% 90% at 50% 40%, #1a2150, #05060f); border: 1px solid var(--ui-line); }
.hx-3d canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.hx-3d canvas:active { cursor: grabbing; }
.hx-3d-cap { position: absolute; bottom: 12px; inset-inline-start: 12px; padding: 9px 14px; border-radius: 14px; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); color: #fff; font-size: 13px; }
.hx-3d.no3d::before { content: "🪐"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; animation: vSpin 14s linear infinite; }

/* DeepSearch */
.hx-ds-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.hx-ds-step { padding: 16px 12px; border-radius: 16px; background: var(--ui-card); border: 1px solid var(--ui-line); text-align: center; }
.hx-ds-step span { font-size: 26px; display: block; margin-bottom: 6px; }
.hx-ds-step b { display: block; font-size: 14px; margin-bottom: 4px; }
.hx-ds-step p { margin: 0; font-size: 12px; color: var(--ui-muted); line-height: 1.6; }
.hx-reveal.in .hx-ds-step span { animation: hxBob 2.4s ease-in-out infinite; }
@keyframes hxBob { 50% { transform: translateY(-5px); } }

@media (max-width: 820px) {
  .hx-live { grid-template-columns: 1fr; padding: 22px; }
  .hx-live-orb { width: 130px; height: 130px; }
  .hx-ads { grid-template-columns: 1fr 1fr; }
  .hx-docs, .hx-code { grid-template-columns: 1fr; }
  .hx-ds-steps { grid-template-columns: 1fr 1fr; }
  .hx-masonry { columns: 2 140px; }
  .hx-live-feats { grid-template-columns: 1fr; }
  .hx-3d { height: 260px; }
}
@media (prefers-reduced-motion: reduce) { .hx-reveal { opacity: 1; transform: none; transition: none; } .hx-live-orb i, .hx-ds-step span { animation: none !important; } }

/* ===== DeepSearch in the chat ===== */
.ds-panel { border: 1px solid var(--ui-line); border-radius: 16px; padding: 10px 14px; margin: 4px 0 12px; background: var(--ui-card); max-width: 640px; }
.ds-top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ds-top b { font-weight: 700; background: linear-gradient(90deg, #8ea2ff, #5b7cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ds-count { margin-inline-start: auto; color: var(--ui-muted); font-size: 12px; }
.ds-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ui-line-2); border-top-color: #5b7cff; animation: vSpin .8s linear infinite; }
.ds-panel.done .ds-spin { display: none; }
.ds-steps { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 5px; }
.ds-steps li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; color: var(--ui-muted); animation: hxPop .35s ease both; overflow: hidden; text-overflow: ellipsis; }
.ds-steps li.now { color: var(--ui-text); }
.ds-steps li.now span { animation: hxBob 1s ease-in-out infinite; display: inline-block; }
.ds-steps li.ok { opacity: .7; }
.ds-panel.done .ds-steps { display: none; }
.ds-sites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ds-sites:empty { display: none; }
.ds-sites a { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; background: var(--ui-field); color: var(--ui-muted); font-size: 11.5px; text-decoration: none; animation: hxPop .35s ease both; direction: ltr; }
.ds-sites a:hover { color: var(--ui-text); }
.ds-sites img { width: 14px; height: 14px; border-radius: 3px; }
.ds-panel.done .ds-sites { display: none; }
.ds-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; max-width: 640px; }
.ds-imgs a { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--ui-field); animation: hxPop .5s ease both; animation-delay: calc(var(--i) * .06s); }
.ds-imgs a:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.ds-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.ds-imgs a:hover img { transform: scale(1.06); }
@media (max-width: 640px) { .ds-imgs { grid-template-columns: repeat(3, 1fr); } }
/* games and 3D play right in the chat */
.live-play { margin: 8px 0 10px; border: 1px solid var(--ui-line); border-radius: 16px; overflow: hidden; background: #0b0d14; }
.lp-stage { position: relative; aspect-ratio: 16 / 10; max-height: 520px; width: 100%; display: grid; place-items: center; background: radial-gradient(70% 90% at 50% 40%, #1a2150, #05060f); }
.lp-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.lp-stage:fullscreen { max-height: none; aspect-ratio: auto; }
.lp-start { border: 0; border-radius: 999px; padding: 14px 26px; font: inherit; font-size: 16px; font-weight: 700; color: #111; background: #fff; cursor: pointer; box-shadow: 0 10px 40px -8px rgba(91,124,255,.8); transition: transform .2s; }
.lp-start:hover { transform: scale(1.06); }
.lp-bar { display: flex; gap: 8px; padding: 8px 10px; background: var(--ui-card); border-top: 1px solid var(--ui-line); }
.lp-bar .btn-soft { font-size: 12.5px; padding: 6px 12px; }
pre.lp-folded { display: none !important; }
pre.lp-folded + * { margin-top: 0; }

/* ===================== image viewer ===================== */
.ux-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8,8,10,.94); color: #fff; overflow: hidden; }
.ux-viewer[open] { display: flex; flex-direction: column; animation: uxIn .22s ease both; }
.ux-viewer::backdrop { background: transparent; }
@keyframes uxIn { from { opacity: 0; } }
.uv-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); z-index: 2; }
.uv-title { flex: 1; min-width: 0; font-size: 13.5px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uv-count { font-size: 12.5px; opacity: .6; font-variant-numeric: tabular-nums; }
.uv-tools { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px; backdrop-filter: blur(10px); }
.uv-tools button, .uv-nav { width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.uv-tools button:hover, .uv-nav:hover { background: rgba(255,255,255,.14); }
.uv-tools svg, .uv-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.uv-zoom { min-width: 46px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.uv-sep { width: 1px; height: 20px; background: rgba(255,255,255,.18); margin: 0 4px; }
.uv-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.uv-stage.zoomed { cursor: grab; } .uv-stage.zoomed:active { cursor: grabbing; }
.uv-stage img { max-width: 92vw; max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 6px; user-select: none; will-change: transform; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); transition: opacity .2s; }
.uv-stage img.loading { opacity: .3; }
.uv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); z-index: 2; }
.uv-prev { inset-inline-start: 14px; } .uv-next { inset-inline-end: 14px; }
[dir="rtl"] .uv-nav svg { transform: scaleX(-1); }
.uv-strip { display: flex; gap: 6px; justify-content: center; padding: 8px 12px max(12px, env(safe-area-inset-bottom)); overflow-x: auto; }
.uv-strip button { flex: none; width: 54px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #222; cursor: pointer; opacity: .55; transition: .2s; }
.uv-strip button.on { border-color: #fff; opacity: 1; }
.uv-strip img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .uv-tools [data-a="rot"], .uv-zoom, .uv-tools [data-a="fit"] { display: none; } .uv-nav { width: 40px; height: 40px; } }
img[data-view], a[data-view] { cursor: zoom-in; }

/* ===================== sheets (feedback · report · details) ===================== */
.ux-sheet { border: 0; padding: 0; background: none; max-width: min(460px, calc(100vw - 24px)); width: 100%; color: var(--ui-text); }
.ux-sheet::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.ux-sheet[open] { animation: uxUp .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes uxUp { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.ux-card { background: var(--ui-modal); border-radius: 20px; padding: 18px; box-shadow: var(--ui-shadow), 0 0 0 1px var(--ui-line); display: flex; flex-direction: column; gap: 12px; }
.ux-card header { display: flex; align-items: center; justify-content: space-between; }
.ux-card header b { font-size: 16px; }
.ux-card p { margin: 0; color: var(--ui-muted); font-size: 13.5px; line-height: 1.7; }
.ux-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--ui-muted); cursor: pointer; display: grid; place-items: center; }
.ux-x:hover { background: var(--ui-hover); color: var(--ui-text); }
.ux-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ux-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ux-chip { border: 1px solid var(--ui-line-2); background: none; color: var(--ui-text); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; transition: .15s; }
.ux-chip.on { background: var(--ui-text); color: var(--ui-bg); border-color: transparent; }
.ux-card textarea { width: 100%; resize: vertical; min-height: 80px; border: 1px solid var(--ui-line-2); border-radius: 12px; background: var(--ui-field); color: var(--ui-text); font: inherit; font-size: 14px; padding: 10px 12px; outline: none; }
.ux-card textarea:focus { border-color: var(--ui-blue, #1f7aff); }
.ux-card footer { display: flex; justify-content: flex-end; gap: 8px; }
.ux-btn { border: 0; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--ui-text); color: var(--ui-bg); }
.ux-btn.ghost { background: none; color: var(--ui-text); border: 1px solid var(--ui-line-2); }
.ux-btn.danger { background: #ef4444; color: #fff; }
.ux-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.ux-dl dt { color: var(--ui-muted); } .ux-dl dd { margin: 0; overflow-wrap: anywhere; }
.ux-dl a { color: var(--ui-blue, #1f7aff); }
.ux-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--ui-text); color: var(--ui-bg); padding: 9px 16px; border-radius: 999px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 2147483000; }
.ux-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* answer "more" menu */
.ans-more { position: relative; }
.ans-menu { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 0; min-width: 190px; background: var(--ui-pop); border-radius: 14px; padding: 6px; box-shadow: var(--ui-shadow), 0 0 0 1px var(--ui-line); z-index: 30; animation: uxUp .18s ease both; }
.ans-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ui-text); font: inherit; font-size: 13.5px; padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: start; }
.ans-menu button:hover { background: var(--ui-hover); }
.ans-menu button.danger { color: #f87171; }
.ans-menu svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ans-actions button.speaking svg { color: #5b7cff; animation: hxBob 1s ease-in-out infinite; }

/* ===== DeepSearch v2: one line + site icons, then a tidy picture mosaic ===== */
.ds-panel { border: 0 !important; background: none !important; padding: 0 !important; margin: 2px 0 12px !important; }
.ds-steps, .ds-top { display: none !important; }
.ds-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ui-muted); }
.ds-panel.live .ds-label { background: linear-gradient(90deg, var(--ui-muted) 0%, var(--ui-text) 50%, var(--ui-muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: dsShimmer 1.6s linear infinite; }
@keyframes dsShimmer { to { background-position: -200% 0; } }
.ds-globe { width: 16px; height: 16px; border-radius: 50%; border: 1.8px solid currentColor; position: relative; flex: none; }
.ds-globe::before { content: ""; position: absolute; inset: -1.8px 4px; border-radius: 50%; border: 1.8px solid currentColor; }
.ds-panel.live .ds-globe { animation: vSpin 2.2s linear infinite; color: #5b7cff; }
.ds-sites { display: flex !important; flex-wrap: nowrap; align-items: center; margin-top: 8px !important; padding-inline-start: 2px; }
.ds-sites:empty { display: none !important; }
.ds-sites a { width: 26px; height: 26px; padding: 0 !important; border-radius: 50% !important; background: #fff !important; display: grid !important; place-items: center; margin-inline-end: -6px; box-shadow: 0 0 0 2px var(--ui-bg); animation: dsIcon .35s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * .04s); transition: transform .2s, margin .2s; position: relative; }
.ds-sites a:hover { transform: translateY(-3px) scale(1.12); z-index: 2; }
.ds-sites:hover a { margin-inline-end: 3px; }
.ds-sites img { width: 16px !important; height: 16px !important; border-radius: 3px; }
.ds-sites b { font-size: 11px; color: #333; }
.ds-plus { margin-inline-start: 12px; font-size: 12px; color: var(--ui-muted); }
@keyframes dsIcon { from { opacity: 0; transform: scale(.4); } }
.ds-panel.done .ds-sites { display: flex !important; }
/* picture mosaic */
.ds-imgs { display: grid !important; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 92px; gap: 6px !important; max-width: 620px; margin: 0 0 14px; }
.ds-imgs a { aspect-ratio: auto !important; border-radius: 12px !important; position: relative; }
.ds-imgs a:first-child { grid-column: span 2; grid-row: span 2; }
.ds-imgs[data-n="1"] { grid-template-columns: 1fr; grid-auto-rows: 260px; } .ds-imgs[data-n="1"] a:first-child { grid-column: auto; grid-row: auto; }
.ds-imgs[data-n="2"] { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; } .ds-imgs[data-n="2"] a:first-child { grid-column: auto; grid-row: auto; }
.ds-imgs[data-n="3"] { grid-template-columns: 2fr 1fr; } .ds-imgs[data-n="3"] a:first-child { grid-column: auto; }
.ds-imgs[data-n="4"] a:nth-child(2) { grid-column: span 2; }
.ds-imgs[data-n="6"] a:nth-child(6), .ds-imgs[data-n="7"] a:nth-child(7) { grid-column: span 1; }
.ds-imgs a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.ds-more { display: grid; place-items: center; border-radius: 12px; background: var(--ui-field); color: var(--ui-muted); font-weight: 700; }
@media (max-width: 640px) { .ds-imgs { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 80px; } .ds-imgs[data-n="4"] a:nth-child(2) { grid-column: auto; } }

/* ===== Hythm Live: orb colours follow the voice (women pink/purple · men blue/green) ===== */
.voice-modal { --o1: #4f5dff; --o2: #6f8bff; --o3: #b9c9ff; }
.voice-modal.v2 .v-orb i:first-child, .vs-orb i:first-child, .vs-mini {
  background: radial-gradient(40% 30% at 30% 62%, rgba(255,255,255,.95), transparent 70%), radial-gradient(45% 28% at 68% 48%, rgba(255,255,255,.85), transparent 70%), radial-gradient(35% 22% at 50% 30%, rgba(255,255,255,.75), transparent 70%), linear-gradient(180deg, var(--o1) 0%, var(--o2) 50%, var(--o3) 100%) !important;
  transition: background .6s; }
.voice-modal.v2 .v-orb i:nth-child(3), .vs-orb i:nth-child(3) { background: radial-gradient(closest-side, var(--o1), transparent) !important; }
/* the studio */
.v-studio { position: absolute; inset: 0; z-index: 20; width: auto !important; margin: 0 !important; border-radius: 0 !important; overflow-y: auto; padding: max(14px, env(safe-area-inset-top)) max(16px, calc(50% - 330px)) 30px !important; background: var(--ui-bg) !important; animation: uxUp .3s cubic-bezier(.2,.8,.2,1) both; display: flex; flex-direction: column; gap: 18px; }
.v-studio[hidden] { display: none !important; }
.vs-head { display: flex; align-items: center; justify-content: space-between; }
.vs-head b { font-size: 18px; }
.vs-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ui-hover); color: var(--ui-text); font-size: 16px; cursor: pointer; }
.vs-preview { display: flex; align-items: center; gap: 22px; padding: 20px; border-radius: 22px; background: radial-gradient(70% 90% at 15% 50%, color-mix(in srgb, var(--o1) 22%, transparent), transparent 70%), var(--ui-card); border: 1px solid var(--ui-line); }
.vs-orb { position: relative; width: 110px; height: 110px; flex: none; animation: vsBreath 3.2s ease-in-out infinite; isolation: isolate; }
.vs-orb i { position: absolute; inset: 0; border-radius: 50%; }
.vs-orb i:first-child { animation: vSpin 8s linear infinite; box-shadow: inset 0 -10px 24px rgba(0,0,0,.18), 0 16px 50px -10px var(--o1); }
.vs-orb i:nth-child(2) { opacity: .6; filter: blur(1.5px); animation: vSpin 12s linear infinite reverse; background: radial-gradient(50% 30% at 60% 72%, rgba(255,255,255,.9), transparent 70%), radial-gradient(40% 25% at 28% 35%, rgba(255,255,255,.7), transparent 70%); }
.vs-orb i:nth-child(3) { inset: -35%; filter: blur(30px); opacity: .55; z-index: -1; }
@keyframes vsBreath { 50% { transform: scale(1.06); } }
.vs-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vs-who b { font-size: 20px; } .vs-who small { color: var(--ui-muted); font-size: 13px; }
.vs-sample { align-self: flex-start; margin-top: 6px; border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; background: var(--o1); color: #fff; cursor: pointer; transition: transform .2s, background .6s; }
.vs-sample:hover { transform: scale(1.05); }
.v-studio section h4 { margin: 0 0 10px; font-size: 14px; color: var(--ui-muted); font-weight: 600; }
.v-studio .v-chips { gap: 8px; }
.vs-voices { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.vs-voices button { display: grid !important; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: start; padding: 10px 12px !important; border-radius: 16px !important; }
.vs-voices button b { font-size: 14px; } .vs-voices button small { grid-column: 2; font-size: 11.5px; opacity: .65; }
.vs-mini { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; animation: vSpin 10s linear infinite; }
.vs-voices button.on { background: var(--ui-card) !important; color: var(--ui-text) !important; border-color: var(--o1) !important; box-shadow: 0 0 0 2px var(--o1); }
.vs-seg { display: grid !important; grid-template-columns: repeat(3, 1fr); background: var(--ui-field); border-radius: 16px; padding: 4px; }
.vs-seg button { border: 0 !important; border-radius: 12px !important; padding: 10px 6px !important; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px !important; }
.vs-seg button span { opacity: 1 !important; font-size: 16px; margin: 0 !important; }
.vs-seg button.on { background: var(--ui-card) !important; color: var(--ui-text) !important; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.vs-dia button.on, .vs-modes button.on { border-color: var(--o1) !important; background: color-mix(in srgb, var(--o1) 18%, transparent) !important; color: var(--ui-text) !important; }
.vs-modes { display: grid !important; grid-template-columns: 1fr 1fr; }
.vs-modes button { display: grid !important; grid-template-columns: 36px 1fr; text-align: start; padding: 12px !important; border-radius: 16px !important; column-gap: 8px; }
.vs-modes button span { grid-row: span 2; font-size: 24px; opacity: 1 !important; }
.vs-modes button small { font-size: 11.5px; opacity: .65; }
.vs-meter { position: relative; height: 10px; border-radius: 99px; background: var(--ui-field); overflow: hidden; margin-bottom: 10px; }
.vs-meter .lvl { position: absolute; inset: 0 auto 0 0; width: calc(var(--mlvl, 0) * 100%); background: linear-gradient(90deg, var(--o2), var(--o1)); border-radius: inherit; transition: width .08s linear; }
[dir="rtl"] .vs-meter .lvl { inset: 0 0 0 auto; }
.vs-meter .thr { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ui-text); inset-inline-start: calc(var(--mthr, .3) * 100%); opacity: .7; }
@media (max-width: 640px) { .vs-preview { gap: 14px; padding: 14px; } .vs-orb { width: 84px; height: 84px; } .vs-modes { grid-template-columns: 1fr; } }
.ux-sheet[open] { position: fixed; inset: 0; margin: auto !important; height: fit-content; }
@media (max-width: 640px) { .ux-sheet[open] { margin: auto auto 0 !important; max-width: 100vw; } .ux-sheet .ux-card { border-radius: 22px 22px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); } }
/* live site icons: pulsing while being read, solid once read, fading if the site did not answer */
.ds-sites a.reading { animation: dsIcon .35s cubic-bezier(.2,.8,.2,1) both, dsRead 1s ease-in-out .35s infinite; }
.ds-sites a.reading::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: #5b7cff; animation: vSpin .8s linear infinite; }
@keyframes dsRead { 50% { opacity: .55; } }
.ds-sites a.read { animation: dsIcon .35s cubic-bezier(.2,.8,.2,1) both; opacity: 1; }
.ds-sites a.gone { opacity: 0 !important; transform: scale(.4); transition: .35s; }
.ds-panel.done .ds-sites a.reading { animation: none; }
.ds-panel.done .ds-sites a.reading::after { display: none; }
.lp-err { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: color-mix(in srgb, #ef4444 14%, var(--ui-card)); color: var(--ui-text); font-size: 12.5px; border-top: 1px solid var(--ui-line); direction: ltr; }
.lp-err span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono, monospace); }

/* ===== one ad → every size ===== */
.ad-sizes { max-width: min(860px, calc(100vw - 24px)) !important; }
.as-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; max-height: 62vh; overflow: auto; }
.as-item { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.as-pv { width: 100%; border-radius: 10px; overflow: hidden; background: var(--ui-field); position: relative; display: grid; place-items: center; box-shadow: 0 6px 20px -8px rgba(0,0,0,.5); }
.as-pv img { width: 100%; height: 100%; object-fit: cover; display: block; animation: hxPop .4s ease both; }
.as-spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ui-line-2); border-top-color: #5b7cff; animation: vSpin .8s linear infinite; }
.as-item figcaption { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.as-item figcaption b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.as-item figcaption small { display: none; }
.as-item .mini-btn { padding: 4px 9px; }
.mini-hot { background: linear-gradient(135deg, #5b7cff, #b06bff) !important; color: #fff !important; border: 0 !important; }
@media (max-width: 720px) { .as-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== video ad ===== */
.ad-video { max-width: min(520px, calc(100vw - 24px)) !important; }
.av-fmts { display: flex; gap: 6px; flex-wrap: wrap; }
.av-stage { display: grid; place-items: center; min-height: 140px; background: var(--ui-field); border-radius: 14px; overflow: hidden; }
.av-stage video { max-width: 100%; max-height: 56vh; display: block; }
.av-bar { width: 80%; height: 8px; border-radius: 99px; background: var(--ui-line); overflow: hidden; }
.av-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #5b7cff, #b06bff); transition: width .2s linear; }

/* ===== meeting / voice note card ===== */
.meet-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-card); max-width: 460px; }
.mc-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: linear-gradient(135deg, #5b7cff, #b06bff); flex: none; }
.mc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mc-body b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mc-body small { color: var(--ui-muted); font-size: 12px; }
.mc-step { font-size: 13px; color: var(--ui-text); }
.mc-body .av-bar { width: 100%; }
.meet-card.ok .av-bar i { background: #22c55e; } .meet-card.err { border-color: #ef4444; } .meet-card.err .av-bar { display: none; }
.mc-body .mini-btn { align-self: flex-start; margin-top: 4px; }

/* ===================== Plans ===================== */
.pl-sheet { max-width: min(1040px, calc(100vw - 24px)) !important; }
.pl-wrap > header b { font-size: 20px; }
.pl-why { text-align: center; color: var(--ui-text) !important; background: color-mix(in srgb, #5b7cff 16%, transparent); padding: 8px 12px; border-radius: 12px; }
.pl-cycle { align-self: center; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--ui-field); }
.pl-cycle button { border: 0; background: none; color: var(--ui-muted); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.pl-cycle button.on { background: var(--ui-text); color: var(--ui-bg); }
.pl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: stretch; max-height: 70vh; overflow: auto; padding: 2px; }
.pl-card { border: 1px solid var(--ui-line-2); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--ui-card); }
.pl-card.rec { background: linear-gradient(160deg, color-mix(in srgb, #3b6bff 38%, var(--ui-card)), var(--ui-card) 70%); border-color: #4f7bff; box-shadow: 0 20px 50px -24px rgba(59,107,255,.7); }
.pl-card header { display: flex; align-items: center; justify-content: space-between; }
.pl-card header b { font-size: 14px; }
.pl-rec { font-style: normal; font-size: 11px; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.14); order: 2; }
.pl-card h3 { margin: 0; font-size: 20px; }
.pl-price { display: flex; align-items: baseline; gap: 6px; }
.pl-price strong { font-size: 34px; letter-spacing: -.5px; } .pl-price span { color: var(--ui-muted); font-size: 13px; }
.pl-btn { border: 0; border-radius: 999px; padding: 11px; font: inherit; font-weight: 700; cursor: pointer; background: #3b82f6; color: #fff; transition: transform .15s; }
.pl-btn:hover:not(:disabled) { transform: translateY(-1px); } .pl-btn.ghost { background: none; border: 1px solid var(--ui-line-2); color: var(--ui-muted); }
.pl-card ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.pl-card li { display: flex; gap: 8px; align-items: flex-start; } .pl-card li::before { content: "✓"; color: #60a5fa; font-weight: 700; }
.pl-card li.lead { font-weight: 700; } .pl-card li.lead::before { content: ""; }
.pl-card.cur { outline: 2px solid var(--ui-text); }
.pl-note { text-align: center; font-size: 12px !important; }
.pl-sum { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--ui-field); }
.pl-in { width: 100%; border: 1px solid var(--ui-line-2); border-radius: 12px; background: var(--ui-field); color: var(--ui-text); font: inherit; padding: 10px 12px; }
.pl-lost { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 14px; }
.upgrade-pill { position: absolute; bottom: 70px; inset-inline-start: 12px; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 99px; cursor: pointer; }
.side-foot-wrap { position: relative; }
.upgrade-pill.paid { background: linear-gradient(135deg, #3b82f6, #8b5cf6); border: 0; color: #fff; }
.p2-plus { background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important; color: #fff !important; }
@media (max-width: 860px) { .pl-grid { grid-template-columns: 1fr; } }
/* ===================== Intros ===================== */
.intro { text-align: center; align-items: center; overflow: hidden; padding-top: 0 !important; }
.in-art { width: calc(100% + 36px); margin: 0 -18px 4px; height: 120px; display: grid; place-items: center; background: radial-gradient(70% 120% at 50% 0%, rgba(91,124,255,.55), transparent 70%), linear-gradient(180deg, #2a3a6e, transparent); }
.in-art span { font-size: 44px; animation: hxBob 2.4s ease-in-out infinite; }
.in-exp { background: radial-gradient(70% 120% at 50% 0%, rgba(245,158,11,.5), transparent 70%), linear-gradient(180deg, #5a3a18, transparent); }
.in-title { font-size: 20px; } .intro p { max-width: 380px; } .intro footer { justify-content: center; width: 100%; } .intro .ux-btn { min-width: 160px; }
/* ===================== Temporary chat ===================== */
.temp-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 12px; font-size: 13px; background: color-mix(in srgb, #8b5cf6 18%, var(--ui-bg)); color: var(--ui-text); }
.temp-bar button { border: 1px solid var(--ui-line-2); background: none; color: var(--ui-text); font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 99px; cursor: pointer; }
.temp-btn[aria-pressed="true"] { color: #a78bfa; background: color-mix(in srgb, #8b5cf6 18%, transparent); }
body.temp-chat .composer-box { box-shadow: 0 0 0 1.5px #8b5cf6 inset; }
.mr-ico { width: 20px; text-align: center; font-size: 15px; }
/* ===================== Plugins ===================== */
.pg-sheet { max-width: min(620px, calc(100vw - 24px)) !important; }
.pg-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.pg-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 14px; }
.pg-item.on { border-color: #5b7cff; background: color-mix(in srgb, #5b7cff 10%, transparent); }
.pg-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--ui-field); flex: none; }
.pg-item > div:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-item b { font-size: 14px; } .pg-item b em { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--ui-field); color: var(--ui-muted); margin-inline-start: 4px; }
.pg-item b em.pg-api { background: #064e3b; color: #6ee7b7; }
.pg-item small { color: var(--ui-muted); font-size: 12px; }
.pg-act { display: flex; gap: 4px; align-items: center; }
.pg-act button { border: 0; background: none; color: var(--ui-muted); cursor: pointer; font-size: 14px; padding: 6px; border-radius: 8px; }
.pg-act .pg-use { background: var(--ui-text); color: var(--ui-bg); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 99px; }
.pg-item.on .pg-use { background: #5b7cff; color: #fff; }
.pg-wrap footer { justify-content: space-between; align-items: center; } .pg-lim { color: var(--ui-muted); }
.pe-form input, .pe-form textarea { width: 100%; border: 1px solid var(--ui-line-2); border-radius: 12px; background: var(--ui-field); color: var(--ui-text); font: inherit; font-size: 14px; padding: 10px 12px; }
.pe-row { display: flex; gap: 8px; } .pe-ico { width: 60px !important; text-align: center; font-size: 20px !important; }
.pe-note { color: var(--ui-muted); font-size: 11.5px; }
.plugin-chip { background: color-mix(in srgb, #5b7cff 18%, var(--ui-field)) !important; }

/* ===== checkout · offer · billing ===== */
.co-sheet, .bl-sheet { max-width: min(520px, calc(100vw - 24px)) !important; }
.co-sum { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, #3b6bff 30%, var(--ui-card)), var(--ui-card)); border: 1px solid #4f7bff; }
.co-sum > div { display: flex; flex-direction: column; } .co-sum small { color: var(--ui-muted); } .co-sum strong { font-size: 24px; }
.co-label, .bl-sheet h4 { font-size: 13px; color: var(--ui-muted); margin: 6px 0 -4px; font-weight: 600; }
.co-methods { display: grid; gap: 6px; }
.co-m { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--ui-line-2); background: var(--ui-field); color: var(--ui-text); font: inherit; font-size: 13.5px; text-align: start; opacity: .75; cursor: not-allowed; }
.co-m.on { border-color: var(--ui-text); opacity: .9; } .co-m span { width: 22px; text-align: center; font-size: 17px; }
.co-m em { margin-inline-start: auto; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, #f59e0b 22%, transparent); color: #fbbf24; }
.co-soon { font-size: 12.5px; color: var(--ui-muted); padding: 8px 12px; border-radius: 10px; background: var(--ui-field); }
.co-pay:disabled { opacity: .45; cursor: not-allowed; }
.co-or { display: flex; align-items: center; gap: 10px; color: var(--ui-muted); font-size: 12px; } .co-or::before, .co-or::after { content: ""; flex: 1; height: 1px; background: var(--ui-line-2); }
.co-code { display: flex; gap: 8px; } .co-code input { flex: 1; min-width: 0; border: 1px solid var(--ui-line-2); border-radius: 12px; background: var(--ui-field); color: var(--ui-text); font: inherit; font-family: var(--mono, monospace); letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px; direction: ltr; }
.co-msg { min-height: 1.2em; font-size: 13px; } .co-msg.ok { color: #4ade80; } .co-msg.err { color: #f87171; }
.in-win { background: radial-gradient(70% 120% at 50% 0%, rgba(74,222,128,.45), transparent 70%), linear-gradient(180deg, #14532d, transparent); }
.in-gift { background: radial-gradient(70% 120% at 50% 0%, rgba(96,165,250,.55), transparent 70%), linear-gradient(180deg, #1e3a8a, transparent); }
.offer-top { margin-inline-start: 8px; border: 0; background: none; color: #60a5fa; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 10px; border-radius: 10px; order: -1; }
.offer-top:hover { background: color-mix(in srgb, #60a5fa 14%, transparent); }
.offer-side { display: block; width: calc(100% - 20px); margin: 6px 10px 8px; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); font: inherit; font-size: 13px; font-weight: 600; padding: 9px; border-radius: 12px; cursor: pointer; }
.offer-side:hover { border-color: #60a5fa; }
.upgrade-pill { bottom: 110px; }
.bl-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--ui-line-2); background: var(--ui-card); }
.bl-plan.paid { border-color: #4f7bff; background: linear-gradient(135deg, color-mix(in srgb, #3b6bff 26%, var(--ui-card)), var(--ui-card)); }
.bl-plan > div { display: flex; flex-direction: column; gap: 2px; } .bl-plan small, .bl-plan span { color: var(--ui-muted); font-size: 12.5px; } .bl-plan b { font-size: 20px; }
.bl-offer { border: 1px dashed #60a5fa; background: color-mix(in srgb, #60a5fa 10%, transparent); color: var(--ui-text); font: inherit; font-weight: 600; padding: 10px; border-radius: 12px; cursor: pointer; }
.bl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .bl-grid > div { padding: 10px; border-radius: 12px; background: var(--ui-field); display: flex; flex-direction: column; } .bl-grid small { color: var(--ui-muted); font-size: 11.5px; } .bl-grid b { font-size: 17px; }
.bl-method { padding: 10px 12px; border-radius: 12px; background: var(--ui-field); color: var(--ui-muted); font-size: 13px; }
.bl-hist { display: grid; gap: 2px; max-height: 190px; overflow: auto; } .bl-hist > div { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--ui-line); font-size: 13px; }
.bl-hist span { color: var(--ui-muted); font-size: 12px; } .bl-hist b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bl-hist em { font-style: normal; } .bl-hist em.pos { color: #4ade80; } .bl-hist em.neg { color: var(--ui-muted); }
.bl-empty { color: var(--ui-muted); font-size: 13px; margin: 4px 0; }
.bl-wrap { max-height: 86vh; overflow: auto; }
@media (max-width: 520px) { .bl-grid { grid-template-columns: 1fr 1fr; } }
.co-code input::placeholder { text-transform: none; letter-spacing: 0; font-family: inherit; }

/* ===== Training Lab ===== */
.lab-sheet { max-width: min(560px, calc(100vw - 24px)) !important; }
.lab-top { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.lab-lvl { font-weight: 700; } .lab-earn { color: var(--ui-muted); }
.lab-bar { height: 8px; border-radius: 99px; background: var(--ui-field); overflow: hidden; } .lab-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #facc15); border-radius: inherit; transition: width .4s; }
.lab-body { min-height: 260px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.lab-kind { font-size: 13px; color: var(--ui-muted); font-weight: 600; } .lab-kind em { font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--ui-field); margin-inline-start: 6px; }
.lab-q { font-size: 19px; line-height: 1.7; padding: 14px 16px; border-radius: 16px; background: var(--ui-field); border: 1px solid var(--ui-line); animation: hxPop .35s ease both; }
.lab-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .lab-opts.two { grid-template-columns: 1fr; }
.lab-opts button { text-align: start; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); font: inherit; font-size: 14px; line-height: 1.6; padding: 12px 14px; border-radius: 14px; cursor: pointer; transition: transform .15s, border-color .15s; animation: hxPop .35s ease both; }
.lab-opts button:hover:not(:disabled) { border-color: #60a5fa; transform: translateY(-1px); }
.lab-opts button b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ui-field); margin-inline-end: 8px; font-size: 12px; }
.lab-opts button.mine { border-color: #60a5fa; background: color-mix(in srgb, #60a5fa 14%, var(--ui-card)); }
.lab-opts button.model::after { content: " · Hythm"; color: var(--ui-muted); font-size: 11px; }
.lab-opts button:disabled { cursor: default; }
.lab-res { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; border-radius: 14px; background: var(--ui-field); font-size: 13.5px; animation: hxPop .35s ease both; }
.lab-res small { flex-basis: 100%; color: var(--ui-muted); } .lab-res .ux-btn { margin-inline-start: auto; }
.lab-coin { font-weight: 800; color: #facc15; animation: labCoin .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes labCoin { from { transform: scale(.3) translateY(10px); opacity: 0; } 60% { transform: scale(1.25); } }
.lab-foot { justify-content: space-between; align-items: center; } .lab-learned { color: var(--ui-muted); font-size: 11.5px; }
.lab-empty { color: var(--ui-muted); text-align: center; }
.lab-link { display: flex; align-items: center; gap: 10px; width: 100%; }
.lab-plus { font-style: normal; margin-inline-start: auto; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: color-mix(in srgb, #facc15 18%, transparent); color: #facc15; }
@media (max-width: 520px) { .lab-opts { grid-template-columns: 1fr; } }

.lab-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lab-ctx { font-size: 13px; color: var(--ui-muted); padding: 8px 12px; border-inline-start: 3px solid var(--ui-line-2); }
.lab-acc { color: #34d399; }
.lab-opts button.right { border-color: #34d399; background: color-mix(in srgb, #34d399 16%, var(--ui-card)); }
.lab-opts button.wrong { border-color: #f87171; background: color-mix(in srgb, #f87171 14%, var(--ui-card)); }

/* ===== chat ⋯ menu + download ===== */
html[data-ui="v2"] .project { position: relative; }
html[data-ui="v2"] .project .project-ren, html[data-ui="v2"] .project .project-del { display: none !important; }
.project-more { opacity: 0; border: 0; background: none; color: var(--ui-muted); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none; transition: opacity .15s, background .15s; }
.project-more svg { width: 16px; height: 16px; }
.project:hover .project-more, .project.active .project-more, .project-more[aria-expanded="true"], .project-more:focus-visible { opacity: 1; }
.project-more:hover, .project-more[aria-expanded="true"] { background: var(--ui-hover); color: var(--ui-text); }
@media (hover: none) { .project-more { opacity: .8; } }
.chat-pop { position: fixed; z-index: 9999; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--ui-card); border: 1px solid var(--ui-line-2); box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: hxPop .16s ease both; }
.chat-pop hr { border: 0; border-top: 1px solid var(--ui-line); margin: 5px 4px; }
.cp-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ui-text); font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: start; }
.cp-row:hover { background: var(--ui-hover); }
.cp-row.danger { color: #f87171; }
.cp-has::after { content: "›"; margin-inline-start: auto; color: var(--ui-muted); transform: rotate(90deg); }
.cp-ico { width: 18px; text-align: center; font-size: 14px; }
.cp-sub { padding: 2px 0 2px 0; margin-inline-start: 14px; border-inline-start: 1px solid var(--ui-line); padding-inline-start: 4px; }
.cp-sub .cp-row { font-size: 13px; padding: 7px 10px; }
/* header: temporary chat + share look the same */
html[data-ui="v2"] .chat-head .temp-btn { height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border-radius: 10px; }
html[data-ui="v2"] .chat-head .temp-btn svg { width: 18px; height: 18px; flex: none; }
.temp-btn .tb-lbl { display: none; font-size: 12.5px; font-weight: 600; }
.temp-btn[aria-pressed="true"] .tb-lbl { display: inline; }
html[data-ui="v2"] .chat-head .head-share { border-radius: 10px; }
/* upgrade pill: in the account row, never over the chat list */
.side-foot-wrap { display: flex; align-items: center; gap: 6px; }
.side-foot-wrap > .side-foot { flex: 1; min-width: 0; }
.upgrade-pill, html .upgrade-pill { position: static !important; inset: auto !important; flex: none; margin-inline-end: 4px; padding: 5px 12px; font-size: 12px; box-shadow: 0 4px 14px rgba(99,102,241,.25); }
.side-foot-wrap > .menu { position: absolute; }

/* ===== Apps page ===== */
.apps-page { position: fixed; inset: 0; z-index: 900; background: var(--ui-bg, #0b0b0f); color: var(--ui-text); overflow-y: auto; animation: hxPop .18s ease both; }
.apps-page > * { max-width: 920px; margin-inline: auto; padding-inline: 20px; }
.ap-top { display: flex; gap: 14px; align-items: flex-start; padding-top: 28px; }
.ap-top h2 { margin: 0; font-size: 26px; } .ap-top p { margin: 4px 0 0; color: var(--ui-muted); font-size: 14px; }
.ap-back { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); cursor: pointer; font-size: 15px; }
.ap-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-block: 16px 10px; background: var(--ui-bg, #0b0b0f); }
.ap-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border-radius: 12px; background: var(--ui-field); border: 1px solid var(--ui-line); }
.ap-search svg { width: 17px; height: 17px; color: var(--ui-muted); flex: none; } .ap-search input { flex: 1; border: 0; background: none; color: inherit; font: inherit; outline: none; }
.ap-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--ui-field); }
.ap-tabs button { border: 0; background: none; color: var(--ui-muted); font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 9px; cursor: pointer; } .ap-tabs button.on { background: var(--ui-card); color: var(--ui-text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.ap-body { padding-bottom: 60px; }
.ap-body h3 { font-size: 15px; margin: 26px 0 8px; }
.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; }
.ap-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.ap-row:hover, .ap-row:focus-visible { background: var(--ui-hover); outline: none; }
.ap-ico { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, var(--ui-card)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); font-size: 20px; font-weight: 800; color: var(--c); }
.ap-ico.glyph { background: var(--c); border-color: transparent; color: #fff; }
.ap-ico img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.ap-ico.big { width: 60px; height: 60px; border-radius: 16px; font-size: 30px; } .ap-ico.big img { width: 32px; height: 32px; }
.ap-meta { flex: 1; min-width: 0; } .ap-meta b { display: block; font-size: 14px; } .ap-meta small { display: block; color: var(--ui-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-tag { font-style: normal; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--ui-field); color: var(--ui-muted); margin-inline-start: 4px; }
.ap-plus { flex: none; width: 34px; height: 34px; border-radius: 99px; border: 1px solid var(--ui-line-2); background: none; color: var(--ui-text); font-size: 18px; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.ap-plus:hover { background: var(--ui-hover); transform: scale(1.06); }
.ap-plus.done { color: #34d399; border-color: color-mix(in srgb, #34d399 40%, transparent); font-size: 15px; }
.ap-plus.on { background: #3b82f6; border-color: #3b82f6; color: #fff; font-size: 15px; }
.ap-hero { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--ui-line-2); background: linear-gradient(120deg, color-mix(in srgb, #4285F4 14%, var(--ui-card)), var(--ui-card) 60%); }
.ap-hero > div:nth-child(2) { flex: 1; } .ap-hero b { display: block; font-size: 15px; } .ap-hero small { color: var(--ui-muted); font-size: 12.5px; }
.ap-hero-ico { display: flex; } .ap-hero-ico .ap-ico { width: 36px; height: 36px; border: 2px solid var(--ui-card); margin-inline-end: -8px; } .ap-hero-ico .ap-ico img { width: 18px; height: 18px; }
.ap-btn { border: 0; background: var(--ui-text); color: var(--ui-bg, #000); font: inherit; font-weight: 700; font-size: 13px; padding: 9px 18px; border-radius: 99px; cursor: pointer; } .ap-btn.ghost { background: none; color: var(--ui-text); border: 1px solid var(--ui-line-2); }
.ap-empty { grid-column: 1 / -1; border: 1.5px dashed var(--ui-line-2); background: none; color: var(--ui-muted); font: inherit; font-size: 13px; padding: 16px; border-radius: 14px; cursor: pointer; } .ap-empty:hover { color: var(--ui-text); border-color: var(--ui-muted); }
.ap-none { text-align: center; color: var(--ui-muted); padding: 40px; }
.ap-new { white-space: nowrap; }
.ap-detail { max-width: min(520px, calc(100vw - 24px)); } .ap-detail header { display: flex; justify-content: space-between; }
.apd-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; } .apd-head b { display: block; font-size: 20px; } .apd-head small { color: var(--ui-muted); }
.ap-detail h4 { margin: 16px 0 6px; font-size: 13px; color: var(--ui-muted); font-weight: 600; }
.apd-can { margin: 0; padding-inline-start: 20px; line-height: 1.9; font-size: 14px; }
.apd-ex { display: flex; flex-wrap: wrap; gap: 6px; } .apd-ex button { border: 1px solid var(--ui-line-2); background: var(--ui-field); color: var(--ui-text); font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 99px; cursor: pointer; } .apd-ex button:hover { border-color: #60a5fa; }
.apd-perm { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--ui-field); font-size: 12.5px; color: var(--ui-muted); line-height: 1.7; }
.apd-ins { font-size: 12.5px; color: var(--ui-muted); direction: ltr; text-align: left; }
.apd-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; } .ux-btn.danger { color: #f87171; }
@media (max-width: 720px) { .ap-grid { grid-template-columns: 1fr; } .ap-top h2 { font-size: 22px; } .ap-hero { flex-wrap: wrap; } .apps-page > * { padding-inline: 16px; } }
/* sidebar: upgrade row under the account, like an offer bar */
.upgrade-pill, html .upgrade-pill { position: static !important; display: flex !important; flex-direction: column; align-items: flex-start; gap: 1px; width: calc(100% - 12px); margin: 6px 6px 4px !important; padding: 9px 14px !important; border-radius: 14px !important; text-align: start; box-shadow: none; }
.upgrade-pill span { font-size: 13px; font-weight: 700; } .upgrade-pill small { font-size: 11.5px; font-weight: 500; opacity: .7; }
.upgrade-pill:not(.paid):hover { background: var(--ui-hover); }
.side-foot-wrap { display: block; }
.lab-plus { background: none !important; padding: 0 !important; font-size: 12px; }

/* upgrade row v3: compact, flat theme colours, Hythm mark + rotating perk */
.upgrade-pill, html .upgrade-pill, .upgrade-pill.paid { flex-direction: row !important; align-items: center !important; gap: 10px !important; padding: 6px 10px !important; border-radius: 12px !important; background: var(--ui-card) !important; border: 1px solid var(--ui-line-2) !important; color: var(--ui-text) !important; box-shadow: none !important; }
.upgrade-pill:hover { border-color: #60a5fa !important; }
.up-ico { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, #60a5fa 16%, transparent); }
.up-ico svg { width: 18px; height: 18px; color: #60a5fa; }
.up-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.up-txt b { font-size: 12.5px; font-weight: 700; } .up-txt b::before { content: "✦ "; color: #60a5fa; }
.up-txt small { font-size: 11px; color: #60a5fa !important; opacity: 1 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* connecting + success */
.ap-plus.busy { cursor: default; border-color: color-mix(in srgb, #60a5fa 45%, transparent); }
.ap-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, #60a5fa 30%, transparent); border-top-color: #60a5fa; animation: apSpin .8s linear infinite; display: inline-block; }
.ap-btn.busy { display: inline-flex; align-items: center; gap: 8px; cursor: default; background: var(--ui-field); color: var(--ui-text); }
@keyframes apSpin { to { transform: rotate(360deg); } }
.ap-ok { max-width: min(480px, calc(100vw - 24px)); text-align: center; }
.apo-art { position: relative; display: flex; justify-content: center; gap: 10px; padding: 26px 0 16px; }
.apo-art .ap-ico { animation: apoPop .5s cubic-bezier(.2,.9,.3,1.3) both; } .apo-art .ap-ico:nth-child(3) { animation-delay: .08s; } .apo-art .ap-ico:nth-child(4) { animation-delay: .16s; }
.apo-ring { position: absolute; inset: 8px 20%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, #60a5fa 28%, transparent), transparent); animation: apoGlow 2.4s ease-in-out infinite alternate; }
.apo-check { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; background: #22c55e; color: #fff; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--ui-card); animation: apoPop .5s .3s cubic-bezier(.2,.9,.3,1.4) both; }
.apo-title { display: block; font-size: 21px; margin-top: 4px; } .ap-ok > p { color: var(--ui-muted); margin: 4px 0 14px; }
.apo-feats { display: grid; gap: 8px; text-align: start; } .apo-f { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--ui-field); animation: hxPop .4s .2s ease both; }
.apo-f b { font-size: 14px; } .apo-f ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; color: var(--ui-muted); line-height: 1.7; }
.ap-ok h4 { text-align: start; margin: 16px 0 6px; font-size: 13px; color: var(--ui-muted); } .ap-ok .apd-foot { justify-content: center; } .ap-ok .apd-foot .ux-btn { min-width: 160px; }
@keyframes apoPop { from { transform: scale(.4); opacity: 0; } }
@keyframes apoGlow { from { opacity: .5; transform: scale(.9); } to { opacity: 1; transform: scale(1.1); } }

/* ===== app activity (under the thinking line) ===== */
.app-act { display: grid; gap: 6px; margin: 4px 0 10px; }
.aa-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: color-mix(in srgb, var(--c) 8%, var(--ui-card)); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--ui-line)); font-size: 13px; width: fit-content; max-width: 100%; animation: hxPop .3s ease both; }
.aa-ico { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; background: color-mix(in srgb, var(--c) 20%, transparent); }
.aa-ico.glyph { background: var(--c); } .aa-ico img { width: 14px; height: 14px; filter: brightness(0) invert(1); }
.aa-row.live .aa-ico { animation: aaBreath 1.2s ease-in-out infinite; }
.aa-txt { display: flex; gap: 8px; align-items: baseline; min-width: 0; } .aa-txt b { font-weight: 600; white-space: nowrap; }
.aa-txt em { font-style: normal; color: var(--ui-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; padding: 1px 8px; border-radius: 99px; background: var(--ui-field); }
.aa-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 0 var(--c); animation: aaPulse 1.2s ease-out infinite; flex: none; }
.aa-ok { color: #22c55e; font-weight: 800; } .aa-row.err { opacity: .7; } .aa-row.err b { color: #f87171; }
.aa-more { border: 0; background: none; color: var(--ui-muted); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 6px; border-radius: 6px; } .aa-more:hover { background: var(--ui-hover); color: var(--ui-text); }
.aa-cards { display: grid; gap: 8px; margin: 2px 0 6px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@keyframes aaBreath { 50% { transform: scale(.88); opacity: .7; } }
@keyframes aaPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* ===== cards ===== */
.hc { margin: 10px 0; border-radius: 16px; border: 1px solid var(--ui-line-2); background: var(--ui-card); overflow: hidden; font-size: 14px; animation: hxPop .35s ease both; max-width: 640px; }
.hc a { color: inherit; text-decoration: none; }
.hc-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 14px; }
.hc-actions a, .hc-actions button, .hc-open { border: 1px solid var(--ui-line-2); background: none; color: var(--ui-text); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 14px; border-radius: 99px; cursor: pointer; }
.hc-actions a:hover, .hc-actions button:hover, .hc-open:hover { background: var(--ui-hover); }
/* Gmail */
.hc-email { background: #fff; color: #202124; border-color: #dadce0; font-family: "Google Sans", Roboto, "Readex Pro", Arial, sans-serif; }
.hc-mail-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12.5px; color: #5f6368; border-bottom: 1px solid #f1f3f4; }
.hc-gm { width: 20px; height: 15px; background: conic-gradient(from 225deg at 50% 45%, #EA4335 0 25%, #FBBC04 0 50%, #34A853 0 75%, #4285F4 0); border-radius: 3px; clip-path: polygon(0 0, 50% 45%, 100% 0, 100% 100%, 0 100%); }
.hc-unread { font-style: normal; margin-inline-start: auto; background: #d93025; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 99px; }
.hc-subj { margin: 14px 16px 10px; font-size: 19px; font-weight: 400; line-height: 1.4; }
.hc-from { display: flex; align-items: center; gap: 10px; padding: 0 16px; } .hc-from > div { flex: 1; min-width: 0; line-height: 1.35; }
.hc-from b { font-size: 14px; } .hc-from small { color: #5f6368; font-size: 12px; } .hc-to { display: block; }
.hc-from time { color: #5f6368; font-size: 12px; white-space: nowrap; }
.hc-av { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none; }
.hc-body { padding: 14px 16px 4px; white-space: pre-wrap; line-height: 1.7; color: #3c4043; max-height: 170px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.hc-email.open .hc-body { max-height: none; -webkit-mask-image: none; mask-image: none; }
.hc-email .hc-actions a, .hc-email .hc-actions button { border-color: #dadce0; color: #1a73e8; }
.hc-email .hc-actions a:hover, .hc-email .hc-actions button:hover { background: #f1f3f4; }
.hc-email.mini .hc-subj { font-size: 15px; margin: 10px 14px 6px; } .hc-email.mini .hc-body { max-height: 70px; font-size: 13px; }
/* Drive */
.hc-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.hc-fico { width: 38px; height: 44px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%); }
.hc-fmeta { flex: 1; min-width: 0; } .hc-fmeta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hc-fmeta small { color: var(--ui-muted); font-size: 12px; }
/* GitHub */
.hc-repo { background: #0d1117; color: #e6edf3; border-color: #30363d; font-family: -apple-system, "Segoe UI", "Noto Sans", Helvetica, Arial, "Readex Pro", sans-serif; direction: ltr; text-align: left; }
.hc-repo-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; } .hc-repo-top a { color: #4493f8; font-size: 16px; } .hc-repo-top a span { font-weight: 400; }
.hc-ava { width: 24px; height: 24px; border-radius: 50%; background: #30363d; flex: none; }
.hc-pub { margin-left: auto; font-size: 11px; border: 1px solid #30363d; color: #8d96a0; padding: 0 8px; border-radius: 99px; }
.hc-desc { margin: 0; padding: 0 16px; color: #8d96a0; font-size: 13.5px; line-height: 1.6; }
.hc-stats { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px 0; color: #8d96a0; font-size: 12px; } .hc-stats i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.hc-repo .hc-actions a { border-color: #30363d; color: #e6edf3; } .hc-repo .hc-actions a:hover { background: #21262d; }
.hc-repo .hc-zip { background: #238636 !important; border-color: #238636 !important; color: #fff !important; }
/* YouTube */
.hc-video { max-width: 520px; }
.hc-thumb { position: relative; aspect-ratio: 16/9; background: #000; cursor: pointer; } .hc-thumb img, .hc-thumb iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.hc-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 44px; border-radius: 12px; background: rgba(255,0,0,.92); transition: transform .2s; }
.hc-play::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; transform: translateX(2px); }
.hc-thumb:hover .hc-play { transform: scale(1.08); }
.hc-dur { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 5px; border-radius: 4px; direction: ltr; }
.hc-vmeta { display: flex; gap: 10px; padding: 10px 12px 12px; align-items: flex-start; flex-wrap: wrap; } .hc-vmeta > div { flex: 1; min-width: 180px; }
.hc-vmeta b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.45; } .hc-vmeta small { color: var(--ui-muted); font-size: 12.5px; }
.hc-yt { flex: none; width: 28px; height: 20px; border-radius: 6px; background: #FF0000; position: relative; margin-top: 2px; } .hc-yt::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent #fff; }
.hc.mini { margin: 0; font-size: 13px; }
.hc-inline { font-weight: 600; text-decoration: none; border-bottom: 1px dashed currentColor; }
.hc-in-video::before { content: "▶ "; color: #FF0000; } .hc-in-email::before { content: "✉ "; } .hc-in-repo::before { content: "⌂ "; } .hc-in-file::before { content: "📄 "; }

/* ===== link + code chips above the box ===== */
.att-link { display: flex; align-items: center; gap: 10px; padding: 6px 30px 6px 6px; border-radius: 14px; border: 1px solid var(--ui-line-2); background: var(--ui-field); max-width: 320px; min-width: 220px; position: relative; animation: hxPop .25s ease both; }
[dir="rtl"] .att-link { padding: 6px 6px 6px 30px; }
.att-link > button { position: absolute; top: 4px; inset-inline-end: 4px; }
.al-thumb { position: relative; width: 96px; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden; background: #000; flex: none; }
.al-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-play { position: absolute; inset: 0; margin: auto; width: 26px; height: 18px; border-radius: 5px; background: rgba(255,0,0,.9); }
.al-play::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent #fff; transform: translateX(1px); }
.al-dur { position: absolute; bottom: 3px; right: 3px; background: rgba(0,0,0,.82); color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 3px; direction: ltr; }
.al-img { width: 52px; height: 52px; border-radius: 9px; overflow: hidden; flex: none; background: var(--ui-card); } .al-img img { width: 100%; height: 100%; object-fit: cover; }
.al-meta { min-width: 0; flex: 1; } .al-meta b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.35; }
.al-meta small { display: flex; align-items: center; gap: 5px; color: var(--ui-muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; }
.al-yt { width: 14px; height: 10px; border-radius: 3px; background: #FF0000; flex: none; } .al-fav { width: 13px; height: 13px; border-radius: 3px; }
.att-link.loading .al-meta b { opacity: .6; } .att-link.loading::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 8%, transparent), transparent); background-size: 200% 100%; animation: alShimmer 1.2s linear infinite; pointer-events: none; }
@keyframes alShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.att-code .att-ico { background: #1e293b; color: #7dd3fc; font-family: "JetBrains Mono", monospace; }
.att-fm { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; } .att-fm small { color: var(--ui-muted); font-size: 11px; }
.bubble-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.bubble-links a { text-decoration: none; color: inherit; } .bubble-links .att-link { padding: 6px; } .bubble-links .att-link:hover { border-color: #60a5fa; }
/* ===== Hythm Info tooltips ===== */
.hx-tip { position: fixed; z-index: 100000; pointer-events: none; display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 7px 11px; border-radius: 10px; background: #111; color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.35); opacity: 0; transform: translateY(3px) scale(.98); transition: opacity .14s ease, transform .14s ease; }
:root[data-theme="light"] .hx-tip { background: #1f1f1f; }
.hx-tip.on { opacity: 1; transform: none; }
.hx-tip::before { content: ""; position: absolute; left: var(--ax, 50%); width: 8px; height: 8px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.hx-tip[data-side="below"]::before { top: -4px; } .hx-tip[data-side="above"]::before { bottom: -4px; }
.hx-kbd { display: inline-flex; gap: 3px; flex: none; direction: ltr; }
.hx-kbd kbd { font: inherit; font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.14); color: #e5e7eb; }

.hc-page { display: flex; max-width: 620px; } .hc-pimg { width: 150px; flex: none; background: var(--ui-field); } .hc-pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hc-pmeta { padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; } .hc-pmeta small { display: flex; align-items: center; gap: 6px; color: var(--ui-muted); font-size: 12px; } .hc-pfav { width: 14px; height: 14px; border-radius: 3px; }
.hc-pmeta b { font-size: 14.5px; line-height: 1.45; } .hc-pmeta p { margin: 0; color: var(--ui-muted); font-size: 12.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .hc-pmeta .hc-open { margin-top: 4px; }
@media (max-width: 560px) { .hc-page { flex-direction: column; } .hc-pimg { width: 100%; aspect-ratio: 1.91; } }
/* English words inside the fixed (RTL) layout: each line reads in its own direction */
/* chat content (may be Arabic or English): each paragraph picks its own direction */
html.lang-en :is(.notes p, .notes li, .notes h1, .notes h2, .notes h3, .notes h4, .notes td, .notes th, .bubble, .thinking-body) { unicode-bidi: plaintext; }
/* interface labels in English: read left-to-right but stay beside their icon in the fixed layout */
html.lang-en :is(.menu, .user-menu, .plus-menu, .chat-pop, .side-foot-wrap, .sidebar .nav-item, .sidebar button:not(.project-open)) > :is(span, b, small):not(:has(*)) { direction: ltr; unicode-bidi: isolate; text-align: right; }
html.lang-en .sidebar input { text-align: right; }
html.lang-en .project-open :is(b, small) { unicode-bidi: plaintext; text-align: right; }
html.lang-en .up-txt :is(b, small) { direction: ltr; unicode-bidi: isolate; text-align: right; }
html.lang-en :is(.sidebar, .menu, .user-menu, .plus-menu, .chat-pop) .menu-row > span:not(.mr-ico) { text-align: right; }
/* menu rows: the icon never stretches; long labels stay inside the menu */
html[data-ui="v2"] .menu-row .mr-ico { flex: none !important; width: 18px; display: grid; place-items: center; }
html[data-ui="v2"] .menu-row > span:not(.mr-ico) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#offerSide { display: none !important; }
html[data-ui="v2"] .user-menu { max-width: calc(100% - 4px); }
html.lang-en .sidebar input::placeholder { direction: ltr; }
html.lang-en .sidebar input:placeholder-shown { direction: ltr; text-align: right; }
html.lang-en textarea:placeholder-shown { direction: ltr; text-align: right; }
textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Checkout v2 (order summary + payment) ===== */
dialog.co2-sheet { padding: 0 !important; border: 0 !important; background: transparent !important; max-width: min(980px, calc(100vw - 24px)) !important; width: 100%; }
.co2 { display: grid; grid-template-columns: 1fr 1fr; border-radius: 20px; overflow: hidden; background: var(--ui-card); color: var(--ui-text); box-shadow: 0 30px 80px rgba(0,0,0,.45); min-height: 560px; }
.co2-order { padding: 26px 30px; background: color-mix(in srgb, var(--ui-field) 70%, var(--ui-card)); border-inline-end: 1px solid var(--ui-line); display: flex; flex-direction: column; gap: 16px; }
.co2-pay { padding: 26px 30px; display: flex; flex-direction: column; gap: 14px; }
.co2-brand { display: flex; align-items: center; gap: 10px; } .co2-brand b { font-size: 15px; }
.co2-back { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); cursor: pointer; font-size: 15px; }
[dir="rtl"] .co2-back { transform: scaleX(-1); }
.co2-logo, .co2-li-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #0b0d16; flex: none; } .co2-logo svg, .co2-li-ico svg { width: 18px; height: 18px; }
.co2-plan small { color: var(--ui-muted); font-size: 13.5px; }
.co2-amount { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; } .co2-amount strong { font-size: 36px; font-weight: 800; letter-spacing: -.02em; direction: ltr; } .co2-amount span { color: var(--ui-muted); font-size: 13px; }
.co2-cycle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.co2-cycle button { text-align: start; border: 1.5px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s; }
.co2-cycle button b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; } .co2-cycle button small { color: var(--ui-muted); font-size: 12px; direction: ltr; display: inline-block; }
.co2-cycle button.on { border-color: #3b82f6; box-shadow: 0 0 0 3px color-mix(in srgb, #3b82f6 22%, transparent); }
.co2-save { font-style: normal; font-size: 10.5px; font-weight: 700; color: #16a34a; background: color-mix(in srgb, #22c55e 16%, transparent); padding: 1px 7px; border-radius: 99px; }
.co2-lines { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.co2-line { display: flex; align-items: center; gap: 12px; } .co2-line > div { flex: 1; } .co2-line b { display: block; } .co2-line small { color: var(--ui-muted); font-size: 12px; }
.co2-line strong, .co2-row span:last-child { direction: ltr; font-variant-numeric: tabular-nums; }
.co2-perks { margin: 0 0 4px; padding-inline-start: 40px; color: var(--ui-muted); font-size: 12.5px; line-height: 1.8; list-style: none; } .co2-perks li::before { content: "✓ "; color: #22c55e; }
.co2-row { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--ui-line); }
.co2-total { font-weight: 800; font-size: 15px; }
.co2-muted { color: var(--ui-muted); font-size: 12.5px; direction: inherit !important; }
.co2-promo { display: flex; flex-direction: column; gap: 6px; }
.co2-promo-btn { align-self: flex-start; border: 0; background: var(--ui-card); color: #3b82f6; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.co2-promo .co-code { display: flex; gap: 6px; } .co2-promo .co-code[hidden] { display: none; }
.co2-promo input { flex: 1; height: 38px; border-radius: 9px; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); padding: 0 12px; font: inherit; font-size: 13px; letter-spacing: .05em; direction: ltr; text-transform: uppercase; }
.co2-promo .co-code button { border: 0; border-radius: 9px; padding: 0 16px; background: var(--ui-text); color: var(--ui-card); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.co2-fine { margin: auto 0 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.6; }
.co2-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 10%, var(--ui-card)); border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent); }
.co2-banner b { display: block; font-size: 13px; } .co2-banner small { color: var(--ui-muted); font-size: 12px; }
.co2-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px color-mix(in srgb, #f59e0b 20%, transparent); }
.co2-express { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.co2-x { height: 44px; border-radius: 10px; border: 0; display: flex; align-items: center; justify-content: center; gap: 4px; font: 600 15px/1 -apple-system, "Segoe UI", sans-serif; cursor: not-allowed; opacity: .55; direction: ltr; }
.co2-x.apple, .co2-x.google { background: #000; color: #fff; } .co2-x.paypal { background: #FFC439; } .co2-x.paypal i { font-style: italic; font-weight: 800; color: #003087; } .co2-x.paypal i + i { color: #009cde; }
.co2-div { display: flex; align-items: center; gap: 10px; color: var(--ui-muted); font-size: 12px; } .co2-div::before, .co2-div::after { content: ""; flex: 1; height: 1px; background: var(--ui-line); }
.co2-form { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; opacity: .6; pointer-events: none; }
.co2-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ui-muted); }
.co2-form input, .co2-form select { height: 42px; border-radius: 10px; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); padding: 0 12px; font: inherit; font-size: 14px; direction: ltr; }
.co2-card { border: 1px solid var(--ui-line-2); border-radius: 10px; overflow: hidden; background: var(--ui-card); }
.co2-card input { border: 0 !important; border-radius: 0 !important; width: 100%; }
.co2-cn { display: flex; align-items: center; border-bottom: 1px solid var(--ui-line-2); direction: ltr; } .co2-cn input { flex: 1; }
.co2-brands { display: flex; gap: 4px; padding: 0 10px; flex: none; }
.co2-brands i { font-style: normal; font-size: 8.5px; font-weight: 900; height: 18px; min-width: 28px; border-radius: 3px; display: grid; place-items: center; }
.co2-brands .visa { background: #1a1f71; color: #fff; letter-spacing: .04em; } .co2-brands .amex { background: #2e77bc; color: #fff; }
.co2-brands .mc { background: #252525; position: relative; } .co2-brands .mc b { position: absolute; width: 11px; height: 11px; border-radius: 50%; top: 3.5px; } .co2-brands .mc b:first-child { background: #eb001b; left: 6px; } .co2-brands .mc b:last-child { background: #f79e1b; right: 6px; opacity: .9; }
.co2-exp { display: grid; grid-template-columns: 1fr 1fr; direction: ltr; } .co2-exp input + input { border-left: 1px solid var(--ui-line-2) !important; }
.co2-paybtn { height: 48px; border: 0; border-radius: 12px; background: #3b82f6; color: #fff; font: inherit; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; opacity: .55; cursor: not-allowed; }
.co2-paybtn .co2-sub { direction: ltr; }
.co2-legal { margin: 0; text-align: center; color: var(--ui-muted); font-size: 11.5px; } .co2-legal a { color: inherit; }
.co2-trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; color: var(--ui-muted); font-size: 11.5px; margin-top: auto; }
.co2 .co-msg.ok { color: #16a34a; } .co2 .co-msg.err { color: #dc2626; }
@media (max-width: 760px) { .co2 { grid-template-columns: 1fr; max-height: calc(100vh - 24px); overflow-y: auto; } .co2-order, .co2-pay { padding: 20px 18px; } .co2-order { border-inline-end: 0; border-bottom: 1px solid var(--ui-line); } .co2-amount strong { font-size: 30px; } }
html.lang-en .co2 :is(p, small, b, li, label, .co2-banner div, .co2-paybtn, .co2-promo-btn, .co2-legal, .co2-fine) { unicode-bidi: plaintext; }
html.lang-en .co2-paybtn { direction: ltr; }

/* ===== teaser player, what's new, policy links, pinned chats ===== */
dialog.tz-sheet { padding: 0 !important; border: 0 !important; background: transparent !important; width: min(1120px, calc(100vw - 24px)); max-width: none !important; }
.tz-wrap { background: var(--ui-card); border: 1px solid var(--ui-line-2); border-radius: 20px; overflow: hidden; box-shadow: 0 40px 120px rgba(0,0,0,.5); }
.tz-wrap header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; } .tz-wrap header b { font-size: 15px; } .tz-wrap header small { color: var(--ui-muted); font-size: 12.5px; margin-inline-end: auto; }
.tz-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ui-line-2); background: none; color: var(--ui-text); cursor: pointer; font-size: 15px; }
.tz-frame { position: relative; aspect-ratio: 16/9; background: #e9ecf5; } .tz-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tz-wrap footer { display: flex; gap: 18px; padding: 10px 16px; font-size: 13px; } .tz-wrap footer a { color: var(--ui-muted); text-decoration: none; } .tz-wrap footer a:hover { color: var(--ui-text); }
.tz-chip { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ui-line-2); background: var(--ui-card); color: var(--ui-text); font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 16px; border-radius: 99px; cursor: pointer; transition: border-color .15s, transform .15s; }
.tz-chip:hover { border-color: #60a5fa; transform: translateY(-1px); } .tz-chip small { color: var(--ui-muted); font-weight: 500; }
.tz-dot { width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; position: relative; flex: none; } .tz-dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent #fff; transform: translateX(1px); }
.wn-wrap { max-width: min(520px, calc(100vw - 24px)); }
.wn-video { display: flex; gap: 14px; align-items: center; width: 100%; text-align: start; border: 0; cursor: pointer; font: inherit; color: #fff; padding: 16px; border-radius: 16px; margin: 6px 0 12px; background: linear-gradient(120deg, #1e2a78, #3b5bff 60%, #7c3aed); }
.wn-video b { display: block; font-size: 15.5px; } .wn-video small { opacity: .8; font-size: 12.5px; }
.wn-play { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #fff; position: relative; } .wn-play::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #1e2a78; transform: translateX(2px); }
.wn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.wn-list li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 6px; border-radius: 12px; animation: hxPop .35s calc(var(--i) * 50ms) ease both; } .wn-list li > span { font-size: 20px; width: 28px; text-align: center; flex: none; }
.wn-list b { display: block; font-size: 14.5px; } .wn-list small { color: var(--ui-muted); font-size: 12.5px; line-height: 1.6; }
.side-links { display: flex; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--ui-muted); padding: 2px 8px 6px; } .side-links a { color: inherit; text-decoration: none; } .side-links a:hover { color: var(--ui-text); text-decoration: underline; }
.project.pinned .project-open b { font-weight: 700; } .pin-ico { font-style: normal; font-size: 11px; margin-inline-end: 5px; }

/* ---------- NanoSpark Forge: the image loader (aurora + forming pixels + the winged mark + live stages) ---------- */
.img-dream.forge { position: absolute !important; inset: 0 !important; display: block !important; padding: 0 !important; overflow: hidden;
  background: var(--ui-card, #0b0e1c) !important; color: var(--ui-text, #eef1ff); isolation: isolate; }
.img-dream.forge::before { display: none !important; }
.forge .fg-aurora { position: absolute; inset: -35%; filter: blur(38px); opacity: .75; z-index: 0;
  background: radial-gradient(30% 32% at 30% 35%, #6f8cff, transparent 70%), radial-gradient(28% 30% at 70% 60%, #c58bff, transparent 70%), radial-gradient(26% 26% at 45% 80%, #57d4ff, transparent 70%);
  animation: fgAurora 9s ease-in-out infinite alternate; }
html[data-theme="light"] .forge .fg-aurora { opacity: .42; }
@keyframes fgAurora { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(40deg) scale(1.12); } 100% { transform: rotate(-25deg) scale(.95); } }
.forge .fg-tiles { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 1fr; gap: 2px; padding: 2px; }
.forge .fg-tiles i { border-radius: 3px; background: color-mix(in srgb, var(--ui-text, #fff) 7%, transparent); opacity: 0; animation: fgTile 3.2s ease-in-out infinite; }
@keyframes fgTile { 0%, 100% { opacity: 0; transform: scale(.6); } 45% { opacity: 1; transform: scale(1); } 70% { opacity: .35; } }
.forge .fg-veil { position: absolute; inset: 0; z-index: 2; background: color-mix(in srgb, var(--ui-card, #0b0e1c) 35%, transparent); backdrop-filter: blur(1px); }
.forge .fg-core { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; }
.forge .fg-mark { position: relative; width: clamp(96px, 46%, 190px); aspect-ratio: 16/9; animation: fgFloat 3s ease-in-out infinite; }
.forge .fg-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(111,140,255,.65)); }
html[data-theme="light"] .forge .fg-mark img { filter: invert(1) drop-shadow(0 4px 14px rgba(111,140,255,.45)); }
@keyframes fgFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.forge .fg-mark s { position: absolute; right: -6%; top: 40%; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #b9c6ff; opacity: 0; text-decoration: none; animation: fgSpark 1.8s linear infinite; }
html[data-theme="light"] .forge .fg-mark s { background: #3b5bff; box-shadow: 0 0 6px #7c8cff; }
.forge .fg-mark s:nth-child(3) { animation-delay: .45s; top: 30%; } .forge .fg-mark s:nth-child(4) { animation-delay: .9s; top: 55%; } .forge .fg-mark s:nth-child(5) { animation-delay: 1.35s; top: 45%; width: 4px; height: 4px; }
@keyframes fgSpark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(46px, -10px) scale(1.1); } }
.forge .fg-stage { font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,.35); font-weight: 700; letter-spacing: -.01em; min-height: 1.4em; animation: fgStage .5s ease both; }
@keyframes fgStage { from { opacity: .2; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.forge .dream-msg { position: static !important; margin: 0 !important; font-size: 12px !important; opacity: .8; padding: 4px 11px !important; }
.forge .dream-msg::before { display: none !important; }
.forge .fg-foot { position: absolute; inset: auto 14px 12px 14px; z-index: 3; display: flex; align-items: center; gap: 10px; font: 600 11px/1 ui-monospace, "JetBrains Mono", monospace; opacity: .85; }
.forge .fg-foot .fg-bar { flex: 1; height: 4px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--ui-text, #fff) 12%, transparent); }
.forge .fg-foot .fg-bar b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6f8cff, #c58bff, #ff8fc8); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.forge .fg-foot .fg-brand { letter-spacing: .08em; }
@media (prefers-reduced-motion: reduce) { .forge *, .forge .fg-tiles i { animation: none !important; } .forge .fg-tiles i { opacity: .3; } }

/* ---------- Explore rework: hero filters, sizes, templates, meetings, motion studio, apps ---------- */
.hx-hero2 { text-align: center; align-items: center; padding: 34px 20px 26px !important; }
.hx-hero2 h2 { font-size: clamp(28px, 4.4vw, 44px) !important; letter-spacing: -.035em; margin: 8px 0 !important; }
.hx-hero2 h2 span { color: var(--ui-muted); }
.hx-hero2 > p { max-width: 640px; margin: 0 auto 16px !important; color: var(--ui-muted); }
.hx-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px auto 18px; }
.hx-filter button { border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.hx-filter button:hover { transform: translateY(-1px); }
.hx-filter button.on { background: var(--ui-text); color: var(--ui-bg); border-color: transparent; }
.hx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 560px; margin: 0 auto; }
.hx-stats div { padding: 10px 6px; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-card); }
.hx-stats b { display: block; font-size: 22px; letter-spacing: -.02em; } .hx-stats span { font-size: 12px; color: var(--ui-muted); }
.m-code { background: var(--ui-field) !important; } .m-spark { background: #0b0d16 !important; } .m-spark img { width: 80%; height: 80%; object-fit: contain; }
html[data-theme="light"] .m-spark { background: var(--ui-field) !important; } html[data-theme="light"] .m-spark img { filter: invert(1); }
.hx-sizes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; }
.hx-size { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-card); color: var(--ui-text); font: inherit; cursor: pointer; transition: transform .2s, border-color .2s; }
.hx-size:hover { transform: translateY(-3px); border-color: var(--ui-text); }
.hx-size i { display: grid; place-items: center; width: 100%; max-height: 110px; max-width: 110px; border-radius: 8px; background: linear-gradient(135deg, color-mix(in srgb, #6f8cff 35%, var(--ui-field)), color-mix(in srgb, #c58bff 30%, var(--ui-field))); font-style: normal; }
.hx-size i span { font: 700 12px ui-monospace, monospace; color: var(--ui-text); opacity: .85; }
.hx-size b { font-size: 13px; } .hx-size small { font-size: 11px; color: var(--ui-muted); font-family: ui-monospace, monospace; direction: ltr; unicode-bidi: isolate; }
.hx-size i span { direction: ltr; unicode-bidi: isolate; }
.hx-tpls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hx-tpl { text-align: start; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-card); color: var(--ui-text); font: inherit; cursor: pointer; transition: transform .2s, border-color .2s; }
.hx-tpl:hover { transform: translateY(-2px); border-color: var(--ui-text); }
.hx-tpl span { font-size: 22px; } .hx-tpl b { font-size: 14px; } .hx-tpl small { font-size: 12px; color: var(--ui-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hx-meet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.hx-studio { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: center; }
.hx-studio iframe { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--ui-line); border-radius: 16px; background: #0b0d16; }
.hx-studio-copy { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hx-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.hx-app { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-card); }
.hx-app span { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.hx-app b { font-size: 13.5px; display: block; } .hx-app small { font-size: 11.5px; color: var(--ui-muted); }
.hx-app div { min-width: 0; }
[data-cat][hidden], .hxs[hidden] { display: none !important; }
@media (max-width: 760px) {
  .hx-sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hx-tpls, .hx-apps { grid-template-columns: 1fr 1fr; }
  .hx-meet { grid-template-columns: 1fr 1fr; } .hx-studio { grid-template-columns: 1fr; } .hx-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- two pictures, you pick / two answers, you pick ---------- */
.img-pair, .ans-pair { width: 100%; }
.img-pair-head, .ans-pair-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.img-pair-head b, .ans-pair-head b { font-size: 15px; } .img-pair-head span, .ans-pair-head span { font-size: 12.5px; color: var(--ui-muted); }
.img-pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-pair-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.img-pair-col .img-frame-gen { width: 100% !important; max-width: none !important; }
.img-pair-col .img-card, .img-pair-col > * { max-width: 100%; }
.img-pick, .ans-pick { border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.img-pick:hover, .ans-pick:hover { background: var(--ui-text); color: var(--ui-bg); transform: translateY(-1px); }
.ans-pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans-pair-col { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--ui-line); border-radius: 18px; background: var(--ui-card); min-width: 0; max-height: 520px; overflow: auto; }
.ans-pair-col .ans-pair-tag { font: 700 11px ui-monospace, monospace; letter-spacing: .08em; color: var(--ui-muted); }
.ans-pair-col .ans-pick { position: sticky; bottom: 0; align-self: stretch; }
@media (max-width: 760px) { .img-pair-row, .ans-pair-row { grid-template-columns: 1fr; } }
.ans-alt-note { margin-top: 8px; font-size: 12.5px; color: var(--ui-muted); display: inline-flex; gap: 6px; align-items: center; animation: dotPulse 1.4s ease-in-out infinite; }
.set-opts.set-wrap { flex-wrap: wrap; row-gap: 6px; }

/* local transfer (CliQ / Zain Cash / Orange Money) */
.co2-local { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--ui-line, #e3e6ef); border-radius: 16px; margin-bottom: 14px; background: color-mix(in srgb, var(--ui-field, #f1f3f8) 60%, transparent); }
.co2-local-t { font-size: 15px; }
.co2-local-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.co2-local-tabs button { border: 1px solid var(--ui-line, #e3e6ef); background: var(--ui-card, #fff); color: inherit; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.co2-local-tabs button.on { background: var(--ui-text, #0f1222); color: var(--ui-bg, #fff); border-color: transparent; }
.co2-local-box { display: flex; flex-direction: column; gap: 4px; } .co2-local-box small { color: var(--ui-muted, #6b7280); }
.co2-local-to { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .co2-local-to b { font: 700 17px ui-monospace, monospace; }
.co2-local-to button { border: 1px solid var(--ui-line, #e3e6ef); background: transparent; color: inherit; border-radius: 8px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.co2-local-amt { font-weight: 700; color: var(--ui-text, #0f1222) !important; }
.co2-local-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.co2-local-form input { min-width: 0; border: 1px solid var(--ui-line, #e3e6ef); background: var(--ui-card, #fff); color: inherit; border-radius: 10px; padding: 9px 11px; font: inherit; }
.co2-local-form button { border: 0; background: var(--ui-text, #0f1222); color: var(--ui-bg, #fff); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.co2-local-msg.ok { color: #16a34a; } .co2-local-msg.err { color: #dc2626; }
@media (max-width: 560px) { .co2-local-form { grid-template-columns: 1fr; } }
/* [[image: …]] in an answer → a "draw it" button */
.img-marker { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; margin: 8px 0; padding: 12px 14px; border: 1px dashed var(--ui-line); border-radius: 14px; background: var(--ui-field); color: var(--ui-text); font: inherit; text-align: start; cursor: pointer; }
.img-marker b { font-size: 14px; } .img-marker small { color: var(--ui-muted); font-size: 12px; direction: ltr; unicode-bidi: isolate; }
.img-marker:hover { border-style: solid; } .img-marker:disabled { opacity: .55; cursor: default; }
.img-edit { display: flex; gap: 6px; margin-top: 8px; } .img-edit input { flex: 1; min-width: 0; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 10px; padding: 8px 11px; font: inherit; }

/* ---------- Usage ring (replaces credits): grey track, blue = what is left; it shrinks as you use it ---------- */
.send-cost, #creditPill { display: none !important; }
.usage-ring { flex: none; width: 34px; height: 34px; padding: 0; margin-inline-end: 4px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.usage-ring svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.usage-ring .ur-track { fill: none; stroke: color-mix(in srgb, var(--ui-muted, #8a8f9e) 45%, transparent); stroke-width: 4; }
.usage-ring .ur-fill { fill: none; stroke: #3b82f6; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dasharray .8s cubic-bezier(.2,.7,.2,1), stroke .3s; }
.usage-ring.low .ur-fill { stroke: #60a5fa; }
.usage-ring.empty .ur-track { stroke: color-mix(in srgb, #ef4444 45%, transparent); }
.usage-ring:hover { background: color-mix(in srgb, var(--ui-text, #fff) 7%, transparent); }
.usage-ring.tick svg { animation: urTick .5s ease; }
@keyframes urTick { 40% { transform: rotate(-90deg) scale(.86); } }
.usage-pop { position: fixed; z-index: 1000; width: 300px; padding: 14px; border-radius: 16px; border: 1px solid var(--ui-line); background: var(--ui-card); color: var(--ui-text); box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); font-size: 13.5px; }
.usage-pop[hidden] { display: none; }
.usage-pop .up-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; } .usage-pop .up-head b { font-size: 15px; } .usage-pop .up-head span { color: var(--ui-muted); font-size: 12px; }
.usage-pop .up-bar { height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--ui-muted) 30%, transparent); overflow: hidden; } .usage-pop .up-bar i { display: block; height: 100%; background: #3b82f6; border-radius: inherit; }
.usage-pop .up-bar.thin { height: 5px; flex: 1; }
.usage-pop .up-row { display: flex; justify-content: space-between; margin: 8px 0 12px; color: var(--ui-muted); } .usage-pop .up-row b { color: var(--ui-text); }
.usage-pop .up-sub { display: flex; align-items: center; gap: 8px; color: var(--ui-muted); font-size: 12.5px; }
.usage-pop .up-warn { margin: 8px 0 0; color: #f59e0b; font-size: 12.5px; }
.usage-pop .up-note { margin: 10px 0; color: var(--ui-muted); font-size: 12px; line-height: 1.6; }
.usage-pop .up-foot { display: flex; gap: 6px; } .usage-pop .up-foot button { flex: 1; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 10px; padding: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.usage-pop .up-foot button.pri { background: #3b82f6; color: #fff; border-color: transparent; }
.img-sizes button { display: inline-flex; align-items: center; gap: 6px; }
.img-sizes .ar-ico { display: inline-block; height: 14px; max-width: 30px; border: 1.6px solid currentColor; border-radius: 3px; opacity: .8; }
.img-sizes button.on .ar-ico { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }

/* ---------- Explore: "Bye bye credits" ---------- */
.xp-tab-new { position: relative; }
.bye-ring { position: relative; width: 140px; height: 140px; margin: 10px auto 4px; display: grid; place-items: center; }
.bye-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.bye-ring .ur-track { fill: none; stroke: color-mix(in srgb, var(--ui-muted) 40%, transparent); stroke-width: 3.2; }
.bye-ring .ur-fill { fill: none; stroke: #3b82f6; stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 73 100; animation: byeRing 6s ease-in-out infinite; }
@keyframes byeRing { 0% { stroke-dasharray: 100 100; } 60% { stroke-dasharray: 38 100; } 100% { stroke-dasharray: 100 100; } }
.bye-ring b { font-size: 26px; line-height: 1; margin-top: 18px; } .bye-ring small { color: var(--ui-muted); margin-top: -26px; }
.bye-hint, .bye-small { color: var(--ui-muted); font-size: 13.5px; text-align: center; }
.bye-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bye-col { padding: 16px; border-radius: 18px; border: 1px solid var(--ui-line); background: var(--ui-card); }
.bye-col b { font-size: 16px; } .bye-col ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--ui-muted); font-size: 14px; line-height: 1.8; }
.bye-col.old { opacity: .75; } .bye-col.old b { text-decoration: line-through; text-decoration-thickness: 2px; }
.bye-col.new { border-color: #3b82f6; box-shadow: 0 0 0 3px color-mix(in srgb, #3b82f6 18%, transparent); }
.bye-ctx { margin-top: 0; }
@media (max-width: 700px) { .bye-vs { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bye-ring .ur-fill { animation: none; } }

/* ---------- wide screens: the chat uses the space (was locked to 768px, leaving empty sides) ---------- */
@media (min-width: 1100px) {
  html[data-ui="v2"] .app.no-design .messages,
  html[data-ui="v2"] .app.no-design .composer,
  html[data-ui="v2"] .home-actions,
  html[data-ui="v2"] .images-page { max-width: clamp(768px, 76vw, 1400px) !important; }
  html[data-ui="v2"] .app.no-design .messages { padding-inline: 32px; }
  /* long text stays comfortable to read; pictures, tables, code and choices take the full width */
  html[data-ui="v2"] .msg-user .bubble, html[data-ui="v2"] .msg-user > div:not(.msg-edit) { max-width: min(70%, 900px); }
  html[data-ui="v2"] .img-frame-gen { width: min(100%, 620px); max-width: 620px !important; }
  html[data-ui="v2"] .img-pair-col .img-frame-gen { width: 100% !important; max-width: none !important; }
}
@media (min-width: 1600px) { html[data-ui="v2"] .img-frame-gen { width: min(100%, 760px); max-width: 760px !important; } }

/* ================= image options v3 (clean): style strip + one row of dropdowns ================= */
html[data-ui="v2"] #imgOpts.img-opts:not([hidden]) { display: flex !important; flex-direction: column !important; flex-wrap: nowrap !important; align-items: stretch !important; gap: 10px !important;
  padding: 10px 12px !important; margin: 0 0 8px !important; border: 1px solid var(--ui-line); border-radius: 18px; background: var(--ui-card); justify-content: flex-start !important; }
html[data-ui="v2"] #imgOpts .engine-chip { display: none !important; }
/* styles: one scrolling strip, round previews, a soft fade at the edges */
html[data-ui="v2"] #imgOpts .img-style-strip { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; overflow-x: auto; width: 100% !important; padding: 2px !important; margin: 0 !important; grid-template-columns: none !important;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); scrollbar-width: none; }
html[data-ui="v2"] #imgOpts .img-style-strip::-webkit-scrollbar { display: none; }
html[data-ui="v2"] #imgOpts .img-style-strip button { flex: none !important; display: inline-flex !important; flex-direction: row !important; align-items: center !important; gap: 7px !important; height: 36px !important;
  padding: 0 12px 0 4px !important; border-radius: 999px !important; border: 1px solid var(--ui-line) !important; background: var(--ui-field) !important; color: var(--ui-text) !important; font-size: 13px !important; font-weight: 600; white-space: nowrap; }
html[data-ui="v2"] #imgOpts .img-style-strip button .sty-prev { width: 28px !important; height: 28px !important; border-radius: 50% !important; object-fit: cover; aspect-ratio: 1 !important; flex: none; }
html[data-ui="v2"] #imgOpts .img-style-strip button:hover { background: var(--ui-hover) !important; }
html[data-ui="v2"] #imgOpts .img-style-strip button.on { background: var(--ui-text) !important; color: var(--ui-bg) !important; border-color: transparent !important; }
/* the dropdown row */
html[data-ui="v2"] #imgOpts .img-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
html[data-ui="v2"] #imgOpts .img-bar-sp { flex: 1; }
html[data-ui="v2"] #imgOpts .img-dd { position: relative; }
html[data-ui="v2"] #imgOpts .img-dd-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s; }
html[data-ui="v2"] #imgOpts .img-dd-btn:hover, html[data-ui="v2"] #imgOpts .img-dd-btn[aria-expanded="true"] { background: var(--ui-hover); border-color: color-mix(in srgb, var(--ui-text) 25%, transparent); }
html[data-ui="v2"] #imgOpts .img-dd-ico { opacity: .7; } html[data-ui="v2"] #imgOpts .img-dd-lbl { color: var(--ui-muted); }
html[data-ui="v2"] #imgOpts .img-dd-val { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
html[data-ui="v2"] #imgOpts .img-dd-val .ar-ico { height: 12px; border: 1.5px solid currentColor; border-radius: 2px; display: inline-block; max-width: 26px; }
html[data-ui="v2"] #imgOpts .img-dd-car { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
html[data-ui="v2"] #imgOpts .img-dd-btn[aria-expanded="true"] .img-dd-car { transform: rotate(180deg); }
html[data-ui="v2"] #imgOpts .img-dd-menu { position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 60; min-width: 230px; padding: 6px; border-radius: 14px; border: 1px solid var(--ui-line); background: var(--ui-card); box-shadow: 0 20px 50px -18px rgba(0,0,0,.5); }
html[data-ui="v2"] #imgOpts .img-dd-menu[hidden] { display: none !important; }
html[data-ui="v2"] #imgOpts .img-dd-menu .img-row { display: flex !important; flex-direction: column !important; gap: 2px !important; margin: 0 !important; width: auto !important; }
html[data-ui="v2"] #imgOpts .img-dd-menu .img-row button { display: flex !important; align-items: center; gap: 9px; justify-content: flex-start !important; width: 100%; height: auto !important; padding: 9px 11px !important; border: 0 !important; border-radius: 9px !important; background: transparent !important; color: var(--ui-text) !important; font-size: 13.5px !important; text-align: start; }
html[data-ui="v2"] #imgOpts .img-dd-menu .img-row button:hover { background: var(--ui-hover) !important; }
html[data-ui="v2"] #imgOpts .img-dd-menu .img-row button.on { background: color-mix(in srgb, #3b82f6 16%, transparent) !important; color: var(--ui-text) !important; font-weight: 700; }
html[data-ui="v2"] #imgOpts .img-dd-menu .img-row button[title]::after { content: attr(title); margin-inline-start: auto; font-size: 11.5px; font-weight: 400; color: var(--ui-muted); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the size menu is a small grid of shapes */
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-dd-menu { min-width: 290px; }
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-row { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 4px !important; }
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-row button { flex-direction: column !important; justify-content: flex-end !important; gap: 6px !important; padding: 10px 6px 8px !important; min-height: 64px; }
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-row button[title]::after { display: none; }
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-row button .ar-ico { height: 22px; max-width: 44px; }
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-row button[data-v="auto"] { grid-column: 1 / -1; min-height: 40px; flex-direction: row !important; justify-content: center !important; }
html[data-ui="v2"] #imgOpts .img-dd[data-dd="size"] .img-row button[data-v="auto"] span::after { content: "  " var(--auto-lbl, "تلقائي من كلامك"); font-weight: 600; }
html[data-ui="v2"] #imgOpts .img-surprise { height: 36px; margin: 0 !important; padding: 0 14px !important; border-radius: 12px !important; border: 1px dashed var(--ui-line) !important; background: transparent !important; color: var(--ui-text) !important; font-size: 13px !important; }
html[data-ui="v2"] #imgOpts .img-surprise:hover { border-style: solid !important; }
@media (max-width: 640px) { html[data-ui="v2"] #imgOpts .img-dd-lbl { display: none; } html[data-ui="v2"] #imgOpts .img-dd-menu { position: fixed; inset: auto 12px 90px 12px; min-width: 0; } }

/* send button doubles as Hythm Live when the box is empty */
html[data-ui="v2"] #voiceBtn { display: none !important; }
.send-btn .i-live { display: none; width: 20px; height: 20px; }
.send-btn.is-live .i-send { display: none; }
.send-btn.is-live .i-live { display: block; }
.send-btn.is-live { background: var(--ui-text) !important; color: var(--ui-bg) !important; opacity: 1 !important; cursor: pointer !important; }
.send-btn.is-live .i-live path { animation: liveWave 1.6s ease-in-out infinite; transform-origin: center; }
@keyframes liveWave { 50% { opacity: .55; } }

/* ---------- Settings → Usage ---------- */
.no-usage-meta .usage-chip { display: none !important; }
.set-usage { display: flex; flex-direction: column; gap: 12px; }
.su-top { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--ui-line); border-radius: 18px; background: var(--ui-card); }
.su-ring { position: relative; width: 110px; height: 110px; flex: none; display: grid; place-items: center; }
.su-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.su-ring .ur-track { fill: none; stroke: color-mix(in srgb, var(--ui-muted) 40%, transparent); stroke-width: 3.4; }
.su-ring .ur-fill { fill: none; stroke: #3b82f6; stroke-width: 3.4; stroke-linecap: round; transition: stroke-dasharray .8s; }
.su-ring b { font-size: 22px; margin-top: 14px; line-height: 1; } .su-ring small { color: var(--ui-muted); margin-top: -22px; font-size: 11.5px; }
.su-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .su-info b { font-size: 16px; } .su-info p { margin: 0; color: var(--ui-muted); font-size: 13.5px; } .su-info strong { color: var(--ui-text); }
.su-btn { align-self: flex-start; margin-top: 6px; border: 1px solid var(--ui-line); background: var(--ui-field); color: var(--ui-text); border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.su-btn.pri { background: #3b82f6; color: #fff; border-color: transparent; }
.su-card { padding: 14px 16px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-card); display: flex; flex-direction: column; gap: 6px; }
.su-card small { color: var(--ui-muted); font-size: 12.5px; }
.su-h { font-size: 14px; margin-bottom: 4px; }
.su-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.su-bar { height: 8px; border-radius: 8px; background: color-mix(in srgb, var(--ui-muted) 28%, transparent); overflow: hidden; } .su-bar.thin { height: 5px; margin-bottom: 4px; }
.su-bar i { display: block; height: 100%; border-radius: inherit; background: #3b82f6; }
.su-list { display: flex; flex-direction: column; } .su-list > div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--ui-line); font-size: 13px; }
.su-list > div:last-child { border-bottom: 0; } .su-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .su-list em { font-style: normal; color: var(--ui-muted); font-size: 12px; }
.su-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .su-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; background: var(--ui-field); } .su-grid b { font-size: 13px; }
.su-tog { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; padding: 4px 0; } .su-tog input { width: 18px; height: 18px; accent-color: #3b82f6; }
@media (max-width: 560px) { .su-top { flex-direction: column; text-align: center; } .su-btn { align-self: center; } .su-grid { grid-template-columns: 1fr; } }
/* the text box stays a comfortable width on wide screens (the chat itself can be wider) */
@media (min-width: 1100px) {
  html[data-ui="v2"] .app.no-design .composer, html[data-ui="v2"] .home-actions { max-width: clamp(768px, 58vw, 1000px) !important; }
  html[data-ui="v2"] .app.no-design .messages { max-width: clamp(768px, 68vw, 1240px) !important; }
}
/* stop-generating button: deep blue instead of white */
html[data-ui="v2"] .send-btn.stop, .send-btn.stop { background: #1d4ed8 !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 0 0 4px color-mix(in srgb, #1d4ed8 25%, transparent) !important; }
html[data-ui="v2"] .send-btn.stop:hover, .send-btn.stop:hover { background: #1e40af !important; }
html[data-ui="v2"] .send-btn.stop svg, .send-btn.stop svg { color: #fff !important; fill: currentColor; }

/* ---------- live activity (replaces "thinking…"): current step in the summary, all stages inside ---------- */
.thinking.act > summary { gap: 8px; }
.thinking.act .act-cur { display: inline-flex; gap: 6px; align-items: center; animation: actIn .35s ease both; }
@keyframes actIn { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.thinking.act.live .act-cur { background: linear-gradient(90deg, var(--ui-muted) 0%, var(--ui-text) 45%, var(--ui-muted) 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: actIn .35s ease both, actShine 1.8s linear infinite; }
@keyframes actShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.thinking.act .act-meta { color: var(--ui-muted); font-weight: 500; font-size: .92em; }
.thinking.act .thinking-body { white-space: normal; max-height: 380px; overflow: auto; }
.act-steps { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
.act-steps::before { content: ""; position: absolute; inset-inline-start: 13px; top: 10px; bottom: 10px; width: 2px; background: var(--ui-line); }
.act-step { position: relative; display: flex; gap: 10px; padding: 6px 0; }
.act-ico { position: relative; z-index: 1; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ui-field); border: 1px solid var(--ui-line); font-size: 13px; }
.act-step.now .act-ico { border-color: #3b82f6; box-shadow: 0 0 0 4px color-mix(in srgb, #3b82f6 18%, transparent); animation: dotPulse 1.4s ease-in-out infinite; }
.act-main { flex: 1; min-width: 0; padding-top: 3px; }
.act-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; } .act-row em { font-style: normal; color: var(--ui-muted); font-size: 12px; font-family: ui-monospace, monospace; }
.act-step.now .act-row em { color: #3b82f6; }
.act-detail { margin-top: 4px; } .act-detail summary { cursor: pointer; font-size: 12px; color: var(--ui-muted); list-style: none; } .act-detail summary::-webkit-details-marker { display: none; }
.act-detail summary::before { content: "▸ "; } .act-detail[open] summary::before { content: "▾ "; }
.act-detail pre { margin: 6px 0 0; padding: 10px; border-radius: 10px; background: var(--ui-field); color: var(--ui-muted); font: 12px/1.6 ui-monospace, monospace; white-space: pre-wrap; max-height: 180px; overflow: auto; direction: ltr; text-align: left; }

/* ---------- image loader v3: grey picture + gliding light, status line above ---------- */
.img-status { display: flex; align-items: baseline; gap: 8px; margin: 2px 2px 8px; font-size: 13px; color: var(--ui-muted); }
.img-status .img-stage { font-weight: 600; color: var(--ui-text); background: linear-gradient(90deg, var(--ui-muted), var(--ui-text) 45%, var(--ui-muted) 90%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: actShine 1.8s linear infinite; }
.img-status .img-eta { font-family: ui-monospace, monospace; font-size: 12px; }
.img-status .dream-msg[hidden] { display: none; }
.img-dream.gray { position: absolute !important; inset: 0 !important; display: block !important; overflow: hidden; background: #8e929c !important; animation: grBreath 3s ease-in-out infinite; }
html[data-theme="dark"] .img-dream.gray, :root:not([data-theme="light"]) .img-dream.gray { background: #3a3d45 !important; }
html[data-theme="light"] .img-dream.gray { background: #c9ccd3 !important; }
.img-dream.gray::before, .img-dream.gray::after { display: none !important; }
.img-dream.gray .gr-shine { position: absolute; inset: -20%; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.22) 46%, rgba(255,255,255,.42) 50%, rgba(255,255,255,.22) 54%, transparent 62%); background-size: 250% 100%; animation: grShine 2.2s cubic-bezier(.45,.05,.55,.95) infinite; }
.img-dream.gray .gr-grain { position: absolute; inset: 0; opacity: calc(.18 - var(--gp, 0) * .14); background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.3px); background-size: 5px 5px; mix-blend-mode: overlay; }
@keyframes grShine { from { background-position: 130% 0; } to { background-position: -130% 0; } }
@keyframes grBreath { 50% { filter: brightness(1.06); } }
@media (prefers-reduced-motion: reduce) { .img-dream.gray, .img-dream.gray .gr-shine, .img-status .img-stage { animation: none !important; } }
html[data-ui="v2"] .img-frame-gen .img-dream.gray { background: #3a3d45 !important; }
html[data-ui="v2"][data-theme="light"] .img-frame-gen .img-dream.gray { background: #c9ccd3 !important; }
html[data-ui="v2"] .img-frame-gen .img-dream.gray { background: linear-gradient(160deg, #5a5e69, #474b55) !important; }
html[data-ui="v2"][data-theme="light"] .img-frame-gen .img-dream.gray { background: linear-gradient(160deg, #d3d6dc, #c3c7cf) !important; }
.img-dream.gray .gr-shine { background: linear-gradient(105deg, transparent 36%, rgba(255,255,255,.18) 45%, rgba(255,255,255,.5) 50%, rgba(255,255,255,.18) 55%, transparent 64%) !important; background-size: 250% 100% !important; }
.img-status .img-stage { background: linear-gradient(90deg, color-mix(in srgb, var(--ui-text) 55%, transparent), var(--ui-text) 45%, color-mix(in srgb, var(--ui-text) 55%, transparent) 90%) !important; background-size: 220% 100% !important; -webkit-background-clip: text !important; background-clip: text !important; }
html[data-ui="v2"] .composer #sendBtn.send-btn.stop { background: #1d4ed8 !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 0 0 4px color-mix(in srgb, #1d4ed8 25%, transparent) !important; }
html[data-ui="v2"] .composer #sendBtn.send-btn.stop:hover { background: #1e40af !important; }
html[data-ui="v2"] .composer #sendBtn.send-btn.stop svg { color: #fff !important; fill: #fff !important; }
.vs-prov { display: block; margin-top: 3px; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: #3b82f6; }
.vs-prov.out { color: #f59e0b; } .vs-prov.off { color: var(--ui-muted, #888); text-decoration: line-through; }

/* Explore: Hythm Desktop */
.dsk-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 4px; } .dsk-cta a { text-decoration: none; }
.dsk-req { display: block; color: var(--ui-muted); font-size: 12.5px; margin-top: 8px; }
.dsk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dsk-grid > div { padding: 14px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-card); } .dsk-grid span { font-size: 24px; } .dsk-grid b { display: block; margin: 4px 0 2px; } .dsk-grid p { margin: 0; color: var(--ui-muted); font-size: 13.5px; line-height: 1.6; }
.dsk-lv { display: flex; flex-direction: column; gap: 10px; }
.dsk-lv > div { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--ui-line); background: var(--ui-card); }
.dsk-lv i { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; } .dsk-lv b { display: block; margin-bottom: 2px; } .dsk-lv p { margin: 0; color: var(--ui-muted); font-size: 13.5px; line-height: 1.7; }
.dsk-lv .ok i { background: rgba(22,163,74,.18); color: #16a34a; } .dsk-lv .warn i { background: rgba(217,119,6,.2); color: #d97706; } .dsk-lv .bad i { background: rgba(220,38,38,.18); color: #dc2626; }
.dsk-list, .dsk-steps { color: var(--ui-muted); font-size: 14px; line-height: 1.9; padding-inline-start: 22px; } .dsk-list b, .dsk-steps b { color: var(--ui-text); } .dsk-steps code { background: var(--ui-field); padding: 1px 6px; border-radius: 6px; }
a.omni-cta { display: block; text-align: center; text-decoration: none; }
@media (max-width: 700px) { .dsk-grid { grid-template-columns: 1fr 1fr; } }

html.lang-en { --auto-lbl: "auto from your words"; }
