* {
  box-sizing: border-box;
}

:root {
  --c-main: #fff;
  --c-surface: #f3f4f6;
  --c-text: #000;
  --c-icon: #000;
  --c-muted: rgb(220, 220, 220);
  --c-placeholder: #9ca3af;
  --c-accent: #2563eb;
  --c-send: var(--c-muted);
  --edit-banner-bg: var(--c-surface);
  --edit-banner-text: var(--c-text);
  --edit-banner-hover: rgba(0, 0, 0, 0.06);
  --md-table-cell-bg: #ffffff;
  --md-table-cell-alt-bg: #ffffff;
}

html[data-theme="dark"] {
  --c-main: #1f1f1f;
  --c-surface: #262626;
  --c-text: #f5f5f5;
  --c-icon: #f5f5f5;
  --c-muted: rgb(120, 120, 120);
  --c-placeholder: #9aa0a6;
  --c-accent: #4f8cff;
  --c-send: var(--c-muted);
  --edit-banner-bg: var(--c-surface);
  --edit-banner-text: var(--c-text);
  --edit-banner-hover: rgba(255, 255, 255, 0.18);
  --md-table-cell-bg: #1f1f1f;
  --md-table-cell-alt-bg: #1f1f1f;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--c-main);
  color: var(--c-text);
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.4) var(--c-main);
}

html[data-theme="dark"] body {
  scrollbar-color: #303030 #171717;
}

body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-track {
  background: var(--c-main);
}

body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  border: 2px solid var(--c-main);
}

html[data-theme="dark"] body::-webkit-scrollbar-track {
  background: #171717;
}

html[data-theme="dark"] body::-webkit-scrollbar-thumb {
  background: #2f2f2f;
  border-color: #171717;
}

textarea::-webkit-scrollbar,
.chat::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track,
.chat::-webkit-scrollbar-track {
  background: #f3f4f6;
}

textarea::-webkit-scrollbar-thumb,
.chat::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
}

textarea,
.chat {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.4) #f3f4f6;
}

textarea::-webkit-scrollbar-button,
.chat::-webkit-scrollbar-button {
  height: 8px;
  background: #f3f4f6;
  border: none;
}

html[data-theme="dark"] textarea::-webkit-scrollbar-track,
html[data-theme="dark"] .chat::-webkit-scrollbar-track {
  background: #262626;
}

html[data-theme="dark"] textarea::-webkit-scrollbar-thumb,
html[data-theme="dark"] .chat::-webkit-scrollbar-thumb {
  background: #3a3a3a;
}

html[data-theme="dark"] textarea,
html[data-theme="dark"] .chat {
  scrollbar-color: #3a3a3a #262626;
}

html[data-theme="dark"] textarea::-webkit-scrollbar-button,
html[data-theme="dark"] .chat::-webkit-scrollbar-button {
  height: 8px;
  background: #262626;
  border: none;
}


.sidebar {
  position: fixed;
  z-index: 55;
  top: 0;
  left: 0;
  height: 100%;
  width: 280px;
  background: var(--c-main);
  border-right: 1px solid var(--c-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateX(-100%);
  transition: transform 0.25s;
}

.sidebar.is-open {
  transform: translateX(0);
}

.side-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 8px;
  font-weight: 400;
}

.side-head__icon {
  flex-shrink: 0;
  display: inline-flex;
  color: currentColor;
}

.side-head .ico-btn {
  margin-left: auto;
  padding: 6px;
}

.side-actions {
  display: grid;
  gap: 8px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--c-surface);
}

.side-actions .side-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--c-text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.side-actions .side-btn:hover {
  background: var(--c-surface);
}

.chat-list {
  flex: 1;
  overflow: auto;
  padding: 10px 8px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--c-text);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  font: inherit;
}

.chat-item:hover {
  background: var(--c-surface);
}

.chat-item.is-active {
  background: var(--c-surface);
  font-weight: 400;
}

.chat-item.is-renaming {
  background: var(--c-surface);
  cursor: text;
}

.chat-item.is-renaming {
  align-items: stretch;
}

.chat-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
  flex: 0 0 auto;
}

.chat-item__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.chat-item__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item__rename-input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--c-text);
  outline: none;
  padding: 0;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.chat-item__rename-input::selection {
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
}

.ctx-menu {
  position: fixed;
  z-index: 150;
  min-width: 194px;
  background: var(--c-main);
  border: 1px solid var(--c-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 6px;
  display: none;
}

.ctx-menu button {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--c-text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.ctx-menu__separator {
  height: 1px;
  margin: 6px 0;
  background: var(--c-surface);
}

.ctx-menu button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ctx-menu button:hover {
  background: var(--c-surface);
}

.ctx-menu button.danger {
  color: #dc2626;
}

.ctx-menu button.danger:hover {
  background: rgba(220, 38, 38, 0.12);
}

html[data-theme="dark"] .ctx-menu button.danger {
  color: #ef4444;
}

html[data-theme="dark"] .ctx-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

.sb-dock {
  position: fixed;
  z-index: 70;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: left 0.25s;
}

.ico-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--c-icon);
  border-radius: 10px;
  cursor: pointer;
}

.ico-btn:hover {
  background: var(--c-surface);
}

.ico-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor !important;
  stroke: none !important;
}

#icoNew svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
  stroke: currentColor;
  fill: currentColor;
  vector-effect: non-scaling-stroke;
}

.ico-btn .label {
  display: none;
}

.sb-dock.is-open .ico-btn .label {
  display: inline;
}

