:root {
  color-scheme: dark;
  --bg: #0a0b10;
  --bg-deep: #07080c;
  --bg-soft: #10131b;
  --surface: rgba(21, 25, 35, 0.86);
  --surface-2: rgba(17, 21, 31, 0.97);
  --surface-3: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f7fb;
  --muted: #95a0b5;
  --pill: rgba(31, 36, 50, 0.92);
  --accent: #4f83ff;
  --accent-2: #7aa3ff;
  --accent-soft: rgba(79, 131, 255, 0.18);
  --danger: #ff8b8b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --blur: blur(18px);
  --drawer-w: min(max(350px, 32vw), 92vw);
}


:root[data-theme='light'] {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-deep: #dce6f4;
  --bg-soft: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-2: rgba(255, 255, 255, 0.97);
  --surface-3: rgba(49, 62, 89, 0.05);
  --line: rgba(43, 56, 87, 0.10);
  --line-strong: rgba(43, 56, 87, 0.18);
  --text: #1d2638;
  --muted: #5f6a81;
  --pill: rgba(255, 255, 255, 0.96);
  --accent: #316cff;
  --accent-2: #5a8aff;
  --accent-soft: rgba(49, 108, 255, 0.12);
  --danger: #d44848;
  --shadow: 0 24px 70px rgba(58, 77, 116, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body { min-height: 100vh; min-height: 100svh; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(41, 58, 103, 0.24), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(31, 50, 102, 0.18), transparent 30%),
    linear-gradient(90deg, rgba(14, 17, 25, 0.94), rgba(8, 10, 16, 0.96) 22%, rgba(9, 10, 16, 0.98) 74%, rgba(8, 9, 14, 1)),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
textarea { resize: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.app-shell {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  overflow: hidden;
}
.app-shell::before,
.app-shell::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.app-shell::before {
  background:
    linear-gradient(90deg, transparent 0%, rgba(80, 118, 215, 0.05) 17%, transparent 35%),
    linear-gradient(90deg, transparent 52%, rgba(80, 118, 215, 0.04) 65%, transparent 82%);
  opacity: .75;
}
.app-shell::after {
  background: radial-gradient(circle at center, transparent 44%, rgba(0, 0, 0, 0.28));
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 0;
  transition: opacity .18s ease, filter .18s ease;
}
.topbar.is-scrolled {
  padding-top: 12px;
}
.topbar.is-scrolled::before {
  content: '';
  position: absolute;
  inset: 0 12px auto;
  height: calc(100% + 8px);
  border-radius: 24px;
  background: rgba(13,16,24,.42);
  border: 1px solid rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: 0 10px 34px rgba(0,0,0,.18);
  z-index: -1;
}
:root[data-theme='light'] .topbar.is-scrolled::before {
  background: rgba(248,250,253,.62);
  border-color: rgba(41,62,110,.08);
  box-shadow: 0 10px 30px rgba(80,102,146,.12);
}
body.drawer-open .topbar {
  opacity: .18;
  filter: blur(6px);
  pointer-events: none;
}
body.drawer-open .page-content,
body.drawer-open .page-footer {
  filter: blur(8px);
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.topbar-right { min-height: 48px; }
.page-content {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 130px 24px 84px;
  position: relative;
  z-index: 1;
}

.hero-section {
  position: relative;
  width: min(100%, 940px);
  margin: 38px auto 28px;
  padding: 0 8px;
}
.hero-greeting {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: .96;
}
.hero-title {
  margin: 10px 0 0;
  max-width: 640px;
  font-size: clamp(58px, 7.4vw, 82px);
  line-height: .96;
  letter-spacing: -0.06em;
}
.hero-spark {
  position: absolute;
  left: -28px;
  top: 136px;
  color: var(--accent);
  font-size: 58px;
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(79, 131, 255, 0.22));
}

.icon-button,
.login-button,
.avatar-button,
.ghost-button,
.outline-button,
.drawer-primary,
.drawer-link,
.toolbar-button,
.toolbar-trigger,
.mode-toggle,
.suggest-pill,
.plan-buy,
.theme-option {
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.icon-button:hover,
.login-button:hover,
.avatar-button:hover,
.ghost-button:hover,
.outline-button:hover,
.drawer-primary:hover,
.drawer-link:hover,
.toolbar-button:hover,
.toolbar-trigger:hover,
.mode-toggle:hover,
.suggest-pill:hover,
.plan-buy:hover,
.theme-option:hover {
  transform: translateY(-1px);
}
.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar-menu {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.ghost-icon {
  background: transparent;
  border-color: transparent;
}
.small {
  width: 34px;
  height: 34px;
}
.login-button {
  min-width: 102px;
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.avatar-button {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(245, 195, 56, 0.28);
  background: #f5c338;
  color: #2d2a24;
  font-weight: 700;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  isolation: isolate;
}
.avatar-button img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.01);
}
.avatar-fallback-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.popover {
  box-shadow: var(--shadow);
}
.profile-popover {
  position: absolute;
  top: 56px;
  right: 0;
  width: min(380px, calc(100vw - 24px));
  padding: 16px;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  z-index: 40;
}
.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.profile-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: #f5c338;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
}
.profile-avatar.mini {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}
.profile-name {
  font-size: 16px;
  font-weight: 700;
}
.profile-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
.balance-summary {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--muted);
  line-height: 1.55;
}
.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.profile-secondary-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}
.text-link-button {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  opacity: .9;
  margin-left: 25px !important;
  margin-top: 2px !important;
}
.text-link-button:hover {
  color: var(--text);
  transform: none;
}
.outline-button {
  min-height: 44px;
  flex: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
}
.primary-outline {
  background: var(--accent-soft);
  border-color: rgba(79, 131, 255, 0.28);
}
.outline-button.danger {
  color: var(--danger);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: rgba(7, 8, 10, 0.62);
  -webkit-backdrop-filter: blur(16px) saturate(.86);
  backdrop-filter: blur(16px) saturate(.86);
}
.left-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(max(350px, 32vw), 92vw);
  z-index: 55;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .24s ease;
  border-right: 1px solid rgba(245, 195, 56, 0.10);
  background: linear-gradient(180deg, rgba(21, 18, 13, 0.96), rgba(12, 11, 9, 0.985));
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
:root[data-theme='light'] .left-drawer {
  background: rgba(244, 247, 252, 0.96);
}
.left-drawer.open {
  transform: translateX(0);
}
.drawer-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 14px;
}
.drawer-title {
  font-size: 18px;
  font-weight: 700;
}
.drawer-scroll {
  flex: 1;
  overflow: auto;
  padding: 8px 18px 18px;
}
.drawer-section + .drawer-section {
  margin-top: 24px;
}
.section-label {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.drawer-primary {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(245, 195, 56, 0.16);
  background: linear-gradient(180deg, rgba(245,195,56,.16), rgba(245,195,56,.08));
  color: #f8ecd0;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.drawer-link {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.drawer-link:hover {
  background: rgba(245, 195, 56, 0.08);
  border-color: rgba(245, 195, 56, 0.14);
}
.drawer-link-side {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.theme-group {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.theme-option {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}
.chat-history-list {
  display: grid;
  gap: 8px;
}
.history-item {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}
.history-item.active {
  border-color: rgba(245, 195, 56, 0.18);
  background: rgba(245, 195, 56, 0.10);
}
.history-item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.history-item-meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.drawer-footer {
  padding: 18px;
  border-top: 1px solid var(--line);
}
.drawer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.drawer-profile-name {
  font-weight: 700;
}
.drawer-profile-sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.chat-section {
  width: min(100%, 960px);
  margin: 0 auto 18px;
}
.chat-messages {
  display: grid;
  gap: 22px;
}
.message-row {
  display: flex;
}
.message-row.user {
  justify-content: flex-end;
}
.message-row.assistant {
  justify-content: flex-start;
}
.message-bubble {
  width: min(100%, 100%);
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.message-row.user .message-bubble {
  max-width: min(100%, 680px);
  padding: 18px 20px;
  border-top-right-radius: 14px;
}
.message-row.assistant .message-bubble {
  max-width: min(100%, 860px);
  padding: 20px;
  border-top-left-radius: 14px;
}
.message-style-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-size: 13px;
  margin-bottom: 14px;
}
.message-style-tag img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 14px;
}
.message-prompt {
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.message-assistant-image {
  width: 100%;
  display: block;
  border-radius: 22px;
  background: rgba(0,0,0,.22);
}
.message-assistant-text {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}
.message-meta {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.message-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight: 600;
}

.styles-panel {
  width: min(100%, 960px);
  margin: 0 auto 18px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.styles-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.styles-title {
  font-size: 18px;
  font-weight: 700;
}
.styles-note {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 14px;
}
.style-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
}
.style-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.style-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(7, 9, 15, .82));
}
.style-card.selected {
  border-color: rgba(79, 131, 255, 0.58);
  box-shadow: 0 0 0 2px rgba(79, 131, 255, 0.18);
}
.style-label {
  position: absolute;
  z-index: 2;
  left: 12px;
  right: 12px;
  bottom: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.selected-style-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}
.selected-style-chip img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}
.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.composer-wrap {
  width: min(100%, 960px);
  margin: 0 auto;
}
.composer-card {
  position: relative;
  padding: 26px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.composer-card.dragover {
  border-color: rgba(245,195,56,.42);
  box-shadow: 0 0 0 1px rgba(245,195,56,.22), var(--shadow);
}
.drop-hint {
  position: absolute;
  inset: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  border: 1.5px dashed rgba(245,195,56,.42);
  background: rgba(17,18,20,.72);
  color: #f5f2eb;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
:root[data-theme='light'] .drop-hint {
  background: rgba(252,249,243,.82);
  color: #312c26;
}
#promptInput {
  width: 100%;
  min-height: 186px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: clamp(22px, 2.7vw, 34px);
  line-height: 1.28;
  letter-spacing: -0.03em;
}
#promptInput::placeholder {
  color: rgba(149, 160, 181, 0.76);
}
.uploaded-images {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.upload-card {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}
.upload-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(7, 9, 15, 0.76);
  color: #fff;
}
.composer-toolbar {
  margin-top: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.composer-left-tools,
.composer-right-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}
.toolbar-button,
.toolbar-trigger,
.mode-toggle {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tool-chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(79, 131, 255, 0.26);
  background: rgba(79, 131, 255, 0.14);
  color: var(--text);
  display: inline-flex;
  align-items: center;
}
.mode-menu {
  position: absolute;
  top: 52px;
  right: 0;
  width: 250px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  z-index: 16;
}
.mode-option {
  width: 100%;
  padding: 12px 10px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.mode-option.selected {
  background: var(--accent-soft);
}
.mode-option-note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.submit-button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(79, 131, 255, 0.22);
}
.quick-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 0 0;
}
.suggest-pill {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--pill);
  color: var(--text);
  font-size: 16px;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.suggest-pill[aria-expanded='true'] {
  border-color: rgba(255, 214, 92, 0.42);
  background: linear-gradient(180deg, rgba(255, 222, 117, 0.18), rgba(255, 204, 73, 0.12));
  box-shadow: 0 14px 30px rgba(255, 191, 0, 0.12);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
#loginModal {
  z-index: 90;
}
.modal-card {
  width: min(560px, 100%);
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.tariffs-card {
  width: min(760px, 100%);
  max-height: min(88vh, 880px);
  overflow: auto;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.modal-title {
  font-size: 22px;
  font-weight: 800;
}
.modal-sub {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}
.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.auth-block-title {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.telegram-auth-wrap {
  min-height: 52px;
  display: flex;
  align-items: center;
}
.login-provider-button {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
}
.plans-grid {
  display: grid;
  gap: 12px;
}
.plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 18px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.plan-card.featured {
  border-color: rgba(79, 131, 255, 0.28);
  background: linear-gradient(180deg, rgba(79, 131, 255, 0.12), rgba(255,255,255,0.02));
}
.plan-name {
  font-size: 16px;
  font-weight: 700;
}
.plan-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.plan-price {
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}
.plan-per {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.plan-buy {
  min-width: 126px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(79, 131, 255, 0.26);
  background: rgba(79, 131, 255, 0.14);
  color: var(--text);
  font-weight: 700;
}
.plan-badge {
  display: inline-flex;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(79, 131, 255, 0.16);
}

.app-shell.has-chat .hero-section {
  margin-top: 0;
  margin-bottom: 18px;
}
.app-shell.has-chat .hero-title {
  max-width: 860px;
  font-size: clamp(38px, 4vw, 56px);
}
.app-shell.has-chat .hero-spark {
  display: none;
}
.app-shell.has-chat .quick-actions {
  display: none;
}

.icon { position: relative; width: 18px; height: 18px; display: inline-block; }
.icon-menu::before,
.icon-menu::after,
.icon-menu span,
.icon-plus::before,
.icon-plus::after,
.icon-sliders::before,
.icon-sliders::after,
.icon-arrow-up::before,
.icon-theme::before,
.icon-help::before {
  content: '';
  position: absolute;
  display: block;
}
.icon-menu::before,
.icon-menu::after,
.icon-menu span {
  left: 1px;
  right: 1px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.icon-menu::before { top: 3px; }
.icon-menu::after { bottom: 3px; }
.icon-menu { box-shadow: inset 0 8px 0 0 currentColor; border-radius: 999px; }
.icon-plus::before,
.icon-plus::after {
  background: currentColor;
  border-radius: 999px;
}
.icon-plus::before { left: 8px; top: 2px; width: 2px; height: 14px; }
.icon-plus::after { left: 2px; top: 8px; width: 14px; height: 2px; }
.icon-sliders::before,
.icon-sliders::after {
  left: 1px;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}
.icon-sliders::before { top: 5px; box-shadow: 0 8px 0 0 currentColor; }
.icon-sliders::after { top: 13px; width: 8px; left: 5px; }
.icon-arrow-up::before {
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
  top: 6px;
  left: 4px;
  background: transparent;
}
.icon-theme::before {
  inset: 2px;
  border-radius: 50%;
  border: 2px solid currentColor;
}
.icon-help::before {
  inset: 0;
  content: '?';
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

@media (max-width: 980px) {
  .hero-section,
  .chat-section,
  .styles-panel,
  .composer-wrap { width: min(100%, 100%); }
  .hero-title { font-size: clamp(46px, 10vw, 64px); }
  .hero-spark { left: -12px; top: 122px; }
  .auth-grid,
  .plan-card { grid-template-columns: 1fr; }
  .plan-price,
  .plan-per { text-align: left; }
}

@media (max-width: 720px) {
  .topbar { padding: 16px 16px 0; }
  .page-content { padding: 98px 16px 56px; }
  .hero-section { margin-top: 18px; padding: 0; }
  .hero-greeting { font-size: 22px; }
  .hero-title { font-size: clamp(40px, 12vw, 56px); }
  .hero-spark { display: none; }
  .composer-card { padding: 18px; border-radius: 24px; }
  #promptInput { min-height: 150px; font-size: 22px; }
  .styles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { justify-content: flex-start; }
  .message-row.user .message-bubble,
  .message-row.assistant .message-bubble { max-width: 100%; }
  .profile-popover { width: min(340px, calc(100vw - 20px)); }
  .mode-menu { left: 0; right: auto; width: min(250px, calc(100vw - 32px)); }
}


/* polish pass */
.topbar { padding: 14px 18px 0; }
.topbar-menu { width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.02); }
.page-content { width: min(100%, 1040px); padding-top: 118px; }
.hero-section { width: min(100%, 930px); margin-top: 48px; margin-bottom: 26px; }
.hero-greeting { font-size: clamp(28px, 2.4vw, 34px); color: rgba(245,247,251,.96); }
.hero-title { font-size: clamp(64px, 7vw, 82px); max-width: 680px; }
.hero-spark { left: -18px; top: 148px; font-size: 48px; }
.composer-wrap { width: min(100%, 930px); }
.composer-card { padding: 26px 28px 22px; min-height: 262px; border-radius: 30px; background: linear-gradient(180deg, rgba(28,33,45,.9), rgba(21,25,35,.82)); }
#promptInput { min-height: 154px; font-size: clamp(28px, 3vw, 40px); }
.composer-toolbar { margin-top: 8px; align-items: center; }
.toolbar-button, .toolbar-trigger, .mode-toggle, .tool-chip { min-height: 46px; }
.quick-actions { padding-top: 18px; gap: 12px; justify-content: flex-start; padding-left: 68px; }
.suggest-pill { min-height: 50px; padding: 0 22px; background: rgba(30,35,48,.88); }
.left-drawer { width: min(max(350px, 32vw), 92vw); }
.drawer-header-row { padding: 14px 16px 10px; }
.drawer-title { opacity: .0; width: 0; overflow: hidden; }
.profile-popover { border-radius: 22px; }
.chat-section { width: min(100%, 930px); }
.styles-panel { width: min(100%, 930px); }

@media (max-width: 900px) {
  .page-content { padding-top: 102px; }
  .hero-section { margin-top: 24px; }
  .hero-title { font-size: 54px; }
  .hero-spark { display:none; }
  .quick-actions { padding-left: 0; justify-content: center; }
}


/* next polish pass */
body {
  background:
    radial-gradient(circle at 12% 4%, rgba(43, 70, 146, 0.20), transparent 26%),
    radial-gradient(circle at 84% 12%, rgba(31, 56, 121, 0.18), transparent 26%),
    linear-gradient(90deg, rgba(13, 16, 24, 0.98) 0%, rgba(9, 11, 17, 0.985) 20%, rgba(9, 11, 16, 0.99) 72%, rgba(8, 10, 15, 1) 100%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}
.topbar { padding: 18px 24px 0; }
.topbar-menu {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255,255,255,.025);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.login-button {
  min-width: 118px;
  height: 48px;
  padding: 0 20px;
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}
.page-content {
  width: min(100%, 1100px);
  padding-top: 126px;
  padding-bottom: 72px;
}
.hero-section {
  width: min(100%, 940px);
  margin-top: 42px;
  margin-bottom: 22px;
  padding-left: 10px;
}
.hero-greeting {
  font-size: clamp(30px, 2.45vw, 36px);
  font-weight: 700;
  color: rgba(245,247,251,.97);
}
.hero-title {
  margin-top: 8px;
  max-width: 700px;
  font-size: clamp(66px, 7.2vw, 88px);
  line-height: .96;
  letter-spacing: -.068em;
}
.hero-spark {
  left: -10px;
  top: 132px;
  font-size: 52px;
  text-shadow: 0 0 22px rgba(79,131,255,.24);
}
.chat-section,
.styles-panel,
.composer-wrap { width: min(100%, 940px); }
.styles-panel,
.composer-card,
.profile-popover,
.modal-card {
  background:
    linear-gradient(180deg, rgba(32,38,52,.90), rgba(20,24,34,.90));
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}
.composer-card {
  min-height: 270px;
  padding: 28px 28px 22px;
  border-radius: 34px;
  border-color: rgba(255,255,255,.085);
}
#promptInput {
  min-height: 164px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.2;
  letter-spacing: -.04em;
}
.composer-toolbar {
  margin-top: 12px;
  align-items: center;
}
.toolbar-button,
.toolbar-trigger,
.mode-toggle,
.tool-chip,
.suggest-pill {
  min-height: 48px;
  border-radius: 18px;
}
.toolbar-trigger,
.mode-toggle,
.toolbar-button {
  background: rgba(255,255,255,.035);
}
.tool-chip {
  padding: 0 18px;
  border-color: rgba(79,131,255,.24);
  background: rgba(79,131,255,.12);
}
.mode-toggle {
  min-width: 150px;
  justify-content: space-between;
}
.submit-button {
  width: 50px;
  height: 50px;
}
.quick-actions {
  justify-content: center;
  gap: 14px;
  padding-top: 20px;
  padding-left: 0;
}
.suggest-pill {
  padding: 0 24px;
  background: rgba(31,36,49,.92);
}
.left-drawer {
  width: min(max(350px, 32vw), 92vw);
  background: linear-gradient(180deg, rgba(13,16,24,.98), rgba(10,13,20,.98));
}
.drawer-header-row { padding: 18px 16px 10px; }
.drawer-primary,
.history-item,
.drawer-profile,
.theme-option,
.drawer-link:hover {
  background: rgba(255,255,255,.035);
}
.history-item { border-color: rgba(255,255,255,.04); }
.history-item.active {
  border-color: rgba(79,131,255,.32);
  background: rgba(79,131,255,.14);
}
.message-bubble {
  background: linear-gradient(180deg, rgba(30,35,48,.88), rgba(18,22,31,.88));
}
.message-row.user .message-bubble {
  max-width: min(100%, 720px);
  border-top-right-radius: 18px;
}
.message-row.assistant .message-bubble {
  max-width: min(100%, 900px);
  border-top-left-radius: 18px;
}
.modal-card { border-radius: 30px; }
.profile-popover { width: min(390px, calc(100vw - 24px)); }
@media (max-width: 980px) {
  .page-content { width: min(100%, 980px); padding-top: 108px; }
  .hero-section { margin-top: 20px; padding-left: 0; }
  .hero-title { font-size: clamp(54px, 10vw, 72px); max-width: 620px; }
  .hero-spark { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 16px 16px 0; }
  .page-content { padding-top: 92px; }
  .hero-greeting { font-size: 22px; }
  .hero-title { font-size: clamp(42px, 13vw, 56px); }
  .composer-card { border-radius: 26px; padding: 20px 18px 18px; min-height: 220px; }
  #promptInput { min-height: 120px; font-size: 24px; }
  .quick-actions { justify-content: flex-start; }
}


/* unified single-chat layout */
.app-shell.has-chat {
  overflow: hidden;
}
.app-shell.has-chat .page-content {
  min-height: calc(100vh - 118px);
  min-height: calc(100svh - 118px);
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
}
.app-shell.has-chat .hero-section {
  display: none;
}
.app-shell.has-chat .chat-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(32,38,52,.90), rgba(20,24,34,.90));
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}
.app-shell.has-chat .chat-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 22px 8px;
  gap: 18px;
}
.app-shell.has-chat .composer-wrap {
  width: 100%;
  margin: 0;
  padding: 0 22px 18px;
  border-top: none;
  background: transparent;
}
.app-shell.has-chat .composer-card {
  min-height: auto;
  padding: 18px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app-shell.has-chat #promptInput {
  min-height: 96px;
  font-size: clamp(24px, 2.2vw, 34px);
}
.app-shell.has-chat .styles-panel.floating-panel {
  position: fixed;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  width: min(940px, calc(100vw - 32px));
  max-height: min(62vh, 720px);
  overflow: auto;
  z-index: 45;
  margin: 0;
}

/* stronger light theme overrides */
:root[data-theme='light'] body {
  background:
    radial-gradient(circle at 12% 4%, rgba(104, 141, 255, 0.12), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(98, 149, 255, 0.10), transparent 28%),
    linear-gradient(90deg, rgba(244,248,253,0.98) 0%, rgba(238,243,251,0.99) 22%, rgba(241,245,252,0.99) 72%, rgba(236,242,250,1) 100%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}
:root[data-theme='light'] .app-shell::after {
  background: radial-gradient(circle at center, transparent 52%, rgba(127, 151, 196, 0.08));
}
:root[data-theme='light'] .topbar-menu,
:root[data-theme='light'] .login-button,
:root[data-theme='light'] .toolbar-button,
:root[data-theme='light'] .toolbar-trigger,
:root[data-theme='light'] .mode-toggle,
:root[data-theme='light'] .suggest-pill,
:root[data-theme='light'] .drawer-primary,
:root[data-theme='light'] .history-item,
:root[data-theme='light'] .drawer-profile,
:root[data-theme='light'] .theme-option,
:root[data-theme='light'] .drawer-link:hover,
:root[data-theme='light'] .tool-chip,
:root[data-theme='light'] .selected-style-chip,
:root[data-theme='light'] .ghost-button,
:root[data-theme='light'] .outline-button,
:root[data-theme='light'] .message-action-link {
  background: rgba(255,255,255,.88);
}
:root[data-theme='light'] .styles-panel,
:root[data-theme='light'] .composer-card,
:root[data-theme='light'] .profile-popover,
:root[data-theme='light'] .modal-card,
:root[data-theme='light'] .app-shell.has-chat .chat-section,
:root[data-theme='light'] .message-bubble {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,253,.96));
  box-shadow: 0 22px 62px rgba(91, 112, 152, 0.12);
}
:root[data-theme='light'] .left-drawer {
  background: linear-gradient(180deg, rgba(248,250,253,.98), rgba(240,245,252,.98));
}
:root[data-theme='light'] .topbar-menu { box-shadow: inset 0 1px 0 rgba(0,0,0,.02); }
:root[data-theme='light'] .tool-chip,
:root[data-theme='light'] .history-item.active,
:root[data-theme='light'] .mode-option.selected,
:root[data-theme='light'] .primary-outline,
:root[data-theme='light'] .plan-card.featured {
  background: rgba(49,108,255,.10);
}
:root[data-theme='light'] .message-assistant-text,
:root[data-theme='light'] .message-meta,
:root[data-theme='light'] .styles-note,
:root[data-theme='light'] .profile-sub,
:root[data-theme='light'] .drawer-profile-sub,
:root[data-theme='light'] .modal-sub,
:root[data-theme='light'] .balance-summary,
:root[data-theme='light'] .plan-meta,
:root[data-theme='light'] .plan-per,
:root[data-theme='light'] .mode-option-note,
:root[data-theme='light'] .themeValueLabel {
  color: #5f6a81;
}
@media (max-width: 720px) {
  .app-shell.has-chat .page-content { min-height: calc(100vh - 82px);
  min-height: calc(100svh - 82px); }
  .app-shell.has-chat .chat-section { border-radius: 26px; }
  .app-shell.has-chat .chat-messages { padding: 14px; }
  .app-shell.has-chat .composer-wrap { padding: 0 14px 14px; }
  .app-shell.has-chat .styles-panel.floating-panel {
    width: calc(100vw - 20px);
    bottom: 88px;
  }
}

/* final pass fixes */
.styles-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.styles-popup {
  width: min(940px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  max-height: min(82vh, 840px);
  max-height: min(82svh, 840px);
  margin: 0;
  overflow: auto;
  border-radius: 30px;
}
#stylesBackdrop {
  z-index: 65;
  align-items: center;
  padding: 12px 10px 12px;
}
#stylesBackdrop .styles-popup {
  margin-bottom: 0;
}
.tool-chip-button {
  border: 1px solid rgba(79,131,255,.24);
  cursor: pointer;
}
.tool-chip-button[disabled] {
  opacity: .6;
  cursor: default;
}
.thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
}
.thinking-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(79,131,255,.22);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.message-bubble.is-pending {
  opacity: .98;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.app-shell.has-chat .page-content {
  min-height: calc(100vh - 112px);
  min-height: calc(100svh - 112px);
  padding-bottom: 34px;
}
.app-shell.has-chat .chat-section {
  margin-bottom: 14px;
}
.app-shell.has-chat .chat-messages {
  padding: 24px 24px 6px;
}
.app-shell.has-chat .composer-wrap {
  padding: 0 24px 20px;
}
.app-shell.has-chat .composer-card {
  padding-top: 10px;
}
.app-shell.has-chat #promptInput {
  min-height: 84px;
}
:root[data-theme='light'] .composer-card,
:root[data-theme='light'] .styles-popup,
:root[data-theme='light'] .profile-popover,
:root[data-theme='light'] .modal-card,
:root[data-theme='light'] .app-shell.has-chat .chat-section,
:root[data-theme='light'] .message-bubble {
  background: linear-gradient(180deg, rgba(250,252,255,.96), rgba(241,246,252,.97));
  border-color: rgba(58, 79, 121, 0.10);
}
:root[data-theme='light'] .toolbar-button,
:root[data-theme='light'] .toolbar-trigger,
:root[data-theme='light'] .mode-toggle,
:root[data-theme='light'] .suggest-pill,
:root[data-theme='light'] .ghost-button,
:root[data-theme='light'] .outline-button,
:root[data-theme='light'] .message-action-link,
:root[data-theme='light'] .drawer-primary,
:root[data-theme='light'] .history-item,
:root[data-theme='light'] .drawer-profile,
:root[data-theme='light'] .theme-option,
:root[data-theme='light'] .drawer-link:hover,
:root[data-theme='light'] .login-button,
:root[data-theme='light'] .topbar-menu {
  background: rgba(247,250,254,.88);
}
:root[data-theme='light'] .tool-chip,
:root[data-theme='light'] .tool-chip-button,
:root[data-theme='light'] .selected-style-chip,
:root[data-theme='light'] .history-item.active,
:root[data-theme='light'] .mode-option.selected,
:root[data-theme='light'] .primary-outline,
:root[data-theme='light'] .plan-card.featured {
  background: rgba(49,108,255,.10);
}
:root[data-theme='light'] #promptInput::placeholder {
  color: rgba(95,106,129,.86);
}
:root[data-theme='light'] .message-style-tag {
  background: rgba(255,255,255,.72);
}
@media (max-width: 720px) {
  #stylesBackdrop {
    align-items: flex-start;
    padding: 74px 10px 12px;
  }
  #stylesBackdrop .styles-popup {
    margin-top: 0;
  }
  .styles-popup {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 86px);
    max-height: calc(100svh - 86px);
    border-radius: 24px;
  }
  .styles-header {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -2px -2px 14px;
    padding: 14px 14px 10px;
    background: inherit;
  }
  .styles-title {
    font-size: 17px;
    line-height: 1.1;
  }
  .styles-note {
    font-size: 12px;
    line-height: 1.45;
    max-width: 220px;
  }
  .styles-actions {
    flex-shrink: 0;
    gap: 6px;
  }
  .styles-actions .ghost-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }
  #closeStylesButton {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 20px;
    line-height: 1;
  }
  .app-shell.has-chat .chat-section {
    margin-bottom: 10px;
  }
}


