*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gpt-sidebar-w: 260px;
  --gpt-rail-w: 52px;
  --gpt-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --gpt-duration: 0.22s;
  --gpt-font: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] .gpt {
  --gpt-bg: var(--product-dark-bg, #000000);
  --gpt-sidebar: #000000;
  --gpt-hover: rgba(255, 255, 255, 0.08);
  --gpt-active: rgba(255, 255, 255, 0.12);
  --gpt-border: rgba(255, 255, 255, 0.1);
  --gpt-composer: #0a0a0a;
  --gpt-composer-border: rgba(255, 255, 255, 0.08);
  --gpt-muted: #8e8ea0;
  --gpt-text: #ececec;
  --gpt-text-secondary: #b4b4b4;
  --gpt-user-bubble: #303030;
  --gpt-user-green: #2f4f44;
  --gpt-send: var(--product-accent, #10a37f);
  --gpt-send-hover: var(--product-accent, #10a37f);
  --gpt-badge-bg: rgba(255, 255, 255, 0.1);
  --gpt-mode-bg: #0a0a0a;
  --gpt-avatar: #f5c518;
}

[data-theme="dark"] .gpt__sidebar,
[data-theme="dark"] .gpt__rail {
  background: #000000 !important;
}

[data-theme="light"] .gpt {
  --gpt-bg: #ffffff;
  --gpt-sidebar: #f9f9f9;
  --gpt-hover: rgba(0, 0, 0, 0.05);
  --gpt-active: rgba(0, 0, 0, 0.08);
  --gpt-border: rgba(0, 0, 0, 0.1);
  --gpt-composer: #ffffff;
  --gpt-composer-border: rgba(0, 0, 0, 0.12);
  --gpt-muted: #6e6e80;
  --gpt-text: #0d0d0d;
  --gpt-text-secondary: #5d5d5d;
  --gpt-user-bubble: #f4f4f4;
  --gpt-user-green: #e8f5e9;
  --gpt-send: var(--product-accent, #10a37f);
  --gpt-send-hover: var(--product-accent, #0d8c6d);
  --gpt-badge-bg: rgba(0, 0, 0, 0.06);
  --gpt-mode-bg: #ececec;
  --gpt-avatar: #f5c518;
}

html, body {
  height: 100%;
  font-family: var(--gpt-font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.gpt {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: var(--gpt-bg);
  color: var(--gpt-text);
}

.gpt__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
}

/* Collapsed icon rail — only visible when full sidebar is closed */
.gpt__rail {
  flex-shrink: 0;
  width: var(--gpt-rail-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  gap: 0.25rem;
  background: var(--gpt-sidebar);
  border-right: 1px solid var(--gpt-border);
}

.gpt__rail[hidden] {
  display: none !important;
}

.gpt__rail-spacer {
  flex: 1;
}

.gpt__rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--gpt-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.gpt__rail-btn:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__rail-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gpt-avatar);
  font-size: 0.7rem;
  font-weight: 600;
  color: #000;
}

/* Sidebar */
.gpt__sidebar {
  flex-shrink: 0;
  width: var(--gpt-sidebar-w);
  height: 100%;
  overflow: hidden;
  background: var(--gpt-sidebar);
  border-right: 1px solid var(--gpt-border);
  transition:
    width var(--gpt-duration) var(--gpt-ease),
    opacity var(--gpt-duration) var(--gpt-ease);
}

.gpt__sidebar.is-closed {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-right: none;
}

.gpt__sidebar-inner {
  display: flex;
  flex-direction: column;
  width: var(--gpt-sidebar-w);
  height: 100%;
  min-height: 0;
  padding: 0.5rem 0.5rem 0.25rem;
  overflow: hidden;
}

.gpt__sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.25rem 0.35rem;
  flex-shrink: 0;
}

.gpt__brand {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 28px;
  padding-left: 0.25rem;
}

.gpt__brand-text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--gpt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gpt__brand-logo {
  display: block;
  width: auto;
  max-width: 148px;
  max-height: 28px;
  height: auto;
  object-fit: contain;
}

[data-theme="light"] .gpt__brand-logo,
[data-theme="light"] .gpt__topbar-brand-logo {
  mix-blend-mode: screen;
}

.gpt__topbar-brand {
  display: flex;
  align-items: center;
  min-height: 28px;
}

/* Sidebar already shows the logo when expanded */
.gpt__sidebar:not(.is-closed) ~ .gpt__main .gpt__topbar-brand {
  display: none !important;
}

.gpt__topbar-brand-logo {
  display: block;
  width: auto;
  max-width: 132px;
  max-height: 26px;
  height: auto;
  object-fit: contain;
}

.gpt__sidebar-actions {
  display: flex;
  gap: 0.1rem;
}

.gpt__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--gpt-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.gpt__icon-btn:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__nav {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin-bottom: 0.5rem;
}

.gpt__nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--gpt-text);
  text-align: left;
  transition: background 0.15s ease;
}

.gpt__nav-item svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.gpt__nav-item:hover {
  background: var(--gpt-hover);
}

.gpt__nav-item--active {
  background: var(--gpt-active);
  font-weight: 500;
}

.gpt__nav-item--new {
  margin-bottom: 0.35rem;
  font-weight: 400;
}

.gpt__badge {
  margin-left: auto;
  padding: 0.1rem 0.4rem;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px;
  background: var(--gpt-badge-bg);
  color: var(--gpt-muted);
}

.gpt__sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 127, 127, 0.3) transparent;
}

