:root {
  color-scheme: only light;
  /* Off-white neutrals — avoid pure #FFFFFF */
  --bg: #fafafa;
  --bg-sidebar: #ffffff;
  --bg-main: #fafafa;
  --ink: #222222;
  --ink-60: rgba(34, 34, 34, 0.62);
  --ink-strong: #0d0d0d;
  --ink-secondary: #2d2d2d;
  --muted: #71717a;
  --stroke: #e5e5e5;
  --stroke-10: rgba(13, 13, 13, 0.08);
  --hover: #f0f0f0;
  --surface-soft: #f5f5f5;
  --surface-muted: #fafafa;
  --card: #fafafa;
  --user-bubble: #fafafa;
  --ai-bubble: #f5f5f5;
  --ai-avatar: #0d0d0d;
  --ai-avatar-fg: #fafafa;
  --user-avatar: #eceff1;
  --chip: #eceff1;
  --chip-fg: #0d0d0d;
  --combo: #f5f5f5;
  --composer: #fafafa;
  --composer-stroke: #e5e5e5;
  --composer-placeholder: rgba(34, 34, 34, 0.38);
  --pill-stroke: rgba(13, 13, 13, 0.1);
  --btn: #0d0d0d;
  --btn-fg: #fafafa;
  --send-bg: #e5e5e5;
  --send-fg: #2d2d2d;
  --send-blue: #3B82F6;
  --newchat-bg: #0d0d0d;
  --newchat-fg: #fafafa;
  --profile-avatar: #eceff1;
  /* ChatGPT-like soft float around the pill (visible under/around the box) */
  --shadow-composer:
    0 0 0 1px rgba(13, 13, 13, 0.04),
    0 2px 6px rgba(13, 13, 13, 0.06),
    0 8px 24px rgba(13, 13, 13, 0.1),
    0 16px 40px rgba(13, 13, 13, 0.06);
  /* Home empty: previous solid-card shadow */
  --shadow-composer-home: 0 8px 32px rgba(13, 13, 13, 0.07), 0 2px 8px rgba(13, 13, 13, 0.04);
  --overlay: rgba(13, 13, 13, 0.4);
  --danger: #c62828;
  --ok: #1b7f4e;
  --accent: #0d0d0d;
  --creating-bg: #f5f5f5;
  --creating-dot: #93c5fd;
  --sidebar-w: 279px;
  --top-h: 52px;
  --foot-h: 80px;
  --radius-composer: 32px;
  --radius-send: 20px;
  --radius-bubble: 22px;
  --font: "IRANSansX", Tahoma, "Segoe UI", sans-serif;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(13, 13, 13, 0.16);
  --scrollbar-thumb-hover: rgba(13, 13, 13, 0.28);
  --account-bento-bg: #f5f5f5;
  --account-bento-hover: #f0f0f0;
  --account-quota-bg: #f5f5f5;
  --account-input-bg: #fafafa;
  /* Match pricing.html plan badges */
  --plan-free-bg: #f3f4f6;
  --plan-free-fg: #6b7280;
  --plan-free-border: rgba(13, 13, 13, 0.08);
  --plan-economy-bg: #f3e8ff;
  --plan-economy-fg: #7c3aed;
  --plan-economy-border: rgba(124, 58, 237, 0.22);
  --plan-plus-bg: #dbeafe;
  --plan-plus-fg: #1d4ed8;
  --plan-plus-border: rgba(29, 78, 216, 0.22);
  --plan-pro-bg: #dcfce7;
  --plan-pro-fg: #15803d;
  --plan-pro-border: rgba(21, 128, 61, 0.22);
  --plan-promax-bg: linear-gradient(135deg, #fff7d6 0%, #fde68a 100%);
  --plan-promax-fg: #92400e;
  --plan-promax-border: rgba(180, 83, 9, 0.3);
}

html[data-theme="dark"] {
  color-scheme: only dark;
  /* Off-black neutrals — avoid pure #000000 */
  --bg: #121212;
  --bg-sidebar: #0d0d0d;
  --bg-main: #121212;
  --ink: #f5f5f5;
  --ink-60: rgba(245, 245, 245, 0.62);
  --ink-strong: #fafafa;
  --ink-secondary: #e5e5e5;
  --muted: #a1a1aa;
  --stroke: #2d2d2d;
  --stroke-10: rgba(250, 250, 250, 0.1);
  --hover: #212121;
  --surface-soft: #1a1a1a;
  --surface-muted: #161616;
  --card: #1a1a1a;
  --user-bubble: #0d0d0d;
  --ai-bubble: #212121;
  --ai-avatar: #212121;
  --ai-avatar-fg: #fafafa;
  --user-avatar: #0d0d0d;
  --chip: #2d2d2d;
  --chip-fg: #fafafa;
  --combo: rgba(45, 45, 45, 0.45);
  --composer: #212121;
  --composer-stroke: transparent;
  --composer-placeholder: rgba(245, 245, 245, 0.36);
  --pill-stroke: rgba(229, 229, 229, 0.3);
  --creating-bg: #212121;
  --creating-dot: #60a5fa;
  --btn: #fafafa;
  --btn-fg: #0d0d0d;
  --send-bg: #e5e5e5;
  --send-fg: #2d2d2d;
  --send-blue: #3B82F6;
  --newchat-bg: #fafafa;
  --newchat-fg: #0d0d0d;
  --profile-avatar: #2d2d2d;
  --shadow-composer:
    0 0 0 1px rgba(250, 250, 250, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.4),
    0 18px 48px rgba(0, 0, 0, 0.28);
  --shadow-composer-home: 0 10px 40px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.2);
  --overlay: rgba(0, 0, 0, 0.64);
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(250, 250, 250, 0.14);
  --scrollbar-thumb-hover: rgba(250, 250, 250, 0.24);
  --account-bento-bg: #161616;
  --account-bento-hover: #212121;
  --account-quota-bg: #161616;
  --account-input-bg: #0d0d0d;
  --plan-free-bg: #2a2a2a;
  --plan-free-fg: #a3a3a3;
  --plan-free-border: rgba(250, 250, 250, 0.1);
  --plan-economy-bg: #2e1065;
  --plan-economy-fg: #d8b4fe;
  --plan-economy-border: rgba(216, 180, 254, 0.28);
  --plan-plus-bg: #1e3a5f;
  --plan-plus-fg: #93c5fd;
  --plan-plus-border: rgba(147, 197, 253, 0.3);
  --plan-pro-bg: #14532d;
  --plan-pro-fg: #86efac;
  --plan-pro-border: rgba(134, 239, 172, 0.3);
  --plan-promax-bg: linear-gradient(135deg, #3b2a05 0%, #5c4108 100%);
  --plan-promax-fg: #fcd34d;
  --plan-promax-border: rgba(252, 211, 77, 0.35);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select, a, [role="button"] {
  font-family: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
button { cursor: pointer; border: 0; background: none; }
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ink) 35%, transparent);
  outline-offset: 2px;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.messages,
.side-chats,
.sheet,
.models-pop,
.bubble .md pre,
.composer textarea,
.msg-edit-box textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.messages::-webkit-scrollbar,
.side-chats::-webkit-scrollbar,
.sheet::-webkit-scrollbar,
.models-pop::-webkit-scrollbar,
.bubble .md pre::-webkit-scrollbar,
.composer textarea::-webkit-scrollbar,
.msg-edit-box textarea::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.messages::-webkit-scrollbar-button,
.side-chats::-webkit-scrollbar-button,
.sheet::-webkit-scrollbar-button,
.models-pop::-webkit-scrollbar-button,
.bubble .md pre::-webkit-scrollbar-button,
.composer textarea::-webkit-scrollbar-button,
.msg-edit-box textarea::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.messages::-webkit-scrollbar-track,
.side-chats::-webkit-scrollbar-track,
.sheet::-webkit-scrollbar-track,
.models-pop::-webkit-scrollbar-track,
.bubble .md pre::-webkit-scrollbar-track,
.composer textarea::-webkit-scrollbar-track,
.msg-edit-box textarea::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
.messages::-webkit-scrollbar-thumb,
.side-chats::-webkit-scrollbar-thumb,
.sheet::-webkit-scrollbar-thumb,
.models-pop::-webkit-scrollbar-thumb,
.bubble .md pre::-webkit-scrollbar-thumb,
.composer textarea::-webkit-scrollbar-thumb,
.msg-edit-box textarea::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.messages::-webkit-scrollbar-thumb:hover,
.side-chats::-webkit-scrollbar-thumb:hover,
.sheet::-webkit-scrollbar-thumb:hover,
.models-pop::-webkit-scrollbar-thumb:hover,
.bubble .md pre::-webkit-scrollbar-thumb:hover,
.composer textarea::-webkit-scrollbar-thumb:hover,
.msg-edit-box textarea::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}
.messages::-webkit-scrollbar-corner,
.side-chats::-webkit-scrollbar-corner,
.composer textarea::-webkit-scrollbar-corner,
.msg-edit-box textarea::-webkit-scrollbar-corner {
  background: transparent;
}

.ico-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: inherit;
}
.ico-svg { display: block; flex: 0 0 auto; }
iconsax-icon.ico-svg,
iconsax-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
  color: inherit;
  vertical-align: middle;
}
iconsax-icon svg {
  display: block;
  flex: 0 0 auto;
}
.file-pick {
  position: fixed;
  inset-inline-start: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  border: 0;
  overflow: hidden;
  z-index: 1;
}
.btn-new .ico-svg { color: var(--newchat-fg); }
.send .ico-svg { color: var(--send-fg); }
.pill.on .ico-svg { color: inherit; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  /* Fallback for WebViews without svh (Chrome < 108): without it .app has no height and the chat cannot scroll. */
  height: 100%;
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  background: var(--bg-main);
}

.sidebar {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-sidebar);
  border-inline: 1px solid var(--stroke);
  min-width: 0;
  min-height: 0;
  max-height: 100svh;
  overflow: hidden;
}
.side-head {
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--stroke);
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  margin: 0;
}
.brand .mark {
  width: 20px;
  height: 20px;
  color: var(--ink);
}
.btn-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  width: 100%;
  background: var(--newchat-bg);
  color: var(--newchat-fg);
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
}
.btn-temp {
  display: none;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.icon-btn.temp-chat-btn.on {
  background: var(--surface-soft);
  color: var(--ink);
}
.icon-btn.temp-chat-btn.is-save {
  color: var(--ink);
}
.side-actions {
  padding: 8px 10px 0;
  flex-shrink: 0;
}
.chat-title.is-temporary {
  color: var(--ink-secondary);
}
html.is-temp-chat .topbar {
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ink) 8%, transparent);
}
.temp-save-btn:not([hidden]) {
  color: var(--ink);
}
.save-chat-modal h3 {
  margin: 0;
  font-size: 18px;
}
.save-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.save-chat-modal .sub {
  margin: 0 0 20px;
  color: var(--ink-secondary);
  line-height: 1.65;
  font-size: 14px;
}
.save-chat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.save-chat-actions .btn-ghost,
.save-chat-actions .btn-primary {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
}
.save-chat-actions .btn-ghost {
  background: #ffffff;
  border: 1px solid #e6e9f0;
  color: #0f0f13;
}
.save-chat-actions .btn-ghost:hover { background: #f7f9fc; }
.save-chat-actions .btn-primary {
  background: linear-gradient(180deg, #3a78d8 0%, #1f4f9e 100%);
  color: #ffffff;
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(31, 79, 158, 0.28);
}
.save-chat-actions .btn-primary:hover { filter: brightness(1.06); }
html[data-theme="dark"] .save-chat-actions .btn-ghost,
html[data-theme="dark"] .save-chat-actions .btn-primary {
  border-radius: 999px;
  font-weight: 600;
  box-shadow: none;
}
html[data-theme="dark"] .save-chat-actions .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
}
html[data-theme="dark"] .save-chat-actions .btn-ghost:hover { background: transparent; }
html[data-theme="dark"] .save-chat-actions .btn-primary {
  background: #fafafa;
  color: #0d0d0d;
}
.side-search {
  margin: 10px 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink-secondary);
}
.side-search .ico-wrap,
.side-search .ico-svg {
  color: var(--ink-secondary);
}
.side-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-strong);
}
.side-search input::placeholder {
  color: #a1a1aa;
}
html[data-theme="dark"] .side-search input::placeholder {
  color: #71717a;
}
.side-nav {
  padding: 8px 6px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--ink-strong);
  position: relative;
}
.side-link[hidden],
#btnBarnamak {
  display: none !important;
}
.side-link .ico-wrap,
.side-link .ico-svg {
  color: var(--ink-secondary);
}
.side-link:hover, .side-link.on { background: var(--hover); }
html[data-theme="dark"] .side-link {
  color: #f4f4f5;
}
html[data-theme="dark"] .side-link .ico-wrap,
html[data-theme="dark"] .side-link .ico-svg {
  color: #d4d4d8;
}
html[data-theme="dark"] .side-search {
  background: #1a1a1a;
  color: #e4e4e7;
}
html[data-theme="dark"] .side-search input {
  color: #fafafa;
}
.side-link .support-dot,
#supportDot.unread {
  position: absolute;
  top: 7px;
  inset-inline-start: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  border: 1.5px solid var(--bg-main, var(--bg));
  box-sizing: content-box;
  pointer-events: none;
  z-index: 1;
}
.list-row .support-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  margin-inline-start: auto;
  flex-shrink: 0;
}

.side-link-subscribe,
.list-row-subscribe {
  color: #1d4ed8;
  font-weight: 700;
}

.side-link-subscribe b,
.list-row-subscribe b {
  font-weight: 700;
}

.side-link-subscribe:not(.is-active-sub) b,
.list-row-subscribe:not(.is-active-sub) b {
  background-image: linear-gradient(
    105deg,
    #1d4ed8 0%,
    #1d4ed8 38%,
    #dbeafe 48%,
    #93c5fd 52%,
    #1d4ed8 62%,
    #1d4ed8 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: subscribe-shimmer 2.4s linear infinite;
}

.side-link-subscribe .subscribe-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.side-link-subscribe .subscribe-ico .ico-svg,
.list-row-subscribe .subscribe-ico .ico-svg {
  color: #1d4ed8;
  stroke-width: 2.15;
}

.side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg,
.list-row-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
  animation: subscribe-ico-shimmer 2.4s linear infinite;
}

.side-link-subscribe.is-active-sub,
.list-row-subscribe.is-active-sub {
  color: var(--ink);
  font-weight: 500;
}

.side-link-subscribe.is-active-sub b,
.list-row-subscribe.is-active-sub b {
  font-weight: 500;
  background: none;
  color: inherit;
  -webkit-text-fill-color: currentColor;
  animation: none;
}

.side-link-subscribe.is-active-sub .subscribe-ico .ico-svg,
.list-row-subscribe.is-active-sub .subscribe-ico .ico-svg {
  color: var(--ink);
  animation: none;
  filter: none;
}

html[data-theme="dark"] .side-link-subscribe:not(.is-active-sub),
html[data-theme="dark"] .list-row-subscribe:not(.is-active-sub) {
  color: #60a5fa;
}

html[data-theme="dark"] .side-link-subscribe:not(.is-active-sub) b,
html[data-theme="dark"] .list-row-subscribe:not(.is-active-sub) b {
  background-image: linear-gradient(
    105deg,
    #60a5fa 0%,
    #60a5fa 38%,
    #eff6ff 48%,
    #bfdbfe 52%,
    #60a5fa 62%,
    #60a5fa 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

html[data-theme="dark"] .side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg,
html[data-theme="dark"] .list-row-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
  color: #60a5fa;
}

html[data-theme="dark"] .side-link-subscribe.is-active-sub,
html[data-theme="dark"] .list-row-subscribe.is-active-sub,
html[data-theme="dark"] .side-link-subscribe.is-active-sub .subscribe-ico .ico-svg,
html[data-theme="dark"] .list-row-subscribe.is-active-sub .subscribe-ico .ico-svg {
  color: var(--ink);
}

.sheet-quota {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 14px 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--hover);
}

.sheet-quota.sheet-quota-meter {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 14px 12px;
}

.quota-meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.quota-meter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.quota-meter-pct {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-60);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quota-meter-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

html[data-theme="dark"] .quota-meter-track {
  background: rgba(255, 255, 255, 0.12);
}

.quota-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--send-blue);
  min-width: 0;
  transition: width 0.35s ease;
}

.quota-meter-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.sheet-quota .side-quota-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.sheet-quota .side-quota-item b {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sheet-quota .side-quota-item small {
  font-size: 11px;
  color: var(--muted);
}

.sheet-quota .side-quota-sep {
  width: 1px;
  align-self: stretch;
  background: var(--stroke);
  margin: 2px 0;
}

@keyframes subscribe-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes subscribe-ico-shimmer {
  0%,
  40%,
  100% {
    color: #1d4ed8;
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
  48% {
    color: #93c5fd;
    filter: brightness(1.45) drop-shadow(0 0 4px rgba(147, 197, 253, 0.85));
  }
  56% {
    color: #dbeafe;
    filter: brightness(1.55) drop-shadow(0 0 5px rgba(219, 234, 254, 0.9));
  }
  64% {
    color: #1d4ed8;
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
}

html[data-theme="dark"] .side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg,
html[data-theme="dark"] .list-row-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
  animation-name: subscribe-ico-shimmer-dark;
}

@keyframes subscribe-ico-shimmer-dark {
  0%,
  40%,
  100% {
    color: #60a5fa;
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
  48% {
    color: #bfdbfe;
    filter: brightness(1.4) drop-shadow(0 0 4px rgba(191, 219, 254, 0.75));
  }
  56% {
    color: #eff6ff;
    filter: brightness(1.55) drop-shadow(0 0 5px rgba(239, 246, 255, 0.85));
  }
  64% {
    color: #60a5fa;
    filter: brightness(1) drop-shadow(0 0 0 transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .side-link-subscribe:not(.is-active-sub) b,
  .list-row-subscribe:not(.is-active-sub) b,
  .side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg,
  .list-row-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
    animation: none;
  }

  .side-link-subscribe:not(.is-active-sub) b,
  .list-row-subscribe:not(.is-active-sub) b {
    background: none;
    color: inherit;
    -webkit-text-fill-color: currentColor;
  }

  .side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg,
  .list-row-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
    filter: none;
  }
}
.side-chats-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 4px 0 8px;
  display: flex;
  flex-direction: column;
}
.chat-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-section[hidden] {
  display: none !important;
}
.side-chats {
  padding: 4px 6px 8px;
}
.side-chats.section-body {
  flex: 0 0 auto;
  overflow: visible;
}
.chat-section.is-collapsed .section-body {
  display: none;
}
.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 7px;
  border-radius: 8.75px;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
  text-align: start;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  background: none;
  border: 0;
}
.chat-item:hover { background: var(--hover); }
.chat-item.on { background: var(--hover); }
.chat-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-item .chat-lead {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: visible;
}
.chat-item .chat-lead .ico-svg,
.chat-item .chat-lead iconsax-icon {
  width: 20px;
  height: 20px;
}
.chat-item .more {
  margin-inline-start: auto;
  opacity: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  color: var(--muted);
  user-select: none;
}
.chat-item .chat-title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}
.chat-item .chat-ago {
  flex: 0 0 auto;
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.chat-item .chat-busy {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--send-blue) 28%, transparent);
  border-top-color: var(--send-blue);
  border-radius: 50%;
  animation: chat-spin 0.7s linear infinite;
}
@keyframes chat-spin {
  to { transform: rotate(360deg); }
}
.chat-item:hover .more, .chat-item.on .more { opacity: 1; }
.chat-item.is-busy .more { opacity: 0.55; }
.side-foot {
  border-top: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 10px 8px max(18px, env(safe-area-inset-bottom, 18px));
  margin-top: auto;
  flex-shrink: 0;
}
.profile-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 8px;
  border-radius: 12px;
  text-align: start;
}
.profile-row:hover { background: var(--hover); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--profile-avatar);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex: 0 0 auto;
  overflow: clip;
}
html[data-theme="dark"] .avatar.user { border: 1px solid #fafafa; }
.who { flex: 1; min-width: 0; display: block; }
.who b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.who small { display: block; font-size: 12px; color: var(--ink-60); margin-top: 3px; line-height: 1.2; }
.who #userPlan .plan-pill {
  margin-top: 2px;
}