/* safari and adaptive polish */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar-menu,
  .login-button,
  .profile-popover,
  .drawer-backdrop,
  .left-drawer,
  .composer-card,
  .styles-popup,
  .modal-card,
  .tool-chip,
  .toolbar-button,
  .toolbar-trigger,
  .mode-toggle {
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar-menu,
  .login-button,
  .profile-popover,
  .left-drawer,
  .composer-card,
  .styles-popup,
  .modal-card {
    background: var(--surface-2);
  }
}

@media (max-width: 1100px) {
  .page-content { width: min(100%, 1000px); }
  .hero-section,
  .chat-section,
  .composer-wrap { width: min(100%, 940px); }
}

@media (max-width: 820px) {
  .page-content { padding-left: 16px; padding-right: 16px; }
  .app-shell.has-chat .chat-section { border-radius: 28px; }
  .composer-toolbar { gap: 10px; align-items: stretch; }
  .composer-left-tools,
  .composer-right-tools { flex-wrap: wrap; }
  .mode-picker-wrap { width: 100%; }
  .mode-toggle { width: 100%; justify-content: space-between; }
}

@media (max-width: 640px) {
  .topbar { padding-left: 14px; padding-right: 14px; }
  .page-content { padding-left: 12px; padding-right: 12px; }
  .hero-section { margin-bottom: 18px; }
  .quick-actions { gap: 8px; }
  .styles-popup { border-radius: 24px; }
}