.edit-banner {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 5px 16px;
  border-radius: 12px 12px 0 0;
  background: var(--edit-banner-bg);
  color: var(--edit-banner-text);
  border: 0;
  box-shadow: none;
  width: max-content;
  font-size: 0.92rem;
  transform: translateY(1px);
}

.dock .edit-banner {
  align-self: flex-start;
  margin: 0 0 0 15px;
}

.edit-banner:not([hidden]),
.edit-banner.is-visible {
  display: flex;
}

.edit-banner__text {
  flex: 0 1 auto;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-banner__label {
  margin-right: 8px;
}

.edit-banner__thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  object-fit: cover;
  image-rendering: pixelated;
}

.edit-banner__close {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.15s ease, transform 0.15s ease;
}

.edit-banner__close:hover {
  background: var(--edit-banner-hover);
  transform: translateY(-1px);
}

.edit-banner__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.edit-banner__close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] .edit-banner {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .edit-banner__close:hover {
  background: var(--edit-banner-hover);
}

.chat {
  width: min(760px, calc(100% - 32px));
  margin: 18px auto 0;
  padding-top: 120px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: calc(500px + env(safe-area-inset-bottom));
  font-size: 120%;
  position: relative;
  z-index: 0;
}

.msg {
  display: flex;
  width: 100%;
  position: relative;
  z-index: 0;
}

.msg .body {
  max-width: 100%;
}

.msg.user {
  justify-content: flex-end;
}

.msg.user .body {
  max-width: 60%;
}

.msg.user .bubble {
  background: var(--c-surface);
  border-radius: 16px;
  padding: 4px 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.06);
}

.msg.assistant {
  justify-content: flex-start;
}

.msg.assistant .body {
  max-width: 100%;
  flex: 1;
  width: 100%;
}

.model-card {
  position: relative;
  z-index: 1;
  background: var(--c-surface);
  border-radius: 24px;
  padding: 16px 18px 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

html[data-theme="dark"] .model-card {
  background: var(--c-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.model-card__layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  width: 100%;
}

.model-card--texture-only {
  width: min(320px, 95vw);
  align-self: center;
  padding: 18px;
}

.texture-card__preview {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 10px;
}

.model-card__viewport {
  position: relative;
  width: min(230px, 45vw);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
  overflow: hidden;
}

html[data-theme="dark"] .model-card__viewport {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5);
}

.model-card__viewer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-card__viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
}

.model-card__info {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 240px;
}

.model-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  width: 100%;
}

.model-card__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--c-icon);
  flex: 0 0 auto;
}

.model-card__title svg {
  width: 20px;
  height: 20px;
}

.model-card__meta-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--c-text);
  white-space: nowrap;
}

.model-card__meta-text+.model-card__meta-text {
  margin-left: 33px;
}

.model-card__using {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--c-text);
  margin-left: 15px;
}

.model-card__using-label {
  display: inline-flex;
  align-items: center;
  font-weight: inherit;
}

.model-card__using-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: inherit;
}

.model-card__using-icon svg {
  width: 100%;
  height: 100%;
}

.model-card__details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.model-card__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.model-card__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-card__section--texture {
  flex: 0 0 auto;
  align-items: center;
  text-align: center;
}

.model-card__section--json {
  flex: 1 1 260px;
  min-width: 220px;
  align-items: stretch;
}

.model-card__section--json .model-card__label {
  align-self: center;
  text-align: center;
}

.model-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--c-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
}

.model-card__label span,
.model-card__label a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.model-card__label span {
  color: var(--c-placeholder);
}

.model-card__label a {
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.model-card__texture {
  width: 145px;
  height: 145px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.model-card--texture-only .model-card__texture {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 18px;
  border-width: 1.5px;
  margin: 0 auto;
}

html[data-theme="dark"] .model-card__texture {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.6);
}

html[data-theme="dark"] .model-card--texture-only .model-card__texture {
  background: rgba(15, 23, 42, 0.75);
}

.model-card__texture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.model-card__texture span {
  font-size: 0.8rem;
  color: var(--c-placeholder);
  text-align: center;
  padding: 0 8px;
}

.texture-card__label {
  margin: 10px auto 0;
  display: flex;
  justify-content: center;
}

.model-card__json {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.04);
  font-family: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--c-text);
  min-height: 148px;
  max-height: 148px;
  text-align: left;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

html[data-theme="dark"] .model-card__json {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.12);
}

.model-card__description {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--c-text);
}

.model-card__description.is-empty {
  font-style: italic;
  color: var(--c-placeholder);
}

.model-card__error {
  text-align: center;
  font-size: 0.9rem;
  color: #ef4444;
  padding: 24px 0;
}

.model-card__loader {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
}

.loader-grid {
  width: 140px;
  height: 140px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
}