/* Plan badges — همان پالت صفحه اشتراک (pricing) */
.plan-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.3;
  vertical-align: middle;
  border: 1px solid transparent;
  user-select: none;
  box-shadow: none;
  text-shadow: none;
  animation: none;
  overflow: visible;
  white-space: nowrap;
  transform: none;
}
.plan-pill::before,
.plan-pill::after {
  content: none !important;
  display: none !important;
}
.plan-pill-free {
  background: var(--plan-free-bg) !important;
  color: var(--plan-free-fg) !important;
  border-color: var(--plan-free-border) !important;
}
.plan-pill-economy {
  background: var(--plan-economy-bg) !important;
  color: var(--plan-economy-fg) !important;
  border-color: var(--plan-economy-border) !important;
}
.plan-pill-plus {
  background: var(--plan-plus-bg) !important;
  color: var(--plan-plus-fg) !important;
  border-color: var(--plan-plus-border) !important;
}
.plan-pill-pro {
  background: var(--plan-pro-bg) !important;
  color: var(--plan-pro-fg) !important;
  border-color: var(--plan-pro-border) !important;
}
.plan-pill.plan-pill-promax {
  background: var(--plan-promax-bg) !important;
  color: var(--plan-promax-fg) !important;
  border-color: var(--plan-promax-border) !important;
}

@media (prefers-reduced-motion: reduce) {
  .list-row .model-tier-tag.tier-flagship {
    animation: none !important;
    opacity: 1 !important;
  }
}
.sheet-account .plan-pill,
.side-foot .plan-pill,
.who .plan-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.side-foot .icon-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  opacity: 0.75;
}
.side-foot .icon-btn:hover { opacity: 1; background: var(--hover); }
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-strong);
}
.icon-btn .ico-wrap,
.icon-btn .ico-svg {
  color: var(--ink-secondary);
}
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--hover); }
}
.icon-btn:active { background: var(--hover); }

