﻿:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --blue: #2563eb;
  --cyan: #0891b2;
  --rose: #e11d48;
  --green: #10b981;
  --green-dark: #047857;
  --shadow: 0 24px 90px rgba(15, 23, 42, 0.22);
  --flag-width: 22px;
  --flag-height: 16px;
  --page-gutter: clamp(10px, 2.2vw, 28px);
  --section-width: min(1160px, calc(100% - var(--page-gutter) - var(--page-gutter)));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.8) rgba(15, 23, 42, 0.12);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid rgba(246, 249, 252, 0.9);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #34d399, var(--green-dark));
}

body {
  margin: 0;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f6f9fc;
  overflow-x: hidden;
}

body.region-blocked {
  overflow: hidden;
}

body.region-blocked .topbar,
body.region-blocked main,
body.region-blocked .mini-chat,
body.region-blocked .ai-launcher,
body.region-blocked .scroll-dock {
  display: none;
}

[data-admin-hidden="true"] {
  display: none !important;
}

.hero-text,
.chat-stream .bubble p,
.mini-stream .bubble p,
.api-panel > div:first-child p:not(.eyebrow),
.api-cards article p,
.tool-card.ad-card > p {
  white-space: pre-line;
}

.region-legal-notice {
  display: none;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.22), transparent 40%);
}

.region-legal-notice.show {
  display: grid;
}

.region-legal-card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.58);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  text-align: center;
}

.region-legal-card h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.1;
}

.region-legal-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  min-width: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.34);
  outline-offset: 2px;
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 40;
  width: var(--section-width);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.brand,
.nav-links,
.nav-actions,
.filter-row,
.quick-prompts,
.action-pair,
.metrics,
.scene-buttons {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.nav-links {
  gap: clamp(12px, 2vw, 22px);
  color: #334155;
  font-size: 14px;
  font-weight: 700;
}

.nav-links a,
.nav-cta,
.theme-text,
.tool-link,
.start-chat {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.nav-cta {
  display: inline-grid;
  place-items: center;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.nav-actions {
  gap: 8px;
}

.language-switcher {
  position: relative;
}

.language-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: clamp(92px, 10vw, 118px);
  min-width: 92px;
  height: 39px;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.language-text {
  min-width: 0;
  max-width: 74px;
  overflow: hidden;
  white-space: nowrap;
}

.language-flag {
  display: inline-flex;
  width: var(--flag-width);
  min-width: var(--flag-width);
  height: var(--flag-height);
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.language-flag .country-flag {
  width: var(--flag-width);
  height: var(--flag-height);
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 55;
  display: grid;
  gap: 6px;
  width: 220px;
  max-height: min(420px, 70vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.language-switcher.open .language-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.language-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.language-option-label,
.model-menu-category-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.language-option:hover,
.language-option.active {
  border-color: rgba(16, 185, 129, 0.26);
  background: rgba(16, 185, 129, 0.1);
}

.language-option:disabled,
.language-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
}

.language-option:disabled:hover,
.language-option[aria-disabled="true"]:hover {
  border-color: transparent;
  background: transparent;
}

.language-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.register-trigger {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

body.user-logged-in .login-trigger,
body.user-logged-in .register-trigger,
.nav-actions .login-trigger[hidden],
.nav-actions .register-trigger[hidden] {
  display: none !important;
}

body:not(.user-logged-in) .user-menu {
  display: none !important;
}

.user-menu {
  position: relative;
}

.user-menu[hidden] {
  display: none !important;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 43px;
  max-width: 198px;
  padding: 0 11px 0 8px;
  border: 1px solid rgba(16, 185, 129, 0.26);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  text-align: left;
}

.user-avatar-small {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-size: 13px;
  font-weight: 1000;
}

.generated-user-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.92) 0 10%, transparent 23%),
    radial-gradient(circle at 82% 12%, var(--avatar-c) 0 15%, transparent 33%),
    radial-gradient(circle at 18% 86%, rgba(255, 255, 255, 0.3) 0 16%, transparent 34%),
    linear-gradient(145deg, var(--avatar-a), var(--avatar-b));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    inset 0 -5px 12px rgba(15, 23, 42, 0.11),
    0 8px 18px rgba(15, 23, 42, 0.13);
}

.generated-user-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.user-menu-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.user-menu-copy strong,
.user-menu-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-copy strong {
  font-size: 13px;
  font-weight: 1000;
}

.user-menu-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.user-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: min(340px, calc(100vw - 28px));
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.user-menu.open .user-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.user-panel-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(22px);
}

.user-panel-card h3 {
  margin: 4px 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.user-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-panel-avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.user-panel-subtitle,
.user-identity {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
}

.user-identity {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.user-identity span,
.user-identity strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.user-stats div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.user-stats span,
.user-stats strong {
  display: block;
}

.user-stats span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 900;
}

.user-stats strong {
  margin-top: 5px;
  font-size: 15px;
}

.user-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.user-panel-actions button,
.user-panel-actions a {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(4, 120, 87, 0.9));
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.user-panel-actions [data-user-logout] {
  grid-column: 1 / -1;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 82px;
  height: 39px;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.theme-symbol {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: inset -6px -2px 0 #fff;
}

body.night-theme .theme-symbol {
  background: #facc15;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.2);
}

.theme-text {
  font-size: 13px;
}

body.night-theme .theme-toggle {
  color: #f8fafc;
  border-color: rgba(250, 204, 21, 0.28);
  background: rgba(15, 23, 42, 0.78);
}

body.night-theme .language-btn {
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.78);
}

body.night-theme .user-menu-btn {
  color: #f8fafc;
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(15, 23, 42, 0.78);
}

body.night-theme .user-menu-copy small {
  color: #a8b5c7;
}

body.night-theme .language-menu {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.94);
}

body.night-theme .language-option {
  color: #e5edf7;
}

body.night-theme .language-option small {
  color: #a8b5c7;
}

main {
  overflow: visible;
}

body.night-theme {
  color: #e5edf7;
  background: #07111f;
}

body.night-theme .topbar,
body.night-theme .metrics,
body.night-theme .section-head,
body.night-theme .tool-grid,
body.night-theme .tool-card,
body.night-theme .featured,
body.night-theme .scenes,
body.night-theme .api-panel,
body.night-theme .login-panel {
  color: #e5edf7;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.82);
}

body.night-theme .nav-links,
body.night-theme .tool-card p,
body.night-theme .metrics span,
body.night-theme .api-panel p,
body.night-theme .login-panel p:not(.eyebrow) {
  color: #a8b5c7;
}

body.night-theme .section-head,
body.night-theme .tool-grid {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

body.night-theme .section-head {
  padding: 18px;
  margin-bottom: 14px;
}

body.night-theme .tool-grid {
  padding: 16px;
}

body.night-theme .ad-card {
  border-color: rgba(56, 189, 248, 0.28);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(6, 78, 59, 0.72)),
    #0f172a;
}

body.night-theme .ad-badge,
body.night-theme .ad-tag {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.18);
}

body.night-theme .section-head h2,
body.night-theme .featured h2,
body.night-theme .scenes h2,
body.night-theme .api-panel h2 {
  color: #e5edf7;
}

body.night-theme .filter,
body.night-theme .scene-buttons button,
body.night-theme .api-cards article,
body.night-theme .feature-strip article {
  color: #e5edf7;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.78);
}

body.night-theme .tag {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
}

body.night-theme .empty-state {
  color: #a8b5c7;
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.78);
}

body.night-theme .hero-bg::after {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(to bottom, transparent 0 66%, #07111f 100%);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 112px 18px clamp(238px, 30vh, 292px);
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.78), rgba(8, 47, 73, 0.48) 45%, rgba(6, 78, 59, 0.34)),
    url("https://images.unsplash.com/photo-1639322537228-f710d846310a?auto=format&fit=crop&w=1800&q=85") center/cover;
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 28% 25%, rgba(34, 211, 238, 0.22), transparent 28%),
    radial-gradient(circle at 72% 34%, rgba(16, 185, 129, 0.2), transparent 24%),
    linear-gradient(to bottom, transparent 0 66%, #f6f9fc 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.tech-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.tech-field span {
  position: absolute;
  width: 220px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.78), transparent);
  opacity: 0.58;
  animation: dataBeam 7s linear infinite;
}

.tech-field span:nth-child(1) {
  top: 28%;
  left: -25%;
}