.loader-cell {
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-square {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: #ffffff;
  opacity: 0.25;
  animation: loader-pulse 1.2s infinite ease-in-out;
}

.loader-square.sq1 {
  animation-delay: 0s;
}

.loader-square.sq2 {
  animation-delay: 0.2s;
}

.loader-square.sq3 {
  animation-delay: 0.4s;
}

.loader-square.sq4 {
  animation-delay: 0.6s;
}

@keyframes loader-pulse {

  0%,
  100% {
    opacity: 0.25;
  }

  50% {
    opacity: 1;
  }
}


.md,
.bubble {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.md pre {
  max-width: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.md h1 {
  font-size: 1.6em;
  margin: 0.4em 0;
}

.md h2 {
  font-size: 1.35em;
  margin: 0.5em 0;
}

.md h3 {
  font-size: 1.2em;
  margin: 0.6em 0;
}

.md h4 {
  font-size: 1.05em;
  margin: 0.7em 0;
}

.md p {
  margin: 0.5em 0;
}

.md ul {
  padding-left: 1.75em;
  margin-left: 0;
}

.md li {
  margin-left: 0;
}

.md blockquote {
  margin: 0.6em 0;
  padding: 0.6em 1em;
  border-left: 3px solid #e5e7eb;
  background: #fafafa;
  border-radius: 8px;
}

html[data-theme="dark"] .md blockquote {
  background: #1f1f1f;
  border-left-color: #2f2f2f;
}

.md table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 0.95em;
  overflow: hidden;
  border-radius: 10px;
}

.md thead th {
  background: rgba(148, 163, 184, 0.2);
  font-weight: 600;
}

.md th,
.md td {
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 6px 10px;
  text-align: left;
  background: var(--md-table-cell-bg);
}

.md tbody tr:nth-child(even) td {
  background: var(--md-table-cell-alt-bg);
}

html[data-theme="dark"] .md thead th {
  background: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .md th,
html[data-theme="dark"] .md td {
  border-color: rgba(148, 163, 184, 0.35);
  background: var(--md-table-cell-bg);
  color: var(--c-text);
}

html[data-theme="dark"] .md tbody tr:nth-child(even) td {
  background: var(--md-table-cell-alt-bg);
}

.md table tr>*:not(:first-child)[style*="#151a25" i],
.md table tr>*:not(:first-child)[style*="rgb(21, 26, 37)"],
.md table tr>*:not(:first-child)[style*="rgb(21,26,37)"] {
  background: var(--md-table-cell-bg) !important;
  color: var(--c-text);
}

.md a {
  color: var(--c-accent);
  text-decoration: none;
}

.md a:hover {
  text-decoration: underline;
}

.md hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 0.8em 0;
}

html[data-theme="dark"] .md hr {
  border-top-color: #2f2f2f;
}

.md code.inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f6f8fa;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  font-size: 0.95em;
}

html[data-theme="dark"] .md code.inline {
  background: #262b33;
}

.md pre {
  background: var(--c-surface);
  color: var(--c-text);
  padding: 12px 14px;
  border-radius: 12px;
  overflow: auto;
}

.md pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.tok-kw {
  color: rgb(147, 197, 253);
}

.tok-str {
  color: rgb(252, 165, 165);
}

.tok-num {
  color: rgb(252, 211, 77);
}

.tok-com {
  color: rgb(148, 163, 184);
  font-style: italic;
}

.dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-48%) scale(1.045, 1.1);
  transform-origin: bottom center;
  width: min(760px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  z-index: 120;
}

.composer {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--c-surface);
  border-radius: 16px;
  position: relative;
  z-index: 2;
}

.input {
  min-height: 35px;
  max-height: 160px;
  resize: none;
  border: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  font-size: 1.08em;
  padding: 4px 6px;
  color: var(--c-text);
}

.input::placeholder {
  font: inherit;
  font-style: medium;
  font-weight: 400;
  color: var(--c-placeholder);
  opacity: 1;
  font-size: 1.08em;
}

.controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 8px;
}

.model-group.is-locked .pill {
  pointer-events: none;
  opacity: 0.6;
  cursor: not-allowed;
}

.model-group.is-locked .model-popover {
  display: none !important;
}

.quality-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--c-surface);
  background: var(--c-main);
  color: var(--c-icon);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.quality-trigger:hover {
  background: var(--c-surface);
}

.quality-trigger:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.quality-trigger.is-boosted {
  border-color: rgba(37, 99, 235, 0.6);
  color: var(--c-accent);
}

.quality-trigger.is-open {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.45);
}

.quality-trigger[hidden] {
  display: none;
}

.quality-trigger svg {
  width: 20px;
  height: 20px;
  display: block;
}

.quality-trigger__label {
  font-weight: 400;
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  background: var(--c-main);
  border-radius: 999px;
  border: 1px solid var(--c-surface);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  color: var(--c-text);
  font-weight: 400;
}

.pill:hover {
  background: var(--c-surface);
}

.pill:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.pill span {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.pill svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
  stroke: currentColor;
  fill: none;
}

.model-group[data-open="true"] .pill svg {
  transform: rotate(180deg);
}

.model-popover {
  position: absolute;
  bottom: 44px;
  right: 0;
  min-width: 200px;
  max-width: 220px;
  background: var(--c-main);
  border: 1px solid var(--c-surface);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 5px 14px rgba(15, 23, 42, 0.08);
  padding: 4px 0;
  display: none;
  z-index: 90;
}

.model-group[data-open="true"] .model-popover {
  display: block;
}

.model-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0;
}

.model-divider {
  height: 1px;
  margin: 6px 12px;
  background: var(--c-surface);
  border-radius: 999px;
}

.model-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--c-text);
  font: inherit;
  border-radius: 12px;
}

.model-opt:hover {
  background: rgba(148, 163, 184, 0.14);
}

.model-opt[aria-selected="true"] {
  background: rgba(37, 99, 235, 0.12);
}