/* bananas final yellow + gray override */
:root {
  --bg: #111214;
  --bg-deep: #0d0e10;
  --bg-soft: #1a1b1f;
  --surface: rgba(28, 29, 33, 0.88);
  --surface-2: rgba(24, 25, 29, 0.97);
  --surface-3: rgba(255,255,255,0.035);
  --line: rgba(232, 232, 232, 0.11);
  --line-strong: rgba(232, 232, 232, 0.18);
  --text: #f5f2eb;
  --muted: #a7a29a;
  --pill: rgba(31, 32, 37, 0.94);
  --accent: #f5c338;
  --accent-2: #ffd75b;
  --accent-soft: rgba(245, 195, 56, 0.16);
  --shadow: 0 30px 90px rgba(0,0,0,.42);
}
:root[data-theme='light'] {
  --bg: #f2efe8;
  --bg-deep: #e8e3d8;
  --bg-soft: #f7f3eb;
  --surface: rgba(255,255,255,0.86);
  --surface-2: rgba(252,249,243,0.98);
  --surface-3: rgba(56,56,56,0.04);
  --line: rgba(75, 69, 57, 0.12);
  --line-strong: rgba(75, 69, 57, 0.20);
  --text: #26231f;
  --muted: #6f695f;
  --pill: rgba(255,255,255,0.92);
  --accent: #e2b122;
  --accent-2: #f5c338;
  --accent-soft: rgba(226,177,34,0.12);
  --shadow: 0 24px 60px rgba(82, 74, 56, 0.12);
}
body {
  background:
    radial-gradient(circle at 12% 2%, rgba(245, 195, 56, 0.10), transparent 24%),
    radial-gradient(circle at 84% 8%, rgba(245, 195, 56, 0.07), transparent 24%),
    linear-gradient(90deg, rgba(17,18,20,.98), rgba(13,14,16,.99) 30%, rgba(12,13,15,1));
}
:root[data-theme='light'] body {
  background:
    radial-gradient(circle at 12% 2%, rgba(226,177,34,.10), transparent 24%),
    radial-gradient(circle at 84% 8%, rgba(226,177,34,.08), transparent 24%),
    linear-gradient(180deg, #f4f1e9, #ebe5da);
}
.topbar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(100%, 1100px);
  padding: 18px 24px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 18px;
}
.topbar-left, .topbar-right { gap: 10px; }
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding-left: 8px;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text);
}
.brand-emoji { color: var(--accent); filter: drop-shadow(0 0 8px rgba(245,195,56,.18)); }
.brand-word { font-weight: 400; }
.hero-greeting { font-weight: 400 !important; }
.hero-title { font-size: clamp(66px, 7.2vw, 85px) !important; font-weight: 400 !important; }
.hero-spark { display: none !important; }
.login-button { font-weight: 400 !important; }
.page-content { width: min(100%, 1160px); padding-top: 116px; min-height: calc(100vh - 116px); min-height: calc(100svh - 116px); display: flex; flex-direction: column; justify-content: center; }
.hero-section { width: min(100%, 980px); padding-left: 8px; margin-top: 0; margin-bottom: 22px; }
.hero-title { font-size: clamp(72px, 6.9vw, 92px) !important; max-width: 760px; }
.hero-greeting { font-size: clamp(30px, 2.3vw, 36px); }
.composer-wrap { width: min(100%, 980px); }
.composer-card { padding: 28px 30px 24px; min-height: 276px; }
#promptInput { min-height: 164px; font-size: clamp(30px, 2.9vw, 42px); }
.chat-section { width: min(100%, 980px); }
.styles-panel { width: min(100%, 980px); }
.topbar-menu, .login-button, .toolbar-button, .toolbar-trigger, .suggest-pill, .drawer-primary, .history-item, .theme-option, .drawer-link:hover, .ghost-button, .outline-button, .login-provider-button {
  border-color: var(--line);
  background: rgba(255,255,255,.03);
}
.toolbar-trigger, .tool-chip, .selected-style-chip, .plan-card.featured, .primary-outline {
  border-color: rgba(245,195,56,.28) !important;
  background: rgba(245,195,56,.10) !important;
}
.tool-chip-button { border-color: rgba(245,195,56,.28) !important; }
.submit-button {
  background: linear-gradient(180deg, #ffdd68, #f5c338) !important;
  color: #2d2a24 !important;
  box-shadow: 0 16px 30px rgba(245,195,56,.22) !important;
}
.submit-button:disabled { box-shadow: none !important; }
.icon-arrow-up::before { border-top-color: currentColor; border-left-color: currentColor; }
.icon-menu { width: 18px; height: 14px; box-shadow: none !important; }
.icon-menu::before, .icon-menu::after { left: 0; right: 0; height: 2px; background: currentColor; }
.icon-menu::before { top: 0; box-shadow: 0 6px 0 0 currentColor; }
.icon-menu::after { bottom: 0; }
.icon-attachment::before, .icon-attachment::after { content:''; position:absolute; display:block; }
.icon-attachment::before { width: 10px; height: 14px; border: 2px solid currentColor; border-top-left-radius: 7px; border-top-right-radius: 7px; border-bottom-left-radius: 7px; border-bottom-right-radius: 7px; left: 4px; top: 1px; border-right-width:2px; transform: rotate(45deg); border-left-color: transparent; }
.icon-attachment::after { width: 6px; height: 10px; border: 2px solid currentColor; border-left-color: transparent; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; left: 7px; top: 4px; transform: rotate(45deg); }
.toolbar-button .icon { display:grid; place-items:center; }
.drawer-profile-button { width: 100%; background: transparent; text-align: left; border: 0; padding: 0; }
.drawer-profile-button:hover .drawer-profile { transform: none; }
.aspect-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.aspect-option {
  width: 44px; height: 44px; border-radius: 999px; border: none; background: transparent; color: var(--text); display:grid; place-items:center; position: relative;
}
.aspect-option.selected { background: rgba(245,195,56,.14); color: #f6ddb0; }
.aspect-icon { display:block; border: 1.8px solid currentColor; border-radius: 2px; opacity: .95; }
.aspect-icon.portrait { width: 12px; height: 18px; }
.aspect-icon.square { width: 16px; height: 16px; }
.aspect-icon.landscape { width: 18px; height: 12px; }
.message-style-tag { background: rgba(245,195,56,.08); border-color: rgba(245,195,56,.18); }
.thinking-spinner { border-color: rgba(245,195,56,.22); border-top-color: var(--accent); }
.message-action-link { border-color: rgba(245,195,56,.22); background: rgba(245,195,56,.08); }
.profile-popover, .modal-card, .styles-popup, .composer-card, .app-shell.has-chat .chat-section { background: linear-gradient(180deg, rgba(27,28,31,.95), rgba(20,21,24,.96)) !important; }
:root[data-theme='light'] .profile-popover, :root[data-theme='light'] .modal-card, :root[data-theme='light'] .styles-popup, :root[data-theme='light'] .composer-card, :root[data-theme='light'] .app-shell.has-chat .chat-section, :root[data-theme='light'] .message-bubble {
  background: linear-gradient(180deg, rgba(252,249,243,.98), rgba(245,240,231,.98)) !important;
}
:root[data-theme='light'] .toolbar-button, :root[data-theme='light'] .toolbar-trigger, :root[data-theme='light'] .suggest-pill, :root[data-theme='light'] .login-button, :root[data-theme='light'] .topbar-menu, :root[data-theme='light'] .aspect-picker, :root[data-theme='light'] .history-item, :root[data-theme='light'] .drawer-primary, :root[data-theme='light'] .theme-option, :root[data-theme='light'] .drawer-link:hover {
  background: rgba(255,252,247,.88) !important;
  border-color: rgba(111, 105, 95, 0.12) !important;
  color: #312c26 !important;
}
:root[data-theme='light'] .toolbar-trigger, :root[data-theme='light'] .tool-chip, :root[data-theme='light'] .selected-style-chip, :root[data-theme='light'] .plan-card.featured, :root[data-theme='light'] .primary-outline, :root[data-theme='light'] .aspect-option.selected, :root[data-theme='light'] .message-action-link {
  background: rgba(226,177,34,.10) !important;
  border-color: rgba(226,177,34,.22) !important;
  color: #5a4630 !important;
}
:root[data-theme='light'] .drawer-profile {
  background: rgba(255,252,247,.92) !important;
  border-color: rgba(111, 105, 95, 0.12) !important;
}
:root[data-theme='light'] .drawer-profile-sub,
:root[data-theme='light'] .drawer-link-side,
:root[data-theme='light'] .history-item-meta {
  color: #7b7368 !important;
}
:root[data-theme='light'] .hero-greeting {
  color: rgba(49, 44, 38, 0.42) !important;
}
#promptInput::placeholder { color: rgba(167,162,154,.88); }
:root[data-theme='light'] #promptInput::placeholder { color: rgba(111,105,95,.86) !important; }
.app-shell.has-chat .chat-section { margin-bottom: 18px !important; }
.app-shell.has-chat .composer-wrap { padding-bottom: 18px !important; }
@media (max-width: 820px) {
  .topbar { width: 100%; padding: 16px 16px 0; grid-template-columns: auto 1fr auto; }
  .topbar-brand { font-size: 24px; padding-left: 2px; }
  .hero-section { padding-left: 0; }
}
@media (max-width: 640px) {
  .topbar-brand { font-size: 22px; gap: 8px; }
  .composer-toolbar { gap: 10px; }
  .composer-right-tools { width: 100%; justify-content: space-between; }
}


/* 2026-03-30 final polish: auth consent, cookie, footer, drawer toggle */
.burger-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}
.burger-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
#drawerClose { display: none !important; }
.drawer-header-row {
  justify-content: flex-start;
  padding-top: 24px;
}
.attach-icon-svg {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
}
.icon-attachment::before,
.icon-attachment::after { display: none !important; }
.toolbar-button { justify-content: center; }
.toolbar-button .icon,
.toolbar-button svg { margin: 0 auto; }
.auth-modal-card {
  width: min(680px, 100%);
}
.auth-status-note {
  margin: 2px 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.consent-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
.consent-check input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.auth-consent-hint {
  margin: 0 0 18px 36px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.telegram-provider-wrap {
  position: relative;
  min-height: 52px;
}
.telegram-auth-wrap {
  min-height: 52px;
  display: flex;
  align-items: center;
}
.provider-consent-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: not-allowed;
}
.provider-consent-overlay.hidden {
  display: none;
}
.login-provider-button:disabled {
  opacity: .52;
  cursor: not-allowed;
}
.cookie-banner {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 75;
  width: min(720px, calc(100vw - 48px));
}
.cookie-banner.hidden {
  display: none;
}
.cookie-card {
  padding: 22px 22px 18px;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(18,19,23,.96), rgba(10,11,14,.98));
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.cookie-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}
.cookie-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.46;
}
.cookie-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.cookie-accept-button,
.cookie-secondary-button {
  min-height: 56px;
  padding: 0 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 700;
}
.cookie-accept-button {
  background: linear-gradient(180deg, #ffdd68, #f5c338);
  color: #26231f;
  border-color: rgba(245,195,56,.42);
}
.cookie-secondary-button {
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.page-footer {
  width: min(100%, 980px);
  margin: auto auto 0;
  padding: 18px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.55 !important;
}
.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.footer-row + .footer-row {
  margin-top: 8px;
}
.footer-right {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}
.footer-linklike {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.footer-copy {
  max-width: 100% !important;
  text-align: justify !important;
  font-size: 12px !important;
  text-wrap: pretty;
  line-height: 1.66;
  hyphens: auto;
}
:root[data-theme='light'] .cookie-card {
  background: linear-gradient(180deg, rgba(252,249,243,.98), rgba(245,240,231,.99));
}
:root[data-theme='light'] .cookie-secondary-button,
:root[data-theme='light'] .provider-consent-overlay {
  background: rgba(255,255,255,.86);
}
:root[data-theme='light'] .page-footer {
  color: #6f695f;
}
:root[data-theme='light'] .chat-section {
  background: linear-gradient(180deg, rgba(245,240,231,.96), rgba(239,232,221,.96));
}
:root[data-theme='light'] .app-shell.has-chat .chat-section,
:root[data-theme='light'] .app-shell.has-chat .composer-wrap,
:root[data-theme='light'] .app-shell.has-chat .composer-card {
  background: linear-gradient(180deg, rgba(245,240,231,.96), rgba(239,232,221,.96)) !important;
}
:root[data-theme='light'] .app-shell.has-chat .composer-wrap {
  border-top: none !important;
  box-shadow: none !important;
}
:root[data-theme='light'] .app-shell.has-chat .composer-card {
  box-shadow: none !important;
}
:root[data-theme='light'] .message-row.user .message-bubble,
:root[data-theme='light'] .message-row.assistant .message-bubble {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(251,247,240,.98)) !important;
}
@media (max-width: 920px) {
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }
  .cookie-card {
    padding: 14px 14px 12px;
    border-radius: 18px;
  }
  .cookie-title {
    font-size: 16px;
    line-height: 1.15;
  }
  .cookie-text {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.38;
  }
  .cookie-actions {
    gap: 8px;
    margin-top: 12px;
  }
  .cookie-accept-button,
  .cookie-secondary-button {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 13px;
  }
  .page-footer {
    width: min(100%, 100%);
  }
}

/* final hard override for light drawer + auth badge */
:root[data-theme='light'] .left-drawer {
  background: linear-gradient(180deg, rgba(252,249,243,.985), rgba(245,240,231,.985)) !important;
}
:root[data-theme='light'] .topbar-menu,
:root[data-theme='light'] .drawer-primary,
:root[data-theme='light'] .history-item,
:root[data-theme='light'] .drawer-profile,
:root[data-theme='light'] .theme-option,
:root[data-theme='light'] .drawer-link:hover {
  background: rgba(255,252,247,.94) !important;
  border-color: rgba(111, 105, 95, 0.12) !important;
  color: #312c26 !important;
  box-shadow: none !important;
}
:root[data-theme='light'] .history-item.active {
  background: rgba(226,177,34,.10) !important;
  border-color: rgba(226,177,34,.22) !important;
}
.avatar-button,
:root[data-theme='light'] .avatar-button {
  border-color: rgba(245, 195, 56, 0.28) !important;
  background: linear-gradient(180deg, #f5c338, #e2b122) !important;
  color: #2d2a24 !important;
}
@media (max-width: 720px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }
  .auth-status-note {
    font-size: 18px;
  }
  .consent-check {
    font-size: 14px;
  }
  .auth-consent-hint {
    margin-left: 0;
  }
  .footer-row {
    flex-direction: column;
  }
  .footer-right {
    justify-content: flex-start;
    text-align: left;
    gap: 14px;
  }
  .page-footer {
    opacity: 0.82 !important;
    color: var(--text) !important;
  }
  .footer-copy {
    font-size: 13px !important;
    line-height: 1.58;
  }
}

/* final hard override for dark drawer + centered desktop landing */
:root:not([data-theme='light']) .left-drawer {
  background: linear-gradient(180deg, rgba(21, 18, 13, 0.96), rgba(12, 11, 9, 0.985)) !important;
  border-right-color: rgba(245, 195, 56, 0.10) !important;
}
:root:not([data-theme='light']) .drawer-primary,
:root:not([data-theme='light']) .theme-option,
:root:not([data-theme='light']) .history-item,
:root:not([data-theme='light']) .drawer-profile,
:root:not([data-theme='light']) .drawer-link:hover {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.08) !important;
  box-shadow: none !important;
}
:root:not([data-theme='light']) .drawer-primary {
  background: linear-gradient(180deg, rgba(245,195,56,.16), rgba(245,195,56,.08)) !important;
  border-color: rgba(245,195,56,.16) !important;
  color: #f8ecd0 !important;
}
:root:not([data-theme='light']) .drawer-link:hover,
:root:not([data-theme='light']) .theme-option:hover {
  background: rgba(245,195,56,.08) !important;
  border-color: rgba(245,195,56,.14) !important;
}
:root:not([data-theme='light']) .history-item.active {
  background: rgba(245,195,56,.10) !important;
  border-color: rgba(245,195,56,.18) !important;
}
@media (min-width: 721px) {
  .app-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }
  .left-drawer {
    width: 350px !important;
    min-width: 350px !important;
  }
  .page-content {
    flex: 1 0 auto;
    padding-top: 25vh !important;
    padding-bottom: 32px;
    justify-content: flex-start;
  }
  .page-footer {
    margin-top: auto;
    padding-top: 22px;
  }
}