.main {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100svh;
  overflow: hidden;
  background: var(--bg-main);
}
.topbar {
  height: var(--top-h);
  min-height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--stroke-10);
  flex-shrink: 0;
  position: relative;
  z-index: 25;
}
.top-model-wrap {
  position: relative;
  flex: 0 1 auto;
  z-index: 32;
}
html[data-theme="dark"] .topbar {
  background: var(--bg-main);
  border-bottom-color: #262626;
}
.menu-mobile { display: none; }
.chat-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  caret-color: transparent;
}
/* Do not cap #chatTitle here — TWA shows it full-width and centered under the actions. */
.topbar > .chat-title:not(#chatTitle) {
  max-width: min(280px, 32vw);
}
/* Topbar chat title + model picker moved into composer. */
.topbar > #chatTitle {
  display: none !important;
}
.top-model-wrap {
  display: none !important;
}
.chat-title.is-typing-title {
  caret-color: transparent;
}
.model-badge { display: none; }
.top-spacer { flex: 1; min-width: 8px; }
.topbar .combo.top-model {
  flex: 0 0 auto;
  width: fit-content;
  max-width: min(220px, 42vw);
  height: 32px;
  border-radius: 999px;
  border-color: var(--pill-stroke);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  padding-inline: 10px 12px;
  margin-inline-start: 2px;
  overflow: hidden;
  box-sizing: border-box;
}
html[data-theme="dark"] .topbar .combo.top-model { border-color: #404040; }
.topbar .combo.top-model .ico-svg,
.topbar .combo.top-model iconsax-icon { flex-shrink: 0; opacity: 0.85; }
.topbar .combo.top-model .model-caret,
.topbar .combo.top-model .model-caret iconsax-icon {
  opacity: 0.55;
  margin-inline-start: 4px;
}
.topbar .combo.top-model #modelTopLabel {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.topbar .top-subscribe-btn {
  height: 32px;
  min-width: 0;
  border-radius: 999px;
  padding-inline: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-inline-start: 2px;
}
.topbar .top-subscribe-btn[hidden] {
  display: none !important;
}
.topbar .top-subscribe-btn b {
  font-size: 12px;
  font-weight: 700;
}
@media (min-width: 981px) {
  .topbar .top-subscribe-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    z-index: 2;
  }
}
.topbar .icon-btn .ico-wrap { width: 18px; height: 18px; }
#btnNotifs {
  position: relative;
}
#btnNotifs .unread {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  border: 1.5px solid var(--bg-main);
  box-sizing: content-box;
  pointer-events: none;
  z-index: 1;
}
.combo {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  min-width: 0;
  max-width: none;
  width: max-content;
  padding-inline: 10px;
  background: var(--combo);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
}
.combo.side-model {
  flex: 0 1 auto;
  max-width: min(148px, 46%);
  border-radius: 999px;
  border-color: var(--pill-stroke);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  padding-inline: 8px 10px;
}
html[data-theme="dark"] .combo.side-model { border-color: #404040; }
.combo.side-model .ico-svg { flex-shrink: 0; opacity: 0.85; }
.combo #modelLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="dark"] .combo { border-color: #262626; }
.combo img.model-ic {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
}
.combo img.model-ic[hidden],
.combo img.model-ic-mini[hidden],
.pill.composer-model img.model-ic-mini[hidden],
#modelIcon[hidden],
#modelTopIcon[hidden] {
  display: none !important;
}
.model-ic-mini,
.model-pick-ic {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.list-row .model-pick-ic {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
#modelIcon:not([src]),
#modelIcon[src=""] {
  display: none !important;
}
#modelIcon:not([hidden]) + #modelIconFb,
#modelTopIcon:not([hidden]) + #modelTopIconFb { display: none; }

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior: none;
  padding: 28px 8% 24px;
  -webkit-overflow-scrolling: touch;
}
.main:not(.is-empty) .messages {
  display: block;
}
.messages-stick {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.main:not(.is-empty) .messages > .msg-row:last-child,
.messages-stick > .msg-row:last-child {
  overflow-anchor: none;
}
.chat-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* Empty chat: equal flex halves pin greeting+composer as one mid-viewport cluster (GPT-style). */
.main.is-empty .chat-stage {
  flex: 1 1 0;
  justify-content: flex-end;
  align-items: center;
  overflow: visible;
}
.main:not(.is-empty) .messages {
  /* Room so last messages clear the floating composer + shadow */
  padding-bottom: 168px;
}
.msg-row {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  align-items: flex-start;
}
.msg-row.user {
  justify-content: flex-start;
  margin-bottom: 4px;
  width: 100%;
}
.msg-row.assistant {
  justify-content: flex-end;
  margin-bottom: 28px;
}
.bubble-av {
  display: none;
}
.msg-row.assistant .bubble-av { background: var(--ai-avatar); color: var(--ai-avatar-fg); }
.msg-row.user .bubble-av { background: var(--user-avatar); color: var(--ink); }
.bubble {
  max-width: min(720px, 72%);
  border: 1px solid var(--stroke-10);
  border-radius: var(--radius-bubble);
  padding: 14px 14px 10px;
  font-size: 14px;
  line-height: 21px;
  word-break: break-word;
}
.msg-row.assistant .bubble {
  max-width: min(768px, 92%);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 2px 0 0;
  box-shadow: none;
}
.msg-row.user .bubble {
  background: #e8f3fe;
  color: #0c274a;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: 22px;
  padding: 10px 16px;
  line-height: 1.45;
  box-shadow: none;
}
html[data-theme="dark"] .msg-row.user .bubble {
  background: #173e76;
  color: #fff;
  border: 0;
}
.msg-time {
  display: none;
}
.msg-row.user .msg-time {
  display: none;
}
.bubble .md p { margin: 0 0 8px; }
.bubble .md p:last-child { margin: 0; }
.bubble .md pre {
  background: transparent;
  border-radius: 0;
  padding: 12px 14px;
  overflow: auto;
  font-size: 12.5px;
  direction: ltr;
  text-align: left;
  margin: 0;
}
.bubble .md .code-block {
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  direction: ltr;
  text-align: left;
}
html[data-theme="dark"] .bubble .md .code-block {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
}
.bubble .md .code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #ececee;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.bubble .md .code-block-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bubble .md .code-preview {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: #2563eb;
  color: #fafafa;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.bubble .md .code-preview:hover { filter: brightness(1.05); }
html[data-theme="dark"] .bubble .md .code-block-head {
  background: #2d2d2d;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.bubble .md .code-lang {
  font-size: 12px;
  color: #6b7280;
  font-family: ui-monospace, Consolas, monospace;
}
html[data-theme="dark"] .bubble .md .code-lang { color: #a0a0a0; }
.bubble .md .code-copy {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.bubble .md .code-copy:hover { background: rgba(0, 0, 0, 0.06); color: #111; }
html[data-theme="dark"] .bubble .md .code-copy { color: #a0a0a0; }
html[data-theme="dark"] .bubble .md .code-copy:hover { background: rgba(255, 255, 255, 0.08); color: #fafafa; }
.bubble .md .prompt-block {
  direction: rtl;
  text-align: start;
}
.bubble .md .prompt-block[dir="ltr"] {
  direction: ltr;
  text-align: left;
}
.bubble .md .prompt-block .prompt-pre {
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  background: transparent;
}
html[data-theme="dark"] .bubble .md .prompt-block {
  background: #171717;
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .bubble .md .prompt-block .code-block-head {
  background: #222;
}
.bubble .md .prompt-block .code-lang {
  font-family: var(--font);
  font-weight: 600;
  color: #3b82f6;
}
html[data-theme="dark"] .bubble .md .prompt-block .code-lang {
  color: #93c5fd;
}
.bubble .md .md-table-wrap {
  margin: 10px 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}
html[data-theme="dark"] .bubble .md .md-table-wrap {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
.bubble .md .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.5;
  min-width: 280px;
}
.bubble .md .md-table th,
.bubble .md .md-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: start;
  vertical-align: top;
  white-space: nowrap;
}
.bubble .md .md-table th {
  font-weight: 650;
  background: rgba(0, 0, 0, 0.035);
  color: var(--ink);
}
.bubble .md .md-table td {
  color: var(--ink);
}
.bubble .md .md-table tbody tr:last-child td {
  border-bottom: none;
}
html[data-theme="dark"] .bubble .md .md-table th,
html[data-theme="dark"] .bubble .md .md-table td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .bubble .md .md-table th {
  background: rgba(255, 255, 255, 0.05);
}
.bubble .md .rates-card {
  margin: 8px 0 12px;
  width: fit-content;
  max-width: min(280px, 100%);
  box-sizing: border-box;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-soft);
  color: var(--ink);
}
.bubble .md .rates-card-head {
  padding: 12px 14px 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--stroke-10);
}
.bubble .md .rates-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 8px 10px;
}
.bubble .md .rate-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 12px;
}
.bubble .md .rate-item + .rate-item {
  border-top: 1px solid var(--stroke-10);
  border-radius: 0;
  margin-top: 0;
}
.bubble .md .rate-item:hover {
  background: var(--hover);
}
.bubble .md .rate-ico {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.bubble .md .rate-ico svg {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 50%;
}
.bubble .md .rate-name {
  font-weight: 650;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink);
}
.bubble .md .rate-nums {
  text-align: start;
  min-width: 0;
}
.bubble .md .rate-price-row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 5px;
  direction: ltr;
}
.bubble .md .rate-price {
  font-weight: 700;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}
.bubble .md .rate-price-unit {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
}
.bubble .md .rate-change {
  font-size: 11px;
  margin-top: 3px;
  font-weight: 600;
  text-align: end;
}
.bubble .md .rate-change.is-up { color: var(--ok); }
.bubble .md .rate-change.is-down { color: var(--danger); }
.bubble .md .rate-change.is-flat { color: var(--muted); }
html[data-theme="dark"] .bubble .md .rates-card {
  background: var(--card);
  border-color: var(--stroke);
}
html[data-theme="dark"] .bubble .md .rates-card-head {
  border-bottom-color: var(--stroke-10);
}
html[data-theme="dark"] .bubble .md .rate-item + .rate-item {
  border-top-color: var(--stroke-10);
}
html[data-theme="dark"] .bubble .md .rate-change.is-up { color: #4ade80; }
html[data-theme="dark"] .bubble .md .rate-change.is-down { color: #f87171; }
.bubble .md .car-price-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px;
  width: 100%;
  max-width: min(480px, 100%);
  box-sizing: border-box;
}
.bubble .md .car-price-stack .car-price-card {
  margin: 0;
  width: 100%;
  max-width: none;
}
.bubble .md .car-price-card {
  margin: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  align-items: center;
}
.bubble .md .car-price-img {
  width: 76px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}
.bubble .md .car-price-img--empty {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.bubble .md .car-price-img img,
.bubble .md .car-price-img .car-price-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  mix-blend-mode: multiply;
}
html[data-theme="dark"] .bubble .md .car-price-img img,
html[data-theme="dark"] .bubble .md .car-price-img .car-price-photo {
  mix-blend-mode: lighten;
  filter: brightness(1.05);
}
.bubble .md .car-price-body {
  min-width: 0;
  flex: 1;
}
.bubble .md .car-price-title {
  font-weight: 650;
  font-size: 12.5px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.bubble .md .car-price-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bubble .md .car-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  line-height: 1.35;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.bubble .md .car-price-k {
  color: var(--ink-secondary);
  flex-shrink: 0;
}
.bubble .md .car-price-v {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 5px;
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bubble .md .car-price-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bubble .md .car-price-unit {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-secondary);
}
.bubble .md .car-clarify-card {
  margin: 8px 0 12px;
  width: fit-content;
  max-width: min(340px, 100%);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 14px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bg-main) 92%, var(--ink) 8%);
}
.bubble .md .car-clarify-head {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
.bubble .md .car-clarify-list {
  margin: 0;
  padding: 0 16px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}
.bubble .md .choices-card {
  margin: 8px 0 12px;
  width: 100%;
  max-width: min(480px, 100%);
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 12px;
  padding: 12px;
  background: transparent;
}
.bubble .md .choices-prompt {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.bubble .md .choices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bubble .md .choice-btn {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.bubble .md .choice-btn:hover {
  background: color-mix(in srgb, #2563eb 10%, var(--bg-main));
  border-color: color-mix(in srgb, #2563eb 35%, transparent);
}
.bubble .md .choice-btn:active {
  transform: scale(0.98);
}
.bubble .md .choice-btn.is-custom {
  border-style: dashed;
  color: var(--ink-secondary);
  font-weight: 600;
}
.bubble .md .choice-custom-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}
.bubble .md .choice-custom-input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  padding: 10px 12px;
  outline: none;
}
.bubble .md .choice-custom-input:focus {
  border-color: color-mix(in srgb, #2563eb 45%, transparent);
}
.bubble .md .choice-custom-input::placeholder {
  color: var(--ink-secondary);
  opacity: 0.85;
}
.bubble .md .choice-custom-send {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}
.bubble .md .choice-custom-send:hover {
  background: color-mix(in srgb, #2563eb 12%, transparent);
  border-color: color-mix(in srgb, #2563eb 35%, transparent);
}
html[data-theme="dark"] .bubble .md .choices-card {
  border-color: rgba(255, 255, 255, 0.08);
}
.bubble .md .cal-card {
  margin: 8px 0 12px;
  width: fit-content;
  max-width: min(340px, 100%);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 12px;
  background: transparent;
}
.bubble .md .cal-card-head {
  padding: 10px 12px 4px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink-secondary);
}
.bubble .md .cal-card-body {
  padding: 2px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble .md .cal-day {
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.bubble .md .cal-day:first-child {
  border-top: 0;
  padding-top: 4px;
}
.bubble .md .cal-day-top {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}
.bubble .md .cal-day-num {
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  min-width: 1.4em;
  color: var(--ink);
}
.bubble .md .cal-day.is-holiday .cal-day-num {
  color: #b91c1c;
}
.bubble .md .cal-day-label {
  font-weight: 700;
  font-size: 13px;
}
.bubble .md .cal-day-date {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 2px;
}
.bubble .md .cal-g {
  font-size: 11px;
  opacity: 0.8;
}
.bubble .md .cal-badge {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
}
.bubble .md .cal-events,
.bubble .md .cal-hit-list,
.bubble .md .cal-up-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bubble .md .cal-events li,
.bubble .md .cal-hit-list li,
.bubble .md .cal-up-list li {
  font-size: 12px;
  line-height: 1.45;
  padding: 2px 0;
  color: var(--ink);
}
.bubble .md .cal-events li.is-hol,
.bubble .md .cal-hit-list li.is-hol {
  color: #b91c1c;
}
.bubble .md .cal-hol-tag {
  margin-right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #b91c1c;
  opacity: 0.85;
}
.bubble .md .cal-empty-ev {
  font-size: 11.5px;
  color: var(--ink-secondary);
}
.bubble .md .cal-section {
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.bubble .md .cal-section-h {
  font-weight: 700;
  font-size: 12px;
  margin: 0 0 4px;
  color: var(--ink-secondary);
}
.bubble .md .cal-hit-list li,
.bubble .md .cal-up-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.bubble .md .cal-hit-date,
.bubble .md .cal-up-date {
  color: var(--ink-secondary);
  flex-shrink: 0;
  font-size: 11px;
}
html[data-theme="dark"] .bubble .md .car-price-card,
html[data-theme="dark"] .bubble .md .car-clarify-card,
html[data-theme="dark"] .bubble .md .cal-card {
  border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .bubble .md .cal-day.is-holiday .cal-day-num,
html[data-theme="dark"] .bubble .md .cal-badge,
html[data-theme="dark"] .bubble .md .cal-events li.is-hol,
html[data-theme="dark"] .bubble .md .cal-hit-list li.is-hol,
html[data-theme="dark"] .bubble .md .cal-hol-tag {
  color: #fca5a5;
}
.bubble .md .code-block .tok-kw { color: #af00db; }
.bubble .md .code-block .tok-str { color: #098658; }
.bubble .md .code-block .tok-type { color: #267f99; }
.bubble .md .code-block .tok-num { color: #098658; }
.bubble .md .code-block .tok-cmt { color: #6a9955; }
html[data-theme="dark"] .bubble .md .code-block .tok-kw { color: #c586c0; }
html[data-theme="dark"] .bubble .md .code-block .tok-str { color: #ce9178; }
html[data-theme="dark"] .bubble .md .code-block .tok-type { color: #4ec9b0; }
html[data-theme="dark"] .bubble .md .code-block .tok-num { color: #b5cea8; }
html[data-theme="dark"] .bubble .md .code-block .tok-cmt { color: #6a9955; }
.bubble .md code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.92em;
}
.bubble .md :not(pre) > code {
  background: var(--hover);
  padding: 1px 5px;
  border-radius: 5px;
}
.bubble img.gen, .bubble img.att {
  max-width: 360px;
  border-radius: 12px;
  margin: 8px 0;
  cursor: zoom-in;
}
.msg-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  max-width: min(720px, 86%);
}
.msg-row.assistant .msg-col { max-width: min(768px, 92%); }
.msg-row.user .msg-col {
  align-items: flex-start;
  width: 100%;
  max-width: min(768px, 100%);
}
.msg-row.user .msg-col .bubble { max-width: 100%; }
.msg-image {
  position: relative;
  width: min(280px, 72vw);
  min-height: min(280px, 72vw);
  max-width: min(360px, 86vw);
  border-radius: 18px;
  overflow: hidden;
  background: var(--hover);
}
.msg-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  max-width: 100%;
}
.msg-images--multi .msg-image {
  width: min(140px, 42vw);
  min-height: min(140px, 42vw);
  max-width: min(160px, 46vw);
}
.msg-image:has(img.blur-ready),
.msg-image:has(img.blob-ready) {
  width: fit-content;
  min-height: 0;
}
.msg-row.assistant .msg-image {
  align-self: auto;
}
.msg-row.assistant.msg-row--gen-image {
  width: 100%;
  justify-content: flex-end;
}
.msg-row.assistant.msg-row--gen-image .msg-col {
  flex: 1;
  width: 100%;
  max-width: 100%;
}
.msg-row.assistant.msg-row--gen-image .msg-image,
.msg-row.assistant.msg-row--gen-image .creating-image-box {
  margin-inline-start: auto;
  margin-inline-end: 0;
}
.msg-row.assistant.msg-row--gen-image .bubble {
  align-self: flex-start;
  max-width: min(768px, 100%);
}
.msg-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: 360px;
  height: auto;
  object-fit: cover;
  border-radius: 18px;
  cursor: zoom-in;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.msg-image-actions {
  position: absolute;
  inset-inline: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  z-index: 2;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.msg-image-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.msg-image-actions-left button {
  pointer-events: auto;
}
.msg-image-actions button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fafafa;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.msg-image-actions .msg-image-share {
  width: 32px;
  padding: 0;
}
.msg-image-actions button:hover { background: rgba(0, 0, 0, 0.72); }
.msg-image-actions .ico-svg { color: #fafafa; }
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--hover);
  font-size: 13px;
  margin: 6px 0;
}
.file-chip-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 2px 0 4px;
}
.file-chip-stack .file-chip {
  margin: 4px 0 0;
}
.file-chip-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 4px 4px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.72;
  color: var(--ink);
}
.file-chip-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.55;
  animation: bounce 1s infinite ease-in-out;
  flex-shrink: 0;
}
.file-chip--video .ico-svg { opacity: 0.85; }
.msg-user-video {
  max-width: min(360px, 100%);
  margin: 6px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0d0d0d;
}
.msg-user-video video {
  display: block;
  width: 100%;
  max-height: 280px;
  background: #0d0d0d;
}
.doc-file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(320px, 100%);
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  color: inherit;
  font: inherit;
  text-align: right;
  cursor: pointer;
}
.doc-file-chip:hover { background: #fafafa; }
html[data-theme="dark"] .doc-file-chip {
  background: #212121;
  border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .doc-file-chip:hover { background: #2a2a2a; }
.doc-file-ico { flex: 0 0 auto; display: flex; }
.doc-file-meta {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-file-meta b {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-file-meta small {
  font-size: 12px;
  color: var(--ink-60);
}
.doc-file-dl {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--ink-60);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.doc-file-chip:hover .doc-file-dl,
.doc-file-chip:focus-visible .doc-file-dl {
  opacity: 1;
}
.doc-file-chip:hover .doc-file-dl {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}
html[data-theme="dark"] .doc-file-chip:hover .doc-file-dl {
  background: rgba(255, 255, 255, 0.08);
}
@media (hover: none) {
  .doc-file-dl { opacity: 1; }
}
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.src {
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--hover);
  border: 1px solid var(--stroke);
  text-decoration: none;
  color: inherit;
}
.source-cite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fafafa;
  color: var(--ink-60);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  max-width: min(280px, 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.source-cite:hover { background: #fafafa; color: var(--ink); }
html[data-theme="dark"] .source-cite {
  background: #262626;
  border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .source-cite:hover { background: #333; }
.source-cite .cite-fav {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #fafafa;
}
.source-cite .cite-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.source-cite .cite-more {
  font-weight: 600;
  opacity: 0.85;
  flex: 0 0 auto;
}
.search-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}
.search-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 2px;
  max-width: min(520px, 92%);
}
.search-progress .search-status {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
}
.search-progress .search-detail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 500;
}
html[data-theme="dark"] .search-progress .search-detail {
  background: #1e3a5f;
  color: #fafafa;
  border-color: #3b82f6;
}
.search-progress .search-detail .ico-svg { color: inherit; flex: 0 0 auto; }
.search-progress .search-detail span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-worked {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.3;
}
.search-worked:hover { color: var(--ink); }
.scroll-fab {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(148px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.scroll-fab:hover { background: var(--hover); }
.scroll-fab[hidden] { display: none !important; }
.main.is-empty .scroll-fab { display: none !important; }
html[data-theme="dark"] .scroll-fab {
  background: #262626;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.fb {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  align-items: center;
}
.msg-row.user .fb {
  margin-top: 4px;
  align-self: flex-end; /* چپِ کامل ردیف پیام در RTL */
  width: fit-content;
}
/* دسکتاپ: آیکون‌های پیام کاربر فقط با هاور روی همان پیام */
@media (min-width: 981px) and (hover: hover) and (pointer: fine) {
  .msg-row.user .fb {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
  }
  .msg-row.user:hover .fb,
  .msg-row.user:focus-within .fb {
    opacity: 1;
    pointer-events: auto;
  }
}
.fb button {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 14px;
  opacity: 1;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #5d5d5d;
}
html[data-theme="dark"] .fb button {
  color: #cdcdcd;
}
.fb button:hover, .fb button.on { opacity: 1; background: var(--hover); color: #5d5d5d; }
html[data-theme="dark"] .fb button:hover,
html[data-theme="dark"] .fb button.on {
  color: #cdcdcd;
}
.msg-row.is-dimmed { opacity: 0.45; pointer-events: none; }
.msg-edit-box {
  width: min(640px, 100%);
  background: #efefef;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
html[data-theme="dark"] .msg-edit-box {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.1);
}
.msg-edit-box textarea {
  width: 100%;
  min-height: 72px;
  max-height: 220px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 0;
}
.msg-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.msg-edit-cancel,
.msg-edit-send {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.msg-edit-cancel {
  background: #fafafa;
  color: #0d0d0d;
  border: 1px solid #0d0d0d;
}
html[data-theme="dark"] .msg-edit-cancel {
  background: transparent;
  color: #fafafa;
  border-color: rgba(255, 255, 255, 0.55);
}
.msg-edit-send {
  background: #0d0d0d;
  color: #fafafa;
  border: 1px solid #0d0d0d;
}
html[data-theme="dark"] .msg-edit-send {
  background: #fafafa;
  color: #0d0d0d;
  border-color: #fafafa;
}
.thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0 2px;
}
.thinking-label {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.72;
  margin-inline-end: 4px;
}
.thinking i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: bounce 1s infinite ease-in-out;
}
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.creating-image-box {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--creating-bg);
  overflow: hidden;
  margin: 2px 0;
}
.msg-row.assistant.msg-row--gen-image .creating-image-box {
  margin-inline-start: auto;
  margin-inline-end: 0;
}
.creating-image-label {
  position: absolute;
  top: 14px;
  inset-inline-start: 16px;
  font-size: 13px;
  color: var(--muted);
  z-index: 1;
  pointer-events: none;
}
.creating-image-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.creating-image-box--done {
  aspect-ratio: 1;
  width: min(280px, 72vw);
  min-height: min(280px, 72vw);
  max-width: min(360px, 86vw);
  background: var(--hover);
}
.creating-image-box--done:has(img.blob-ready),
.creating-image-box--done:has(img.blur-ready) {
  aspect-ratio: auto;
  width: fit-content;
  min-height: 0;
}
.creating-image-box--done .creating-image-label,
.creating-image-box--done .creating-image-canvas {
  display: none;
}
.creating-image-box--done.msg-image img {
  border-radius: 18px;
}
.creating-image-box--done.creating-image-box--video,
.creating-image-box--video.creating-image-box--done {
  aspect-ratio: auto;
  width: min(420px, calc(100vw - 36px));
  max-width: min(420px, calc(100vw - 36px));
  min-width: min(260px, calc(100vw - 36px));
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
  align-self: stretch;
  box-sizing: border-box;
}
.creating-image-box--video.media-skel {
  width: min(100%, 360px);
}
.creating-image-box--pdf {
  display: flex;
  flex-direction: column;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--creating-bg);
  overflow: hidden;
  margin: 2px 0;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.creating-pdf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 14px 14px 10px;
}
.creating-pdf-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  margin: 0 12px;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.creating-pdf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.creating-pdf-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 14px;
}
.creating-pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid rgba(239, 68, 68, 0.22);
  flex-shrink: 0;
}
.creating-pdf-badge-ic {
  display: flex;
  align-items: center;
  opacity: 0.9;
}
.creating-pdf-badge-ic svg {
  stroke: currentColor;
}
.creating-pdf-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.9;
}
.creating-pdf-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creating-pdf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
  animation: pdfPulseRed 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pdfPulseRed {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.65;
    box-shadow: 0 0 4px #ef4444;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 0 10px #ef4444;
  }
}
.creating-pdf-detail {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.creating-pdf-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  direction: ltr;
}
.creating-pdf-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.14);
  overflow: hidden;
  position: relative;
}
.creating-pdf-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.45);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.creating-pdf-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: pdfShineSweep 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes pdfShineSweep {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
.creating-pdf-pct {
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
  direction: rtl;
}
html[data-theme="dark"] .creating-image-box--pdf {
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.12);
}
html[data-theme="dark"] .creating-pdf-stage {
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .creating-pdf-badge {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}
html[data-theme="dark"] .creating-pdf-track {
  background: rgba(239, 68, 68, 0.18);
}
html[data-theme="dark"] .creating-pdf-pct {
  color: #f87171;
}
.msg-pdf-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(320px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 2px 0;
  box-sizing: border-box;
}
.msg-row.assistant.msg-row--gen-image .msg-pdf-wrap {
  margin-inline-start: auto;
  margin-inline-end: 0;
}
.msg-pdf-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  background: #fff;
  margin: 0;
  box-shadow: 0 4px 18px color-mix(in srgb, #000 8%, transparent);
}
.msg-pdf-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  padding: 16px 12px;
  border-radius: 16px;
  background: #f3f3f3;
}
.msg-pdf-preview {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px color-mix(in srgb, #000 14%, transparent);
}
.msg-pdf-preview img,
.msg-pdf-preview-img {
  display: block;
  width: 132px;
  height: auto;
  min-height: 120px;
  aspect-ratio: 1 / 1.414;
  object-fit: cover;
  object-position: top center;
  background: #fff;
  opacity: 1;
}
.msg-pdf-preview-img:not(.is-ready):not([src]) {
  opacity: 0;
}
.msg-pdf-preview--fallback {
  width: 132px;
  height: 186px;
  display: grid;
  place-items: center;
  background: #fff;
}
.msg-pdf-fallback-ico {
  opacity: 0.45;
  color: #ef4444;
}
.msg-pdf-size-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #1f1f1f 72%, transparent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  backdrop-filter: blur(6px);
}
.msg-pdf-size-ic {
  display: inline-flex;
  color: #ef4444;
  line-height: 0;
}
.msg-pdf-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.msg-pdf-file-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.msg-pdf-file-ico .pdf-doc-ico {
  display: block;
}
.msg-pdf-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
}
.msg-pdf-title {
  display: block;
  max-width: 100%;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.msg-pdf-pages {
  font-size: 12px;
  color: var(--muted);
}
.msg-pdf-chevron {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.55;
  line-height: 0;
}
.msg-pdf-chevron .ico-svg,
.msg-pdf-chevron iconsax-icon {
  transform: rotate(90deg);
}
.msg-pdf-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.msg-pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--send-blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}
.msg-pdf-btn.msg-pdf-download {
  background: transparent;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
}
.msg-pdf-btn:hover {
  background: color-mix(in srgb, var(--send-blue) 86%, #000);
}
.msg-pdf-btn.msg-pdf-download:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.msg-pdf-btn:active {
  transform: scale(0.98);
}
html[data-theme="dark"] .msg-pdf-card {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .msg-pdf-stage {
  background: #1c1c1c;
}
html[data-theme="dark"] .msg-pdf-preview,
html[data-theme="dark"] .msg-pdf-preview--fallback {
  background: #262626;
}
html[data-theme="dark"] .msg-pdf-size-badge {
  background: color-mix(in srgb, #000 55%, transparent);
}
html[data-theme="dark"] .msg-pdf-btn:hover {
  background: color-mix(in srgb, var(--send-blue) 78%, #fff);
}
html[data-theme="dark"] .msg-pdf-btn.msg-pdf-download {
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.16);
}
html[data-theme="dark"] .msg-pdf-btn.msg-pdf-download:hover {
  background: rgba(255, 255, 255, 0.08);
}
html.is-twa .msg-pdf-wrap,
html.is-standalone .msg-pdf-wrap {
  width: min(320px, 100%);
  max-width: 100%;
}
@media (max-width: 959px) {
  .msg-pdf-wrap {
    width: min(320px, 100%);
    max-width: 100%;
  }
}
.creating-image-box--slides {
  display: flex;
  flex-direction: column;
  width: min(340px, 88vw);
  aspect-ratio: 16 / 11;
  min-height: 220px;
  border-radius: 24px;
  background: var(--creating-bg);
  overflow: hidden;
  margin: 2px 0;
  box-sizing: border-box;
  box-shadow: 0 4px 22px rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.18);
}
.creating-slides-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 14px 14px 10px;
}
.creating-slides-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  margin: 0 12px;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.creating-slides-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.creating-slides-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 14px;
}
.creating-slides-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(34, 197, 94, 0.22);
  flex-shrink: 0;
}
.creating-slides-badge-ic {
  display: flex;
  align-items: center;
  opacity: 0.92;
}
.creating-slides-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.92;
}
.creating-slides-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creating-slides-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
  animation: slidesPulseGreen 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes slidesPulseGreen {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.65;
    box-shadow: 0 0 4px #22c55e;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
    box-shadow: 0 0 10px #22c55e;
  }
}
.creating-slides-detail {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.creating-slides-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  direction: ltr;
}
.creating-slides-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  overflow: hidden;
  position: relative;
}
.creating-slides-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.45);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.creating-slides-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: slidesShineSweep 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes slidesShineSweep {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
.creating-slides-pct {
  font-size: 12px;
  font-weight: 700;
  color: #16a34a;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
  direction: rtl;
}
html[data-theme="dark"] .creating-image-box--slides {
  border-color: rgba(74, 222, 128, 0.25);
  box-shadow: 0 4px 24px rgba(34, 197, 94, 0.12);
}
html[data-theme="dark"] .creating-slides-stage {
  background: rgba(255, 255, 255, 0.03);
}
html[data-theme="dark"] .creating-slides-badge {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}
html[data-theme="dark"] .creating-slides-track {
  background: rgba(34, 197, 94, 0.18);
}
html[data-theme="dark"] .creating-slides-pct {
  color: #4ade80;
}
.msg-webdev-wrap {
  display: flex;
  flex-direction: column;
  width: min(360px, 92vw);
  margin: 2px 0;
}
.msg-row.assistant.msg-row--gen-image .msg-webdev-wrap {
  margin-inline-start: auto;
  margin-inline-end: 0;
}
.msg-webdev-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  background: #fff;
  box-shadow: 0 4px 18px color-mix(in srgb, #000 8%, transparent);
}
.msg-webdev-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 2px 4px 0;
  text-align: start;
}
.msg-webdev-kind {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--send-blue);
}
.msg-webdev-head-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}
.msg-webdev-stage {
  position: relative;
  min-height: 0;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  overflow: hidden;
}
.msg-webdev-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 232px;
  margin: 0;
  padding: 0;
  border: 0;
  background: #f3f3f3;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
}
.msg-webdev-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 900px;
  max-width: none;
  border: 0;
  background: #fff;
  pointer-events: none;
  transform-origin: top left;
  transform: scale(0.26);
}
.msg-webdev-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
}
.msg-webdev-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.msg-webdev-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}
.msg-webdev-sub {
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--ink) 58%, transparent);
}
.msg-webdev-chevron {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.55;
  line-height: 0;
  margin-inline-start: 8px;
  padding-inline: 2px;
}
.msg-webdev-chevron .ico-svg,
.msg-webdev-chevron iconsax-icon {
  transform: rotate(90deg);
}
html[dir="rtl"] .msg-webdev-chevron {
  margin-inline-start: 0;
  margin-inline-end: 8px;
}
.msg-webdev-linkrow {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 5%, #fff);
}
.msg-webdev-link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--send-blue);
  text-decoration: none;
}
.msg-webdev-copy {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.msg-webdev-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.msg-webdev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--send-blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}
.msg-webdev-btn.msg-webdev-download {
  background: transparent;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent);
}
.msg-webdev-btn:hover {
  background: color-mix(in srgb, var(--send-blue) 86%, #000);
}
.msg-webdev-btn.msg-webdev-download:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.msg-webdev-btn:active,
.msg-webdev-copy:active {
  transform: scale(0.98);
}
html[data-theme="dark"] .msg-webdev-card {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}
@media (max-width: 959px) {
  .msg-webdev-wrap {
    width: min(100%, 92vw);
  }
  .msg-webdev-frame {
    width: 100%;
    height: 100%;
    transform: none;
  }
}
html.is-twa .msg-webdev-wrap,
html.is-standalone .msg-webdev-wrap {
  width: 100%;
  max-width: 100%;
}
html.is-twa .msg-webdev-frame,
html.is-standalone .msg-webdev-frame {
  width: 100%;
  height: 100%;
  transform: none;
}
html[data-theme="dark"] .msg-webdev-preview {
  background: #141414;
}
html[data-theme="dark"] .msg-webdev-frame {
  background: #fff;
}
html[data-theme="dark"] .msg-webdev-head-title,
html[data-theme="dark"] .msg-webdev-title {
  color: #f2f2f2;
}
html[data-theme="dark"] .msg-webdev-sub {
  color: rgba(255, 255, 255, 0.58);
}
html[data-theme="dark"] .msg-webdev-linkrow {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .msg-webdev-copy {
  color: #f2f2f2;
}
html[data-theme="dark"] .msg-webdev-btn:hover {
  background: color-mix(in srgb, var(--send-blue) 78%, #fff);
}
html[data-theme="dark"] .msg-webdev-btn.msg-webdev-download {
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.16);
  background: transparent;
}
html[data-theme="dark"] .msg-webdev-btn.msg-webdev-download:hover {
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .msg-webdev-chevron {
  opacity: 0.72;
}
.creating-image-box--webdev .magic-gen-box.pdf {
  --magic-accent: #6366f1;
}
.msg-slides-wrap {
  display: flex;
  flex-direction: column;
  width: min(380px, 92vw);
  margin: 2px 0;
}
.msg-row.assistant.msg-row--gen-image .msg-slides-wrap {
  margin-inline-start: auto;
  margin-inline-end: 0;
}
.msg-slides-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(34, 197, 94, 0.16);
  background: #fff;
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.08);
}
.msg-slides-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f0fdf4;
}
.msg-slides-hero-wrap {
  position: relative;
}
.msg-slides-hero {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: #ecfdf5;
  cursor: zoom-in;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
}
.msg-slides-hero--empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  color: #16a34a;
  opacity: 0.45;
  border-radius: 16px;
  background: #f0fdf4;
}
.msg-slides-hero-img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  background: #ecfdf5;
  z-index: 1;
}
.msg-slides-hero .blurhash-canvas,
.msg-slides-strip-item .blurhash-canvas {
  display: none !important;
}
.msg-slides-nav {
  position: absolute;
  top: 50%;
  margin-top: -18px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  padding: 0;
}
.msg-slides-nav:hover {
  background: rgba(0, 0, 0, 0.68);
}
.msg-slides-nav--prev {
  left: 8px !important;
  right: auto !important;
}
.msg-slides-nav--next {
  right: 8px !important;
  left: auto !important;
}
.msg-slides-chev {
  display: block;
  pointer-events: none;
}
.msg-slides-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.16));
  pointer-events: none;
}
.msg-slides-index {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  direction: rtl;
}
.msg-slides-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-slides-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.msg-slides-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.msg-slides-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.msg-slides-count {
  font-size: 12px;
  color: color-mix(in srgb, var(--text) 62%, transparent);
}
.msg-slides-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.msg-slides-strip-item {
  position: relative;
  flex: 0 0 88px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #f3f3f3;
  scroll-snap-align: start;
  transition: border-color 0.15s ease, transform 0.12s ease;
  aspect-ratio: 16 / 9;
}
.msg-slides-strip-item.is-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}
.msg-slides-strip-item img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
}
.msg-slides-strip-num {
  display: none;
}
.msg-slides-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.msg-slides-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 96px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.msg-slides-btn--primary {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.28);
}
.msg-slides-btn:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.msg-slides-btn--primary:hover {
  background: linear-gradient(135deg, #15803d, #16a34a);
}
.msg-slides-btn:active {
  transform: scale(0.98);
}
html[data-theme="dark"] .msg-slides-card {
  background: #1a1a1a;
  border-color: rgba(74, 222, 128, 0.2);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .msg-slides-stage {
  background: #14241c;
}
html[data-theme="dark"] .msg-slides-strip-item {
  background: #262626;
}
html[data-theme="dark"] .msg-slides-btn {
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.16);
}
.creating-image-box--video .media-video,
.creating-image-box--video video {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: min(420px, 70vh);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0d0d0d;
  border-radius: 18px 18px 0 0;
}
.creating-image-box--video.is-portrait .media-video,
.creating-image-box--video.is-square .media-video {
  aspect-ratio: auto;
  max-height: min(560px, 72vh);
}
.creating-image-box--video.creating-image-box--done.is-portrait {
  width: min(300px, calc(100vw - 36px));
  max-width: min(300px, calc(100vw - 36px));
  min-width: min(220px, calc(100vw - 36px));
}
.creating-image-box--video.creating-image-box--done.is-square {
  width: min(360px, calc(100vw - 36px));
  max-width: min(360px, calc(100vw - 36px));
}
@media (max-width: 980px) {
  .msg-row.assistant.msg-row--gen-image .creating-image-box--video.is-portrait {
    width: min(300px, calc(100vw - 36px));
    max-width: min(300px, calc(100vw - 36px));
    align-self: flex-start;
  }
}

/* Video settings bar — above composer, 10px gap like image showcase */
.video-opts {
  width: min(768px, calc(100% - 48px));
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.video-opts[hidden] { display: none !important; }
.video-opts::-webkit-scrollbar { display: none; }
.main:not(.is-empty) .video-opts {
  pointer-events: auto;
}
.vopt-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.vopt-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--pill-stroke);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  letter-spacing: -0.1px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.vopt-pill:hover:not([disabled]) { background: rgba(0, 0, 0, 0.04); }
.vopt-pill[disabled] { cursor: default; opacity: 0.85; }
.vopt-caret { display: inline-flex; opacity: 0.6; }
.video-opts[data-open-key="model"] [data-vopt="model"],
.video-opts[data-open-key="style"] [data-vopt="style"],
.video-opts[data-open-key="duration"] [data-vopt="duration"],
.video-opts[data-open-key="aspect"] [data-vopt="aspect"],
.video-opts[data-open-key="resolution"] [data-vopt="resolution"] {
  background: #e8f0fe;
  border-color: #c7d7fb;
  color: #1d4ed8;
}
.vopt-cost {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.vopt-cost.is-over {
  background: #fdecec;
  color: #b42318;
}
.vopt-pop {
  position: fixed;
  z-index: 240;
  min-width: 180px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(360px, calc(100dvh - 24px));
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.vopt-pop-head {
  padding: 6px 10px 4px;
  font-size: 12px;
  opacity: 0.6;
}
.vopt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  text-align: start;
  cursor: pointer;
}
.vopt-item:hover { background: rgba(0, 0, 0, 0.05); }
.vopt-item.on { background: #e8f0fe; color: #1d4ed8; }
.vopt-item-label { flex: 1 1 auto; }
.vopt-item-cost { font-size: 12px; opacity: 0.7; }
.vopt-check { display: inline-flex; width: 14px; }
[data-theme="dark"] .vopt-pill:hover:not([disabled]),
[data-theme="dark"] .vopt-item:hover { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .vopt-cost,
[data-theme="dark"] .vopt-item.on,
[data-theme="dark"] .video-opts[data-open-key="model"] [data-vopt="model"],
[data-theme="dark"] .video-opts[data-open-key="style"] [data-vopt="style"],
[data-theme="dark"] .video-opts[data-open-key="duration"] [data-vopt="duration"],
[data-theme="dark"] .video-opts[data-open-key="aspect"] [data-vopt="aspect"],
[data-theme="dark"] .video-opts[data-open-key="resolution"] [data-vopt="resolution"] {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #bfdbfe;
}
[data-theme="dark"] .vopt-cost.is-over {
  background: #4a1d1d;
  color: #fca5a5;
}
.creating-image-box--video .media-video-bar {
  padding: 8px 10px 10px;
  background: #141414;
}
@media (max-width: 980px) {
  .msg-row.assistant.msg-row--gen-image .msg-col {
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }
  .msg-row.assistant.msg-row--gen-image .creating-image-box--video,
  .msg-row.assistant.msg-row--gen-image .creating-image-box--done.creating-image-box--video,
  .msg-row.assistant.msg-row--gen-image .creating-image-box--video.creating-image-box--done,
  .msg-row.assistant.msg-row--gen-image .media-video-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
  }
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.gallery-head h3 { margin: 0; }
.gallery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gallery-actions .btn-text {
  border: 0;
  background: transparent;
  color: var(--send-blue);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 4px;
}
.gallery-actions .btn-icon {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.gallery-actions .btn-icon.on,
.gallery-actions .btn-icon:hover { background: var(--stroke); }
.gal-item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: var(--hover);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  min-height: 140px;
}
.gal-item .blurhash-canvas,
.msg-image .blurhash-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  filter: blur(12px);
  transform: scale(1.08);
  pointer-events: none;
}
.gal-item .blurhash-canvas.is-done,
.msg-image .blurhash-canvas.is-done {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gal-item img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.28s ease;
  background: transparent;
}
.gal-item img.blur-ready,
.msg-image img.blur-ready {
  opacity: 1;
}
.gal-check {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #fafafa;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 2;
}
.gallery.selecting .gal-check { display: block; }
.gal-item.on .gal-check {
  background: var(--send-blue);
  border-color: #fafafa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}
.gal-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}
.gal-bar .btn {
  flex: 1;
}
.gal-bar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.msg-row.upgrade-row .bubble-av {
  display: none;
}
.msg-row.upgrade-row .msg-col {
  max-width: min(640px, 100%);
}
.upgrade-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.upgrade-card-text {
  flex: 1;
  min-width: 0;
}
.upgrade-card-text b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.upgrade-card-text p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}
.upgrade-card-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.upgrade-card-code b {
  letter-spacing: 0.04em;
}
.upgrade-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.upgrade-card.is-budget .upgrade-card-actions {
  flex-direction: column;
  align-items: stretch;
}
.upgrade-card-btn {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.upgrade-card-btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
.upgrade-card-btn:hover {
  opacity: 0.92;
}
.upgrade-card-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.upgrade-card-close:hover {
  background: var(--hover);
  color: var(--ink);
}
@media (max-width: 640px) {
  .upgrade-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .upgrade-card-actions {
    justify-content: space-between;
  }
  .upgrade-card-btn {
    flex: 1;
  }
}

.empty-hero {
  display: none;
  text-align: center;
  padding: 0 24px 16px;
  flex: 0 0 auto;
}
.main.is-empty .empty-hero {
  display: block;
  padding: 0 24px 0;
}
.main.is-empty .empty-hero .mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
}
.main.is-empty .empty-hero.empty-hero--intro .mark {
  animation: gimino-mark-in 0.56s cubic-bezier(0.34, 1.4, 0.64, 1) both,
    gimino-mark-pulse 0.48s ease-in-out 0.56s 1 both;
}
.main.is-empty .empty-hero.empty-hero--intro h2,
.main.is-empty .empty-hero.empty-hero--intro h1 {
  animation: gimino-title-in 0.42s ease-out 0.16s both;
}
.chat-sale-slot {
  --sale-notch: var(--bg, #f5f5f5);
  position: relative;
  container-type: inline-size;
  align-self: center;
  flex-shrink: 0;
  width: min(640px, calc(100% - 32px));
  margin: 10px auto 0;
}
html[data-theme="dark"] .chat-sale-slot {
  --sale-notch: var(--bg, #0d0d0d);
}
.chat-sale-dismiss {
  position: absolute;
  top: -8px;
  inset-inline-start: -8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #334155;
  border-radius: 999px;
  background: #111827;
  color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-sale-dismiss:hover {
  background: #1e293b;
  color: #e2e8f0;
}
.chat-sale-slot[hidden] {
  display: none !important;
  margin: 0;
}
.chat-sale {
  --s: min(1, 100cqi / 640px);
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: calc(18px * var(--s));
  color: #f8fafc;
  text-align: right;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(140px 90px at 88% 20%, rgba(248, 113, 113, 0.28), transparent 70%),
    radial-gradient(160px 100px at 20% 90%, rgba(59, 130, 246, 0.28), transparent 70%),
    linear-gradient(135deg, #0b1220 0%, #111827 55%, #0f172a 100%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
}
.chat-sale::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.07) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: subscribe-shimmer 2.4s linear infinite;
  pointer-events: none;
  z-index: 1;
}
.chat-sale:hover {
  border-color: rgba(251, 146, 60, 0.45);
}
.chat-sale-stub {
  position: relative;
  z-index: 2;
  flex: 0 0 calc(92px * var(--s));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(6px * var(--s));
  padding: calc(10px * var(--s)) calc(8px * var(--s));
  color: #fff;
  text-align: center;
  background:
    radial-gradient(circle at left 18px, var(--sale-notch) 7px, transparent 7.5px) left / 100% 18px repeat-y,
    linear-gradient(145deg, #ef4444, #b91c1c);
  border-inline-end: 1.5px dashed rgba(254, 202, 202, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(254, 202, 202, 0.28),
    0 10px 24px rgba(239, 68, 68, 0.28);
}
.chat-sale-stub b {
  font-size: calc(22px * var(--s));
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}
.chat-sale-stub > span {
  font-size: calc(10px * var(--s));
  font-weight: 800;
  opacity: 0.92;
}
.chat-sale-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: calc(10px * var(--s));
  padding: calc(10px * var(--s)) calc(12px * var(--s));
}
.chat-sale-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.chat-sale-copy {
  order: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.chat-sale-copy strong,
.chat-sale-copy small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sale-copy strong {
  font-size: calc(13px * var(--s));
  font-weight: 800;
  color: #f8fafc;
}
.chat-sale-copy small {
  margin-top: calc(3px * var(--s));
  color: #94a3b8;
  font-size: calc(11px * var(--s));
  font-weight: 600;
}
.chat-sale-plans {
  order: 2;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: calc(6px * var(--s));
}
.chat-sale-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(134, 239, 172, 0.28);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.chat-sale-mark:nth-child(2) {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.3);
}
.chat-sale-mark:nth-child(3),
.chat-sale-mark:nth-child(4) {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.3);
}
.chat-sale-clock {
  display: flex;
  flex-direction: row;
  direction: rtl;
  justify-content: flex-start;
  gap: calc(5px * var(--s));
  flex-shrink: 0;
}
.chat-sale-clock span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(44px * var(--s));
  height: calc(44px * var(--s));
  border-radius: calc(11px * var(--s));
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.12);
  color: #fff;
}
.chat-sale-clock b {
  font-size: calc(15px * var(--s));
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.chat-sale-clock i {
  margin-top: calc(3px * var(--s));
  color: #fdba74;
  font-size: calc(9px * var(--s));
  font-style: normal;
  font-weight: 700;
}
.chat-sale-go {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: calc(40px * var(--s));
  padding: 0 calc(14px * var(--s));
  border-radius: calc(12px * var(--s));
  background: linear-gradient(135deg, #fb923c, #f97316);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.35);
  color: #fff;
  font-size: calc(12px * var(--s));
  font-weight: 800;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .chat-sale::before {
    animation: none;
    display: none;
  }
}
@media (max-width: 720px) {
  .chat-sale-slot {
    width: calc(100% - 24px);
    margin-top: 8px;
  }
  .chat-sale {
    --s: 1;
    flex-direction: column;
    align-items: stretch;
  }
  .chat-sale-stub {
    flex: none;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #dc2626;
    background-image:
      radial-gradient(circle at 9px 0, var(--sale-notch) 6px, transparent 7px),
      linear-gradient(90deg, #ef4444 0%, #dc2626 45%, #b91c1c 100%);
    background-repeat: repeat-x, no-repeat;
    background-position: top left, center;
    background-size: 18px 12px, 100% 100%;
    border-inline-end: 0;
    border-bottom: 1.5px dashed rgba(254, 226, 226, 0.65);
    box-shadow: inset 0 0 0 1px rgba(254, 202, 202, 0.2);
  }
  .chat-sale-stub b {
    font-size: 18px;
  }
  .chat-sale-stub > span {
    font-size: 11px;
  }
  .chat-sale-body {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px 12px;
  }
  .chat-sale-info {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .chat-sale-plans {
    order: 0;
    margin-top: 0;
    flex-shrink: 0;
  }
  .chat-sale-copy {
    order: 1;
    flex: 1;
    min-width: 0;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }
  .chat-sale-copy strong {
    font-size: 13px;
    flex: 0 1 auto;
  }
  .chat-sale-copy small {
    margin-top: 0;
    font-size: 11.5px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .chat-sale-clock {
    width: 100%;
    gap: 5px;
  }
  .chat-sale-clock span {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: 40px;
  }
  .chat-sale-clock b {
    font-size: 14px;
  }
  .chat-sale-clock i {
    font-size: 9px;
  }
  .chat-sale-go {
    width: 100%;
    height: 40px;
    font-size: 13px;
  }
}
.main.is-empty .empty-hero--temp {
  display: block;
}
.main.is-empty .empty-hero--temp .temp-hero-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  color: var(--ink);
}
.main.is-empty .empty-hero--temp .temp-hero-ico .ico-svg {
  width: 52px;
  height: 52px;
}
.main.is-empty .empty-hero--temp h2 {
  margin: 0 0 10px;
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.temp-hero-sub {
  margin: 0 auto;
  max-width: 420px;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.7;
}
html.is-temp-chat .main.is-empty .empty-hero--intro {
  display: none;
}
html.is-temp-chat .main.is-empty .empty-hero--temp {
  display: block;
}
html:not(.is-temp-chat) .empty-hero--temp {
  display: none !important;
}
.icon-btn.temp-save-btn.is-disabled {
  opacity: 0.38;
  pointer-events: auto;
  cursor: not-allowed;
}
@keyframes gimino-mark-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.72);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes gimino-mark-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}
@keyframes gimino-title-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .main.is-empty .empty-hero.empty-hero--intro .mark,
  .main.is-empty .empty-hero.empty-hero--intro h2,
  .main.is-empty .empty-hero.empty-hero--intro h1 {
    animation: none;
  }
}
.main.is-empty .messages { display: none; }
.main.is-empty .composer-wrap {
  flex: 1 1 0;
  min-height: 0;
  padding: 28px 24px calc(20px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  position: relative;
  background: transparent;
}
.main.is-empty .composer-wrap::before {
  display: none;
}
.main.is-empty .composer {
  width: min(768px, calc(100% - 48px));
  max-width: 768px;
  margin-inline: auto;
  padding: 12px 14px 10px;
  border-radius: 28px;
  background: var(--composer);
  border: 1px solid var(--composer-stroke);
  box-shadow: var(--shadow-composer-home);
}
.main.is-empty .composer textarea {
  min-height: 24px;
  font-size: 16px;
  line-height: 1.45;
}
.main.is-empty .composer-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}
.main.is-empty .composer-tools {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 148px);
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}
.main.is-empty .composer-tools::-webkit-scrollbar { display: none; }
.main.is-empty .composer-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
}
.main.is-empty .composer-actions .icon-btn,
.main.is-empty .composer-actions .composer-mini,
.main.is-empty .composer-actions .attach-btn,
.main.is-empty .composer-actions .composer-mic,
.main.is-empty .composer-actions .send {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  padding: 0;
  border-radius: 999px;
  pointer-events: auto;
  touch-action: manipulation;
}
.main.is-empty .pill {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  flex-shrink: 0;
}
.empty-hero .mark { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--ink); }
.empty-hero h1,
.empty-hero h2 {
  margin: 0;
  font-size: clamp(18px, 3.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.35;
}
.empty-hero-sub {
  margin: 10px auto 0;
  max-width: 36rem;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 400;
}
.seo-root {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  color: var(--ink, #0d0d0d);
  font-size: 14px;
  line-height: 1.85;
  border-top: 1px solid var(--line, rgba(0,0,0,.08));
}
.seo-root-inner h1 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}
.seo-root-inner h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}
.seo-root-inner h3 {
  margin: 16px 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.seo-root-inner p,
.seo-root-inner ul {
  margin: 0 0 10px;
  color: var(--muted, #666);
}
.seo-root-inner a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
html[data-theme="dark"] .seo-root {
  border-top-color: rgba(255,255,255,.08);
}
@media (max-width: 980px) {
  .seo-root { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
}
.recents-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 10px 10px 4px;
}
.recents-label.is-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: start;
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding: 10px 10px 4px;
  border-radius: 8px;
}
.recents-label.is-toggle:hover {
  color: var(--ink);
  background: var(--hover);
}

.composer-wrap {
  padding: 0 24px calc(10px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  overflow: visible;
  background: transparent;
}
.composer-disclaimer {
  margin: 10px 8px 0;
  max-width: min(640px, 100%);
  padding: 0 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}
/* Chat: float over messages — room in wrap so box-shadow is not clipped */
.main:not(.is-empty) .composer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  flex: none;
  padding: 28px 24px calc(12px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  pointer-events: none;
  background: transparent;
  overflow: visible;
  z-index: 3;
}
.main:not(.is-empty) .composer-wrap::before {
  content: none;
}
.composer {
  width: min(768px, 100%);
  background: var(--composer);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-composer);
  box-shadow: var(--shadow-composer);
  display: flex;
  flex-direction: column;
  padding: 12px 14px 10px;
  position: relative;
  z-index: 1;
}
.main:not(.is-empty) .composer {
  width: min(768px, calc(100% - 48px));
  pointer-events: auto;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-composer);
}
html[data-theme="dark"] .main:not(.is-empty) .composer {
  background: #212121;
  border: 0;
  box-shadow: none;
}
html[data-theme="dark"] .composer,
html[data-theme="dark"] .main.is-empty .composer {
  background: #212121;
  border: 0;
  box-shadow: none;
}
.main:not(.is-empty) .models-pop {
  pointer-events: auto;
}
.main:not(.is-empty) .composer-bar,
.main:not(.is-empty) .composer-actions,
.main:not(.is-empty) .composer-tools,
.main:not(.is-empty) .composer textarea,
.main:not(.is-empty) .composer-mini,
.main:not(.is-empty) .attach-btn,
.main:not(.is-empty) .composer-mic,
.main:not(.is-empty) .send {
  pointer-events: auto;
}
.composer textarea {
  width: 100%;
  min-height: 26px;
  max-height: 180px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.1px;
}
.composer textarea::placeholder { color: var(--composer-placeholder); }
.composer-ph-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.composer-ph-wrap textarea {
  position: relative;
  z-index: 2;
  background: transparent;
}
/* Legacy composer-ph-wrap only — #composerField uses chat-ux.css overlay */
.composer-ph-wrap .composer-ph {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
  display: block;
  padding: 0;
  margin: 0;
  min-height: 26px;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.1px;
  color: var(--composer-placeholder);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.composer-ph-wrap .composer-ph-caret {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-inline-start: 2px;
  vertical-align: -2px;
  background: var(--composer-placeholder);
  animation: composerPhCaret 0.7s steps(1) infinite;
}
@keyframes composerPhCaret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.composer-ph-wrap.ph-hidden .composer-ph,
.composer-ph-wrap:has(textarea:not(:placeholder-shown)) .composer-ph {
  opacity: 0 !important;
  visibility: hidden !important;
  animation: none !important;
  pointer-events: none;
}
.main.is-empty .composer-ph-wrap .composer-ph {
  font-size: 15px;
  line-height: 1.4;
}
.composer-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  min-width: 0;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 148px);
  flex-wrap: nowrap;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}