html[data-theme="dark"] .model-opt:hover {
  background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .model-opt[aria-selected="true"] {
  background: rgba(79, 140, 255, 0.16);
}

.model-opt__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-opt__title {
  font-weight: 400;
  font-size: 0.93rem;
}

.model-opt__desc {
  font-size: 0.8rem;
  color: var(--c-placeholder);
}

.model-opt__accent {
  font-style: italic;
  color: inherit;
}

.quality-popover {
  position: absolute;
  bottom: 44px;
  left: 0;
  transform: translateX(-8px);
  background: var(--c-main);
  border: 1px solid var(--c-surface);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 5px 14px rgba(15, 23, 42, 0.08);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 45;
  min-width: 200px;
}

.quality-popover[data-open="true"] {
  display: flex;
}

html[data-theme="dark"] .quality-popover {
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.44), 0 8px 20px rgba(0, 0, 0, 0.28);
}

.quality-mode {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--c-text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}

.quality-mode:hover {
  background: rgba(148, 163, 184, 0.14);
}

.quality-mode.is-active {
  background: rgba(37, 99, 235, 0.14);
  color: var(--c-accent);
}

html[data-theme="dark"] .quality-mode:hover {
  background: rgba(148, 163, 184, 0.18);
}

.quality-mode__labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.quality-mode__name {
  font-weight: 400;
  font-size: 0.9rem;
}

.quality-mode__cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--c-placeholder);
}

.quality-mode.is-active .quality-mode__cost {
  color: var(--c-accent);
}

.ticket-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quality-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.quality-icon__needle {
  transform-origin: 8px 10.4px;
  transform-box: view-box;
  transition: transform 0.2s ease;
}

.quality-icon[data-mode="fast"] .quality-icon__needle {
  transform: rotate(-60deg);
}

.quality-icon[data-mode="medium"] .quality-icon__needle {
  transform: rotate(0deg);
}

.quality-icon[data-mode="elaborate"] .quality-icon__needle {
  transform: rotate(60deg);
}

.send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--c-muted);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background-color 0.2s;
}

.send.is-active {
  background: var(--c-icon);
}

.send.is-loading {
  background: var(--c-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

.send.is-loading .glyph {
  font-size: 0;
  color: transparent;
  transform: none;
  width: 18px;
  height: 18px;
}

.send.is-loading .glyph::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

.send .glyph {
  font-size: 19px;
  line-height: 1;
  display: inline-block;
  font-weight: 700;
  color: #fff;
  transform: rotate(-90deg);
  transform-origin: center;
}

html[data-theme="dark"] .send {
  background: var(--c-muted);
}

html[data-theme="dark"] .send.is-active {
  background: #fff;
}

html[data-theme="dark"] .send .glyph {
  color: var(--c-main);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pill,
.pill span,
.pill svg,
.send,
.send .glyph,
.model-opt {
  user-select: none;
}

.input.is-empty {
  user-select: none;
}

.input.is-empty::selection {
  background: transparent;
}

.msg.user .bubble .md p {
  margin: 0.25em 0;
}

.assist-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.08em;
  color: var(--c-text);
  margin: 2px 0 6px;
}

.assist-meta .bulb {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
}

.copy-line {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  pointer-events: none;
}

.copy-line>* {
  pointer-events: auto;
}

.copy-line--model {
  margin-top: 12px;
}

.msg.assistant .copy-line {
  justify-content: flex-start;
}

.msg.user .copy-line {
  justify-content: flex-end;
}

.copy-btn,
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid transparent;
  background: none;
  border-radius: 8px;
  padding: 4px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  color: var(--c-icon);
  position: relative;
  z-index: 2;
}

.copy-btn svg,
.mini-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-btn.edit-btn svg {
  width: calc(14px * 1.05);
  height: calc(14px * 1.05);
}

.copy-btn:hover,
.mini-btn:hover {
  background: var(--c-surface);
  border-color: var(--c-surface);
}

.copy-btn.copied {
  background: var(--c-surface);
  border-color: var(--c-surface);
}

.copy-btn.copied svg {
  stroke: currentColor;
}

.copy-btn.copied {
  color: var(--c-icon);
}

.trends-thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95em;
  color: var(--c-text);
  background: none;
  padding: 0;
  border-radius: 0;
  position: relative;
}

.trends-thinking__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.trends-thinking__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.trends-thinking__icon svg {
  width: 24px;
  height: 24px;
  animation: spin 1.6s linear infinite;
}

.trends-thinking__text {
  transition: opacity 0.3s ease;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 360px;
}

.trends-thinking__text.is-fading {
  opacity: 0;
}

.side-head .ico-btn svg,
.side-actions .side-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.sb-open .sb-dock #icoNew,
body.sb-open .sb-dock #icoSettings {
  opacity: 0;
  pointer-events: none;
}

.composer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  flex-wrap: wrap;
}

.ticket-display {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--c-text);
  font-size: 0.9em;
  height: 36px;
}

.ticket-display .count {
  font-weight: 500;
}

.ticket-display svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.char-limit {
  font-size: 0.85em;
  color: var(--c-text);
  opacity: 0.6;
  line-height: 1.2;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.modal-card {
  position: relative;
  background: var(--c-main);
  border: 1px solid var(--c-surface);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 14px;
  min-width: 280px;
  max-width: 90%;
}

.modal-title {
  font-weight: 400;
  margin-bottom: 8px;
}

.modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-surface);
  background: var(--c-main);
  color: var(--c-text);
  border-radius: 8px;
  font: inherit;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn {
  border: 1px solid var(--c-surface);
  background: var(--c-main);
  color: var(--c-text);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.btn:hover {
  background: var(--c-surface);
}

.btn.primary {
  border-color: var(--c-accent);
}


.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--c-muted);
  border-top-color: var(--c-icon);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.request-error {
  border: 1px solid #ef4444;
  border-radius: 14px;
  background: transparent;
  color: #ef4444;
  padding: 20px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 86px;
  line-height: 1.4;
}