.gpt__sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.gpt__sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.25);
  border-radius: 999px;
}

.gpt__section {
  margin-top: 0.15rem;
}

.gpt__section-label {
  padding: 0.65rem 0.65rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gpt-muted);
}

.gpt__chat-list {
  list-style: none;
}

.gpt__chat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.gpt__chat-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--gpt-text-secondary);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.gpt__chat-item svg {
  flex-shrink: 0;
  opacity: 0.55;
}

.gpt__chat-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpt__chat-item:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__chat-item--active {
  background: var(--gpt-active);
  color: var(--gpt-text);
}

.gpt__chat-menu-btn {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  color: #b4b4b4;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.gpt__chat-row:hover .gpt__chat-menu-btn,
.gpt__chat-item--active ~ .gpt__chat-menu-btn,
.gpt__chat-menu-btn[aria-expanded="true"] {
  opacity: 1;
}

.gpt__chat-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ececec;
}

.gpt__chat-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: transparent;
  border: none;
  cursor: default;
}

.gpt__chat-menu {
  position: fixed;
  z-index: 100;
  min-width: 12.25rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #353535;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.gpt__chat-menu-sep {
  height: 1px;
  margin: 0.3rem 0.35rem;
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .gpt__chat-menu {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .gpt__chat-menu-item {
  color: #0d0d0d;
}

[data-theme="light"] .gpt__chat-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .gpt__chat-menu-sep {
  background: rgba(0, 0, 0, 0.1);
}

.gpt__chat-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 0.875rem;
  text-align: left;
  border-radius: 8px;
  color: #ececec;
}

.gpt__chat-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.gpt__chat-menu-label {
  flex: 1;
  min-width: 0;
}

.gpt__chat-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.gpt__chat-menu-item--danger,
.gpt__chat-menu-item--danger .gpt__chat-menu-icon {
  color: #ff6b6b;
}

.gpt__sidebar-foot {
  margin-top: auto;
  padding: 0.35rem 0.15rem 0.15rem;
  flex-shrink: 0;
}

.gpt__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  text-align: left;
  transition: background 0.15s ease;
}

.gpt__user:hover {
  background: var(--gpt-hover);
}

.gpt__user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gpt-avatar);
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
}

.gpt__user-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.gpt__user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gpt-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpt__user-plan {
  font-size: 0.75rem;
  color: var(--gpt-muted);
}

.gpt__user-expand {
  flex-shrink: 0;
  color: var(--gpt-muted);
  opacity: 0.6;
}

/* Scrim */
.gpt__scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
}

.gpt__scrim.is-visible {
  display: block;
  animation: gptScrimIn 0.18s ease both;
}

@keyframes gptScrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Main */
.gpt__main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--gpt-bg);
}