.composer-tools::-webkit-scrollbar { display: none; }
.composer-tools > .pill {
  flex: 0 1 auto;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  pointer-events: auto;
}
.composer-tools > .active-tool {
  flex: 0 0 auto;
  min-width: 0;
}
.composer-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-inline-start: auto;
  position: relative;
  z-index: 3;
}
.composer-actions .icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--pill-stroke);
  font-size: 13px;
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.pill.composer-model[hidden],
#btnModel[hidden],
#btnModelTop[hidden],
.topbar .combo.top-model[hidden] {
  display: none !important;
}
.pill.composer-model {
  max-width: min(200px, 52vw);
  width: fit-content;
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  font-weight: 500;
  height: 32px;
  padding-inline: 10px 12px;
  overflow: hidden;
  box-sizing: border-box;
}
.pill.composer-model #modelLabel {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill.composer-model .ico-svg,
.pill.composer-model iconsax-icon { flex-shrink: 0; opacity: 0.85; }
.pill.composer-model .model-caret,
.pill.composer-model .model-caret iconsax-icon {
  opacity: 0.55;
  margin-inline-start: 4px;
}

.effort-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
.effort-chip {
  border: 1px solid var(--stroke);
  background: var(--chip);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.effort-chip.on {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--send-blue);
  color: var(--send-blue);
  box-shadow: none;
}
html[data-theme="dark"] .effort-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}
html[data-theme="dark"] .effort-chip.on {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--send-blue);
  color: #93c5fd;
}