html[data-theme="dark"] .request-error {
  border-color: rgba(239, 68, 68, 0.8);
  color: rgba(248, 113, 113, 0.95);
}

.msg .request-error {
  width: 100%;
}

.request-error__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.request-error__icon svg {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.request-error__text {
  flex: 1;
  display: block;
}

.dock-note {
  font-size: 0.85em;
  color: var(--c-placeholder);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 2px 2px;
}

.dock-note svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-notice {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 96px;
  width: min(760px, calc(100% - 32px));
  z-index: 80;
  pointer-events: none;
}

.chat-notice__card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--c-main);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.25),
    0 6px 20px rgba(0, 0, 0, .08);
  color: var(--c-text);
  font-size: 0.966em;
  pointer-events: auto;
}

.chat-notice__row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.chat-notice__icon svg {
  width: calc(16px * 1.25);
  height: calc(16px * 1.25);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}

.chat-notice b {
  font-weight: 400;
}

.chat-notice {
  transition: opacity .18s ease, transform .18s ease;
}

.chat-notice.is-hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.98);
  pointer-events: none;
}

.chat-notice__btn {
  color: #000;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 1px solid var(--c-surface);
  background: color-mix(in oklab, var(--c-main) 85%, transparent);
  backdrop-filter: saturate(150%) blur(60px);
  border-radius: 12px;
  padding: calc(10px * 1.05) calc(20px * 1.05);
  font-size: calc(1.2em * 1.05);
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.chat-notice__btn:hover {
  filter: brightness(1.05);
}


.code-block {
  position: relative;
  margin: 8px 0;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.8em;
  color: var(--c-placeholder);
  background: color-mix(in oklab, var(--c-surface) 85%, transparent);
  border: 1px solid var(--c-surface);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.code-lang {
  font-weight: 400;
  letter-spacing: .02em;
}

.code-block pre {
  margin: 0;
  border: 1px solid var(--c-surface);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.code-copy-btn {
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-icon);
  border-radius: 6px;
}

.code-copy-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.code-copy-btn:hover {
  background: var(--c-surface);
}

.color-picker,
.icon-picker {
  position: fixed;
  z-index: 150;
  display: none;
  flex-direction: column;
  background: var(--c-main);
  border: 1px solid var(--c-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 18px 42px rgba(15, 23, 42, 0.18);
  border-radius: 14px;
  padding: 14px;
  width: 280px;
  gap: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.color-picker.is-open,
.icon-picker.is-open {
  opacity: 1;
  transform: translateY(0);
}

.color-picker__title,
.icon-picker__title {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-placeholder);
}

.icon-picker {
  width: 260px;
  gap: 12px;
}

.icon-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
}

.icon-picker__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--c-surface);
  background: var(--c-main);
  color: var(--c-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.icon-picker__btn:hover {
  transform: translateY(-1px);
  background: var(--c-surface);
}

.icon-picker__btn.is-active {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(37, 99, 235, 0.08);
}

html[data-theme="dark"] .icon-picker__btn.is-active {
  background: rgba(79, 140, 255, 0.12);
}

.icon-picker__btn svg {
  width: 28px;
  height: 28px;
  display: block;
}

.icon-picker__btn:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.icon-picker__clear {
  align-self: flex-end;
  border: 0;
  background: transparent;
  color: var(--c-placeholder);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 0;
}

.icon-picker__clear:hover {
  color: var(--c-text);
}

.icon-picker__clear:disabled {
  opacity: 0.45;
  cursor: default;
}

.color-picker__gradient {
  position: relative;
  height: 49px;
  border-radius: 12px;
  border: 1px solid var(--c-surface);
  overflow: hidden;
  background: var(--c-surface);
}

.color-picker__gradient-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--c-surface);
  pointer-events: none;
  z-index: 0;
}

.color-picker__gradient-handles {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

html[data-theme="dark"] .color-picker__gradient {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .color-picker__saturation input[type="range"] {
  background: linear-gradient(90deg, #3b3b3b 0%, var(--c-accent) 100%);
}

html[data-theme="dark"] .color-picker__saturation input[type="range"]::-webkit-slider-thumb {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
}

html[data-theme="dark"] .color-picker__saturation input[type="range"]::-moz-range-thumb {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
}

.color-picker__handle {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  background: var(--c-main);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.color-picker__handle::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: currentColor;
}

.color-picker__handle:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.color-picker__handle.is-active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 4px 10px rgba(15, 23, 42, 0.25);
}

html[data-theme="dark"] .color-picker__handle {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.5);
}

.color-picker__canvas {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0));
}

.color-picker__canvas canvas {
  width: 100%;
  height: 180px;
  display: block;
  cursor: crosshair;
}

.color-picker__canvas-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.color-picker__hue input[type="range"] {
  width: 100%;
  appearance: none;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg,
      #ff0000 0%,
      #ff9900 16%,
      #ccff00 32%,
      #00ff66 48%,
      #00ccff 64%,
      #6600ff 80%,
      #ff0099 100%);
  outline: none;
  margin: 0;
}

.color-picker__hue input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  background: var(--c-main);
  cursor: pointer;
}

.color-picker__hue input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  background: var(--c-main);
  cursor: pointer;
}

.color-picker__saturation {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 0;
}