.tech-field span:nth-child(2) {
  top: 42%;
  left: -35%;
  animation-delay: 1.4s;
  animation-duration: 8.5s;
}

.tech-field span:nth-child(3) {
  top: 58%;
  left: -20%;
  animation-delay: 2.6s;
  animation-duration: 7.8s;
}

.tech-field span:nth-child(4) {
  top: 72%;
  left: -30%;
  animation-delay: 4s;
  animation-duration: 9s;
}

.hero-content {
  width: min(1040px, 100%);
  margin: 0 auto;
  text-align: center;
  color: #fff;
  transform: translateY(clamp(-12px, -2vh, -4px));
}

.eyebrow {
  margin: 0 0 12px;
  color: #67e8f9;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  width: min(920px, 100%);
  margin: 0 auto 20px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-text {
  width: min(780px, 100%);
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.78;
}

.hero-console {
  --hero-console-gap: 12px;
  --hero-expand-size: clamp(28px, 2.2vw, 34px);
  --hero-expand-gap: clamp(7px, 0.9vw, 10px);
  --hero-control-rail: calc(var(--hero-expand-size) + var(--hero-expand-gap));
  --hero-linked-width: calc(100% - var(--hero-control-rail));
  position: absolute;
  left: 50%;
  bottom: 38px;
  z-index: 50;
  width: min(calc(1040px + var(--hero-control-rail)), calc(100% - var(--page-gutter) - var(--page-gutter)));
  transform: translateX(-50%);
  display: grid;
  gap: var(--hero-console-gap);
  overflow: visible;
  pointer-events: none;
  opacity: 1;
  transition: opacity 260ms ease, transform 260ms ease;
  max-height: calc(100vh - 132px);
}

body.chat-mode:not(.mini-mode) .hero-console {
  top: calc(var(--topbar-bottom, 78px) + var(--hero-console-gap));
  bottom: 38px;
  grid-template-rows: auto auto auto auto;
  max-height: none;
  align-content: end;
}

.hero:has(.more-models.open) .hero-console,
body.model-menu-open .hero-console {
  z-index: 2147483640;
}

.model-bar,
.search-chat-row,
.search-chat-box,
.chat-stream,
.quick-prompts {
  pointer-events: auto;
}

.model-bar,
.chat-stream,
.quick-prompts {
  width: var(--hero-linked-width);
  justify-self: start;
}

.chat-stream {
  visibility: hidden;
  display: grid;
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: none;
}

body.chat-mode .chat-stream {
  visibility: visible;
  min-height: 0;
  max-height: var(--hero-chat-max-height, 46vh);
  height: auto;
  align-self: end;
  align-content: start;
  align-items: start;
  padding: 18px 18px 44px;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition: opacity 280ms ease, transform 280ms ease;
  animation: chatPanelIn 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

body.chat-mode .chat-stream:empty {
  display: none;
}

body.chat-mode.empty-chat-expanded .chat-stream:empty {
  display: grid;
  min-height: var(--hero-chat-max-height, 46vh);
  height: var(--hero-chat-max-height, 46vh);
  max-height: var(--hero-chat-max-height, 46vh);
}

.bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  color: #fff;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  animation: bubbleIn 320ms ease forwards;
}

.bubble.user {
  position: relative;
  justify-content: flex-end;
  z-index: 1;
}

.bubble.user::before {
  content: "";
  position: absolute;
  top: -12px;
  right: -10px;
  bottom: -42px;
  width: min(86%, 720px);
  z-index: 0;
}

.bubble.user:hover,
.bubble.user:focus-within {
  z-index: 6;
}

.bubble.user .user-avatar {
  position: relative;
  z-index: 1;
  order: 2;
}

.bubble.user .user-bubble-body {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  display: grid;
  justify-items: end;
  width: fit-content;
  max-width: min(78%, 620px);
  min-width: 0;
}

.bubble p {
  flex: 0 1 auto;
  width: fit-content;
  max-width: min(78%, 620px);
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  line-height: 1.62;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.18);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble.user p {
  background: rgba(16, 185, 129, 0.58);
}

.bubble.user .user-bubble-body > .bubble-text {
  max-width: 100%;
}

.bubble-actions {
  position: absolute;
  top: 100%;
  right: 4px;
  bottom: auto;
  z-index: 4;
  display: inline-flex;
  gap: 2px;
  padding: 4px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.bubble.user:hover .bubble-actions,
.bubble.user:focus-within .bubble-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bubble.user.editing .bubble-actions {
  display: none;
}

.bubble-action-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  cursor: pointer;
  font-size: 0;
  box-shadow: none;
  transition: color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.bubble-action-btn:hover,
.bubble-action-btn.copied {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.bubble-action-btn.copied {
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.14);
}

.copy-action::before,
.copy-action::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  border: 1.7px solid currentColor;
  border-radius: 3px;
}

.copy-action::before {
  left: 8px;
  top: 7px;
  background: transparent;
  opacity: 0.55;
}

.copy-action::after {
  left: 11px;
  top: 10px;
  background: transparent;
}

.copy-action.copied::before {
  left: 9px;
  top: 9px;
  width: 13px;
  height: 7px;
  border: 0;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 0;
  opacity: 1;
  transform: rotate(-45deg);
}

.copy-action.copied::after {
  display: none;
}

.edit-action::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-42deg);
  box-shadow: none;
}

.edit-action::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.5;
  transform: rotate(-10deg);
}

.bubble-edit-input {
  width: min(520px, 72vw);
  max-width: 100%;
  min-height: 86px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.42);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  outline: none;
  resize: vertical;
  font: inherit;
  line-height: 1.58;
}

.bubble-edit-input:focus {
  border-color: rgba(16, 185, 129, 0.72);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16), 0 10px 28px rgba(15, 23, 42, 0.18);
}

.bubble-edit-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.bubble-edit-actions button {
  min-width: 62px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 900;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.bubble-edit-actions button:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
}

.bubble-edit-done {
  border-color: rgba(255, 255, 255, 0.92) !important;
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

.bubble-edit-done:hover {
  background: #fff !important;
}

.api-fallback-note {
  display: block;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffe8a3;
  font-weight: 850;
}

.quota-warning-title,
.quota-warning-text {
  display: block;
}

.quota-warning-title {
  margin-bottom: 6px;
  color: #fef3c7;
  font-weight: 1000;
}

.quota-warning-text {
  color: rgba(255, 255, 255, 0.9);
}

.quota-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  white-space: normal;
}

.quota-action-btn {
  display: inline-grid;
  place-items: center;
  min-width: 102px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  transition: transform 150ms ease, filter 150ms ease;
}

.quota-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.quota-action-btn.free {
  background: linear-gradient(135deg, #22c55e, #10b981);
}

.quota-action-btn.recharge {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.mini-stream .quota-action-row {
  justify-content: flex-end;
  gap: 6px;
  margin-top: 9px;
}

.mini-stream .quota-action-btn {
  min-width: 78px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  animation: typingPulse 900ms ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 240ms;
}

.avatar {
  flex: 0 0 34px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 900;
}

.user-avatar {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fef3c7, #f9a8d4 64%, #60a5fa);
  box-shadow: inset 0 -4px 0 rgba(15, 23, 42, 0.12);
}

.user-avatar.generated-user-avatar {
  padding: 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.92) 0 10%, transparent 23%),
    radial-gradient(circle at 82% 12%, var(--avatar-c) 0 15%, transparent 33%),
    radial-gradient(circle at 18% 86%, rgba(255, 255, 255, 0.3) 0 16%, transparent 34%),
    linear-gradient(145deg, var(--avatar-a), var(--avatar-b));
}

.user-avatar.user-panel-avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.user-avatar.generated-user-avatar::before,
.user-avatar.generated-user-avatar::after,
.user-avatar.generated-user-avatar .user-smile {
  display: none;
}

.user-avatar::before,
.user-avatar::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0f172a;
}

.user-avatar::before {
  left: 10px;
}

.user-avatar::after {
  right: 10px;
}

.user-smile {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 12px;
  height: 6px;
  transform: translateX(-50%);
  border-bottom: 2px solid #0f172a;
  border-radius: 0 0 12px 12px;
}

.model-bar {
  position: relative;
  z-index: 120;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(16px);
  overflow: visible;
}

.model-bar:has(.more-models.open),
.search-chat-row:has(.chat-model-picker.open),
.search-chat-row:has(.model-version-picker.open) {
  position: relative;
  z-index: 2147483642;
  overflow: visible;
}