.list-row .menu-cost.model-effort-tag {
  background: rgba(59, 130, 246, 0.12);
  color: var(--send-blue);
  border: 0;
  font-size: 11px;
  font-weight: 600;
}
html[data-theme="dark"] .list-row .menu-cost.model-effort-tag {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.list-row.on .menu-cost.model-effort-tag {
  background: var(--send-blue);
  color: #fafafa;
}
.list-row.effort-row .effort-row-val {
  margin-inline-start: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--send-blue);
  white-space: nowrap;
}
.list-row.effort-row .row-chevron {
  margin-inline-start: 6px;
}
html[data-theme="dark"] .list-row.effort-row .effort-row-val {
  color: #93c5fd;
}
/* Think / misc: solid invert when on */
.pill.on:not(.tool) {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
html[data-theme="dark"] .pill.on:not(.tool) {
  background: #fafafa;
  color: #0d0d0d;
  border-color: #fafafa;
}
/* Image / web / deep research — gray stroke idle, light-blue active */
button.pill.tool,
.pill.tool {
  background: #fafafa;
  color: #0d0d0d;
  border: 1px solid #c8c8c8;
  font-weight: 500;
}
button.pill.tool .ico-svg,
.pill.tool .ico-svg { color: #0d0d0d; opacity: 1; }
button.pill.tool.on,
button.pill.tool[aria-pressed="true"],
.pill.tool.on {
  background: #e8f0fe !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}
button.pill.tool.on .ico-svg,
button.pill.tool[aria-pressed="true"] .ico-svg,
.pill.tool.on .ico-svg {
  color: #1d4ed8 !important;
  opacity: 1;
}
html[data-theme="dark"] button.pill.tool,
html[data-theme="dark"] .pill.tool {
  background: transparent;
  color: #f5f5f5;
  border-color: rgba(217, 217, 217, 0.4);
}
html[data-theme="dark"] button.pill.tool .ico-svg,
html[data-theme="dark"] .pill.tool .ico-svg { color: #f5f5f5; }
html[data-theme="dark"] button.pill.tool.on,
html[data-theme="dark"] button.pill.tool[aria-pressed="true"],
html[data-theme="dark"] .pill.tool.on {
  background: #1e3a5f !important;
  color: #93c5fd !important;
  border-color: #3b82f6 !important;
}
html[data-theme="dark"] button.pill.tool.on .ico-svg,
html[data-theme="dark"] button.pill.tool[aria-pressed="true"] .ico-svg,
html[data-theme="dark"] .pill.tool.on .ico-svg {
  color: #93c5fd !important;
}

/* Active tool chip inside composer — unused; keep hidden */
.tool-chip-row { display: none !important; }
.tool-chip-row[hidden] { display: none !important; }
.attach-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}
.attach-btn:hover,
.attach-btn:focus-visible {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
}
html[data-theme="dark"] .attach-btn {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.composer-bar > .attach-btn {
  order: 0;
}
.attach-previews {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0;
  min-width: 0;
}
.attach-previews:empty {
  display: none;
}
.composer > .attach-previews--stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 2px 0 8px;
  margin: 0;
  pointer-events: none;
}
.composer > .attach-previews--stack:empty {
  display: none;
  padding: 0;
}
.composer > .attach-previews--stack .att-preview {
  pointer-events: auto;
}
.att-preview {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--hover);
  border: 1px solid var(--stroke);
  flex: 0 0 auto;
  cursor: pointer;
}
.att-preview img { width: 100%; height: 100%; object-fit: cover; }
.att-preview.att-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
}
.att-preview.att-file .ico-svg { color: var(--ink); opacity: 0.7; }
.att-preview.att-video .ico-svg { color: var(--accent, #2563eb); opacity: 0.9; }
.att-file-name {
  font-size: 9px;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  padding: 0 2px;
}
.att-preview button {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0d0d0d;
  color: #fafafa;
  font-size: 11px;
  line-height: 18px;
}
.composer-mic {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.composer-mic:hover { background: var(--hover); }
.composer-mic .ico-svg,
.composer-mic iconsax-icon {
  width: 18px;
  height: 18px;
  color: inherit;
}
.composer-mic.listening {
  color: var(--send-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--send-blue) 28%, transparent);
  animation: send-mic-pulse 1.2s ease-in-out infinite;
}
.composer-mic:disabled {
  opacity: 0.45;
  cursor: default;
}
html[data-theme="dark"] .composer-mic { color: #f5f5f5; }
html[data-theme="dark"] .composer-mic:hover { background: #262626; }

.send {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 999px;
  background: var(--send-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease;
}
.send .ico-svg { width: 18px; height: 18px; color: var(--send-fg); transition: color 0.15s ease; }
.send.active {
  background: var(--send-blue);
  cursor: pointer;
}
.send.active .ico-svg { color: #fafafa; }
/* Mirror send arrow for RTL chat (not voice / stop) */
.send.active:not(.voice):not(.stop) .ico-svg,
.send.active:not(.voice):not(.stop) iconsax-icon {
  transform: scaleX(-1);
}
.send:disabled:not(.stop) { cursor: default; opacity: 1; }
.send.is-wait,
.send:disabled.is-wait {
  cursor: wait;
  pointer-events: none;
  opacity: 0.55;
}
.send.stop {
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
}
.send.stop { background: var(--send-blue); }
.send.stop .ico-svg { color: #fafafa; }
.send.listening {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--send-blue) 35%, transparent);
  animation: send-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes send-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--send-blue) 28%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--send-blue) 12%, transparent); }
}

/* Live voice — matches .overlay / .sheet language */
.live-voice-panel {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
}
.live-voice-panel[hidden] { display: none !important; }
.live-voice-card {
  width: min(420px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-composer-home);
}
.live-voice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.live-voice-head-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-strong);
}
.live-voice-sub {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
}
.live-voice-x {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.live-voice-x:hover { background: var(--hover); color: var(--ink); }
.live-voice-orb {
  width: 88px;
  height: 88px;
  margin: 8px auto 14px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--ink-strong);
  border: 1px solid var(--stroke);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.live-voice-bars { display: block; }
.live-voice-panel.is-connecting .live-voice-orb,
.live-voice-panel.is-thinking .live-voice-orb {
  animation: live-voice-pulse 1.2s ease-in-out infinite;
}
.live-voice-panel.is-listening .live-voice-orb {
  background: color-mix(in srgb, var(--send-blue) 12%, var(--surface-soft));
  color: var(--send-blue);
  border-color: color-mix(in srgb, var(--send-blue) 28%, var(--stroke));
}
.live-voice-panel.is-speaking .live-voice-orb {
  background: var(--send-blue);
  color: #fafafa;
  border-color: var(--send-blue);
  animation: live-voice-pulse 1s ease-in-out infinite;
}
.live-voice-panel.is-error .live-voice-orb {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-soft));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, var(--stroke));
}
@keyframes live-voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.live-voice-status {
  text-align: center;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-height: 1.4em;
}
.live-voice-transcript {
  max-height: 160px;
  overflow-y: auto;
  background: var(--surface-soft);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-secondary);
  margin-bottom: 16px;
}
.live-voice-transcript:empty {
  display: none;
}
.live-voice-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.live-voice-line.is-user {
  color: var(--ink);
  font-weight: 600;
}
.live-voice-line.is-user::before {
  content: "شما: ";
  color: var(--muted);
  font-weight: 500;
}
.live-voice-line.is-ai::before {
  content: "دستیار: ";
  color: var(--muted);
  font-weight: 500;
}
.live-voice-line:last-child { margin-bottom: 0; }
.live-voice-actions {
  display: flex;
  justify-content: stretch;
}
.live-voice-actions .btn {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.banner, .maint {
  margin: 10px auto 0;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--stroke);
  font-size: 13.5px;
  flex-shrink: 0;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: calc(100% - 32px);
  max-width: min(640px, calc(100% - 32px));
  box-sizing: border-box;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  padding: 12px 12px 12px 16px;
  transform-origin: top center;
  will-change: transform, opacity, max-height, margin, padding;
}
/* Strip: full bar of the chat column, same side inset as the composer (24px). */
.banner:not(.banner--code) {
  width: calc(100% - 48px);
  max-width: none;
  margin: 10px auto 12px;
  padding: 12px 16px;
  align-items: stretch;
  position: relative;
  z-index: 2;
  background: #fff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.08);
}
html[data-theme="dark"] .banner:not(.banner--code) {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.banner.is-enter {
  animation: banner-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.banner.is-leave {
  animation: banner-leave 0.24s ease-in both;
  pointer-events: none;
}
@keyframes banner-enter {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    box-shadow: none;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 520px;
  }
}
@keyframes banner-leave {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 520px;
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .banner.is-enter,
  .banner.is-leave {
    animation: none;
  }
}
.banner.is-expanded {
  align-items: stretch;
  max-height: none;
}
.banner-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  direction: rtl;
  text-align: right;
}
.banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}
.banner-body b {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  text-align: right;
}
.banner-body span,
.banner-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: right;
  direction: rtl;
  unicode-bidi: embed;
}
.banner.is-expanded .banner-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
@media (max-width: 980px) {
  .banner:not(.banner--code) {
    width: calc(100% - 32px);
    margin-top: 8px;
    padding: 12px 14px;
  }
  .banner-body b,
  .banner-text {
    text-align: right;
    line-height: 1.65;
  }
  .banner-text {
    -webkit-line-clamp: 3;
    font-size: 13px;
  }
}
.banner-side {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.banner.is-expanded .banner-side {
  align-items: center;
  padding-top: 0;
}
.banner-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  background: var(--soft);
}
.banner-expand {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.banner-expand[hidden] {
  display: none !important;
}
.banner-expand:hover {
  background: var(--hover);
  color: var(--ink);
}
.banner-expand svg {
  display: block;
  transition: transform 0.2s ease;
}
.banner.is-expanded .banner-expand svg {
  transform: rotate(180deg);
}
.banner-dismiss {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.banner-dismiss:hover {
  background: var(--hover);
  color: var(--ink);
}
.banner.banner--code {
  width: fit-content;
  max-width: min(720px, calc(100% - 32px));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.code-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 8px 8px 12px;
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--stroke);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  font-family: inherit;
}
.code-chip-badge {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #DFEBFF;
  color: #1f4f9e;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  padding: 6px 12px;
  cursor: pointer;
}
.code-chip-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.85) 50%, transparent 68%);
  transform: translateX(130%);
  animation: code-chip-sheen 2.8s ease-in-out infinite;
  pointer-events: none;
}
html[data-theme="dark"] .code-chip-badge {
  background: #16325c;
  color: #DFEBFF;
}
html[data-theme="dark"] .code-chip-badge::after {
  background: linear-gradient(105deg, transparent 32%, rgba(223, 235, 255, 0.42) 50%, transparent 68%);
}
@keyframes code-chip-sheen {
  0%,
  58% { transform: translateX(130%); }
  82%,
  100% { transform: translateX(-130%); }
}
@media (prefers-reduced-motion: reduce) {
  .code-chip-badge::after { animation: none; opacity: 0; }
}
.code-chip-badge:hover { filter: brightness(0.97); }
.code-chip-text {
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}
.code-chip-x {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.code-chip-x:hover {
  background: var(--hover);
  color: var(--ink);
}
.maint {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: none;
}
.maint[hidden],
.banner[hidden],
.maint:empty,
.banner:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  min-height: 0 !important;
  box-shadow: none !important;
}
.maint b { font-weight: 700; color: inherit; }
.maint span { color: inherit; }
.maint.is-update { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
html[data-theme="dark"] .maint { background: #3a2a10; color: #ffcc80; border-color: #5c4018; }
html[data-theme="dark"] .maint.is-update { background: #1a2a44; color: #9ec1ff; border-color: #2a4068; }
html[data-theme="dark"] .banner { color: var(--ink); }

.site-maint {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
  touch-action: none;
}
.site-maint[hidden] { display: none !important; }
body.site-locked {
  overflow: hidden !important;
}
body.site-locked .app,
body.site-locked .overlay,
body.site-locked .aspect-pop {
  pointer-events: none !important;
  user-select: none !important;
}
.site-maint-card {
  width: min(440px, 100%);
  background: #fafafa;
  color: #111;
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
}
html[data-theme="dark"] .site-maint-card {
  background: #1c1c1e;
  color: #f5f5f5;
}
.site-maint-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: #fff4e5;
  color: #7a4b00;
}
.site-maint.is-update .site-maint-badge {
  background: #e8f1ff;
  color: #1a4b8c;
}
html[data-theme="dark"] .site-maint-badge {
  background: #3a2a10;
  color: #ffcc80;
}
html[data-theme="dark"] .site-maint.is-update .site-maint-badge {
  background: #1a2a44;
  color: #9ec1ff;
}
.site-maint-card h1 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-maint-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  opacity: .85;
}

/* Cursor-style announcement popup (model promo card) */
.announce-popup {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  pointer-events: auto;
}
.announce-popup[hidden] {
  display: none !important;
}
.announce-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.announce-popup-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(86vh, 640px);
  overflow: auto;
  background: var(--card, #fff);
  color: var(--ink, #111);
  border: 1px solid var(--stroke, rgba(0, 0, 0, 0.1));
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  padding: 0 0 20px;
  text-align: start;
  animation: announce-popup-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html[data-theme="dark"] .announce-popup-card {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
@keyframes announce-popup-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .announce-popup-card {
    animation: none;
  }
}
.announce-popup-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink, #111);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
html[data-theme="dark"] .announce-popup-close {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
}
.announce-popup-close:hover {
  background: rgba(0, 0, 0, 0.12);
}
.announce-popup-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  background: #f0f0f2;
}
.announce-popup-media[hidden] {
  display: none !important;
}
.announce-popup-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.announce-popup-copy {
  padding: 20px 22px 8px;
}
.announce-popup-copy h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.announce-popup-copy p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted, #666);
  white-space: pre-wrap;
}
.announce-popup-ok {
  display: block;
  margin: 16px 22px 0;
  width: calc(100% - 44px);
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--btn-dark, #0d0d0d);
  color: var(--btn-dark-fg, #fafafa);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
html[data-theme="dark"] .announce-popup-ok {
  background: #f5f5f5;
  color: #111;
}
.announce-popup-ok:hover {
  filter: brightness(1.05);
}
body.announce-popup-open {
  overflow: hidden;
}

.twa-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  justify-content: center;
}

.payment-redirect {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.payment-redirect[hidden] {
  display: none !important;
}
body.payment-redirect-lock {
  overflow: hidden;
}
.payment-redirect-card {
  width: min(360px, 100%);
  background: var(--card, #fafafa);
  color: var(--ink, #111);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.24);
}
html[data-theme="dark"] .payment-redirect-card {
  background: var(--card, #171717);
  color: var(--ink, #ececec);
}
.payment-redirect-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  border: 3px solid rgba(127, 127, 127, 0.2);
  border-top-color: #ff6b00;
  border-radius: 50%;
  animation: payment-redirect-spin 0.8s linear infinite;
}
@keyframes payment-redirect-spin {
  to {
    transform: rotate(360deg);
  }
}
.payment-redirect-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}
.payment-redirect-sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted, #676767);
  line-height: 1.6;
}

.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.overlay.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  width: min(560px, 100%);
  max-height: min(86dvh, 820px);
  overflow: auto;
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  padding: 26px 24px 24px;
}
.sheet.wide { width: min(860px, 100%); }
.sheet-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 6px;
  border-radius: 10px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-inline-start: -6px;
  margin-top: -4px;
}
.sheet-back:hover { background: var(--hover); }
.sheet-back .ico-svg { transform: scaleX(-1); flex-shrink: 0; }
.sheet-nav-body .sub { margin-top: 0; }
.sheet-account {
  padding-top: 0;
}
.sheet-account > h3 {
  margin: 0 0 4px;
  font-size: 20px;
}
.sheet-account > .sub {
  margin: 0 0 20px;
}

/* ── Account panel (premium bento) ── */
.sheet-account .sheet-quota.sheet-quota-meter {
  gap: 14px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: var(--account-quota-bg);
  border: 1px solid var(--stroke);
  margin-bottom: 18px;
}

.sheet-account .quota-meter-top {
  gap: 16px;
  margin-bottom: 2px;
}

.sheet-account .quota-meter-title {
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.sheet-account .quota-meter-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-60);
}

.sheet-account .quota-meter-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
}