footer.page-footer {
  opacity: 0.55 !important;
}

@media (max-width: 720px) {
  .hero-greeting {
    font-size: 20px !important;
  }
  .hero-title {
    font-size: clamp(48px, 8.8vw, 62px) !important;
  }
}

@media (min-width: 1024px) {
  .page-content {
    padding-top: 25vh !important;
  }
}

/* referral system + final safari/mobile fixes */
.referral-card {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}
.referral-card-disabled {
  opacity: .92;
}
.referral-copy-row {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(245,195,56,.18);
  background: rgba(245,195,56,.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.referral-copy-row:hover {
  transform: translateY(-1px);
  border-color: rgba(245,195,56,.26);
  background: rgba(245,195,56,.11);
}
.referral-copy-row:disabled,
.referral-share-button:disabled,
.referral-action-inactive {
  cursor: default;
  opacity: .62;
  transform: none !important;
}
.referral-link-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.referral-copy-icon {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.referral-copy-icon::before,
.referral-copy-icon::after {
  content: '';
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: transparent;
}
.referral-copy-icon::before {
  width: 12px;
  height: 12px;
  top: 6px;
  left: 2px;
  opacity: .88;
}
.referral-copy-icon::after {
  width: 12px;
  height: 12px;
  top: 2px;
  left: 8px;
  background: transparent;
}
.referral-share-button {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(245,195,56,.34);
  background: linear-gradient(180deg, #ffdd68, #f5c338);
  color: #2d2a24;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 12px 24px rgba(245,195,56,.16);
}
.referral-note,
.referral-modal-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.referral-modal-card {
  width: min(520px, calc(100vw - 24px));
}
.referral-copy-row-modal {
  margin-top: 8px;
}
.referral-login-button {
  width: min(220px, 100%);
  min-height: 52px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(245,195,56,.30);
  background: linear-gradient(180deg, #ffdd68, #f5c338);
  color: #2d2a24;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(245,195,56,.22);
}
.referral-login-button.hidden {
  display: none;
}
.footer-link-button {
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link-button {
  margin-left: 0 !important;
  margin-top: 0 !important;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
}
.profile-secondary-actions {
  margin-top: 12px;
}
.composer-card {
  overflow: hidden !important;
  border-radius: 34px !important;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}
#promptInput {
  border-radius: 0 !important;
}
:root[data-theme='light'] .referral-copy-row {
  background: rgba(226,177,34,.10);
  border-color: rgba(226,177,34,.20);
  color: #312c26;
}
:root[data-theme='light'] .referral-copy-row:hover {
  background: rgba(226,177,34,.14);
  border-color: rgba(226,177,34,.24);
}
:root[data-theme='light'] .referral-note,
:root[data-theme='light'] .referral-modal-note,
:root[data-theme='light'] .footer-link-button {
  color: #6f695f;
}
@supports (-webkit-touch-callout: none) {
  .composer-card,
  .profile-popover,
  .modal-card,
  .left-drawer,
  .drawer-profile,
  .history-item,
  .referral-copy-row,
  .referral-share-button {
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
}
@media (max-width: 900px) {
  .referral-link-text {
    font-size: 14px;
  }
}
@media (max-width: 720px) {
  .referral-copy-row,
  .referral-share-button {
    min-height: 48px;
    border-radius: 16px;
  }
  .referral-note,
  .referral-modal-note {
    font-size: 13px;
    line-height: 1.42;
  }
  .composer-card {
    border-radius: 26px !important;
  }
}
.embedded-prompt-collection {
  margin-top: 0;
  max-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition: max-height 360ms cubic-bezier(.22,1,.36,1), opacity 220ms ease, transform 360ms cubic-bezier(.22,1,.36,1), margin-top 220ms ease;
}
.embedded-prompt-collection.is-open {
  margin-top: 18px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
:root[data-theme='light'] .embedded-prompt-collection {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.embedded-prompt-collection__head { margin-bottom: 18px; }
.embedded-prompt-collection__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.embedded-prompt-collection__title {
  margin: 0;
  max-width: 760px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.02;
  letter-spacing: -.05em;
}
.embedded-prompt-collection__sub {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.embedded-prompt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.embedded-prompt-filter {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight: 700;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.embedded-prompt-filter:hover {
  transform: translateY(-1px);
  border-color: rgba(245,195,56,.26);
}
.embedded-prompt-filter.is-active {
  background: linear-gradient(180deg, #ffdd68, #f5c338);
  border-color: rgba(245,195,56,.44);
  color: #2d2a24;
  box-shadow: 0 14px 34px rgba(151,118,18,.24);
}
.embedded-prompt-stats {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}
.embedded-prompt-cards {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.embedded-prompt-card,
.embedded-prompt-empty-state {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  box-shadow: 0 20px 50px rgba(0,0,0,.12);
}
:root[data-theme='light'] .embedded-prompt-card,
:root[data-theme='light'] .embedded-prompt-empty-state {
  border-color: rgba(111,105,95,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,246,239,.98));
}
.embedded-prompt-card__media {
  position: relative;
  overflow: hidden;
}
.embedded-prompt-card__media::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 96px;
  background: linear-gradient(180deg, rgba(10,12,18,0), rgba(10,12,18,.34));
  pointer-events: none;
}
.embedded-prompt-card__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: rgba(255,255,255,.04);
}
.embedded-prompt-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}
.embedded-prompt-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.embedded-prompt-card__category,
.embedded-prompt-card__number,
.embedded-prompt-card__tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
:root[data-theme='light'] .embedded-prompt-card__category,
:root[data-theme='light'] .embedded-prompt-card__number,
:root[data-theme='light'] .embedded-prompt-card__tag {
  border-color: rgba(111,105,95,.10);
  background: rgba(245,195,56,.08);
}
.embedded-prompt-card__title {
  margin: 0;
  font-size: clamp(21px, 2.2vw, 24px);
  line-height: 1.12;
  letter-spacing: -.03em;
}
.embedded-prompt-card__prompt {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.embedded-prompt-card__footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}
.embedded-prompt-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.embedded-prompt-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.embedded-prompt-card__copy,
.embedded-prompt-card__try {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.embedded-prompt-card__copy {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.embedded-prompt-card__try {
  border: 1px solid rgba(122, 92, 16, 0.18);
  background: linear-gradient(180deg, #f4da72 0%, #e7c85a 100%);
  color: #4f3d0a;
  box-shadow: 0 10px 22px rgba(151, 118, 18, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.embedded-prompt-card__copy:hover,
.embedded-prompt-card__try:hover {
  transform: translateY(-1px);
}
.embedded-prompt-empty-state {
  grid-column: 1 / -1;
  padding: 28px;
}
.embedded-prompt-empty-state__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.embedded-prompt-empty-state__text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 900px) {
  .embedded-prompt-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .embedded-prompt-collection { padding: 18px; border-radius: 24px; }
  .embedded-prompt-filter { min-height: 40px; padding: 0 14px; }
  .embedded-prompt-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .embedded-prompt-card__copy,
  .embedded-prompt-card__try {
    width: 100%;
  }
}


/* prompt collection layout refinements */
.embedded-prompt-collection.is-open {
  overflow: visible;
}

.embedded-prompt-collection.is-open #embeddedPromptHost {
  display: block;
}

/* prompt collection insert feedback */
#composerWrap {
  scroll-margin-top: 96px;
}

.prompt-collection-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  max-height: 0;
  padding: 0 14px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    max-height 240ms ease,
    opacity 180ms ease,
    transform 240ms ease,
    margin-top 240ms ease,
    padding 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease;
}

.prompt-collection-notice::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.88;
  flex: 0 0 auto;
}

.prompt-collection-notice.is-visible {
  margin-top: 12px;
  max-height: 72px;
  padding: 12px 14px;
  opacity: 1;
  transform: translateY(0);
}

#promptInput {
  transition: background-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

#promptInput.is-prompt-inserted {
  animation: promptInputInsertedPulse 1.4s cubic-bezier(.22, 1, .36, 1);
}

.composer-card.is-prompt-inserted {
  animation: composerCardInsertedGlow 1.4s cubic-bezier(.22, 1, .36, 1);
}

@keyframes promptInputInsertedPulse {
  0% {
    transform: translateY(0);
    box-shadow: inset 0 0 0 0 rgba(79, 131, 255, 0);
  }
  22% {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 2px rgba(79, 131, 255, 0.4);
  }
  58% {
    transform: translateY(0);
    box-shadow: inset 0 0 0 2px rgba(79, 131, 255, 0.18);
  }
  100% {
    transform: translateY(0);
    box-shadow: inset 0 0 0 0 rgba(79, 131, 255, 0);
  }
}

@keyframes composerCardInsertedGlow {
  0% {
    box-shadow: var(--shadow);
  }
  30% {
    box-shadow: 0 0 0 1px rgba(79, 131, 255, 0.24), 0 24px 70px rgba(79, 131, 255, 0.14);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

:root[data-theme='light'] .prompt-collection-notice.is-visible {
  background: rgba(49, 108, 255, 0.08);
  border-color: rgba(49, 108, 255, 0.18);
  color: #234692;
}

:root:not([data-theme='light']) .prompt-collection-notice.is-visible {
  background: rgba(79, 131, 255, 0.12);
  border-color: rgba(79, 131, 255, 0.24);
  color: #dbe7ff;
}

:root[data-theme='light'] #promptInput.is-prompt-inserted {
  background: rgba(49, 108, 255, 0.04);
}

:root:not([data-theme='light']) #promptInput.is-prompt-inserted {
  background: rgba(79, 131, 255, 0.06);
}

@media (max-width: 720px) {
  #composerWrap {
    scroll-margin-top: 84px;
  }

  .prompt-collection-notice {
    font-size: 13px;
  }

  .prompt-collection-notice.is-visible {
    margin-top: 10px;
    padding: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-collection-notice,
  #promptInput,
  .composer-card {
    transition: none !important;
    animation: none !important;
  }
}