.gpt__topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.5rem 1rem;
  min-height: 52px;
  flex-shrink: 0;
}

.gpt__topbar-left,
.gpt__topbar-right {
  display: flex;
  align-items: center;
}

.gpt__topbar-right {
  justify-content: flex-end;
}

.gpt__mode-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--gpt-mode-bg);
}

.gpt__mode-btn {
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gpt-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.gpt__mode-btn--active {
  background: var(--gpt-bg);
  color: var(--gpt-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .gpt__mode-btn--active {
  background: #424242;
}

.gpt__profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--gpt-muted);
  transition: background 0.15s ease;
}

.gpt__profile-btn:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

/* Content */
.gpt__content[hidden],
.gpt__panel--page[hidden],
.gpt__composer-wrap--dock[hidden],
.gpt__composer-wrap--hero[hidden],
.gpt__hero[hidden],
.gpt__thread[hidden],
.gpt__topbar[hidden] {
  display: none !important;
}

.gpt__content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.gpt__content--hero {
  justify-content: center;
  padding-bottom: 0;
  overflow: visible;
}

.gpt__content--hero:has(#hero-logo-wrap:not([hidden])) {
  justify-content: center;
  margin-top: -4vh;
}

.gpt--logo-layout .gpt__content {
  overflow: visible;
}

.gpt__content--thread {
  flex: 1;
  min-height: 0;
  justify-content: flex-start;
  align-items: stretch;
  width: 100%;
  padding-bottom: 0;
  overflow: hidden;
}

.gpt__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(40rem, 88vw);
  padding: 0 1.5rem;
  gap: 2rem;
}

.gpt__hero:has(#hero-logo-wrap:not([hidden])) {
  max-width: min(56rem, 94vw);
  gap: 1.35rem;
}

.gpt__hero-logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: visible;
  /* Logo PNGs are wide 16:9 canvases — keep layout footprint small */
  height: 4.5rem;
  margin-bottom: 0;
  pointer-events: none;
}

.gpt__hero-logo-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(560px, 88vw);
  height: 4.5rem;
  min-height: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.gpt__hero-logo-transform {
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
}

.gpt__hero-logo {
  display: block;
  width: auto;
  max-width: min(560px, 88vw);
  max-height: 4.5rem;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

[data-theme="light"] .gpt__hero-logo {
  mix-blend-mode: screen;
}

.gpt--logo-layout .gpt__hero-logo-stage {
  outline: 2px dashed color-mix(in srgb, var(--product-accent, #10a37f) 65%, transparent);
  outline-offset: 10px;
  border-radius: 12px;
  cursor: grab;
  touch-action: none;
}

.gpt--logo-layout .gpt__hero-logo-stage:active {
  cursor: grabbing;
}

.gpt--logo-layout .gpt__hero-logo-wrap,
.gpt--logo-layout .gpt__hero-logo-stage {
  pointer-events: auto;
}

.gpt--logo-layout .gpt__hero-logo-wrap {
  cursor: grab;
}

.gpt__hero-title {
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--gpt-text);
  text-align: center;
}

.gpt__thread {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 0 0.5rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 127, 127, 0.45) transparent;
}

.gpt__thread::-webkit-scrollbar {
  width: 10px;
}

.gpt__thread::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.gpt__messages {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.gpt__message {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.gpt__message-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  align-items: flex-start;
}

.gpt__message--user .gpt__message-row {
  justify-content: flex-end;
}

.gpt__message-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  background: var(--product-accent, #10a37f);
  margin-top: 0.15rem;
}

.gpt__message-body {
  min-width: 0;
  max-width: 85%;
}

.gpt__message--assistant .gpt__message-body {
  max-width: 100%;
  flex: 1;
}

.gpt__message--user {
  align-items: flex-end;
}

.gpt__message--assistant {
  align-items: flex-start;
}

.gpt__search-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--gpt-text-muted);
  background: var(--gpt-hover);
  border: 1px solid var(--gpt-border);
}

.gpt__search-pill--web {
  color: var(--product-accent, #10a37f);
}

.gpt__sources {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gpt-border);
}