.model-bar > span {
  flex: 0 0 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.model-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.model-pills {
  width: auto;
  max-width: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 7px;
  min-width: 0;
  overflow: auto;
  scrollbar-width: none;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
}

.model-pills::-webkit-scrollbar {
  display: none;
}

.model-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 0 10px 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.model-pill > .app-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

.app-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: transparent;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  position: relative;
  font-size: 0;
}

.app-icon img {
  grid-area: 1 / 1;
}

.app-icon img {
  z-index: 1;
  width: 74%;
  height: 74%;
  object-fit: contain;
  background: transparent;
}

.app-icon.icon-missing::before {
  content: "AI";
  color: #0f172a;
  font-size: 10px;
  font-weight: 1000;
}

.app-icon.custom-generated-icon {
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.48), transparent 28%),
    linear-gradient(135deg, var(--custom-icon-a, #22c55e), var(--custom-icon-b, #2563eb));
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-icon.custom-generated-icon > span {
  line-height: 1;
}

.logo.app-icon.custom-generated-icon {
  font-size: 18px;
}

.brand-mark[data-ai-model-icon],
.avatar[data-ai-model-icon],
.mini-avatar[data-ai-model-icon],
.ai-launcher [data-ai-model-icon] {
  overflow: hidden;
  padding: 0;
  color: transparent;
}

.brand-mark[data-ai-model-icon] > .app-icon,
.avatar[data-ai-model-icon] > .app-icon,
.mini-avatar[data-ai-model-icon] > .app-icon,
.ai-launcher [data-ai-model-icon] > .app-icon {
  width: 100%;
  height: 100%;
}

.ai-avatar {
  overflow: hidden;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
}

.ai-avatar > .app-icon {
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.model-pill .app-icon,
.more-model-option .app-icon,
.chat-model-option .app-icon,
.mini-model-option .app-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
}

.model-pill .app-icon img,
.more-model-option .app-icon img,
.chat-model-btn .app-icon img,
.chat-model-option .app-icon img,
.mini-model-option .app-icon img,
.mini-avatar .app-icon img,
.ai-avatar .app-icon img,
.logo.app-icon img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  background: transparent;
}

.app-icon.original-brand-icon,
.model-pill > .app-icon.original-brand-icon,
.more-model-option > .app-icon.original-brand-icon,
.chat-model-btn > .app-icon.original-brand-icon,
.chat-model-option > .app-icon.original-brand-icon,
.mini-model-option > .app-icon.original-brand-icon,
.mini-avatar .app-icon.original-brand-icon,
.ai-avatar > .app-icon.original-brand-icon,
.logo.app-icon.original-brand-icon {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-icon.original-brand-icon img,
.model-pill .app-icon.original-brand-icon img,
.more-model-option .app-icon.original-brand-icon img,
.chat-model-btn .app-icon.original-brand-icon img,
.chat-model-option .app-icon.original-brand-icon img,
.mini-model-option .app-icon.original-brand-icon img,
.mini-avatar .app-icon.original-brand-icon img,
.ai-avatar .app-icon.original-brand-icon img,
.logo.app-icon.original-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.model-pill.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.24);
}

.more-models {
  position: relative;
  z-index: 1;
  justify-self: end;
  min-width: max-content;
}

.more-models.open {
  z-index: 2147483643;
}

.more-model-btn {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.32);
  cursor: pointer;
  font-weight: 900;
}

.more-model-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 2147483644;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
  width: min(420px, 82vw);
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.more-model-menu::-webkit-scrollbar,
.model-menu-list::-webkit-scrollbar,
.chat-stream::-webkit-scrollbar,
.mini-stream::-webkit-scrollbar,
.model-version-menu::-webkit-scrollbar,
.chat-model-menu::-webkit-scrollbar,
.mini-model-menu::-webkit-scrollbar {
  width: 8px;
}

.more-model-menu::-webkit-scrollbar-track,
.model-menu-list::-webkit-scrollbar-track,
.chat-stream::-webkit-scrollbar-track,
.mini-stream::-webkit-scrollbar-track,
.model-version-menu::-webkit-scrollbar-track,
.chat-model-menu::-webkit-scrollbar-track,
.mini-model-menu::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.more-model-menu::-webkit-scrollbar-thumb,
.model-menu-list::-webkit-scrollbar-thumb,
.chat-stream::-webkit-scrollbar-thumb,
.mini-stream::-webkit-scrollbar-thumb,
.model-version-menu::-webkit-scrollbar-thumb,
.chat-model-menu::-webkit-scrollbar-thumb,
.mini-model-menu::-webkit-scrollbar-thumb {
  border: 2px solid rgba(15, 23, 42, 0.4);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
}

.more-models.open .more-model-menu,
.more-model-menu.model-menu-floating.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.more-model-menu.model-menu-floating {
  position: fixed;
  right: auto;
  bottom: auto;
  z-index: 2147483647;
  transform-origin: right bottom;
}

.more-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.more-model-option.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.24);
}

.more-model-option > .app-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

.search-chat-row {
  position: relative;
  z-index: 130;
  display: grid;
  grid-template-columns: minmax(0, var(--hero-linked-width)) var(--hero-expand-size);
  align-items: center;
  gap: var(--hero-expand-gap);
  width: 100%;
  transition: transform 280ms ease;
}

.chat-side-controls {
  display: inline-grid;
  gap: 6px;
  align-self: center;
  align-content: center;
  justify-items: center;
  justify-self: center;
  padding: 2px 0;
  transform: none;
}

.search-chat-box {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: max-content max-content minmax(220px, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  transition: transform 280ms ease, background 280ms ease;
}

body.chat-mode .search-chat-row {
  transform: translateY(-2px);
}

body.chat-mode .search-chat-box {
  background: rgba(255, 255, 255, 0.62);
}

.chat-model-picker {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: max-content;
  max-width: min(340px, 36vw);
}

.chat-model-picker.open {
  z-index: 2147483643;
}

.chat-model-btn {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 4px;
  width: max-content;
  max-width: min(340px, 36vw);
  min-height: 58px;
  height: 100%;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.38);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chat-model-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.chat-model-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  width: auto;
  max-width: 100%;
  row-gap: 4px;
}

.chat-model-main .model-option-name {
  min-width: 0;
  max-width: none;
  overflow: visible;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.chat-model-btn:hover,
.chat-model-picker.open .chat-model-btn {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.72), rgba(4, 120, 87, 0.72));
}

.chat-model-btn > .app-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.chat-model-btn .app-icon,
.mini-avatar .app-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
}

.mini-avatar .app-icon {
  width: 34px;
  height: 34px;
}

.model-version-picker {
  position: relative;
  z-index: 1;
  width: var(--model-version-width, max-content);
  min-width: 0;
  max-width: calc(100vw - 36px);
}

.model-version-picker.open {
  z-index: 2147483643;
}

.model-version-btn {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  height: 100%;
  padding: 7px 24px 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.38);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.model-version-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-62%) rotate(45deg);
  opacity: 0.82;
}

.model-version-btn:hover,
.model-version-picker.open .model-version-btn {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.72), rgba(4, 120, 87, 0.72));
}

.model-version-label {
  min-width: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.model-version-name {
  min-width: 0;
  width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
}

.model-version-menu {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483647;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: var(--model-version-menu-width, max(100%, 180px));
  max-width: calc(100vw - 36px);
  max-height: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transform-origin: left bottom;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
}

.model-version-picker.open .model-version-menu,
.model-version-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.model-version-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.model-version-option.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.48), rgba(4, 120, 87, 0.48));
}

.chat-model-menu {
  position: absolute;
  left: 0;
  top: auto;
  bottom: calc(100% + 8px);
  z-index: 2147483644;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
  width: min(430px, 86vw);
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.chat-model-picker.open .chat-model-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.chat-model-option.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.48), rgba(4, 120, 87, 0.48));
}

.chat-model-option > .app-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

#aiQuery {
  width: 100%;
  min-height: 58px;
  height: auto;
  padding: var(--hero-input-padding-y, 17px) 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  outline: none;
  color: #fff;
  background: rgba(15, 23, 42, 0.38);
  font-size: var(--hero-input-font-size, 16px);
  line-height: 1.55;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
}

#aiQuery.is-empty {
  text-align: left;
  white-space: nowrap;
}

#aiQuery:not(.is-empty) {
  --hero-input-font-size: 16px;
  --hero-input-padding-y: 17px;
  text-align: left;
}