html[data-theme="dark"] .sheet-account .quota-meter-track {
  background: rgba(255, 255, 255, 0.1);
}

.sheet-account .quota-meter-fill {
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 52%, #8b5cf6 100%);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.sheet-account .quota-meter-hint {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.sheet-account > h3 { margin-bottom: 14px; }

.account-profile {
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: var(--account-quota-bg);
}
.account-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.account-avatar {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, #3a78d8 0%, #1f4f9e 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.account-profile-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.account-profile-plan { flex-shrink: 0; }
.account-profile-hint {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.account-login-btn { width: 100%; margin-top: 12px; }
.account-profile-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
}
.account-profile-fields > .account-field:only-child { grid-column: 1 / -1; }
.account-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.account-group-label {
  margin: 18px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.account-phone-value {
  border: 1px solid var(--stroke);
  background: var(--account-input-bg);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  height: 44px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  letter-spacing: 0.02em;
  color: var(--ink);
  user-select: all;
}

.account-name-label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--muted);
}

.account-name-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.account-name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--stroke);
  background: var(--account-input-bg);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  height: 44px;
  box-sizing: border-box;
}

.account-save-btn {
  flex-shrink: 0;
  align-self: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.account-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.28);
}

.account-save-btn:active {
  transform: scale(0.97);
  box-shadow: none;
}

.account-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.account-bento > .list-row-subscribe { grid-column: 1 / -1; }

.account-bento-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 16px;
  background: var(--account-bento-bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.12s ease;
}

.account-bento-item:hover {
  background: var(--account-bento-hover);
}

.account-bento-item:active {
  transform: scale(0.985);
}

.account-bento-item[data-panel="tickets"] {
  position: relative;
}
.account-bento-item .support-dot {
  position: absolute;
  top: 12px;
  inset-inline-start: 28px;
  width: 8px;
  height: 8px;
  margin: 0;
  border-radius: 50%;
  background: #dc2626;
  border: 1.5px solid var(--account-bento-bg, #fff);
  pointer-events: none;
}

.account-bento-item.list-row-subscribe {
  font-weight: 700;
}

.account-footer-btns {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-top: 20px;
}

.account-footer-btns .btn {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}

.account-btn-logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--stroke);
}

.account-btn-logout:hover {
  background: var(--hover);
  color: var(--ink);
}

.account-btn-logout:active {
  transform: scale(0.98);
}

.account-btn-delete {
  background: rgba(198, 40, 40, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(198, 40, 40, 0.22);
}

html[data-theme="dark"] .account-btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.28);
}

.account-btn-delete:hover {
  background: rgba(198, 40, 40, 0.14);
}

html[data-theme="dark"] .account-btn-delete:hover {
  background: rgba(239, 68, 68, 0.18);
}

.account-btn-delete:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .account-save-btn,
  .account-bento-item,
  .account-footer-btns .btn {
    transition: none;
  }
  .account-save-btn:hover,
  .account-bento-item:active,
  .account-btn-logout:active,
  .account-btn-delete:active {
    transform: none;
  }
}