.gpt__sources-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gpt-text-muted);
  margin-bottom: 0.4rem;
}

.gpt__sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gpt__source-link {
  display: block;
  font-size: 0.8125rem;
  color: var(--product-accent, #10a37f);
  text-decoration: none;
  line-height: 1.35;
}

.gpt__source-link:hover {
  text-decoration: underline;
}

.gpt__source-link span {
  display: block;
  font-size: 0.6875rem;
  color: var(--gpt-text-muted);
  margin-top: 0.1rem;
}

.gpt__message-inner {
  font-size: 1rem;
  line-height: 1.65;
}

.gpt__message--user .gpt__message-inner {
  white-space: pre-wrap;
}

.gpt__message--assistant .gpt__message-inner {
  white-space: normal;
}

.gpt__message--user .gpt__message-inner {
  max-width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 1.25rem;
  background: var(--gpt-user-green);
  color: var(--gpt-text);
}

[data-theme="light"] .gpt__message--user .gpt__message-inner {
  color: #0d0d0d;
}

.gpt__message--assistant .gpt__message-inner {
  max-width: 100%;
  color: var(--gpt-text);
  padding: 0.15rem 0;
}

.gpt__message-inner pre {
  background: var(--gpt-hover);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre;
}

.gpt__message-inner code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

.gpt__message-inner :not(pre) > code {
  background: var(--gpt-hover);
  padding: 2px 6px;
  border-radius: 4px;
}

.gpt__message-inner p {
  margin-bottom: 0.75rem;
}

.gpt__message-inner p:last-child {
  margin-bottom: 0;
}

.gpt__message-inner ul,
.gpt__message-inner ol {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding-left: 0.25rem;
}

.gpt__message-inner li {
  margin-bottom: 0.35rem;
}

.gpt__message-inner li:last-child {
  margin-bottom: 0;
}

.gpt__message-inner img {
  display: block;
  max-width: 100%;
  margin: 0.75rem 0;
  border-radius: 12px;
  border: 1px solid var(--gpt-border);
}

.gpt__message-inner strong {
  font-weight: 600;
  color: var(--gpt-text);
}

.gpt__message-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gpt__message--assistant:hover .gpt__message-actions {
  opacity: 1;
}

.gpt__msg-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--gpt-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.gpt__msg-action:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__typing {
  opacity: 0.65;
  font-style: italic;
}

/* Composer */
.gpt__composer-wrap {
  width: 100%;
  position: relative;
  z-index: 4;
}

.gpt__composer-wrap--hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.gpt__composer-wrap--dock {
  flex-shrink: 0;
  max-width: min(40rem, 88vw);
  margin: 0 auto;
  margin-top: auto;
  padding: 0 1.5rem 1rem;
  width: 100%;
}

.gpt__suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gpt__suggestion {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--gpt-text-secondary);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.gpt__suggestion:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__suggestion-icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.gpt__composer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 52px;
  padding: 0.5rem 0.75rem 0.5rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--gpt-composer-border);
  background: var(--gpt-composer);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.gpt__composer-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--gpt-muted);
}

.gpt__composer-add:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__composer-input {
  flex: 1;
  min-width: 0;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--gpt-text);
  caret-color: var(--gpt-text);
  -webkit-text-fill-color: var(--gpt-text);
  padding: 0.25rem 0.35rem;
  max-height: 8rem;
  min-height: 1.35rem;
}

.gpt__composer-input::placeholder {
  color: var(--gpt-muted);
}

.gpt__composer-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.gpt__composer-mode {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--gpt-muted);
  border: 1px solid var(--gpt-border);
  background: var(--gpt-hover);
  max-width: 7.5rem;
}

.gpt__composer-mode [data-model-label] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gpt__composer-mode:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__composer-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--gpt-muted);
}

.gpt__composer-mic:hover {
  background: var(--gpt-hover);
  color: var(--gpt-text);
}

.gpt__composer-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gpt-send);
  color: #fff;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.gpt__composer-send:hover:not(:disabled) {
  background: var(--gpt-send-hover);
}

.gpt__composer-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gpt__disclaimer {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--gpt-muted);
}