.color-picker__saturation-value {
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.color-picker__saturation input[type="range"] {
  width: 100%;
  appearance: none;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffffff 0%, #2563eb 100%);
  outline: none;
}

.color-picker__saturation input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.color-picker__saturation input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.color-picker__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  margin-bottom: 4px;
}

.color-picker__item {
  display: flex;
  width: 100%;
}

.color-picker__item-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--c-surface);
  background: var(--c-main);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.color-picker__item-main.is-active {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.08);
  box-shadow: none;
}

.color-picker__item-main:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}

.color-picker__item-swatch {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--c-surface);
  background: var(--c-surface);
}

.color-picker__item input {
  flex: 1;
  font: inherit;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-text);
  text-transform: uppercase;
}

.color-picker__item input:focus {
  outline: none;
}

.color-picker__remove {
  width: 30px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 0;
  background: rgba(0, 0, 0, 0.04);
  color: var(--c-icon);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.color-picker__remove:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  transform: translateY(-1px);
}

html[data-theme="dark"] .color-picker__remove {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
}

html[data-theme="dark"] .color-picker__remove:hover {
  background: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
}

.color-picker__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.color-picker__actions button {
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.color-picker__actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(37, 99, 235, 0.15);
}

.color-picker__actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.color-picker__actions .primary {
  background: var(--c-accent);
  color: #fff;
}

.color-picker__actions .primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.color-picker__reset {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0;
  background: var(--c-accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  margin-top: 2px;
}

.color-picker__reset:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #1d4ed8;
}

.color-picker__reset:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: rgba(37, 99, 235, 0.35);
  color: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .color-picker__item-main {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .color-picker__item-main.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .color-picker__item-main:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .color-picker__item-swatch {
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .color-picker__preview-box,
html[data-theme="dark"] .color-picker__item-swatch {
  border-color: rgba(255, 255, 255, 0.15);
}

.model-controls {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 8px;
}

.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--c-surface);
  background: var(--c-main);
  color: var(--c-icon);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.search-toggle:hover {
  background: var(--c-surface);
}

.search-toggle:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.search-toggle.is-active {
  /* Preserve active styling without overpowering the buttons */
  border-color: rgba(37, 99, 235, 0.6);
  color: var(--c-accent);
  background: rgba(37, 99, 235, 0.08);
}

.search-toggle[hidden] {
  display: none;
}

.search-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.search-toggle__label {
  font-weight: 400;
  font-size: 0.9rem;
}


[data-theme="dark"] .chat-notice__btn {
  color: #fff;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.settings-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.45);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.settings-overlay.is-open .settings-overlay__backdrop {
  opacity: 1;
}

.settings-overlay__dialog {
  position: relative;
  width: min(900px, calc(100% - 80px));
  height: min(92vh, 760px);
  background: var(--c-main);
  border-radius: 24px;
  border: 1px solid var(--c-surface);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.settings-overlay.is-open .settings-overlay__dialog {
  opacity: 1;
  transform: translateY(0);
}

.settings-overlay__close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.04);
  color: var(--c-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.settings-overlay__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.settings-overlay__close:hover {
  background: rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

html[data-theme="dark"] .settings-overlay__dialog {
  background: rgba(23, 23, 23, 0.98);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.65);
}

html[data-theme="dark"] .settings-overlay__close {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .settings-overlay__close:hover {
  background: rgba(79, 140, 255, 0.35);
}

body.has-settings-open {
  overflow: hidden;
}

.settings-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-panel__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 40px 40px 52px;
  width: 100%;
  max-width: none;
  margin: 0;
}

#settingsHeading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 auto 24px;
  text-align: center;
  font-size: 1.85em;
  font-weight: 600;
  color: var(--c-text);
}

#settingsHeading svg {
  width: 28px;
  height: 28px;
  color: currentColor;
  flex-shrink: 0;
}

.settings-panel__body .section--logout {
  margin-top: auto;
  padding-top: 24px;
  margin-bottom: 0;
}

.settings-panel__body .section--inline {
  margin-top: 12px;
}

.settings-panel__body h1 {
  font-size: 1.5em;
  margin: 0 0 12px;
}

.settings-panel__body h2 {
  font-size: 1.15em;
  margin: 0 0 8px;
}

.settings-panel .section-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  margin: 0 auto 16px;
}

.settings-panel .section-heading svg {
  width: 24px;
  height: 24px;
}

.settings-panel .section-subtitle {
  font-size: 0.95em;
  font-weight: 600;
  text-transform: none;
  margin: 20px 0 8px;
  color: var(--c-text);
}

.settings-panel .section-subtitle:first-of-type {
  margin-top: 4px;
}

.settings-panel__signin {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 48px;
  margin-bottom: 20px;
}

.settings-panel__signin.is-empty {
  display: none;
}

.settings-panel__body .section {
  margin-bottom: 12px;
  padding-bottom: 0;
  position: relative;
}

.settings-panel__body .section:not(:last-child)::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin: 36px 0 8px;
  background: linear-gradient(90deg, transparent, rgba(209, 213, 219, 0.9), transparent);
  opacity: 0.85;
}

html[data-theme="dark"] .settings-panel__body .section:not(:last-child)::after {
  background: linear-gradient(90deg, transparent, rgba(82, 82, 91, 0.85), transparent);
}

.settings-panel .theme-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-panel .theme-buttons button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--c-surface);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  font-size: 0.95em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-panel .theme-buttons button.active {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

.settings-panel .theme-buttons svg {
  width: 20px;
  height: 20px;
}

.settings-panel .theme-buttons .theme-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 10px;
  opacity: 0.1;
  transition: opacity 0.2s ease;
  color: var(--c-text);
}