#aiQuery::placeholder {
  color: rgba(255, 255, 255, 0.76);
}

#aiQuery:focus {
  border-color: rgba(103, 232, 249, 0.85);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.22);
}

.action-pair {
  gap: 8px;
  align-self: stretch;
}

.attach-btn {
  display: none;
  place-items: center;
  min-width: 58px;
  min-height: 58px;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.46);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.attach-btn span {
  position: relative;
  display: block;
  width: 18px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 7px 7px;
  border-top-color: transparent;
  transform: rotate(-10deg);
}

.attach-btn span::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -7px;
  width: 8px;
  height: 14px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.attach-btn:hover,
.attach-btn.has-files {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.62);
  background: rgba(16, 185, 129, 0.24);
}

.ghost-btn,
.solid-btn {
  display: inline-grid;
  place-items: center;
  min-width: 76px;
  min-height: 58px;
  height: 100%;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.ghost-btn {
  border: 1px solid rgba(15, 23, 42, 0.58);
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
}

.solid-btn {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.expand-chat-btn,
.fullscreen-chat-btn {
  --mini-control-icon-size: 11px;
  --mini-control-icon-stroke: 2px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--hero-expand-size);
  height: var(--hero-expand-size);
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.expand-chat-btn > span,
.fullscreen-chat-btn > span {
  display: none;
}

.expand-chat-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border-top: var(--mini-control-icon-stroke) solid #fff;
  border-left: var(--mini-control-icon-stroke) solid #fff;
  border-radius: 2px 0 0 0;
  transform: translate(-50%, -50%) rotate(45deg);
  transform-origin: center;
}

.expand-chat-btn:hover,
.expand-chat-btn.active,
.fullscreen-chat-btn:hover,
.fullscreen-chat-btn.active {
  transform: scale(1.06);
  border-color: rgba(16, 185, 129, 0.62);
  background: rgba(16, 185, 129, 0.28);
}

.expand-chat-btn.active::before {
  transform: translate(-50%, -50%) rotate(225deg);
}

.fullscreen-chat-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  transform-origin: center;
  background:
    linear-gradient(#fff, #fff) left top / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) left top / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) right top / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) right top / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 2px 7px no-repeat;
}

.fullscreen-chat-btn.active::before {
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%) rotate(45deg);
}

body.chat-fullscreen {
  overflow: hidden;
}

body.chat-fullscreen .hero {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  overflow: visible;
  isolation: isolate;
  pointer-events: none;
}

body.chat-fullscreen .hero > :not(.hero-console) {
  display: none;
}

body.chat-fullscreen main > :not(.hero) {
  display: none !important;
}

body.chat-fullscreen .topbar,
body.chat-fullscreen .scroll-dock,
body.chat-fullscreen .mini-chat,
body.chat-fullscreen .ai-launcher,
body.chat-fullscreen .language-menu,
body.chat-fullscreen .user-panel,
body.chat-fullscreen .auth-modal,
body.chat-fullscreen .custom-model-modal,
body.chat-fullscreen .country-hover-tip {
  display: none;
}

body.chat-fullscreen.chat-mode:not(.mini-mode) .hero-console,
body.chat-fullscreen .hero-console {
  --fullscreen-hot-pill-gap: 8px;
  --fullscreen-hot-scroll-space: 14px;
  --fullscreen-edge-padding: 18px;
  --fullscreen-hot-pill-height: max(54px, calc((100vh - 236px) / 10));
  --fullscreen-hot-pill-height: max(54px, calc((100dvh - 236px) / 10));
  --fullscreen-hot-icon-size: clamp(32px, calc(var(--fullscreen-hot-pill-height) - 28px), 48px);
  --fullscreen-hot-rank-size: clamp(32px, calc(var(--fullscreen-hot-pill-height) - 30px), 44px);
  position: fixed;
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2147483647;
  width: auto;
  max-height: none;
  height: auto;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 82% 10%, rgba(16, 185, 129, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(8, 47, 73, 0.9) 56%, rgba(6, 78, 59, 0.88));
  backdrop-filter: blur(26px);
  box-shadow: none;
  transform: none;
  grid-template-columns: clamp(236px, 22vw, 320px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "models chat"
    "models composer";
  gap: 18px;
  align-content: stretch;
  pointer-events: auto;
}

body.chat-fullscreen .model-bar {
  grid-area: models;
  width: 100%;
  max-height: none;
  height: 100%;
  min-height: 0;
  justify-self: stretch;
  align-self: stretch;
  align-content: stretch;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.46), rgba(15, 23, 42, 0.2));
  overflow: hidden;
}