/* Search modal */
.gpt__search-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 720px;
  width: min(720px, calc(100% - 48px));
  margin: 8vh auto auto;
}

.gpt__search-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.gpt__search-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.85rem;
  min-height: 2.25rem;
  border-radius: 999px;
  background: var(--gpt-composer);
  border: 1px solid var(--gpt-border);
  color: var(--gpt-muted);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.gpt__search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--gpt-text);
}

.gpt__search-input::placeholder {
  color: var(--gpt-muted);
}

.gpt__search-close {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--gpt-muted);
  padding: 0.25rem;
}

.gpt__search-results {
  margin-top: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--gpt-composer);
  border: 1px solid var(--gpt-border);
}

.gpt__search-result {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: left;
  color: var(--gpt-text);
  border-bottom: 1px solid var(--gpt-border);
  transition: background 0.15s ease;
}

.gpt__search-result:last-child {
  border-bottom: none;
}

.gpt__search-result:hover {
  background: var(--gpt-hover);
}

.gpt__search-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gpt-muted);
}

/* Settings modal */
.gpt__modal {
  border: none;
  padding: 0;
  background: transparent;
  color: #ececec;
  max-width: 480px;
  width: calc(100% - 32px);
  margin: auto;
}

.gpt__modal[open] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  max-height: 100vh;
}

.gpt__modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.gpt__modal-content {
  background: #353535;
  color: #ececec;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.gpt__modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gpt-border);
}

.gpt__modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ececec;
}

.gpt__modal-close {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gpt-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
}

.gpt__modal-close:hover {
  background: var(--gpt-hover);
}

.gpt__modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gpt__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.gpt__field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #ececec;
}

.gpt__field-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gpt-border);
  border-radius: 8px;
  background: var(--gpt-bg);
  font-size: 0.875rem;
}

.gpt__field-input:focus {
  outline: 2px solid var(--gpt-send);
  outline-offset: -1px;
}

.gpt__field-hint {
  font-size: 0.75rem;
  color: var(--gpt-muted);
}

.gpt__btn-danger {
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  background: #dc3545;
  color: #fff;
}

.gpt__btn-danger:hover {
  background: #c82333;
}

/* Mobile */
@media (max-width: 860px) {
  .gpt__rail {
    display: none !important;
  }

  .gpt--mobile .gpt__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: min(19rem, 86vw) !important;
    max-width: 86vw;
    opacity: 1 !important;
    pointer-events: auto;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    transition: none;
    transform: translateX(-100%);
  }

  .gpt--mobile .gpt__sidebar.is-open {
    transform: translateX(0);
    animation: gptDrawerIn 0.22s var(--gpt-ease) both;
  }

  .gpt--mobile .gpt__sidebar.is-closed {
    width: min(19rem, 86vw) !important;
    transform: translateX(-100%);
    opacity: 1 !important;
    pointer-events: none;
  }

  @keyframes gptDrawerIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
  }

  .gpt--mobile .gpt__sidebar-inner {
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .gpt__topbar {
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }

  .gpt__mode-toggle {
    transform: scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gpt__sidebar,
  .gpt--mobile .gpt__sidebar.is-open {
    transition: none;
    animation: none;
  }
}

@media (max-width: 720px) {
  .gpt__hero {
    padding: 0 1rem;
    gap: 1.5rem;
  }

  .gpt__hero-title {
    font-size: 1.5rem;
  }

  .gpt__composer-wrap--dock {
    padding: 0 1rem 0.75rem;
  }

  .gpt__product-switcher {
    right: 1rem;
    bottom: 1rem;
  }
}

/* Model picker */
.gpt__model-menu {
  position: fixed;
  z-index: 60;
  width: min(300px, calc(100vw - 1.5rem));
  padding: 0.5rem;
  border-radius: 14px;
  border: 1px solid var(--gpt-border);
  background: var(--gpt-composer);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.gpt__model-menu-title {
  margin: 0.25rem 0.5rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gpt-muted);
}

.gpt__model-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(420px, 60vh);
  overflow-y: auto;
}