.settings-panel .theme-buttons .theme-social:hover {
  opacity: 0.6;
}

.settings-panel .theme-buttons .theme-social svg {
  width: 30px;
  height: 30px;
}

.settings-panel .section--custom .theme-account {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.settings-panel .section--custom .theme-account__column {
  flex: 1 1 280px;
}

.settings-panel .section--custom .theme-account__column--theme {
  min-width: 280px;
}

.settings-panel .section--custom .theme-account__column--account {
  flex: 0 0 auto;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  text-align: right;
  align-self: flex-start;
}

.settings-panel .section--custom .theme-account__column--account .danger-btn {
  min-width: 0;
  width: auto;
  align-self: flex-end;
  margin-top: 0;
}

.settings-panel__body .section--inline .danger-btn {
  min-width: 0;
  width: auto;
  align-self: flex-start;
  padding-right: 15px;
}

.settings-panel .danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #b91c1c;
  background: #dc2626;
  color: #fff;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: background 0.15s ease;
}

.settings-panel .danger-btn:hover {
  background: #b91c1c;
}

.settings-panel .danger-btn svg {
  width: 20px;
  height: 20px;
}

.settings-panel #ticketsSection {
  text-align: left;
}

.settings-panel .ticket-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--c-text);
  font-size: 2em;
  font-weight: 600;
  margin: 0 auto 16px;
  max-width: 320px;
}

.settings-panel .ticket-card .units {
  font-size: 0.5em;
  text-transform: lowercase;
  color: var(--c-placeholder);
}

.settings-panel .ticket-card svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-panel #ticketsSection .ticket-analytics {
  margin-top: 24px;
  text-align: left;
}

.settings-panel #ticketsSection .ticket-analytics .analytics-header {
  margin-bottom: 12px;
}

.settings-panel .section--shop .purchase-grid {
  margin-top: 8px;
}

.settings-panel .analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.settings-panel .analytics-header .stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-panel .analytics-header .stats .total {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.4em;
  font-weight: 600;
}

.settings-panel .analytics-header .stats .total .units {
  font-size: 0.7em;
  font-weight: 400;
  margin-left: 4px;
}

.settings-panel .analytics-header .stats .max {
  font-size: 0.85em;
  color: var(--c-accent);
}

.settings-panel .analytics-header svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-panel .range-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-panel .range-selector button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--c-muted);
  background: transparent;
  color: var(--c-text);
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.settings-panel .range-selector button.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

.settings-panel .analytics-chart {
  position: relative;
  height: 220px;
  margin-top: 12px;
}

.settings-panel .analytics-chart .bars {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  height: calc(100% - 20px);
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.settings-panel .analytics-chart .bar {
  flex: 1;
  position: relative;
  background: var(--c-accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: opacity 0.15s ease;
}

.settings-panel .analytics-chart .bar[data-count="0"] {
  background: var(--c-muted);
}

.settings-panel .analytics-chart .bar:hover {
  opacity: 1;
}

.settings-panel .analytics-chart .bar:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-main);
  color: var(--c-text);
  border: 1px solid var(--c-surface);
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: pre;
  font-size: 0.75em;
  z-index: 5;
  opacity: 1;
}

.settings-panel .analytics-chart .baseline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  border-bottom: 1px dashed var(--c-muted);
}

.settings-panel .analytics-chart .limit-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dotted var(--c-accent);
}

.settings-panel .analytics-chart .labels {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75em;
  color: var(--c-placeholder);
  pointer-events: none;
}

.settings-panel .purchase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
}

.settings-panel .package-card {
  position: relative;
  display: block;
  border-radius: 20px;
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--pack-start, #2563eb), var(--pack-end, #3b82f6));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.settings-panel .package-card[data-tier="starting"] {
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
}

.settings-panel .package-card[data-tier="basic"] {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.settings-panel .package-card[data-tier="rocket"] {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.settings-panel .package-card[data-tier="space"] {
  background: linear-gradient(135deg, #0891b2, #0f766e);
}

.settings-panel .package-card[data-tier="legendary"] {
  background: linear-gradient(135deg, #c026d3, #e11d48);
}

.settings-panel .package-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.settings-panel .package-card.package-card--loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: progress;
}

.settings-panel .package-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.settings-panel .package-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-right: 150px;
  position: relative;
  z-index: 1;
  user-select: none;
}

.settings-panel .package-card__tier {
  font-size: 1.4em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: 'Joker', 'Comic Sans MS', cursive;
}

.settings-panel .package-card__price {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.3em;
  font-weight: 600;
  flex-wrap: wrap;
}

.settings-panel .package-card__price-value,
.settings-panel .package-card__price-meta {
  font-weight: 700;
}

.settings-panel .package-card__price-meta {
  font-size: 0.95em;
  letter-spacing: 0.02em;
  opacity: 0.95;
}

.settings-panel .package-card__ticket-icon {
  display: inline-flex;
  align-items: center;
}

.settings-panel .package-card__ticket-icon .ticket-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.settings-panel .package-card__divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  margin: 6px 0 4px;
}

.settings-panel .package-card__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95em;
}

.settings-panel .package-card__features li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-panel .package-card__saved {
  margin-top: 8px;
  font-size: 0.95em;
  font-weight: 600;
  display: block;
}

.settings-panel .package-card__art {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 3;
}