body.chat-fullscreen .model-bar > span {
  justify-self: center;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 17px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

body.chat-fullscreen .model-switcher {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  align-self: stretch;
  gap: 10px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.chat-fullscreen .model-pills {
  counter-reset: hot-rank;
  flex-direction: column;
  align-content: stretch;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  gap: var(--fullscreen-hot-pill-gap);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: var(--fullscreen-hot-scroll-space);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

body.chat-fullscreen .model-pills::-webkit-scrollbar {
  display: block;
  width: 8px;
}

body.chat-fullscreen .model-pill {
  counter-increment: hot-rank;
  flex: 0 0 var(--fullscreen-hot-pill-height);
  width: 100%;
  min-height: var(--fullscreen-hot-pill-height);
  height: var(--fullscreen-hot-pill-height);
  justify-content: flex-start;
  gap: clamp(9px, 0.8vw, 13px);
  padding: 0 14px 0 10px;
  font-size: clamp(14px, calc(10px + 0.5vw), 16px);
  white-space: normal;
}

body.chat-fullscreen .model-pill::before {
  content: counter(hot-rank, decimal-leading-zero);
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: var(--fullscreen-hot-rank-size);
  height: var(--fullscreen-hot-rank-size);
  border-radius: 8px;
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.14);
  font-size: clamp(12px, calc(8px + 0.35vw), 14px);
  font-weight: 1000;
}

body.chat-fullscreen .model-pill > .app-icon {
  width: var(--fullscreen-hot-icon-size);
  height: var(--fullscreen-hot-icon-size);
}

body.chat-fullscreen .model-pill .model-option-name {
  flex: 1 1 auto;
  justify-content: flex-start;
  text-align: left;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

body.chat-fullscreen .model-pill .model-hot-badge {
  display: inline-flex;
  min-height: clamp(20px, calc(var(--fullscreen-hot-pill-height) - 48px), 26px);
  padding: 0 8px;
  font-size: clamp(11px, calc(8px + 0.3vw), 12px);
}

body.chat-fullscreen .more-models {
  width: calc(100% - var(--fullscreen-hot-scroll-space));
  min-width: 0;
  justify-self: start;
}

body.chat-fullscreen .more-model-btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
}

body.chat-fullscreen .chat-stream {
  grid-area: chat;
  width: calc(100% + var(--fullscreen-edge-padding));
  justify-self: start;
  display: grid;
  visibility: visible;
  min-height: 0;
  max-height: none;
  height: 100%;
  align-self: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px calc(var(--hero-control-rail) + var(--fullscreen-edge-padding)) 52px 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  scrollbar-gutter: stable;
}

body.chat-fullscreen .bubble {
  gap: clamp(12px, 1.1vw, 16px);
}

body.chat-fullscreen .bubble p {
  max-width: min(76%, 860px);
  padding: clamp(14px, 1vw, 18px) clamp(16px, 1.2vw, 22px);
  border-radius: 10px;
  font-size: clamp(16px, 1.05vw, 19px);
  line-height: 1.68;
}

body.chat-fullscreen .bubble.user .user-bubble-body {
  max-width: min(76%, 860px);
}

body.chat-fullscreen .bubble.user .user-bubble-body > .bubble-text {
  max-width: 100%;
}

body.chat-fullscreen .bubble-edit-input {
  width: min(760px, 70vw);
  min-height: 116px;
  font-size: clamp(16px, 1.05vw, 19px);
}

body.chat-fullscreen .avatar,
body.chat-fullscreen .user-avatar {
  flex-basis: clamp(44px, 3.1vw, 54px);
  width: clamp(44px, 3.1vw, 54px);
  height: clamp(44px, 3.1vw, 54px);
  border-radius: 12px;
}

body.chat-fullscreen .user-avatar.generated-user-avatar {
  border-radius: 14px;
}

body.chat-fullscreen .user-avatar::before,
body.chat-fullscreen .user-avatar::after {
  top: 16px;
  width: 7px;
  height: 7px;
}

body.chat-fullscreen .user-avatar::before {
  left: 13px;
}

body.chat-fullscreen .user-avatar::after {
  right: 13px;
}

body.chat-fullscreen .user-smile {
  bottom: 11px;
  width: 16px;
  height: 8px;
}

body.chat-fullscreen .typing-dot {
  width: 8px;
  height: 8px;
}

body.chat-fullscreen .chat-stream:empty {
  display: grid;
}

body.chat-fullscreen .search-chat-row {
  grid-area: composer;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) var(--hero-expand-size);
  justify-self: stretch;
  align-self: end;
  transform: none;
}

body.chat-fullscreen .chat-side-controls {
  transform: none;
}

body.chat-fullscreen .action-pair {
  display: grid;
  grid-template-columns: 58px minmax(116px, 168px);
}

body.chat-fullscreen .attach-btn {
  display: inline-grid;
}

body.chat-fullscreen .ghost-btn {
  display: none;
}

body.chat-fullscreen .solid-btn {
  min-width: 116px;
  padding: 0 clamp(18px, 1.7vw, 28px);
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

body.chat-fullscreen #aiQuery {
  min-height: 82px;
}

body.chat-fullscreen .quick-prompts {
  display: none;
}

.quick-prompts {
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompts button,
.scene-buttons button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-weight: 800;
}

.quick-prompts button:hover,
.scene-buttons button:hover,
.ghost-btn:hover,
.solid-btn:hover,
.tool-link:hover,
.start-chat:hover,
.favorite-btn:hover,
.nav-cta:hover {
  transform: translateY(-1px);
}

.metrics,
.section-head,
.tool-grid,
.featured,
.scenes,
.api-panel {
  width: var(--section-width);
  margin-inline: auto;
}

.metrics {
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  margin-bottom: 64px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metrics div {
  display: grid;
  gap: 4px;
}

.metrics strong {
  font-size: 28px;
}

.metrics span {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
  scroll-margin-top: 108px;
}

.section-head h2,
.featured h2,
.scenes h2,
.api-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0;
}

.section-head .eyebrow,
.featured .eyebrow,
.scenes .eyebrow,
.api-panel .eyebrow {
  color: var(--cyan);
}

.filter-row {
  flex-wrap: wrap;
  gap: 9px;
}

.filter {
  display: inline-grid;
  place-items: center;
  grid-auto-flow: column;
  gap: 7px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  color: #334155;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.filter.active {
  color: #fff;
  border-color: transparent;
  background: var(--ink);
}

.filter.favorite-filter {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 7px;
  padding-inline: 13px 15px;
  border-color: #f6d58b;
  color: #92400e;
  background: linear-gradient(180deg, #fffaf0 0%, #fff2c2 100%);
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.13);
}

.filter.favorite-filter::before,
.filter.favorite-filter::after {
  display: none;
}

.filter.favorite-filter.active {
  color: #78350f;
  border-color: #fbbf24;
  background: linear-gradient(180deg, #fde68a 0%, #fbbf24 100%);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.2);
}

.favorite-filter-star {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #f6c453;
  color: #b45309;
  background: #fde68a;
  box-shadow: 0 3px 0 rgba(180, 83, 9, 0.12);
  font-size: 14px;
  line-height: 1;
  transform: rotate(-7deg);
}

.filter.favorite-filter:hover .favorite-filter-star,
.filter.favorite-filter.active .favorite-filter-star {
  color: #92400e;
  background: #fff7cc;
  transform: translateY(-1px) rotate(-7deg);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: inherit;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px;
  line-height: 1;
}

.filter.active .filter-count {
  background: rgba(255, 255, 255, 0.22);
}

.filter.favorite-filter .filter-count {
  color: #78350f;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.filter.favorite-filter.active .filter-count {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 74px;
}

.tool-card {
  display: grid;
  grid-template-rows: auto minmax(70px, 1fr) auto auto;
  gap: 14px;
  min-height: 286px;
  padding: 16px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.13);
}

.ad-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(56, 189, 248, 0.38);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(236, 253, 245, 0.92)),
    #fff;
}

.ad-card::after {
  content: "ADS";
  position: absolute;
  right: 12px;
  top: 10px;
  color: rgba(2, 132, 199, 0.18);
  font-size: 34px;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
}

.ad-logo {
  width: 52px;
  height: 52px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(135deg, #38bdf8, #10b981 58%, #f59e0b);
  border: 0;
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.24);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0;
}

.ad-badge {
  color: #075985;
  background: #e0f2fe;
}

.ad-tag {
  color: #075985;
  background: rgba(224, 242, 254, 0.86);
}

.ad-actions {
  grid-template-columns: 1fr 1fr;
}

.ad-promo-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.tool-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.logo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
}

.tool-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.tool-title {
  flex: 1;
  min-width: 0;
}

.tool-name-group {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  column-gap: 7px;
  row-gap: 4px;
  min-width: 0;
}

.tool-name-group h3 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  line-height: 1.16;
  white-space: normal;
}

.model-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-badge {
  align-self: center;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: var(--flag-width);
  min-height: var(--flag-height);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1;
}

.country-flag {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: var(--flag-width);
  height: var(--flag-height);
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.country-flag img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}


.flag-fallback {
  display: none;
  color: #334155;
  font-size: 8px;
  font-weight: 1000;
  line-height: 1;
}

.country-hover-tip {
  position: fixed;
  z-index: 2147483647;
  max-width: min(420px, calc(100vw - 24px));
  padding: 7px 9px;
  border-radius: 6px;
  color: #fff;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) scale(0.96);
  transition: opacity 140ms ease, transform 140ms ease;
}

.country-hover-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 4px);
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.94);
  transform: translateX(-50%) rotate(45deg);
}

.country-hover-tip.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.flag-missing .flag-fallback {
  display: inline;
}

.country-globe {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.92) 0 18%, transparent 19%),
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.65) 44% 56%, transparent 56%),
    linear-gradient(180deg, transparent 0 44%, rgba(255, 255, 255, 0.65) 44% 56%, transparent 56%),
    radial-gradient(circle at 50% 50%, #38bdf8, #2563eb 72%);
}

.tool-country,
.model-country,
.chat-current-country {
  min-width: var(--flag-width);
  min-height: var(--flag-height);
  padding: 0;
}

.country-name {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.model-option-name {
  flex: 1 1 auto;
}

.model-pill .model-option-name {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.model-country,
.chat-current-country {
  margin-left: auto;
}

.model-pill .model-country,
.chat-model-main .chat-current-country {
  margin-left: 2px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-model-main .model-hot-badge,
.chat-model-main .chat-current-country {
  margin-left: 0;
}

body.night-theme .country-flag {
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.28);
}

.tool-card h3 {
  margin: 0;
  font-size: 18px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.tool-company {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 24px;
  margin-top: 6px;
}

.tool-company > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.badge {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 7px;
  color: #92400e;
  background: #fef3c7;
  font-size: 11px;
}

.model-hot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  color: #92400e;
  background: #fef3c7;
  font-size: 10px;
  font-weight: 1000;
  line-height: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  min-height: 25px;
  padding: 0 8px;
  color: #475569;
  background: #eef5fb;
  font-size: 12px;
}

.tool-actions {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

.tool-link,
.start-chat,
.favorite-btn {
  display: grid;
  min-width: 0;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 150ms ease, filter 150ms ease;
}

.tool-link {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  text-decoration: none;
}

.tool-link::before {
  display: none;
}

.tool-link:hover {
  filter: brightness(1.03);
}

.start-chat {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.favorite-btn {
  min-width: 42px;
  border: 1px solid #fde68a;
  color: #f59e0b;
  background: linear-gradient(145deg, #fff7ed, #fef3c7);
  font-size: 0;
  position: relative;
  overflow: hidden;
}

.favorite-btn.active {
  border-color: #fbbf24;
  background: linear-gradient(145deg, #fef08a, #f59e0b);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.26);
}

.favorite-btn::before {
  content: "⭐";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 23px;
  transform: translateY(-1px) rotate(-6deg);
  filter: drop-shadow(0 3px 0 rgba(146, 64, 14, 0.16));
}

.favorite-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 12px;
  height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid #92400e;
  border-radius: 0 0 999px 999px;
  opacity: 0.7;
}

.favorite-btn.active::before {
  transform: translateY(-1px) rotate(-6deg) scale(1.1);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed #bcccdc;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.featured,
.scenes,
.api-panel,
.login-panel {
  margin-bottom: 74px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.api-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(0, 1.12fr);
  align-items: center;
  gap: 24px;
}

.api-panel p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.api-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.api-cards article {
  min-height: 152px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(240, 253, 250, 0.92)),
    #fff;
}

.api-cards span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #0369a1;
  background: #e0f2fe;
  font-size: 11px;
  font-weight: 1000;
}

.api-cards strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 17px;
}

.api-cards p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

body.night-theme .api-cards strong {
  color: #f8fafc;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1160px, calc(100% - 28px));
  margin-inline: auto;
}

.login-panel p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.login-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.login-actions button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  cursor: pointer;
  font-weight: 900;
}

.login-actions button:first-child {
  color: var(--ink);
  background: #eef5fb;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.48);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.auth-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.custom-model-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.custom-model-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.quota-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.quota-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.quota-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.97);
  transition: transform 260ms ease;
}

.quota-modal.show .quota-card {
  transform: translateY(0) scale(1);
}

.quota-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.quota-card h2 {
  margin: 6px 42px 8px 0;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.16;
}

.quota-card > p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.quota-preview {
  display: grid;
  place-items: center;
  min-height: 108px;
  margin: 18px 0;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(37, 99, 235, 0.18)),
    rgba(255, 255, 255, 0.08);
  font-weight: 950;
}

.quota-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quota-modal-actions button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 150ms ease, filter 150ms ease;
}