@media (max-width: 520px) {
  .account-profile-fields { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .account-bento { grid-template-columns: 1fr; }
}

.sheet h3 { margin: 0 0 6px; font-size: 20px; }
.sheet .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.sheet h3.auth-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 8px;
}
.sheet .auth-sub-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 18px;
  min-height: 1.45em;
}
.sheet .auth-sub-row.is-phone {
  margin-bottom: 10px;
}
.sheet .sub.auth-sub {
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}
.sheet .auth-sub-row.is-phone .auth-sub {
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: 0.02em;
  text-align: start;
}
.auth-edit-phone {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.sheet .auth-sub-row.is-phone .auth-edit-phone:not([hidden]) {
  display: inline-flex;
}
.auth-edit-phone[hidden] {
  display: none !important;
}
.auth-edit-phone:hover {
  color: var(--ink);
  background: var(--hover);
}
.auth-otp {
  display: flex;
  direction: ltr;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.auth-otp-digit {
  width: 48px;
  max-width: none;
  flex: 0 0 48px;
  height: 52px;
  border: 1px solid var(--stroke);
  background: var(--panel, var(--bg));
  border-radius: 10px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
}
.auth-otp-digit:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}
/* 6-digit login code: narrower boxes so six fit a 320px phone. */
.auth-otp.is-6 { gap: 6px; }
.auth-otp.is-6 .auth-otp-digit {
  width: 42px;
  flex: 0 0 42px;
  height: 50px;
  font-size: 20px;
}
.auth-resend {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 14px;
  text-align: center;
}
.auth-resend-wait {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}
.auth-resend-wait[hidden],
.auth-resend-btn[hidden] {
  display: none !important;
}
.auth-resend-ico {
  display: inline-flex;
  color: var(--muted);
  flex: 0 0 auto;
}
.auth-resend-wait b {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  direction: ltr;
  unicode-bidi: isolate;
}
.auth-resend-btn {
  border: 0;
  background: transparent;
  color: var(--accent, #2563eb);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.auth-resend-btn:hover {
  background: var(--hover);
}
.auth-resend-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.row-btns.auth-actions .btn.is-busy {
  gap: 8px;
  opacity: 0.92;
  pointer-events: none;
}
.auth-btn-spin {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, currentColor 28%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: chat-spin 0.7s linear infinite;
  flex-shrink: 0;
}
html[data-theme="dark"] .sheet .sub.auth-sub {
  color: #ffffff;
}
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.ticket-msg {
  display: flex;
  max-width: min(300px, 88%);
}
.ticket-msg--user { align-self: flex-start; }
.ticket-msg--admin { align-self: flex-end; }
.ticket-msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 100%;
}
.ticket-msg--user .ticket-msg-bubble {
  background: var(--user-bubble);
  border: 1px solid var(--stroke);
  border-top-right-radius: 6px;
}
.ticket-msg--user .ticket-msg-meta { color: var(--muted); }
.ticket-msg--user .ticket-msg-body { color: var(--ink); }
.ticket-msg--admin .ticket-msg-bubble {
  background: #e8f0fe;
  border-top-left-radius: 6px;
}
.ticket-msg--admin .ticket-msg-meta,
.ticket-msg--admin .ticket-msg-body { color: #1e3a8a; }
html[data-theme="dark"] .ticket-msg--admin .ticket-msg-bubble { background: #1e3a5f; }
html[data-theme="dark"] .ticket-msg--admin .ticket-msg-meta,
html[data-theme="dark"] .ticket-msg--admin .ticket-msg-body { color: #93c5fd; }
.ticket-msg-meta {
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 4px;
}
.ticket-msg-body {
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.ticket-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 10px;
}
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.ticket-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: start;
  padding: 14px 14px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}
.ticket-row:hover { background: var(--hover); }
.ticket-row-main { flex: 1; min-width: 0; }
.ticket-row-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticket-row-date {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.ticket-row-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 55%;
}
.ticket-row-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.ticket-row-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.ticket-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.ticket-chip-topic {
  background: #e8f0fe;
  color: #1d4ed8;
}
.ticket-chip-status.is-open {
  background: #e8f0fe;
  color: #1d4ed8;
}
.ticket-chip-status.is-progress {
  background: #fff4e5;
  color: #c2410c;
}
.ticket-chip-status.is-waiting {
  background: #f3e8ff;
  color: #7c3aed;
}
.ticket-chip-status.is-closed {
  background: #f3f3f3;
  color: #8f8f8f;
}
.ticket-chip-read {
  background: #f3f3f3;
  color: var(--muted);
  font-size: 10px;
  padding: 0 8px;
}
.ticket-chip-read.is-unread {
  background: #fee2e2;
  color: #dc2626;
}
.ticket-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
}
.ticket-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
html[data-theme="dark"] .ticket-chip-topic,
html[data-theme="dark"] .ticket-chip-status.is-open {
  background: #1e3a5f;
  color: #93c5fd;
}
html[data-theme="dark"] .ticket-chip-status.is-progress {
  background: #3b2610;
  color: #fdba74;
}
html[data-theme="dark"] .ticket-chip-status.is-waiting {
  background: #2e1065;
  color: #c4b5fd;
}
html[data-theme="dark"] .ticket-chip-status.is-closed,
html[data-theme="dark"] .ticket-chip-read {
  background: #2a2a2a;
  color: #a3a3a3;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--stroke);
  background: var(--bg);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
}
.field select {
  padding-inline-end: 36px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input.auth-phone {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
.field input.auth-name {
  direction: rtl;
  text-align: right;
}
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row-btns.auth-actions .btn {
  border-radius: 10px;
  flex: 1;
  min-width: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}
.btn.primary { background: var(--btn); color: var(--btn-fg); }
.btn.ghost { border: 1px solid var(--stroke); }
.btn.danger { background: var(--danger); color: #fafafa; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--stroke);
  width: 100%;
  text-align: start;
  cursor: pointer;
  border-radius: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.list-row:hover { background: var(--hover); }
.list-row[role="button"]:active { opacity: 0.85; }
.list-row:last-child { border-bottom: 0; }
.list-row small { color: var(--muted); display: block; }
.list-row .model-pick-copy {
  flex: 1 1 0;
  min-width: 0;
}
.list-row .model-pick-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .model-pick-sub {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}
.list-row .model-tier-tag {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  padding: 2px 7px !important;
  margin-inline-end: 4px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 10px !important;
  letter-spacing: 0.02em;
  line-height: 1.3;
  vertical-align: middle;
  white-space: nowrap;
  -webkit-text-fill-color: currentColor;
}
/* پرچمدار = پرو اشتراک (سبز) */
.list-row .model-tier-tag.tier-flagship {
  background: var(--plan-pro-bg) !important;
  color: var(--plan-pro-fg) !important;
  border-color: var(--plan-pro-border) !important;
  animation: none;
}
/* میان‌رده = پلاس اشتراک (آبی) */
.list-row .model-tier-tag.tier-mid {
  background: var(--plan-plus-bg) !important;
  color: var(--plan-plus-fg) !important;
  border-color: var(--plan-plus-border) !important;
}
/* اقتصادی = اقتصادی اشتراک (بنفش) */
.list-row .model-tier-tag.tier-budget {
  background: var(--plan-economy-bg) !important;
  color: var(--plan-economy-fg) !important;
  border-color: var(--plan-economy-border) !important;
}
.list-row .model-tier-usage {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  display: inline;
}
.list-row .model-plan-meta {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.list-row .model-row-trail {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  max-width: 38%;
  justify-content: flex-end;
  min-width: 0;
}
.list-row .model-row-trail .model-plan-meta {
  margin-inline-start: 0;
}
.list-row .model-row-trail .menu-cost {
  margin-inline-start: 0;
}
.list-row .model-new-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  flex: 0 0 auto;
  text-transform: none;
}
html[data-theme="dark"] .list-row .model-new-tag {
  background: #ef4444;
  color: #fff;
}
.list-row.locked .model-new-tag {
  opacity: 1;
}
.list-row .model-plan-meta .plan-pill,
.list-row .plan-pill.model-tier-pill {
  transform: none;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  height: auto;
  min-height: 22px;
}
.list-row .model-lock-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  line-height: 0;
  opacity: 0.85;
  background: none;
  padding: 0;
}
.list-row .model-lock-ico svg {
  display: block;
}
.list-row.on { background: var(--hover); }
.list-row.on b { font-weight: 700; }
.list-row .menu-cost.model-cost {
  margin-inline-start: auto;
  flex: 0 0 auto;
  min-width: auto;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.archive-row {
  gap: 8px;
  cursor: default;
}
.archive-row .archive-open {
  flex: 1;
  min-width: 0;
  text-align: start;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.archive-row .archive-open span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-row .archive-restore {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 12px;
  height: auto;
}
.list-row.on .menu-cost.model-cost {
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
}
html[data-theme="dark"] .list-row.on .menu-cost.model-cost {
  background: rgba(255, 255, 255, 0.12);
  color: #fafafa;
}
.list-row.locked { opacity: 0.62; }
.list-row.locked b { font-weight: 500; }
.list-row.locked .model-lock-ico {
  background: none;
  padding: 0;
  color: var(--muted);
}
#autoRow { border-bottom: 1px solid var(--stroke); margin-bottom: 4px; padding-bottom: 2px; }
.model-auto-row { border-bottom: 0; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 16px;
  text-align: start;
}
.plan-card.on { border-color: var(--ink); }
.plan-card h4 { margin: 0 0 6px; }
.plan-card .price { font-size: 20px; font-weight: 700; margin: 8px 0; }
.plan-card ul { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 13px; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + 12px);
  left: 0;
  right: 0;
  margin-inline: auto;
  z-index: 320;
  width: fit-content;
  max-width: min(92vw, 380px);
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--composer);
  color: var(--ink);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-composer);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  text-align: center;
  overflow-wrap: break-word;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.menu-pop {
  position: fixed;
  z-index: 310;
  min-width: 200px;
  max-height: min(70vh, 440px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 6px;
  display: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  -webkit-overflow-scrolling: touch;
}
.menu-pop.show { display: block; }
.menu-pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.menu-pop button .menu-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
  white-space: normal;
}
.menu-pop button .menu-copy b {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}
.menu-pop button .menu-copy small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
/* Desktop web: wide row like the reference add menu. Phone and the app stay compact. */
.menu-pop .menu-sep {
  height: 1px;
  margin: 6px 10px;
  background: var(--stroke);
  opacity: 0.9;
  pointer-events: none;
}
.menu-pop.menu-pop--desk {
  min-width: 0;
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 8px;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
/* Web: chat box + tools lift together while menu is open (no menu scroll) */
@media (min-width: 960px) {
  #composer.is-attach-lift,
  #menuPop.menu-pop--desk.is-attach-lift {
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }
  #composer.is-attach-lift.is-attach-lift-up,
  #menuPop.menu-pop--desk.is-attach-lift.is-attach-lift-up {
    transform: translateY(var(--attach-lift, -80px));
  }
}
@media (min-width: 960px) and (prefers-reduced-motion: reduce) {
  #composer.is-attach-lift,
  #menuPop.menu-pop--desk.is-attach-lift {
    transition: none;
  }
}
.menu-pop.menu-pop--desk button {
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
}
.menu-pop.menu-pop--desk button .menu-copy {
  flex-direction: row;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.menu-pop.menu-pop--desk button .menu-copy b {
  flex: 0 0 auto;
  font-size: 14.5px;
  font-weight: 600;
}
.menu-pop.menu-pop--desk button .menu-copy small {
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-pop button .menu-cost {
  margin-inline-start: auto;
  flex: 0 0 auto;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-pop button[data-att="imggen"] .menu-cost {
  background: rgba(240, 120, 80, 0.14);
  color: #c2410c;
}
.menu-pop button[data-att="vidgen"] .menu-cost {
  background: rgba(225, 29, 72, 0.12);
  color: #be123c;
}
.menu-pop button[data-att="pdfgen"] .menu-cost {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}
.menu-pop button[data-att="slidesgen"] .menu-cost {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.menu-pop button[data-att="web"] .menu-cost {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
}
.menu-pop button[data-att="think"] .menu-cost {
  background: rgba(236, 72, 153, 0.12);
  color: #be185d;
}
.menu-pop button[data-att="deep"] .menu-cost {
  background: rgba(79, 70, 229, 0.12);
  color: #3730a3;
}
.menu-pop button[data-att="webdev"] .menu-cost {
  background: rgba(202, 138, 4, 0.16);
  color: #a16207;
}
.menu-pop button.on .menu-cost {
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
}
.menu-pop button.on[data-att="imggen"] .menu-cost {
  background: rgba(240, 120, 80, 0.18);
  color: #c2410c;
}
.menu-pop button.on[data-att="vidgen"] .menu-cost {
  background: rgba(225, 29, 72, 0.16);
  color: #be123c;
}
.menu-pop button.on[data-att="pdfgen"] .menu-cost {
  background: rgba(124, 58, 237, 0.16);
  color: #6d28d9;
}
.menu-pop button.on[data-att="slidesgen"] .menu-cost {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
}
.menu-pop button.on[data-att="web"] .menu-cost {
  background: rgba(14, 165, 233, 0.18);
  color: #0369a1;
}
.menu-pop button.on[data-att="think"] .menu-cost {
  background: rgba(236, 72, 153, 0.16);
  color: #be185d;
}
.menu-pop button.on[data-att="deep"] .menu-cost {
  background: rgba(79, 70, 229, 0.16);
  color: #3730a3;
}
.menu-pop button.on[data-att="webdev"] .menu-cost {
  background: rgba(202, 138, 4, 0.2);
  color: #a16207;
}
html[data-theme="dark"] .menu-pop button.on .menu-cost {
  background: rgba(255, 255, 255, 0.12);
  color: #fafafa;
}
html[data-theme="dark"] .menu-pop button[data-att="imggen"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="imggen"] .menu-cost {
  background: rgba(240, 120, 80, 0.22);
  color: #fdba74;
}
html[data-theme="dark"] .menu-pop button[data-att="vidgen"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="vidgen"] .menu-cost {
  background: rgba(251, 113, 133, 0.22);
  color: #fecdd3;
}
html[data-theme="dark"] .menu-pop button[data-att="pdfgen"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="pdfgen"] .menu-cost {
  background: rgba(167, 139, 250, 0.2);
  color: #ddd6fe;
}
html[data-theme="dark"] .menu-pop button[data-att="slidesgen"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="slidesgen"] .menu-cost {
  background: rgba(52, 211, 153, 0.2);
  color: #a7f3d0;
}
html[data-theme="dark"] .menu-pop button[data-att="web"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="web"] .menu-cost {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
}
html[data-theme="dark"] .menu-pop button[data-att="think"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="think"] .menu-cost {
  background: rgba(244, 114, 182, 0.2);
  color: #fbcfe8;
}
html[data-theme="dark"] .menu-pop button[data-att="deep"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="deep"] .menu-cost {
  background: rgba(129, 140, 248, 0.22);
  color: #c7d2fe;
}
html[data-theme="dark"] .menu-pop button[data-att="webdev"] .menu-cost,
html[data-theme="dark"] .menu-pop button.on[data-att="webdev"] .menu-cost {
  background: rgba(250, 204, 21, 0.2);
  color: #fde68a;
}
.menu-pop button .menu-ico {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 2px;
}
.menu-pop button .menu-ico .ico-svg { color: var(--ink); opacity: 0.85; }
@keyframes menu-tone-in {
  from {
    opacity: 0;
    transform: scale(0.82) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes menu-tone-shine {
  0%,
  100% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
}
/* Glass-tint chips for tools (upload/image stay neutral) */
.menu-pop button[data-att="imggen"] .menu-ico,
.menu-pop button[data-att="vidgen"] .menu-ico,
.menu-pop button[data-att="pdfgen"] .menu-ico,
.menu-pop button[data-att="slidesgen"] .menu-ico,
.menu-pop button[data-att="web"] .menu-ico,
.menu-pop button[data-att="think"] .menu-ico,
.menu-pop button[data-att="deep"] .menu-ico,
.menu-pop button[data-att="webdev"] .menu-ico {
  width: 28px;
  height: 28px;
  margin-top: 0;
  border-radius: 9px;
  position: relative;
  overflow: hidden;
  background-size: 140% 140%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  animation:
    menu-tone-in 0.58s cubic-bezier(0.22, 1, 0.36, 1) both,
    menu-tone-shine 7.5s ease-in-out infinite;
}
.menu-pop button[data-att="imggen"] .menu-ico { animation-delay: 0.04s, 0s; }
.menu-pop button[data-att="vidgen"] .menu-ico { animation-delay: 0.1s, 0.55s; }
.menu-pop button[data-att="pdfgen"] .menu-ico { animation-delay: 0.16s, 1.1s; }
.menu-pop button[data-att="slidesgen"] .menu-ico { animation-delay: 0.22s, 1.65s; }
.menu-pop button[data-att="web"] .menu-ico { animation-delay: 0.28s, 2.2s; }
.menu-pop button[data-att="think"] .menu-ico { animation-delay: 0.34s, 2.75s; }
.menu-pop button[data-att="deep"] .menu-ico { animation-delay: 0.4s, 3.3s; }
.menu-pop button[data-att="webdev"] .menu-ico { animation-delay: 0.46s, 3.85s; }
.menu-pop button[data-att="imggen"]:hover .menu-ico,
.menu-pop button[data-att="vidgen"]:hover .menu-ico,
.menu-pop button[data-att="pdfgen"]:hover .menu-ico,
.menu-pop button[data-att="slidesgen"]:hover .menu-ico,
.menu-pop button[data-att="web"]:hover .menu-ico,
.menu-pop button[data-att="think"]:hover .menu-ico,
.menu-pop button[data-att="deep"]:hover .menu-ico,
.menu-pop button[data-att="webdev"]:hover .menu-ico {
  transform: scale(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 10px rgba(0, 0, 0, 0.14);
}
@media (prefers-reduced-motion: reduce) {
  .menu-pop button[data-att="imggen"] .menu-ico,
  .menu-pop button[data-att="vidgen"] .menu-ico,
  .menu-pop button[data-att="pdfgen"] .menu-ico,
  .menu-pop button[data-att="slidesgen"] .menu-ico,
  .menu-pop button[data-att="web"] .menu-ico,
  .menu-pop button[data-att="think"] .menu-ico,
  .menu-pop button[data-att="deep"] .menu-ico,
  .menu-pop button[data-att="webdev"] .menu-ico {
    animation: none;
    transition: none;
  }
  .menu-pop button[data-att="imggen"]:hover .menu-ico,
  .menu-pop button[data-att="vidgen"]:hover .menu-ico,
  .menu-pop button[data-att="pdfgen"]:hover .menu-ico,
  .menu-pop button[data-att="slidesgen"]:hover .menu-ico,
  .menu-pop button[data-att="web"]:hover .menu-ico,
  .menu-pop button[data-att="think"]:hover .menu-ico,
  .menu-pop button[data-att="deep"]:hover .menu-ico,
  .menu-pop button[data-att="webdev"]:hover .menu-ico {
    transform: none;
  }
}
.menu-pop button[data-att="imggen"] .menu-ico::after,
.menu-pop button[data-att="vidgen"] .menu-ico::after,
.menu-pop button[data-att="pdfgen"] .menu-ico::after,
.menu-pop button[data-att="slidesgen"] .menu-ico::after,
.menu-pop button[data-att="web"] .menu-ico::after,
.menu-pop button[data-att="think"] .menu-ico::after,
.menu-pop button[data-att="deep"] .menu-ico::after,
.menu-pop button[data-att="webdev"] .menu-ico::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.06) 48%, transparent 70%);
  pointer-events: none;
}
.menu-pop button[data-att="imggen"] .menu-ico .ico-svg,
.menu-pop button[data-att="vidgen"] .menu-ico .ico-svg,
.menu-pop button[data-att="pdfgen"] .menu-ico .ico-svg,
.menu-pop button[data-att="slidesgen"] .menu-ico .ico-svg,
.menu-pop button[data-att="web"] .menu-ico .ico-svg,
.menu-pop button[data-att="think"] .menu-ico .ico-svg,
.menu-pop button[data-att="deep"] .menu-ico .ico-svg,
.menu-pop button[data-att="webdev"] .menu-ico .ico-svg {
  color: #fff;
  opacity: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}
/* peach — ساخت تصویر */
.menu-pop button[data-att="imggen"] .menu-ico {
  background: linear-gradient(145deg, #ffb089, #f07850);
}
.menu-pop button[data-att="imggen"] { color: #c2410c; }
/* rose — ساخت ویدیو (متفاوت از نارنجی ساخت تصویر) */
.menu-pop button[data-att="vidgen"] .menu-ico {
  background: linear-gradient(145deg, #fb7185, #e11d48);
}
.menu-pop button[data-att="vidgen"] { color: #be123c; }
/* violet — ساخت PDF */
.menu-pop button[data-att="pdfgen"] .menu-ico {
  background: linear-gradient(145deg, #c4b5fd, #7c3aed);
}
.menu-pop button[data-att="pdfgen"] { color: #6d28d9; }
/* green — ساخت اسلاید */
.menu-pop button[data-att="slidesgen"] .menu-ico {
  background: linear-gradient(145deg, #6ee7b7, #10b981);
}
.menu-pop button[data-att="slidesgen"] { color: #047857; }
/* sky — جستجوی وب */
.menu-pop button[data-att="web"] .menu-ico {
  background: linear-gradient(145deg, #7dd3fc, #0ea5e9);
}
.menu-pop button[data-att="web"] { color: #0369a1; }
/* magenta — تفکر بیشتر */
.menu-pop button[data-att="think"] .menu-ico {
  background: linear-gradient(145deg, #f9a8d4, #ec4899);
}
.menu-pop button[data-att="think"] { color: #be185d; }
/* indigo — تحقیق عمیق */
.menu-pop button[data-att="deep"] .menu-ico {
  background: linear-gradient(145deg, #a5b4fc, #4f46e5);
}
.menu-pop button[data-att="deep"] { color: #3730a3; }
/* gold — وب‌ساز HTML */
.menu-pop button[data-att="webdev"] .menu-ico {
  background: linear-gradient(145deg, #fde047, #ca8a04);
}
.menu-pop button[data-att="webdev"] { color: #a16207; }
/* Free plan: locked tools stay neutral (no glass tint) */
.menu-pop button.menu-locked {
  color: var(--ink) !important;
}
.menu-pop button.menu-locked .menu-ico {
  width: 20px !important;
  height: 20px !important;
  margin-top: 2px !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  animation: none !important;
  overflow: visible !important;
  transition: none !important;
}
.menu-pop button.menu-locked .menu-ico::after {
  display: none !important;
}
.menu-pop button.menu-locked .menu-ico .ico-svg {
  color: var(--ink) !important;
  opacity: 0.85 !important;
  filter: none !important;
}
.menu-pop button.menu-locked .menu-cost {
  background: var(--hover) !important;
  color: var(--muted) !important;
}
.menu-pop button.menu-locked:hover .menu-ico {
  transform: none !important;
  box-shadow: none !important;
}
.menu-pop button:hover { background: var(--hover); }
.menu-pop button.on {
  background: #e8f0fe;
  color: #1d4ed8;
}
.menu-pop button.on .menu-ico .ico-svg { color: #1d4ed8; }
.menu-pop button.on[data-att="imggen"],
.menu-pop button.on[data-att="vidgen"],
.menu-pop button.on[data-att="pdfgen"],
.menu-pop button.on[data-att="slidesgen"],
.menu-pop button.on[data-att="web"],
.menu-pop button.on[data-att="think"],
.menu-pop button.on[data-att="deep"],
.menu-pop button.on[data-att="webdev"] {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.menu-pop button.on[data-att="imggen"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="vidgen"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="pdfgen"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="slidesgen"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="web"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="think"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="deep"] .menu-ico .ico-svg,
.menu-pop button.on[data-att="webdev"] .menu-ico .ico-svg {
  color: #fff;
}
html[data-theme="dark"] .menu-pop button.on {
  background: #1e3a5f;
  color: #fafafa;
}
html[data-theme="dark"] .menu-pop button.on .menu-ico .ico-svg { color: #fafafa; }
html[data-theme="dark"] .menu-pop button[data-att="imggen"],
html[data-theme="dark"] .menu-pop button[data-att="vidgen"],
html[data-theme="dark"] .menu-pop button[data-att="pdfgen"],
html[data-theme="dark"] .menu-pop button[data-att="slidesgen"],
html[data-theme="dark"] .menu-pop button[data-att="web"],
html[data-theme="dark"] .menu-pop button[data-att="think"],
html[data-theme="dark"] .menu-pop button[data-att="deep"],
html[data-theme="dark"] .menu-pop button[data-att="webdev"] {
  color: #fafafa;
}
html[data-theme="dark"] .menu-pop button.on[data-att="imggen"],
html[data-theme="dark"] .menu-pop button.on[data-att="vidgen"],
html[data-theme="dark"] .menu-pop button.on[data-att="pdfgen"],
html[data-theme="dark"] .menu-pop button.on[data-att="slidesgen"],
html[data-theme="dark"] .menu-pop button.on[data-att="web"],
html[data-theme="dark"] .menu-pop button.on[data-att="think"],
html[data-theme="dark"] .menu-pop button.on[data-att="deep"],
html[data-theme="dark"] .menu-pop button.on[data-att="webdev"] {
  background: rgba(255, 255, 255, 0.08);
  color: #fafafa;
}
html[data-theme="dark"] .menu-pop button.on[data-att="imggen"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="vidgen"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="pdfgen"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="slidesgen"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="web"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="think"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="deep"] .menu-ico .ico-svg,
html[data-theme="dark"] .menu-pop button.on[data-att="webdev"] .menu-ico .ico-svg {
  color: #fff;
}
.active-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
  max-width: min(200px, 46vw);
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  box-sizing: border-box;
}
.active-tool[hidden] { display: none !important; }
.active-tool-ico {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.active-tool-ico .ico-svg { color: #1d4ed8; }
#activeToolLabel {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-tool-clear {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 0;
  background: rgba(29, 78, 216, 0.12);
  color: #1d4ed8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}
.active-tool-clear:hover { background: rgba(29, 78, 216, 0.22); }
html[data-theme="dark"] .active-tool {
  background: #1e3a5f;
  color: #fafafa;
}
html[data-theme="dark"] .active-tool-ico .ico-svg { color: #fafafa; }
html[data-theme="dark"] .active-tool-clear {
  background: rgba(255, 255, 255, 0.12);
  color: #fafafa;
}
.viewer {
  position: fixed;
  inset: 0;
  background: #0d0d0d;
  display: none;
  z-index: 400;
  flex-direction: column;
  color: #fafafa;
}
.viewer.show { display: flex; }
.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  flex-shrink: 0;
}
.viewer-close {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fafafa;
  display: grid;
  place-items: center;
}
.viewer-close:hover { background: rgba(255, 255, 255, 0.2); }
.viewer-share {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fafafa;
  color: #0d0d0d;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.viewer-share:hover { filter: brightness(0.96); }
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 56px 0;
  position: relative;
  overflow: hidden;
  touch-action: pan-x pan-y;
}
.viewer.is-pinch-zoom .viewer-stage {
  overflow: auto;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
}
.viewer.is-loading .viewer-stage::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fafafa;
  border-radius: 50%;
  animation: payment-redirect-spin 0.75s linear infinite;
  pointer-events: none;
}
.viewer-stage img {
  max-width: min(920px, 94vw);
  max-height: calc(100dvh - 240px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  transition: opacity 0.2s ease;
  transform-origin: center center;
  will-change: transform;
}
.viewer.is-pinch-zoom .viewer-stage img {
  transition: opacity 0.2s ease;
}
.viewer-nav {
  position: absolute;
  top: 50%;
  margin-top: -22px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fafafa;
  cursor: pointer;
}
.viewer-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}
.viewer-nav[hidden] {
  display: none !important;
}
.viewer-nav--prev {
  left: 12px !important;
  right: auto !important;
}
.viewer-nav--next {
  right: 12px !important;
  left: auto !important;
}
.viewer-nav .msg-slides-chev {
  display: block;
  pointer-events: none;
}
.viewer-index {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 5;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  direction: rtl;
  backdrop-filter: blur(6px);
}
.viewer-index[hidden] {
  display: none !important;
}
.viewer.is-loading .viewer-stage img {
  opacity: 0.2;
}
.viewer-tools {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 0 12px 28px;
  flex-shrink: 0;
}
.viewer-tool {
  flex: 1;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: #fafafa;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 8px;
}
.viewer-tool-ic {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  color: #fafafa;
}
.viewer-tool:hover .viewer-tool-ic { background: rgba(255, 255, 255, 0.22); }
.viewer-tool .ico-svg { color: #fafafa; }
.aspect-pop {
  position: fixed;
  z-index: 450;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 24px));
  background: #fafafa;
  color: #111;
  border-radius: 16px;
  padding: 10px 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  display: none;
}
.aspect-pop.show { display: block; }
.aspect-pop .aspect-title {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  padding: 6px 12px 10px;
  line-height: 1.35;
}
.aspect-pop button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #111;
  cursor: pointer;
  font: inherit;
}
.aspect-pop button:hover,
.aspect-pop button:focus-visible {
  background: #f2f2f2;
  outline: none;
}
.aspect-pop .aspect-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid #bbb;
  border-radius: 4px;
  flex: 0 0 auto;
}
.aspect-pop .aspect-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.aspect-pop .aspect-label b {
  font-weight: 600;
  font-size: 14px;
}
.aspect-pop .aspect-label small {
  color: #777;
  font-size: 12px;
}
html[data-theme="dark"] .aspect-pop {
  background: #1c1c1e;
  color: #f5f5f5;
}
html[data-theme="dark"] .aspect-pop .aspect-title { color: #bbb; }
html[data-theme="dark"] .aspect-pop button { color: #f5f5f5; }
html[data-theme="dark"] .aspect-pop button:hover,
html[data-theme="dark"] .aspect-pop button:focus-visible { background: #2c2c2e; }
html[data-theme="dark"] .aspect-pop .aspect-label small { color: #999; }
html[data-theme="dark"] .aspect-pop .aspect-check { border-color: #666; }
.models-pop {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  max-height: min(420px, calc(100dvh - 24px));
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 8px;
  display: none;
  z-index: 240;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.models-pop.show { display: block; }
.model-pop-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 4px;
  font-size: 14px;
  font-weight: 700;
}
.model-pop-back {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--ink);
}
.model-pop-back:hover { background: var(--hover); }
.model-pop-back .ico-svg { transform: scaleX(-1); }
.list-row .row-chevron {
  margin-inline-start: auto;
  margin-inline-end: 2px;
  opacity: 0.45;
  display: inline-flex;
  line-height: 0;
  /* keep as down caret — do not flip to a sideways arrow */
  transform: none;
}
.list-row .row-chevron iconsax-icon {
  display: inline-flex;
  line-height: 0;
  color: inherit;
}
.kind-row { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; }
.kind-row button {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 12px;
}
.kind-row button.on { background: var(--ink); color: var(--bg); }

@media (min-width: 981px) {
  /* Site/desktop: align thread with centered composer — AI answers start mid-column (RTL) */
  .messages {
    padding-inline: max(24px, calc((100% - min(768px, calc(100% - 48px))) / 2));
  }
  .msg-row.assistant {
    justify-content: flex-start;
  }
  .msg-row.assistant .msg-col {
    max-width: min(768px, 100%);
  }
  .msg-row.assistant.msg-row--gen-image {
    justify-content: flex-end;
  }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  /* Keep drawer above all main/composer UI (composer was painting over the menu). */
  .main {
    position: relative;
    z-index: 1;
    isolation: isolate;
  }
  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(300px, 86vw);
    z-index: 210;
    transform: translateX(105%);
    transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-mobile { display: grid; }
  .top-model-wrap {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 32;
    pointer-events: auto;
  }
  .topbar .combo.top-model {
    margin-inline-start: 0;
    max-width: min(200px, 52vw);
  }
  .models-pop {
    width: min(280px, calc(100vw - 24px));
    max-height: min(320px, calc(100dvh - 24px));
    border-radius: 12px;
    padding: 6px;
    z-index: 40;
  }
  .models-pop .list-row {
    padding: 8px 10px;
    gap: 8px;
    font-size: 13px;
  }
  .models-pop .list-row small { font-size: 11px; }
  .models-pop .model-pop-head { font-size: 13px; padding: 4px 6px 2px; }
  .models-pop .kind-row { padding: 6px; gap: 4px; }
  .models-pop .kind-row button { height: 26px; padding: 0 8px; font-size: 11px; }
  /* Mobile / responsive: composer stays at bottom (desktop site keeps GPT mid-cluster). */
  .main.is-empty .chat-stage {
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }
  .main.is-empty .composer-wrap {
    flex: 0 0 auto;
    min-height: 0;
    justify-content: center;
    padding-inline: 16px;
    padding-top: 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  }
  .main.is-empty .empty-hero {
    padding-bottom: 16px;
  }
  .composer-tools { gap: 4px; }
  .composer,
  .composer-wrap,
  .composer-bar {
    max-width: 100%;
    overflow-x: hidden;
  }
  /* Tool chip (e.g. ساخت تصویر) must stay fully tappable — shrink model, never scroll sideways. */
  .composer-tools:has(.active-tool:not([hidden])) .pill.composer-model {
    max-width: min(112px, 30vw);
    flex: 1 1 0;
  }
  .composer-tools:has(.active-tool:not([hidden])) .active-tool {
    max-width: min(148px, 42vw);
    flex: 0 0 auto;
  }
  .pill { height: 30px; padding: 0 8px; font-size: 12px; }
  .attach-btn, .composer-mic, .send { width: 36px; height: 36px; }
  .messages { padding: 20px 16px 16px; }
  .main:not(.is-empty) .messages { padding-bottom: 160px; }
  .main:not(.is-empty) .composer-wrap {
    padding: 24px 16px calc(10px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  }
  .main:not(.is-empty) .composer,
  .main.is-empty .composer,
  .composer,
  .video-opts {
    width: 100%;
    max-width: 768px;
    box-sizing: border-box;
  }
  .scroll-fab { bottom: calc(162px + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px)); }
  .bubble { max-width: 86%; }
  .plan-grid { grid-template-columns: 1fr; }
  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 200;
  }
  .scrim.show { display: block; }
  body.drawer-open {
    overflow: hidden;
    touch-action: none;
  }

  /* Login / OTP: full-screen sheet on phone */
  .overlay:has(.sheet.sheet-auth) {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }
  .sheet.sheet-auth {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 22px calc(22px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .sheet.sheet-auth .auth-actions {
    margin-top: auto;
    padding-top: 28px;
  }
}

.reply-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.reply-bar[hidden] { display: none; }
.reply-bar-mark {
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  flex: 0 0 auto;
}
.reply-bar-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  padding: 0;
}
.reply-bar-body b {
  font-size: 12px;
  font-weight: 700;
}
.reply-bar-body span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.reply-quote {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 6px;
  padding: 6px 10px;
  border: 0;
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  max-width: 100%;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.reply-quote span {
  font-size: 11px;
  color: var(--muted);
}
.reply-quote b {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-row.is-reply-target .msg-col {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Chat shell aligned with the /home landing look. Structure and copy stay. */
:root {
  --bg: #ffffff;
  --bg-sidebar: #f7f9fc;
  --bg-main: #ffffff;
  --ink: #0f0f13;
  --ink-strong: #0f0f13;
  --muted: #5e5e61;
  --stroke: #e6e9f0;
  --hover: #eef3fb;
  --composer: #ffffff;
  --composer-stroke: #e6e9f0;
  --newchat-bg: transparent;
  --shadow-composer: 0 1px 2px rgba(15, 15, 19, 0.04), 0 18px 50px rgba(26, 47, 86, 0.1);
  --shadow-composer-home: 0 1px 2px rgba(15, 15, 19, 0.04), 0 24px 60px rgba(26, 47, 86, 0.12);
}
html[data-theme="dark"] {
  --bg: #0f0f13;
  --bg-sidebar: #13151b;
  --bg-main: #0f0f13;
  --ink: #f3f4f6;
  --stroke: #262a34;
  --hover: #1c2433;
  --composer: #171a21;
  --shadow-composer: 0 18px 50px rgba(0, 0, 0, 0.4);
}
.sidebar {
  background: var(--bg-sidebar);
  border-inline: 0;
  margin: 10px;
  border-radius: 22px;
  max-height: calc(100svh - 20px);
  box-shadow: 0 1px 2px rgba(15, 15, 19, 0.04);
}
.side-head { border-bottom: 0; height: 64px; }
.brand { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.btn-new {
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #3a78d8 0%, #1f4f9e 100%);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(31, 79, 158, 0.22);
}
.btn-new .ico-svg { color: #fff; }
.side-link { border-radius: 12px; }
.side-search {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e6e9f0;
}
html[data-theme="dark"] .side-search {
  background: #171a21;
  border-color: #262a34;
}
.main.is-empty {
  background:
    radial-gradient(circle at 18% 22%, rgba(219, 230, 251, 0.9), transparent 28%),
    radial-gradient(circle at 82% 30%, rgba(201, 217, 246, 0.7), transparent 26%),
    #fff;
}
html[data-theme="dark"] .main.is-empty {
  background:
    radial-gradient(circle at 18% 22%, rgba(37, 99, 201, 0.18), transparent 28%),
    #0f0f13;
}
.main.is-empty .empty-hero h2 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #0f0f13;
}
html[data-theme="dark"] .main.is-empty .empty-hero h2 { color: #f3f4f6; }
.composer {
  border: 1px solid #e6e9f0;
  border-radius: 28px;
  box-shadow: var(--shadow-composer-home);
  background: #fff;
}
html[data-theme="dark"] .composer,
html[data-theme="dark"] .main.is-empty .composer,
html[data-theme="dark"] .main:not(.is-empty) .composer {
  background: #171a21;
  border: 1px solid #262a34;
  box-shadow: var(--shadow-composer);
}
.send.active {
  background: linear-gradient(180deg, #3a78d8 0%, #1f4f9e 100%);
}
.topbar { background: transparent; border-bottom: 0; }
.topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) {
  height: 36px;
  padding-inline: 14px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3a78d8 0%, #1f4f9e 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 79, 158, 0.22);
  gap: 6px;
}
.topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub):hover {
  filter: brightness(1.06);
}
.topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) b {
  background: none;
  background-image: none;
  color: #fff;
  -webkit-text-fill-color: #fff;
  animation: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
  color: #fff;
  animation: none;
  filter: none;
}
html[data-theme="dark"] .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub),
html[data-theme="dark"] .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) b,
html[data-theme="dark"] .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
  color: #fff;
  -webkit-text-fill-color: #fff;
}
@media (min-width: 981px) {
  .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) {
    background: #DFEBFF;
    color: #1f4f9e;
    box-shadow: none;
  }
  .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) b,
  .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
    color: #1f4f9e;
    -webkit-text-fill-color: #1f4f9e;
  }
  html[data-theme="dark"] .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) {
    background: #16325c;
    color: #DFEBFF;
    box-shadow: none;
  }
  html[data-theme="dark"] .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) b,
  html[data-theme="dark"] .topbar .top-subscribe-btn.side-link-subscribe:not(.is-active-sub) .subscribe-ico .ico-svg {
    color: #DFEBFF;
    -webkit-text-fill-color: #DFEBFF;
  }
}
@media (max-width: 860px) {
  .sidebar { margin: 0; border-radius: 0; max-height: 100svh; }
}
@media (max-width: 640px) {
  .main.is-empty .empty-hero.empty-hero--intro {
    padding-left: 10px;
    padding-right: 10px;
  }
  .main.is-empty .empty-hero.empty-hero--intro h2 {
    font-size: clamp(15px, 4.5vw, 20px);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.25;
    white-space: nowrap;
  }
}

/* In-app sheets (login, settings, images, archive, support, devices, legal)
   aligned with the /home landing look. Subscription lives on /pricing. */
:root {
  --card: #ffffff;
  --btn: linear-gradient(180deg, #3a78d8 0%, #1f4f9e 100%);
  --btn-fg: #ffffff;
  --overlay: rgba(15, 15, 19, 0.32);
  --account-bento-bg: #f7f9fc;
  --account-bento-hover: #eef3fb;
  --account-quota-bg: #f7f9fc;
  --account-input-bg: #ffffff;
}
html[data-theme="dark"] {
  --card: #171a21;
  --btn: linear-gradient(180deg, #3f7fe0 0%, #2455a8 100%);
  --btn-fg: #ffffff;
  --overlay: rgba(0, 0, 0, 0.6);
  --account-bento-bg: #1c2029;
  --account-bento-hover: #20283a;
  --account-quota-bg: #1c2029;
  --account-input-bg: #13151b;
}
.overlay.show {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet {
  border-radius: 22px;
  border: 1px solid #e6e9f0;
  box-shadow: 0 1px 2px rgba(15, 15, 19, 0.04), 0 30px 80px rgba(26, 47, 86, 0.14);
}
html[data-theme="dark"] .sheet {
  border-color: #262a34;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.sheet h3 { font-weight: 700; letter-spacing: -0.02em; color: #0f0f13; }
html[data-theme="dark"] .sheet h3 { color: #f3f4f6; }
.btn { border-radius: 12px; font-weight: 700; }
.btn.primary,
.upgrade-card-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(31, 79, 158, 0.28);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.upgrade-card-btn-ghost {
  box-shadow: none;
}
.btn.primary:hover,
.upgrade-card-btn:hover { filter: brightness(1.06); }
.btn.primary:disabled { filter: saturate(0.4); box-shadow: none; }
.btn.ghost {
  background: #ffffff;
  border-color: #e6e9f0;
  color: #0f0f13;
}
.btn.ghost:hover { background: #f7f9fc; }
html[data-theme="dark"] .btn.ghost {
  background: #171a21;
  border-color: #262a34;
  color: #f3f4f6;
}
html[data-theme="dark"] .btn.ghost:hover { background: #1c2029; }
.field input,
.field textarea,
.field select,
.account-name-input,
.auth-otp-digit {
  border-color: #e6e9f0;
  background: #ffffff;
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus,
.account-name-input:focus,
.auth-otp-digit:focus {
  border-color: #2563c9;
  box-shadow: 0 0 0 3px rgba(37, 99, 201, 0.14);
}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .account-name-input,
html[data-theme="dark"] .auth-otp-digit {
  border-color: #262a34;
  background: #13151b;
}
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field textarea:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .account-name-input:focus,
html[data-theme="dark"] .auth-otp-digit:focus {
  border-color: #5b95ea;
  box-shadow: 0 0 0 3px rgba(91, 149, 234, 0.2);
}
.sheet .list-row { border-radius: 12px; border-bottom-color: #eef1f6; }
html[data-theme="dark"] .sheet .list-row { border-bottom-color: #20242d; }
.account-bento-item { border: 1px solid #eef1f6; }
html[data-theme="dark"] .account-bento-item { border-color: #20242d; }
.ticket-row { border-color: #e6e9f0; border-radius: 16px; }
.ticket-row:hover { background: #f7f9fc; }
html[data-theme="dark"] .ticket-row { border-color: #262a34; }
html[data-theme="dark"] .ticket-row:hover { background: #1c2029; }
.quota-meter-fill { background: linear-gradient(90deg, #3a78d8 0%, #1f4f9e 100%); }
.gal-item { border-radius: 14px; background: #f7f9fc; }
html[data-theme="dark"] .gal-item { background: #1c2029; }
.sheet-back:hover { background: #eef3fb; color: #1f4f9e; }
html[data-theme="dark"] .sheet-back:hover { background: #16243d; color: #9fc0f5; }

.rate-app {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.rate-card {
  width: min(400px, 100%);
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  padding: 28px 20px 0;
  text-align: center;
}
html[data-theme="dark"] .rate-card {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.rate-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0;
}
.rate-card h2 b { font-weight: 800; }
.rate-kicker {
  margin: 0 auto 10px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue, #2563eb) 12%, transparent);
  color: var(--blue, #2563eb);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}
.rate-hint {
  margin: 4px 8px 0;
  min-height: 2.8em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-60);
}
.rate-faces {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  direction: rtl;
  gap: 4px;
  margin: 22px 8px 8px;
  touch-action: none;
}
.rate-faces button,
.rate-faces span {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rate-faces img {
  width: 36px;
  height: 36px;
  display: block;
  pointer-events: none;
  user-select: none;
}
.rate-faces-lock { pointer-events: none; margin-top: 8px; }
.rate-faces-lock [data-rate-five] { pointer-events: auto; }
.rate-actions {
  display: flex;
  margin: 18px -20px 0;
  border-top: 1px solid var(--stroke);
}
.rate-actions button {
  flex: 1;
  height: 52px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.rate-actions button + button { border-inline-start: 1px solid var(--stroke); }
.rate-actions button[data-rate-ok] { font-weight: 700; color: var(--ink); }
.rate-actions button[data-rate-ok]:disabled { color: var(--muted); font-weight: 500; }
.rate-card-note { padding-bottom: 20px; text-align: start; }
.rate-back {
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin: -8px 0 8px;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}
.rate-note {
  width: 100%;
  min-height: 140px;
  margin-top: 8px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
.rate-note::placeholder { color: var(--composer-placeholder); }
.rate-error {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--danger);
}
.rate-send {
  width: 100%;
  height: 48px;
  margin-top: 14px;
  border-radius: 14px;
  background: var(--btn);
  color: var(--btn-fg);
  font-size: 15px;
  font-weight: 700;
}
.rate-send:disabled { opacity: 0.4; }
@media (prefers-reduced-motion: reduce) {
  .rate-card { animation: none; }
}

/* Video build confirm — quota spend gate */
.video-confirm {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.video-confirm.is-open { pointer-events: auto; }
.video-confirm-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 19, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.video-confirm-card {
  position: relative;
  width: min(100%, 420px);
  margin: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  padding: 22px 20px 18px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: var(--card, var(--surface, #fff));
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(15, 15, 19, 0.18);
  text-align: right;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.18s ease;
}
.video-confirm.is-open .video-confirm-scrim { opacity: 1; }
.video-confirm.is-open .video-confirm-card { transform: none; opacity: 1; }
.video-confirm-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #b45309;
}
.video-confirm-card > b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.video-confirm-specs {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--surface-soft, color-mix(in srgb, var(--ink) 4%, transparent));
}
.video-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.video-confirm-row span {
  color: var(--muted);
  flex-shrink: 0;
}
.video-confirm-row strong {
  font-weight: 700;
  text-align: left;
  color: var(--ink);
}
.video-confirm-cost {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.video-confirm-cost.is-over {
  color: #b45309;
  font-weight: 700;
}
.video-confirm-actions {
  display: flex;
  gap: 10px;
}
.video-confirm-actions button {
  flex: 1;
  height: 46px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.video-confirm-no {
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--ink);
}
.video-confirm-yes {
  border: 0;
  color: var(--btn-fg, #fff);
  background: var(--btn);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent, #2563c9) 28%, transparent);
}
html[data-theme="dark"] .video-confirm-scrim {
  background: rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .video-confirm-badge {
  background: color-mix(in srgb, #fbbf24 22%, transparent);
  color: #fcd34d;
}

/* Sponsored ad under assistant replies */
.ad-card {
  margin: 14px 0 6px;
  padding: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  text-align: right;
}
.ad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ad-sponsor { font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.ad-menu-wrap { position: relative; }
.ad-menu-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 18px; line-height: 1; padding: 2px 8px; border-radius: 8px;
}
.ad-menu-btn:hover { background: var(--hover); color: var(--ink); }
.ad-menu {
  position: absolute; inset-inline-start: 0; top: 100%; z-index: 5; min-width: 170px;
  background: var(--bg-sidebar); border: 1px solid var(--stroke);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); padding: 4px;
}
.ad-menu[hidden] { display: none; }
.ad-menu button {
  display: block; width: 100%; text-align: right; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.ad-menu button:hover { background: var(--hover); }
.ad-body { margin-top: 2px; font-weight: 400; color: var(--ink); }
.ad-link { color: var(--send-blue); text-decoration: none; font-weight: 400; }
.ad-link:hover { text-decoration: underline; }
.ad-note { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