.gpt__model-menu-section-title {
  margin: 0.15rem 0.5rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gpt-muted);
}

.gpt__model-menu-empty {
  margin: 0 0.5rem 0.35rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--gpt-muted);
}

.gpt__model-menu-empty code {
  font-size: 0.72rem;
}

.gpt__model-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  text-align: left;
  color: var(--gpt-text);
  transition: background 0.12s ease;
}

.gpt__model-menu-item:hover,
.gpt__model-menu-item.is-active {
  background: var(--gpt-hover);
}

.gpt__model-menu-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.gpt__model-menu-item-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.gpt__model-menu-item-desc {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--gpt-muted);
}

.gpt__model-menu-check {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--product-accent, #10a37f);
  opacity: 0;
}

.gpt__model-menu-item.is-active .gpt__model-menu-check {
  opacity: 1;
}

/* Logo layout tool */
.gpt__logo-layout-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 4.75rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--gpt-text);
  background: var(--gpt-composer);
  border: 1px solid var(--gpt-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gpt__logo-layout-btn:hover {
  background: var(--gpt-hover);
}

.gpt__logo-layout-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 7.5rem;
  z-index: 51;
  width: min(280px, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--gpt-border);
  background: var(--gpt-composer);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.gpt__logo-layout-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.gpt__logo-layout-hint {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--gpt-muted);
}

.gpt__logo-layout-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.85rem;
}

.gpt__logo-layout-scale-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem;
  align-items: center;
}

.gpt__logo-layout-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--gpt-border);
  background: var(--gpt-hover);
  color: var(--gpt-text);
  font-size: 1rem;
  line-height: 1;
}

.gpt__logo-layout-step:hover {
  background: color-mix(in srgb, var(--product-accent, #10a37f) 18%, var(--gpt-hover));
}

.gpt__logo-layout-scale input[type="range"] {
  width: 100%;
}

.gpt__logo-layout-btn[aria-pressed="true"] {
  color: #fff;
  background: var(--product-accent, #10a37f);
  border-color: transparent;
}

.gpt__logo-layout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Product switcher */
.gpt__product-switcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--product-accent, #10a37f);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gpt__product-switcher:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.gpt__modal--product {
  max-width: 420px;
}

.gpt__product-intro {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #b4b4b4;
}

.gpt__product-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.gpt__product-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a2a2a;
  cursor: pointer;
}

.gpt__product-row:hover {
  background: var(--gpt-hover);
}

.gpt__product-row--active {
  border-color: var(--product-accent, #10a37f);
  background: var(--gpt-hover);
}

.gpt__product-row-logo {
  width: 52px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: #fff;
  padding: 2px 4px;
}

.gpt__product-swatch {
  width: 0.65rem;
  height: 2rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.gpt__product-row-main {
  flex: 1;
  min-width: 0;
}

.gpt__product-row-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ececec;
}

.gpt__product-row-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--gpt-muted);
}

.gpt__product-active-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--product-accent, #10a37f);
}

.gpt__product-edit {
  padding: 0.2rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--gpt-muted);
  border-radius: 6px;
}

.gpt__product-edit:hover {
  background: var(--gpt-active);
  color: var(--gpt-text);
}

.gpt__product-add {
  width: 100%;
  padding: 0.55rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gpt-text);
  border: 1px dashed var(--gpt-border);
}

.gpt__product-add:hover {
  background: var(--gpt-hover);
}

.gpt__product-editor {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--gpt-border);
}

.gpt__product-editor-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.gpt__product-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.gpt__product-logo-preview {
  display: block;
  max-width: 120px;
  max-height: 48px;
  margin-top: 0.5rem;
  object-fit: contain;
}

.gpt__btn-primary {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--product-accent, #10a37f);
}

.gpt__btn-secondary {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--gpt-text);
  background: var(--gpt-hover);
  border: 1px solid var(--gpt-border);
}

.gpt__field input[type="color"] {
  width: 3rem;
  height: 2rem;
  padding: 0.15rem;
  border: 1px solid var(--gpt-border);
  border-radius: 8px;
  background: var(--gpt-bg);
  cursor: pointer;
}