.quota-modal-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.quota-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 14px 34px rgba(4, 120, 87, 0.28);
}

.quota-secondary {
  min-width: 94px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
  .quota-card {
    padding: 20px;
  }

  .quota-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quota-primary,
  .quota-secondary {
    width: 100%;
  }
}

.custom-model-card {
  position: relative;
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.97);
  transition: transform 260ms ease;
}

.custom-model-modal.show .custom-model-card {
  transform: translateY(0) scale(1);
}

.custom-model-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.custom-model-copy h2 {
  margin: 0 0 10px;
  font-size: 30px;
}

.custom-model-copy p:not(.eyebrow),
.custom-model-note {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.custom-model-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.custom-model-form label {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.custom-model-form input {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.custom-model-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.custom-model-note {
  min-height: 22px;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.custom-model-note.error {
  color: #fecaca;
}

.custom-model-note.success {
  color: #bbf7d0;
}

.custom-model-save {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  cursor: pointer;
  font-weight: 900;
}

.auth-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.97);
  transition: transform 260ms ease;
}

.auth-modal.show .auth-card {
  transform: translateY(0) scale(1);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.auth-copy h2 {
  margin: 0 0 10px;
  font-size: 30px;
}

.auth-copy p:not(.eyebrow),
.auth-note {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-tab {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 900;
}

.auth-form input {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.auth-submit {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  cursor: pointer;
  font-weight: 900;
}

.auth-oauth {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.auth-oauth p {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
}

.auth-oauth p::before,
.auth-oauth p::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.oauth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.oauth-btn {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.oauth-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
}

.oauth-btn span {
  display: inline-grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  color: #111827;
  background: #fff;
  font-size: 11px;
  font-weight: 1000;
  padding: 4px;
}

.oauth-btn svg {
  display: block;
  width: 100%;
  height: 100%;
}

.oauth-btn.google span {
  background: #fff;
}

.oauth-btn.github span {
  background: #fff;
}

.oauth-btn.microsoft span {
  background: #fff;
}

.oauth-btn.apple span {
  background: #fff;
}

.account-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.account-preview[hidden] {
  display: none;
}

.account-preview div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.account-preview span,
.account-preview strong {
  display: block;
}

.account-preview span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.account-preview strong {
  margin-top: 6px;
  font-size: 15px;
}

.mini-chat {
  --mini-compact-height: 78px;
  --mini-bottom: 20px;
  --mini-expanded-height: clamp(220px, 34vh, 340px);
  position: fixed;
  left: 50%;
  top: auto;
  bottom: var(--mini-bottom);
  z-index: 70;
  display: grid;
  align-items: center;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  width: min(760px, calc(100% - 92px));
  height: var(--mini-compact-height);
  overflow: visible;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 34px) scale(0.86);
  transform-origin: center bottom;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease, height 220ms ease;
  will-change: height, transform, opacity;
}

.mini-chat.model-open {
  z-index: 2147483640;
}

body.mini-mode .mini-chat {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
  animation: none;
}

body.mini-mode .mini-chat:not(.compact) {
  top: auto;
  bottom: var(--mini-bottom);
  height: var(--mini-expanded-height);
  transform: translate(-50%, 0) scale(1);
  animation: none;
}

body.launcher-mode .mini-chat {
  opacity: 0;
  transform: translate(calc(50vw - 94px), 24px) scale(0.18);
  pointer-events: none;
}

.mini-controls {
  --mini-control-stack-height: 72px;
  position: absolute;
  right: -46px;
  bottom: calc((var(--mini-compact-height) - var(--mini-control-stack-height)) / 2);
  z-index: 2;
  display: grid;
  align-content: center;
  gap: 8px;
  height: var(--mini-control-stack-height);
}

.mini-close,
.mini-expand {
  --mini-control-icon-size: 12px;
  --mini-control-icon-stroke: 2px;
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.mini-close::before,
.mini-close::after,
.mini-expand::before,
.mini-expand::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--mini-control-icon-size);
  height: var(--mini-control-icon-stroke);
  border-radius: 999px;
  background: #fff;
  transform-origin: center;
}

.mini-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.mini-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mini-expand::before {
  box-sizing: border-box;
  width: 11px;
  height: 11px;
  border-top: var(--mini-control-icon-stroke) solid #fff;
  border-left: var(--mini-control-icon-stroke) solid #fff;
  border-radius: 2px 0 0 0;
  background: transparent;
  transform: translate(-50%, -38%) rotate(45deg);
}

.mini-expand::after {
  display: none;
}

.mini-chat:not(.compact) .mini-expand::before {
  transform: translate(-50%, -62%) rotate(225deg);
}

.mini-close:hover,
.mini-expand:hover {
  transform: scale(1.06);
  border-color: rgba(16, 185, 129, 0.62);
  background: rgba(16, 185, 129, 0.28);
}

.mini-expand:disabled {
  opacity: 0.46;
  cursor: default;
}

.mini-expand:disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.78);
}

.mini-model-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 2147483644;
  display: grid;
  grid-template-columns: repeat(2, minmax(128px, 1fr));
  gap: 8px;
  width: min(420px, calc(100vw - 36px));
  max-height: min(320px, 42vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mini-chat.model-open .mini-model-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mini-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.mini-model-option.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.48), rgba(4, 120, 87, 0.48));
}

.mini-model-option > .app-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

.more-model-menu,
.chat-model-menu,
.mini-model-menu {
  z-index: 2147483644;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: start;
  gap: 10px;
  width: min(430px, calc(100vw - 36px));
  height: auto;
  max-height: min(430px, 72vh);
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
}

.model-menu-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 8px;
  min-height: 0;
  max-height: min(280px, 44vh);
  overflow: auto;
  padding-right: 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
}

.more-model-option,
.chat-model-option,
.mini-model-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.more-model-option.active,
.chat-model-option.active,
.mini-model-option.active {
  border-color: rgba(16, 185, 129, 0.7);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.48), rgba(4, 120, 87, 0.48));
}

.more-model-option > .app-icon,
.chat-model-option > .app-icon,
.mini-model-option > .app-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
}