.settings-panel .package-card__art img {
  width: 130px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.settings-panel .package-card .price {
  font-weight: 700;
  font-size: 1.05em;
}

.settings-panel .package-card button {
  align-self: stretch;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: #fff;
  color: var(--c-accent);
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-panel .package-card button:hover {
  background: rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] .settings-panel .analytics-chart .bar:hover::after {
  background: rgba(20, 20, 20, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
  .settings-overlay {
    padding: 12px;
  }

  .settings-overlay__dialog {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .settings-panel__body {
    padding: 28px 20px 36px;
  }
}

.user-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 20px;
  background: var(--c-main);
  border: 1px solid var(--c-surface);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  z-index: 70;
  transition: transform 0.25s ease, opacity 0.2s ease;
  overflow: visible;
  will-change: transform;
}

.user-panel.is-collapsed {
  transform: translateX(calc(100% - 16px));
  opacity: 0.95;
}

.user-panel__toggle {
  position: absolute;
  left: -16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: var(--c-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.25s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  opacity: 0.25;
}

.user-panel__toggle:hover {
  background: rgba(0, 0, 0, 0.12);
  opacity: 0.5;
}

.user-panel__toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s ease;
}

.user-panel.is-collapsed .user-panel__toggle svg {
  transform: rotate(180deg);
}

html[data-theme="dark"] .user-panel__toggle {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .user-panel__toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.user-panel .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-muted);
  font-weight: 600;
  color: var(--c-text);
  background-size: cover;
  background-position: center;
}

.user-panel .details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-panel .details .name {
  font-weight: 600;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-panel .details .sub {
  font-size: 0.8em;
  color: var(--c-placeholder);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.user-panel__signin {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.user-panel__signin .google-signin {
  display: flex;
}

@font-face {
  font-family: 'Joker';
  src: url('joker.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body.payment-result {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.3), transparent 50%),
    #0f172a;
  color: #e2e8f0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.payment-result__card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.payment-result__card h1 {
  margin: 0 0 12px;
  font-size: 1.8rem;
  font-weight: 600;
  color: #f8fafc;
}

.payment-result__card p {
  margin: 0 0 20px;
  color: #cbd5f5;
  line-height: 1.5;
}

.payment-result__card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-weight: 600;
}

.provider-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
}

.provider-modal__card {
  width: min(780px, 95%);
  background: var(--c-surface, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 22px 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  color: var(--c-text, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-light .provider-modal__card {
  background: var(--c-surface, #f8fafc);
  color: var(--c-text, #0f172a);
  border-color: rgba(0, 0, 0, 0.08);
}

.provider-modal__header {
  text-align: center;
}

.provider-modal__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.provider-modal__layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: auto 1fr auto auto;
  gap: 16px;
  align-items: start;
}

.provider-modal__summary {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.provider-modal__summary-line {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.provider-modal__summary-price {
  font-weight: 800;
}

.provider-modal__summary-tickets {
  font-weight: 600;
  opacity: 0.9;
}

.provider-modal__ticket-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: -3px;
}

.provider-modal__ticket-icon .ticket-icon {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.provider-modal__divider {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.28));
  border-radius: 999px;
}

.theme-light .provider-modal__divider {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.26));
}

.provider-modal__pack {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.provider-modal__pack-name {
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  font-family: 'Joker', cursive;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.provider-modal__pack-art {
  width: min(260px, 100%);
  min-height: 190px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  position: relative;
  overflow: hidden;
  background: transparent;
  flex: 0 0 auto;
  user-select: none;
  -webkit-user-select: none;
  contain: layout paint;
  isolation: isolate;
  margin-left: auto;
  margin-right: auto;
}

.provider-modal__pack-art img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  transform: translateZ(0);
  will-change: transform;
}

.provider-modal__providers {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  grid-auto-rows: minmax(110px, 1fr);
  gap: 14px;
}

.provider-modal__currency-box {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.provider-modal__currency-label {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.provider-modal__currency-select {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
}

.provider-modal__currency-select:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.theme-light .provider-modal__currency-select {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.22);
  color: #0f172a;
}

.provider-modal__currency-hint {
  font-size: 0.85rem;
  opacity: 0.7;
}

.provider-modal__provider {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.provider-modal__provider:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.2);
}

.provider-modal__provider:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 3px;
}

.provider-modal__provider.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.provider-modal__logo {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

.provider-modal__logo-img {
  width: 72%;
  max-width: 130px;
  height: auto;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.provider-modal__logo--cycle .provider-modal__logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  max-width: 120px;
  opacity: 0;
  animation: providerLogoCycle 2.7s linear infinite;
  animation-delay: calc(var(--logo-index, 0) * 0.9s);
}

.provider-modal__actions {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.provider-modal__cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-text, #e2e8f0);
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.provider-modal__cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.theme-light .provider-modal__cancel {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border: none;
}

.theme-light .provider-modal__cancel:hover {
  background: rgba(15, 23, 42, 0.12);
}

@keyframes providerLogoCycle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }

  7.5% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  25.9% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  33.4% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
}

@media (max-width: 640px) {
  .provider-modal__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
  }

  .provider-modal__pack {
    grid-column: 1;
    grid-row: 2;
  }

  .provider-modal__providers {
    grid-column: 1;
    grid-row: 3;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .provider-modal__currency-box {
    grid-column: 1;
    grid-row: 4;
  }

  .provider-modal__actions {
    grid-column: 1;
    grid-row: 5;
    justify-content: flex-end;
  }
}