.more-model-option > .app-icon.original-brand-icon,
.chat-model-option > .app-icon.original-brand-icon,
.mini-model-option > .app-icon.original-brand-icon {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.model-pill > .app-icon.original-brand-icon,
.chat-model-btn > .app-icon.original-brand-icon,
.more-model-option > .app-icon.original-brand-icon,
.chat-model-option > .app-icon.original-brand-icon,
.mini-model-option > .app-icon.original-brand-icon,
.mini-avatar .app-icon.original-brand-icon,
.logo.app-icon.original-brand-icon {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-icon.grok-brand-icon,
.model-pill > .app-icon.grok-brand-icon,
.chat-model-btn > .app-icon.grok-brand-icon,
.more-model-option > .app-icon.grok-brand-icon,
.chat-model-option > .app-icon.grok-brand-icon,
.mini-model-option > .app-icon.grok-brand-icon,
.mini-avatar .app-icon.grok-brand-icon,
.ai-avatar > .app-icon.grok-brand-icon,
.logo.app-icon.grok-brand-icon {
  border: 0;
  background: #050505;
  box-shadow: none;
}

.app-icon.grok-brand-icon img,
.model-pill .app-icon.grok-brand-icon img,
.chat-model-btn .app-icon.grok-brand-icon img,
.more-model-option .app-icon.grok-brand-icon img,
.chat-model-option .app-icon.grok-brand-icon img,
.mini-model-option .app-icon.grok-brand-icon img,
.mini-avatar .app-icon.grok-brand-icon img,
.ai-avatar .app-icon.grok-brand-icon img,
.logo.app-icon.grok-brand-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.app-icon.white-backed-brand-icon,
.model-pill > .app-icon.white-backed-brand-icon,
.chat-model-btn > .app-icon.white-backed-brand-icon,
.more-model-option > .app-icon.white-backed-brand-icon,
.chat-model-option > .app-icon.white-backed-brand-icon,
.mini-model-option > .app-icon.white-backed-brand-icon,
.mini-avatar .app-icon.white-backed-brand-icon,
.ai-avatar > .app-icon.white-backed-brand-icon,
.logo.app-icon.white-backed-brand-icon {
  border: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}

.app-icon.white-backed-brand-icon img,
.model-pill .app-icon.white-backed-brand-icon img,
.chat-model-btn .app-icon.white-backed-brand-icon img,
.more-model-option .app-icon.white-backed-brand-icon img,
.chat-model-option .app-icon.white-backed-brand-icon img,
.mini-model-option .app-icon.white-backed-brand-icon img,
.mini-avatar .app-icon.white-backed-brand-icon img,
.ai-avatar .app-icon.white-backed-brand-icon img,
.logo.app-icon.white-backed-brand-icon img {
  display: block;
  width: 76%;
  height: 76%;
  object-fit: contain;
  border-radius: 0;
}

.more-model-option .model-country,
.chat-model-option .model-country,
.mini-model-option .model-country {
  margin-left: auto;
  min-width: var(--flag-width);
  min-height: var(--flag-height);
}

.more-model-option .country-flag,
.chat-model-option .country-flag,
.mini-model-option .country-flag {
  width: var(--flag-width);
  height: var(--flag-height);
}

.country-badge .country-flag > img,
.model-pill .country-flag > img,
.more-model-option .country-flag > img,
.chat-model-btn .country-flag > img,
.chat-model-option .country-flag > img,
.mini-model-option .country-flag > img,
.tool-card .country-flag > img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: transparent;
  object-fit: cover;
}

.model-menu-categories {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  margin: 0 -2px -2px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.9) 26%, rgba(15, 23, 42, 0.96));
  backdrop-filter: blur(14px);
}

.model-menu-category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.model-menu-category:hover,
.model-menu-category.active {
  border-color: rgba(16, 185, 129, 0.72);
  color: #fff;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.5), rgba(4, 120, 87, 0.42));
}

.model-menu-category.favorite-category {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 6px;
  border-color: rgba(245, 158, 11, 0.36);
  color: #ffedd5;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(146, 64, 14, 0.58), rgba(245, 158, 11, 0.2));
}

.model-menu-category.favorite-category::before {
  display: none;
}

.model-favorite-star {
  position: relative;
  display: inline;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  border-radius: 0;
  color: #fde68a;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  transform: none;
}

.model-favorite-star::after {
  display: none;
}

.model-menu-category.favorite-category:hover,
.model-menu-category.favorite-category.active {
  border-color: rgba(251, 191, 36, 0.72);
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.26), transparent 36%),
    linear-gradient(135deg, rgba(245, 158, 11, 0.72), rgba(180, 83, 9, 0.58));
}

.model-menu-category.favorite-category:hover .model-favorite-star,
.model-menu-category.favorite-category.active .model-favorite-star {
  transform: none;
}

.model-menu-category.custom-model-category {
  gap: 6px;
  border-color: rgba(56, 189, 248, 0.34);
  color: #dbeafe;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(135deg, rgba(14, 116, 144, 0.5), rgba(37, 99, 235, 0.24));
}

.model-menu-category.custom-model-category:hover {
  border-color: rgba(125, 211, 252, 0.78);
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(135deg, rgba(14, 165, 233, 0.68), rgba(37, 99, 235, 0.5));
}

.custom-model-plus {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: #0f172a;
  background: #bae6fd;
  font-size: 12px;
  line-height: 1;
}

.model-menu-category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 10px;
  line-height: 1;
}

.model-menu-category.active .model-menu-category-count {
  background: rgba(255, 255, 255, 0.24);
}

.model-menu-category.favorite-category .model-menu-category-count,
.model-menu-category.favorite-category.active .model-menu-category-count {
  min-width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.model-menu-empty {
  grid-column: 1 / -1;
  padding: 18px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.mini-chat:not(.compact) .mini-model-menu {
  left: 10px;
  bottom: 72px;
  transform-origin: left bottom;
}

.ai-launcher {
  position: fixed;
  right: 20px;
  bottom: 142px;
  z-index: 73;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.72), transparent 18%),
    linear-gradient(145deg, var(--green), var(--green-dark));
  box-shadow: 0 18px 42px rgba(16, 185, 129, 0.28);
  cursor: pointer;
  font-weight: 1000;
  opacity: 0;
  transform: translateY(16px) scale(0.82);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.ai-launcher::before,
.ai-launcher::after {
  content: "";
  position: absolute;
  top: 19px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.ai-launcher::before {
  left: 18px;
}

.ai-launcher::after {
  right: 18px;
}

.ai-launcher span {
  transform: translateY(9px);
  font-size: 13px;
  letter-spacing: 0;
}

body.launcher-mode .ai-launcher {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.mini-mode .hero-console {
  opacity: 0;
  transform: translate(-50%, 42px) scale(0.72);
  pointer-events: none;
  transition: opacity 300ms ease, transform 340ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.mini-head {
  align-self: center;
  display: grid;
  align-items: center;
  justify-items: center;
  width: 54px;
  height: 54px;
  min-height: 54px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mini-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.mini-avatar img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}

.mini-body {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  width: 100%;
  min-height: 0;
  padding: 0;
}

.mini-chat.compact {
  grid-template-columns: 54px 1fr;
}

.mini-chat.compact .mini-head,
.mini-chat.compact .mini-body {
  align-self: center;
}

.mini-chat.compact .mini-body {
  height: 54px;
  align-content: center;
}

.mini-chat.compact .mini-stream {
  display: none;
}

.mini-chat:not(.compact) .mini-head {
  align-self: end;
}

.mini-chat:not(.compact) .mini-body {
  align-self: stretch;
  gap: 12px;
}

.mini-stream {
  display: none;
  gap: 10px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  margin-bottom: 0;
  padding: 0 4px 34px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.86) rgba(255, 255, 255, 0.08);
}

.mini-chat:not(.compact) .mini-stream {
  display: grid;
}

.mini-stream .bubble {
  align-items: flex-start;
  gap: 8px;
}

.mini-stream .bubble p {
  max-width: min(68%, calc(100% - 56px));
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.mini-stream .bubble.user .user-bubble-body {
  max-width: min(68%, calc(100% - 56px));
}

.mini-stream .bubble.user .user-bubble-body > .bubble-text {
  max-width: 100%;
}

.mini-stream .bubble-actions {
  right: 2px;
  top: 100%;
  bottom: auto;
  gap: 1px;
  padding: 3px 0 0;
}

.mini-stream .bubble-action-btn {
  width: 26px;
  height: 26px;
}

.mini-stream .bubble-edit-input {
  width: min(220px, 60vw);
  min-height: 66px;
  padding: 9px 10px;
  font-size: 12px;
}

.mini-stream .bubble-edit-actions button {
  min-width: 48px;
  height: 27px;
  font-size: 12px;
}

.mini-stream .avatar,
.mini-stream .user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.mini-stream .user-avatar::before,
.mini-stream .user-avatar::after {
  top: 13px;
}

.mini-stream .user-avatar::before {
  left: 11px;
}

.mini-stream .user-avatar::after {
  right: 11px;
}

.mini-input-row {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.scroll-dock {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 72;
  display: grid;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
}

.scroll-dock button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: transparent;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  font-size: 0;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.scroll-dock button:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.58);
  background: rgba(15, 23, 42, 0.84);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.3);
}

.scroll-dock button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-left: 3px solid #fff;
  border-top: 3px solid #fff;
}

#toTopBtn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#toBottomBtn::before {
  transform: translate(-50%, -50%) rotate(225deg);
}

body.mini-mode .scroll-dock {
  bottom: 22px;
}

#miniQuery {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  outline: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

#miniQuery::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

#miniSendBtn {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  cursor: pointer;
  font-weight: 900;
}

.mini-expand {
  display: grid;
}

@keyframes chatPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.38;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes miniPop {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  70% {
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes miniShrinkIn {
  0% {
    opacity: 0;
    transform: translate(-50%, 28px) scale(0.9);
  }
  70% {
    transform: translate(-50%, -2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1);
    filter: saturate(1.05) contrast(1.02);
  }
  to {
    transform: scale(1.04);
    filter: saturate(1.18) contrast(1.08);
  }
}

@keyframes dataBeam {
  from {
    transform: translateX(0) rotate(-8deg);
  }
  to {
    transform: translateX(160vw) rotate(-8deg);
  }
}

.compact {
  margin-bottom: 20px;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.feature-strip article {
  min-height: 140px;
  padding: 18px;
  border-radius: 8px;
  background: #f3f7fb;
}

.feature-strip span {
  display: block;
  margin-bottom: 14px;
  color: var(--rose);
  font-weight: 900;
}

.feature-strip strong {
  line-height: 1.56;
}

.scene-buttons {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.scene-buttons button {
  color: var(--ink);
  border-color: #d8e1ea;
  background: #fff;
  backdrop-filter: none;
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .tool-grid,
  .feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .hero {
    padding-top: 108px;
    padding-bottom: 312px;
    padding-inline: var(--page-gutter);
  }

  .hero-content {
    transform: translateY(-8px);
  }
  .topbar {
    top: 10px;
  }

  .nav-actions {
    display: none;
  }

  h1 {
    font-size: clamp(36px, 10.8vw, 48px);
  }

  .hero-console {
    bottom: 18px;
  }

  .search-chat-box {
    grid-template-columns: 1fr;
  }

  body.chat-mode:not(.mini-mode) .hero-console {
    top: calc(var(--topbar-bottom, 68px) + var(--hero-console-gap));
    bottom: 18px;
  }

  .chat-model-picker,
  .chat-model-btn,
  .model-version-picker {
    width: 100%;
    max-width: 100%;
  }

  .model-bar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .model-switcher {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .model-pills {
    justify-content: flex-start;
    overflow: auto;
  }

  .action-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .expand-chat-btn,
  .fullscreen-chat-btn {
    width: var(--hero-expand-size);
    height: var(--hero-expand-size);
  }

  body.chat-fullscreen.chat-mode:not(.mini-mode) .hero-console,
  body.chat-fullscreen .hero-console {
    --fullscreen-hot-pill-gap: 6px;
    --fullscreen-hot-scroll-space: 9px;
    --fullscreen-edge-padding: 10px;
    --fullscreen-hot-pill-height: max(44px, calc((100vh - 178px) / 10));
    --fullscreen-hot-pill-height: max(44px, calc((100dvh - 178px) / 10));
    --fullscreen-hot-icon-size: clamp(24px, calc(var(--fullscreen-hot-pill-height) - 22px), 36px);
    --fullscreen-hot-rank-size: clamp(24px, calc(var(--fullscreen-hot-pill-height) - 24px), 34px);
    inset: 0;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    grid-template-columns: clamp(116px, 31vw, 164px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 10px;
    gap: 10px;
  }

  body.chat-fullscreen .model-bar {
    width: 100%;
    max-height: none;
    padding: 10px;
  }
  body.chat-fullscreen .model-bar > span {
    font-size: 13px;
  }

  body.chat-fullscreen .model-pill {
    gap: 5px;
    padding: 0 7px;
    min-height: var(--fullscreen-hot-pill-height);
    height: var(--fullscreen-hot-pill-height);
    flex-basis: var(--fullscreen-hot-pill-height);
    font-size: clamp(11px, 2.6vw, 13px);
  }

  body.chat-fullscreen .model-pill::before {
    width: var(--fullscreen-hot-rank-size);
    height: var(--fullscreen-hot-rank-size);
    font-size: 10px;
  }

  body.chat-fullscreen .model-pill > .app-icon {
    width: var(--fullscreen-hot-icon-size);
    height: var(--fullscreen-hot-icon-size);
  }

  body.chat-fullscreen .chat-stream {
    padding: 10px calc(var(--hero-control-rail) + var(--fullscreen-edge-padding)) 42px 6px;
  }

  body.chat-fullscreen .bubble {
    gap: 8px;
  }

  body.chat-fullscreen .bubble p {
    max-width: min(80%, 680px);
    padding: 12px 13px;
    font-size: clamp(14px, 3.3vw, 16px);
    line-height: 1.62;
  }

  body.chat-fullscreen .bubble.user .user-bubble-body {
    max-width: min(80%, 680px);
  }

  body.chat-fullscreen .bubble-edit-input {
    width: min(560px, 72vw);
    min-height: 84px;
    font-size: clamp(14px, 3.3vw, 16px);
  }

  body.chat-fullscreen .avatar,
  body.chat-fullscreen .user-avatar {
    flex-basis: clamp(38px, 9vw, 44px);
    width: clamp(38px, 9vw, 44px);
    height: clamp(38px, 9vw, 44px);
  }

  body.chat-fullscreen .action-pair {
    grid-template-columns: 52px minmax(92px, 126px);
  }

  body.chat-fullscreen .solid-btn {
    min-width: 92px;
    padding: 0 14px;
    font-size: clamp(16px, 4vw, 18px);
  }

  .bubble p {
    max-width: 86%;
  }

  .metrics,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .featured,
  .scenes,
  .api-panel,
  .login-panel {
    padding: 20px;
  }

  .api-panel {
    grid-template-columns: 1fr;
  }

  .api-cards {
    grid-template-columns: 1fr;
  }

  .login-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-body {
    grid-template-columns: 1fr;
  }

  .mini-chat {
    --mini-bottom: 16px;
    --mini-expanded-height: min(310px, 48vh);
  }

  .mini-model-menu {
    grid-template-columns: 1fr;
    width: min(300px, calc(100vw - 92px));
  }

  .scroll-dock {
    right: 12px;
    bottom: 12px;
  }

  body.mini-mode .scroll-dock {
    bottom: 112px;
  }
}

@supports (height: 100svh) {
  .hero {
    min-height: 100svh;
  }

  .hero-console {
    max-height: calc(100svh - 132px);
  }
}

@media (max-width: 820px), (max-height: 700px) {
  .topbar {
    width: min(calc(100% - var(--page-gutter) - var(--page-gutter)), 1040px);
  }

  .hero-console {
    width: min(
      calc(100% - var(--page-gutter) - var(--page-gutter)),
      calc(1040px + var(--hero-control-rail))
    );
  }

  .model-bar,
  .search-chat-row,
  .search-chat-box,
  .quick-prompts {
    max-width: 100%;
  }

  .model-pills {
    max-width: 100%;
  }

  .more-model-menu,
  .chat-model-menu,
  .mini-model-menu {
    width: min(430px, calc(100vw - var(--page-gutter) - var(--page-gutter)));
    height: auto;
    max-height: min(430px, 72svh);
  }

  .model-menu-list {
    max-height: min(280px, 44svh);
  }
}

@media (max-width: 520px) {
  .more-model-menu,
  .chat-model-menu,
  .mini-model-menu {
    grid-template-columns: 1fr;
    width: min(330px, calc(100vw - 20px));
    height: auto;
    max-height: min(420px, 76svh);
  }

  .model-menu-list {
    grid-template-columns: 1fr;
    max-height: min(250px, 44svh);
  }

  .model-menu-category {
    flex: 0 0 auto;
    min-width: auto;
    padding: 0 9px;
  }

  .chat-model-picker {
    width: 100%;
  }

  .more-model-menu {
    right: 0;
  }

  .chat-model-menu {
    left: 0;
  }
}

@media (max-height: 620px) {
  .hero-console {
    max-height: calc(100svh - 92px);
  }

  .more-model-menu,
  .chat-model-menu,
  .mini-model-menu {
    height: auto;
    max-height: min(340px, 68svh);
  }

  .model-menu-list {
    max-height: min(210px, 40svh);
  }
}

