:root {
  --bg: #121019;
  --bg-deep: #08090f;
  --panel: #191725;
  --panel-soft: #242132;
  --line: #342f42;
  --line-bright: #5a526b;
  --text: #fff8ee;
  --muted: #c3b8ca;
  --blue: #8fa8ff;
  --green: #87d4a8;
  --orange: #f4ad7a;
  --violet: #d3adff;
  --danger: #ff8a8a;
  --profile-avatar-image: url("logo2.png");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(140deg, rgba(111, 84, 125, 0.2) 0%, transparent 38%),
    linear-gradient(220deg, rgba(69, 91, 123, 0.16) 0%, transparent 44%),
    linear-gradient(180deg, #14111a 0%, var(--bg-deep) 58%, #11141b 100%);
  font: 15px/1.5 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: #8db0ff;
  text-decoration: none;
}

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

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  background: linear-gradient(180deg, rgba(18, 15, 25, 0.94), rgba(10, 11, 17, 0.95));
  backdrop-filter: blur(16px);
}

.sidebar.has-chat-history {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.brand-mark {
  color: var(--blue);
  font-size: 30px;
}

.nav-section {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 28px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
}

.nav-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}

.nav-item .nav-code-icon {
  font-size: 13px;
  letter-spacing: 0;
}

.nav-item:hover {
  border-color: rgba(143, 168, 255, 0.26);
  background: rgba(143, 168, 255, 0.1);
}

.mini-card,
.panel,
.prompt-panel,
.model-tile,
.hint-card {
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.92), rgba(18, 18, 27, 0.94));
  box-shadow: 0 22px 58px rgba(4, 5, 11, 0.34), inset 0 1px 0 rgba(255, 248, 238, 0.04);
}

.mini-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.mini-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.wallet-mini {
  display: grid;
  gap: 3px;
}

.wallet-mini > span {
  color: var(--text);
  font-weight: 800;
}

.wallet-mini small {
  display: block;
  font-size: 12px;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  height: 64px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: rgba(15, 13, 20, 0.72);
  backdrop-filter: blur(18px);
}

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

.content {
  padding: 16px 18px;
}

.button,
.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--text);
  background: var(--panel-soft);
  cursor: pointer;
  font: inherit;
}

.button.primary,
.btn,
button.primary {
  border-color: rgba(177, 192, 255, 0.55);
  background: linear-gradient(180deg, #93a8ff, #5f73df);
  box-shadow: 0 10px 28px rgba(95, 115, 223, 0.26);
}

.button.ghost,
.btn.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.button.full,
.btn.full {
  width: 100%;
}

.link-button {
  min-height: auto;
  border: 0;
  padding: 4px 0 0;
  justify-content: flex-start;
  color: #8db0ff;
  background: transparent;
}

.caption,
.eyebrow {
  color: #8db0ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.muted,
small {
  color: var(--muted);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: rgba(63, 115, 255, 0.12);
}

.flash.danger {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.12);
}

.flash.success {
  border-color: rgba(57, 217, 138, 0.5);
  background: rgba(57, 217, 138, 0.12);
}

.workspace-layout,
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.chat-layout {
  grid-template-columns: 240px minmax(0, 1fr) 270px;
  min-height: calc(100vh - 96px);
}

.workspace-main {
  min-width: 0;
}

.right-rail {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.right-rail > .panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel {
  padding: 18px;
}

.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.page-heading p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
}

.hint-card {
  min-height: 70px;
  padding: 16px;
  color: var(--text);
}

.prompt-panel {
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 24px 70px rgba(7, 7, 14, 0.34), inset 0 1px 0 rgba(255, 248, 238, 0.05);
}

.prompt-title {
  min-height: 62px;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-actions span,
.pill,
.model-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.model-picker-row,
.model-strip {
  display: grid;
  gap: 10px;
}

.model-picker-row {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.model-chip {
  text-align: center;
}

button.model-chip {
  min-height: 44px;
  width: 100%;
  border-color: var(--line);
  font-weight: 600;
}

.model-chip.selected,
.model-tile.active {
  border-color: #5f86ff;
  box-shadow: 0 0 0 1px rgba(63, 115, 255, 0.42);
}

.model-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.model-tile {
  min-height: 150px;
  padding: 16px;
}

.model-tile strong,
.model-tile span {
  display: block;
}

.model-tile span {
  margin: 6px 0 14px;
  color: var(--muted);
}

.model-tile p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-head,
.table-row,
.history-item,
.metric-list > div,
.metric-list > a,
.metric-list > button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  align-items: center;
  margin-bottom: 12px;
}

.section-head h2 {
  margin-bottom: 0;
}

.table-row,
.history-item,
.metric-list > div,
.metric-list > a,
.metric-list > button {
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.table-row:last-child,
.history-item:last-child,
.metric-list > div:last-child,
.metric-list > a:last-child,
.metric-list > button:last-child {
  border-bottom: 0;
}

.metric-list > a,
.metric-list > button {
  align-items: center;
  color: var(--text);
}

.metric-list > a:hover span,
.metric-list > button:hover span {
  color: #8db0ff;
}

.metric-list > button {
  width: 100%;
  min-height: auto;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.quick-prompt-list {
  display: grid;
  min-width: 0;
}

.quick-prompt-list .quick-prompt-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  flex-wrap: nowrap;
}

.quick-prompt-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-prompt-item b {
  justify-self: end;
  min-width: max-content;
  color: var(--muted);
  font-size: 12px;
}

.recent-dialog-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.big-number {
  font-size: 34px;
  font-weight: 800;
}

.chat-history {
  align-self: start;
  min-height: calc(100vh - 96px);
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.small-button.wide {
  width: auto;
  min-width: 112px;
  padding: 0 12px;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  min-height: calc(100vh - 96px);
}

.chat-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.chat-head select {
  width: min(100%, 320px);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
}

select {
  color-scheme: dark;
}

select option {
  color: #fff8ee;
  background: #191725;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.messages {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 20px 0;
}

.messages.compact {
  min-height: 160px;
  max-height: 260px;
}

.msg {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 78%;
  box-sizing: border-box;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 15px;
  white-space: pre-wrap;
}

.msg.user {
  justify-self: end;
  background: rgba(143, 168, 255, 0.14);
}

.msg.assistant {
  justify-self: start;
  background: rgba(255, 248, 238, 0.055);
}

.msg.thinking {
  color: var(--muted);
}

.reasoning-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(63, 115, 255, 0.08);
}

.reasoning-box summary {
  cursor: pointer;
  color: #8db0ff;
  font-weight: 700;
}

.reasoning-box pre {
  margin: 10px 0 0;
  color: var(--muted);
  font: inherit;
  white-space: pre-wrap;
}

.assistant-answer {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

.message-content {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-prose {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-model {
  display: flex;
  align-items: center;
  gap: 7px;
  border-top: 1px solid rgba(255, 248, 238, 0.08);
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.msg.user .message-model {
  justify-content: flex-end;
  text-align: right;
}

.model-logo-inline {
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 248, 238, 0.12);
  border-radius: 6px;
  padding: 3px;
  object-fit: contain;
  background: rgba(255, 248, 238, 0.82);
}

.model-title-inline,
.model-meter-label,
.metric-label,
.model-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.model-chip {
  justify-content: center;
}

.model-title-inline span,
.model-meter-label span,
.metric-label span,
.model-chip span {
  min-width: 0;
}

.message-prose + .code-block,
.code-block + .message-prose {
  margin-top: 12px;
}

.code-block {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 238, 0.09);
  border-radius: 18px;
  background: #1f1f1f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  white-space: normal;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border-bottom: 1px solid rgba(255, 248, 238, 0.08);
  padding: 0 14px 0 16px;
  color: #f7f1e8;
  background: #242424;
}

.code-language {
  font-weight: 800;
}

.copy-code-button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #f7f1e8;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
}

.copy-code-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.code-block pre {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  padding: 18px;
  color: #f8f8f2;
  background: #1f1f1f;
  font: 14px/1.55 "Cascadia Code", "Fira Code", Consolas, monospace;
  white-space: pre;
}

.code-block code {
  display: block;
  min-width: max-content;
  font: inherit;
}

.composer {
  display: grid;
  position: relative;
  gap: 12px;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-composer-actions {
  justify-content: space-between;
}

.file-attach-button {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  white-space: nowrap;
}

.template-menu-button[aria-expanded="true"] {
  border-color: rgba(143, 168, 255, 0.5);
  color: #d9e1ff;
  background: rgba(143, 168, 255, 0.14);
}

.composer-template-menu {
  position: absolute;
  right: 18px;
  bottom: 64px;
  z-index: 12;
  display: none;
  width: min(380px, calc(100% - 36px));
  max-height: min(320px, calc(100dvh - 210px));
  overflow-y: auto;
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 14px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.98), rgba(18, 17, 27, 0.98));
  box-shadow: 0 22px 58px rgba(4, 5, 11, 0.42), inset 0 1px 0 rgba(255, 248, 238, 0.05);
}

.composer-template-menu.is-open {
  display: grid;
  gap: 6px;
}

.composer-template-menu button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: auto;
  justify-items: start;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.composer-template-menu button:hover,
.composer-template-menu button:focus-visible {
  background: rgba(143, 168, 255, 0.13);
}

.composer-template-menu span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.composer-template-menu small {
  color: var(--muted);
}

.input-with-send {
  position: relative;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.07), rgba(255, 248, 238, 0.035));
  box-shadow: 0 18px 44px rgba(7, 7, 14, 0.22), inset 0 1px 0 rgba(255, 248, 238, 0.06);
  overflow: hidden;
}

.input-with-send textarea {
  min-height: 120px;
  border: 0;
  padding: 16px 72px 16px 16px;
  background: transparent;
  line-height: 1.5;
  overflow-y: hidden;
  resize: none;
}

.input-with-send textarea.is-scrollable {
  overflow-y: auto;
}

.input-with-send textarea:focus {
  outline: none;
}

.input-with-send .send-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  margin-left: 0;
}

.composer-menu-button {
  display: none;
}

.file-input {
  display: none;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-list[hidden] {
  display: none;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 999px;
  padding: 0 6px 0 12px;
  color: var(--text);
  background: rgba(255, 248, 238, 0.06);
  font-size: 13px;
}

.file-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-remove {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  margin-left: 8px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--muted);
  background: rgba(255, 248, 238, 0.06);
}

.file-remove:hover {
  color: var(--text);
  background: rgba(255, 248, 238, 0.12);
}

.guest-inline-composer .input-with-send textarea {
  min-height: 132px;
}

.mock-input-with-send textarea {
  pointer-events: none;
}

.company-info-panel {
  position: relative;
  isolation: isolate;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 14px;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(143, 168, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(31, 28, 43, 0.9), rgba(18, 18, 27, 0.94));
  box-shadow: 0 22px 58px rgba(4, 5, 11, 0.3), inset 0 1px 0 rgba(255, 248, 238, 0.04);
}

.company-info-panel::before,
.company-info-panel::after {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
}

.company-info-panel::before {
  background:
    repeating-linear-gradient(115deg, rgba(255, 248, 238, 0.08) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(22deg, rgba(143, 168, 255, 0.08) 0 1px, transparent 1px 42px);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.company-info-panel::after {
  background:
    linear-gradient(90deg, transparent, rgba(211, 173, 255, 0.16), transparent),
    linear-gradient(0deg, transparent, rgba(143, 168, 255, 0.12), transparent);
  transform: rotate(-8deg);
}

.company-info-panel div {
  max-width: 780px;
}

.company-info-panel h2 {
  margin-bottom: 10px;
  font-size: 26px;
}

.company-info-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.assistant-image {
  display: grid;
  gap: 8px;
  max-width: min(100%, 520px);
  margin: 12px 0;
}

.assistant-image img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 248, 238, 0.1);
}

.assistant-image figcaption {
  color: var(--muted);
  font-size: 13px;
}

.assistant-file-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  background: rgba(143, 168, 255, 0.1);
}

.send-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  margin-left: auto;
  border-radius: 50%;
  padding: 0;
  border-color: transparent;
  background: linear-gradient(180deg, #a6b7ff, #6478df);
  box-shadow: 0 12px 28px rgba(95, 115, 223, 0.32);
}

.send-button:disabled,
textarea:disabled {
  opacity: 0.68;
  cursor: wait;
}

.grid2 {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 18px;
}

.auth {
  width: 100%;
  max-width: 560px;
}

.auth-title {
  margin-bottom: 8px;
  text-align: center;
}

.auth-subtitle {
  max-width: 420px;
  margin: 0 auto 18px;
  color: var(--muted);
  text-align: center;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 560px);
  place-content: center;
  min-height: calc(100vh - 112px);
  padding: 32px 0;
}

.auth-page-wide {
  grid-template-columns: minmax(320px, 560px) minmax(240px, 320px);
  gap: 18px;
}

.auth-side {
  width: 100%;
}

.auth form {
  display: grid;
  gap: 14px;
}

.auth-switch {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
}

.auth-method-form {
  position: relative;
}

.method-radio {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.auth-method-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  background: rgba(255, 248, 238, 0.035);
}

.auth-method-tabs label,
.auth-method-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.auth-method-tabs a {
  color: #201600;
  background: rgba(255, 213, 77, 0.88);
  font-weight: 800;
}

#method-phone:checked ~ .auth-method-tabs label[for="method-phone"],
#method-email:checked ~ .auth-method-tabs label[for="method-email"] {
  border-color: rgba(143, 168, 255, 0.45);
  color: var(--text);
  background: rgba(143, 168, 255, 0.16);
}

.method-panels {
  display: grid;
}

.auth-method-fields {
  display: none;
  gap: 8px;
}

.auth-method-fields p {
  margin: -2px 0 0;
  font-size: 13px;
}

#method-phone:checked ~ .method-panels .phone-fields,
#method-email:checked ~ .method-panels .email-fields {
  display: grid;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.button.yandex,
.btn.yandex {
  border-color: #ffd54d;
  color: #201600;
  background: #ffd54d;
  font-weight: 800;
}

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

.wallet-page .pricing-main {
  display: grid;
  gap: 16px;
}

.wallet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: center;
}

.wallet-hero p {
  color: var(--muted);
}

.wallet-balance-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(63, 115, 255, 0.1);
}

.wallet-balance-card span,
.wallet-balance-card small {
  color: var(--muted);
}

.wallet-balance-card strong {
  font-size: 30px;
}

.topup-panel .section-head p,
.models-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.topup-card {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.92), rgba(18, 18, 27, 0.94));
  box-shadow: 0 18px 48px rgba(4, 5, 11, 0.24), inset 0 1px 0 rgba(255, 248, 238, 0.04);
}

.topup-card.hot {
  border-color: rgba(244, 173, 122, 0.48);
  box-shadow: 0 0 0 1px rgba(244, 173, 122, 0.18), 0 22px 58px rgba(112, 75, 50, 0.22);
}

.topup-card h2,
.topup-card p {
  margin-bottom: 0;
}

.topup-card p {
  color: var(--muted);
}

.topup-card ul {
  display: grid;
  gap: 8px;
  min-height: 104px;
  margin: 8px 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
}

.topup-card li::before {
  content: "✓";
  margin-right: 8px;
  color: #8db0ff;
}

.model-catalog-panel {
  display: grid;
  gap: 16px;
}

.models-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.pricing-note {
  max-width: 360px;
  color: var(--muted);
  text-align: right;
}

.model-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

button.filter-chip {
  width: auto;
  min-height: 38px;
  box-shadow: none;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  color: var(--text);
  border-color: rgba(143, 168, 255, 0.34);
  background: rgba(143, 168, 255, 0.1);
}

.filter-chip.active {
  color: var(--text);
  border-color: rgba(143, 168, 255, 0.38);
  background: rgba(143, 168, 255, 0.13);
}

.model-filter-summary {
  margin-top: -6px;
  color: var(--muted);
  font-size: 13px;
}

.model-price-list {
  display: grid;
  gap: 14px;
}

.model-price-card[hidden] {
  display: none;
}

.model-filter-empty {
  border: 1px dashed rgba(255, 248, 238, 0.14);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
}

.model-price-card {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 14px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.92), rgba(18, 18, 27, 0.94));
  box-shadow: 0 20px 52px rgba(4, 5, 11, 0.28), inset 0 1px 0 rgba(255, 248, 238, 0.04);
}

.model-price-top {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.model-price-top h2,
.model-price-top p {
  margin-bottom: 0;
}

.model-price-top p,
.model-price-top small {
  color: var(--muted);
}

.model-task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.model-task-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 248, 238, 0.045);
  font-size: 12px;
}

.provider-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: #fff;
  background: #111827;
  font-weight: 900;
}

.provider-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.provider-logo.openai {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-size: 36px;
}

.provider-logo.anthropic {
  background: linear-gradient(180deg, #9d8cff, #6351d7);
}

.provider-logo.deepseek {
  background: linear-gradient(180deg, #5f86ff, #315eea);
}

.model-price-actions {
  display: flex;
  gap: 10px;
}

.model-price-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.model-price-metrics div {
  display: grid;
  gap: 4px;
  justify-items: center;
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  text-align: center;
}

.model-price-metrics div:last-child {
  border-right: 0;
}

.model-price-metrics strong {
  font-size: 20px;
}

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

.price {
  padding: 18px;
}

.price.hot {
  border-color: rgba(244, 173, 122, 0.48);
  box-shadow: 0 0 0 1px rgba(244, 173, 122, 0.18), 0 22px 58px rgba(112, 75, 50, 0.22);
}

.amount {
  font-size: 26px;
  font-weight: 800;
  white-space: nowrap;
}

.amount small {
  font-size: 15px;
}

.note {
  margin-top: 16px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 92px;
  height: 92px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--profile-avatar-image) center / cover no-repeat;
  box-shadow: 0 0 0 3px rgba(143, 168, 255, 0.12), 0 12px 32px rgba(4, 5, 11, 0.24);
}

@media (max-width: 1240px) {
  .workspace-layout,
  .chat-layout,
  .page-heading {
    grid-template-columns: 1fr;
  }

  .model-strip {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .chat-history {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .app-shell,
  .grid2,
  .pricing {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .msg {
    max-width: 100%;
  }
}

/* Mockup-aligned pages */
.sidebar {
  width: 270px;
}

.nav-item.active {
  border-color: rgba(143, 168, 255, 0.32);
  background: linear-gradient(180deg, rgba(143, 168, 255, 0.2), rgba(211, 173, 255, 0.11));
  color: #c9d5ff;
}

.sidebar-history {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  overflow: hidden;
  padding-top: 18px;
}

.sidebar-title {
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 700;
}

.history-link {
  display: block;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--muted);
}

button.history-link {
  width: 100%;
  min-height: auto;
  border: 0;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  font: inherit;
}

.history-link.active,
.history-link:hover {
  color: #c9d5ff;
  background: rgba(143, 168, 255, 0.12);
}

.guest-history-list,
.saved-history-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: none;
}

.guest-history-list::-webkit-scrollbar,
.saved-history-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.guest-history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.clear-guest-history {
  margin-top: 4px;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.mobile-menu-button,
.sidebar-close-button,
.menu-backdrop {
  display: none;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--text);
}

.avatar-mini {
  width: 34px;
  height: 34px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--profile-avatar-image) center / cover no-repeat;
  box-shadow: 0 0 0 2px rgba(143, 168, 255, 0.12);
}

.dashboard-page,
.pricing-page,
.profile-page,
.conversation-page {
  display: grid;
  gap: 16px;
}

.dashboard-page {
  grid-template-columns: minmax(0, 1fr) 330px;
}

.pricing-page,
.profile-page,
.conversation-page {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.dashboard-main,
.pricing-main,
.profile-main,
.conversation-main {
  min-width: 0;
}

.workspace-head {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  color: #fff;
  border-radius: 50%;
  background: rgba(63, 115, 255, 0.18);
}

.hero-prompt {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  min-height: 430px;
  max-height: min(78vh, 900px);
  padding: 20px;
  overflow: auto;
  resize: vertical;
}

.hero-prompt .messages.compact {
  min-height: 180px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.prompt-subtitle {
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.overview-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.92), rgba(18, 18, 27, 0.94));
  box-shadow: 0 22px 58px rgba(4, 5, 11, 0.28), inset 0 1px 0 rgba(255, 248, 238, 0.04);
}

.overview-panel article {
  min-height: 160px;
  border-right: 1px solid var(--line);
  padding: 18px;
}

.overview-panel article:last-child {
  border-right: 0;
}

.overview-panel strong,
.overview-panel span {
  display: block;
}

.overview-panel span {
  margin: 6px 0 16px;
  color: var(--muted);
}

.overview-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.scenario-panel .section-head {
  align-items: start;
}

.scenario-panel .section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.scenario-card {
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  background: rgba(255, 248, 238, 0.035);
  text-decoration: none;
}

.scenario-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(57, 217, 138, 0.35);
}

.scenario-card:hover,
.scenario-card:focus-visible {
  border-color: rgba(143, 168, 255, 0.42);
  background: rgba(143, 168, 255, 0.08);
  transform: translateY(-1px);
}

.scenario-card span {
  display: block;
  margin: 6px 0 12px;
  color: var(--muted);
}

.scenario-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.overview-panel .model-title-inline,
.scenario-card .model-title-inline,
.support-model-grid .model-title-inline,
.admin-usage-table .model-title-inline {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.overview-panel .model-title-inline span,
.scenario-card .model-title-inline span,
.support-model-grid .model-title-inline span,
.admin-usage-table .model-title-inline span {
  display: inline;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: inherit;
  text-transform: none;
  font-size: inherit;
  font-weight: inherit;
}

.advice {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.data-table,
.compare-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.data-table > div,
.compare-table > div {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.data-table > div:last-child,
.compare-table > div:last-child {
  border-bottom: 0;
}

.data-table .table-header,
.compare-table .table-header {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.model-meter {
  display: grid;
  grid-template-columns: minmax(108px, 0.9fr) minmax(78px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 11px 0;
}

.model-meter-label {
  overflow: hidden;
}

.model-meter-label > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-meter b {
  position: relative;
  display: block;
  height: 9px;
  border: 1px solid rgba(255, 248, 238, 0.14);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 248, 238, 0.055);
}

.model-meter b i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
}

.model-meter.green b i {
  background: var(--green);
}

.model-meter.orange b i {
  background: var(--orange);
}

.model-meter.blue b i {
  background: var(--blue);
}

.model-meter em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.rail-total,
.field-row,
.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.money {
  font-size: 28px;
  font-weight: 800;
}

.money span,
.green-text {
  color: var(--green);
}

.line-chart,
.bar-chart {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 92px;
  margin-top: 18px;
}

.line-chart i,
.bar-chart i {
  display: block;
  flex: 1;
  min-width: 6px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #6b8dff, #334fe7);
}

.bar-chart i:nth-child(2n) {
  background: linear-gradient(180deg, #8f6bff, #6840e8);
}

.compact > div {
  font-size: 13px;
}

.page-card {
  padding: 28px;
}

.pricing-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.pricing-head p {
  color: var(--muted);
}

.billing-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.billing-toggle span,
.billing-toggle b {
  flex: 1;
  padding: 12px;
  text-align: center;
}

.billing-toggle b {
  background: rgba(63, 115, 255, 0.22);
}

.billing-toggle em {
  color: #fff;
  font-style: normal;
  background: var(--blue);
  border-radius: 999px;
  padding: 2px 6px;
}

.info-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0 28px;
  padding: 13px 16px;
  color: var(--muted);
  background: rgba(63, 115, 255, 0.08);
}

.price {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.92), rgba(18, 18, 27, 0.94));
}

.popular {
  position: absolute;
  right: 16px;
  top: 14px;
  border: 1px solid rgba(141, 176, 255, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  color: #a9c0ff;
  background: rgba(63, 115, 255, 0.14);
}

.plan-icon {
  color: #ffd166;
  font-size: 26px;
}

.price ul {
  display: grid;
  gap: 11px;
  min-height: 180px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.price li::before {
  content: "✓";
  margin-right: 9px;
  color: #8db0ff;
}

.compare-table {
  margin-top: 22px;
}

.compare-table > div {
  grid-template-columns: 1.4fr repeat(3, 1fr);
  text-align: center;
}

.compare-table > div span:first-child {
  text-align: left;
}

.security-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 18px;
  align-items: center;
  border: 1px solid #2d65bd;
  border-radius: 8px;
  margin-top: 20px;
  padding: 18px;
  background: rgba(63, 115, 255, 0.08);
}

.status {
  display: inline-flex;
  border-radius: 999px;
  margin-left: 8px;
  padding: 4px 8px;
  color: var(--green);
  background: rgba(57, 217, 138, 0.12);
  font-size: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.included-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.included-list div {
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.included-list div:last-child {
  border-bottom: 0;
}

.page-heading.single {
  grid-template-columns: 1fr;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
}

.avatar.large {
  width: 116px;
  height: 116px;
}

.profile-actions {
  display: grid;
  gap: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.field-row {
  margin-top: 0;
}

.toggle-row {
  align-items: center;
  margin-top: 0;
}

.toggle-row i {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: inset 16px 0 0 #fff;
}

.toggle-row.off i {
  background: rgba(255, 255, 255, 0.16);
}

.security-panel {
  margin-bottom: 14px;
}

.security-list {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.security-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.security-action-button {
  min-height: 34px;
  border-color: rgba(143, 168, 255, 0.36);
  padding: 0 13px;
  color: #dbe4ff;
  background: linear-gradient(180deg, rgba(143, 168, 255, 0.2), rgba(95, 115, 223, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 248, 238, 0.08);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.security-action-button:hover {
  border-color: rgba(143, 168, 255, 0.58);
  background: linear-gradient(180deg, rgba(143, 168, 255, 0.28), rgba(95, 115, 223, 0.2));
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 9, 15, 0.68);
  backdrop-filter: blur(12px);
}

.modal-window {
  width: min(100%, 480px);
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 10px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.98), rgba(18, 18, 27, 0.98));
  box-shadow: 0 30px 90px rgba(4, 5, 11, 0.48), inset 0 1px 0 rgba(255, 248, 238, 0.05);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin-bottom: 0;
}

.modal-close {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-color: var(--line);
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  font-size: 22px;
  line-height: 1;
}

.modal-form {
  display: grid;
  gap: 13px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.export-option-list {
  display: grid;
  gap: 10px;
}

.export-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 248, 238, 0.045);
}

.export-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.export-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.export-option small {
  font-weight: 500;
}

body.modal-open {
  overflow: hidden;
}

.support-page,
.admin-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.support-main,
.admin-main {
  min-width: 0;
}

.support-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.support-hero-panel p,
.telegram-panel p {
  color: var(--muted);
}

.support-feature-list {
  display: grid;
  gap: 10px;
}

.support-feature-list div {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.support-feature-list span {
  color: var(--green);
  font-weight: 800;
}

.support-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.support-model-grid article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.support-model-grid article span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

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

.privacy-info-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 248, 238, 0.035);
}

.privacy-info-grid p {
  margin: 0;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.faq-list summary {
  cursor: pointer;
  padding: 15px 16px;
  font-weight: 800;
}

.faq-list details[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-list p {
  margin: 0;
  padding: 15px 16px;
  color: var(--muted);
}

.support-floating-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  min-height: 44px;
  border: 1px solid rgba(143, 168, 255, 0.42);
  border-radius: 8px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #5f7bff, #826fff);
  box-shadow: 0 16px 36px rgba(95, 123, 255, 0.32);
}

.support-widget[hidden] {
  display: none;
}

.support-widget {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 90;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(380px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - 120px));
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.98), rgba(18, 18, 27, 0.99));
  box-shadow: 0 30px 90px rgba(4, 5, 11, 0.48);
  overflow: hidden;
}

.support-widget-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.support-widget-head h2 {
  margin-bottom: 0;
}

.support-widget-messages,
.admin-ticket-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: 320px;
  padding: 14px;
  overflow-y: auto;
  scrollbar-color: rgba(143, 168, 255, 0.44) transparent;
  scrollbar-width: thin;
}

.support-message {
  display: grid;
  gap: 4px;
  max-width: 88%;
  border: 1px solid rgba(255, 248, 238, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.support-message.user {
  justify-self: end;
  background: rgba(143, 168, 255, 0.18);
}

.support-message.admin {
  justify-self: start;
  background: rgba(135, 212, 168, 0.12);
}

.support-message p {
  margin: 0;
  white-space: pre-wrap;
}

.support-message span {
  color: var(--muted);
  font-size: 12px;
}

.support-widget-form,
.admin-reply-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.support-widget-form input,
.support-widget-form textarea,
.admin-reply-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  resize: vertical;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-grid article {
  display: grid;
  gap: 6px;
}

.admin-stat-grid span,
.admin-stat-grid small,
.data-table small {
  color: var(--muted);
}

.admin-stat-grid strong {
  font-size: 28px;
}

.data-table span {
  min-width: 0;
}

.data-table small {
  display: block;
  margin-top: 3px;
}

.admin-ticket-list {
  display: grid;
  gap: 8px;
}

.admin-ticket-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.admin-ticket-list a.active,
.admin-ticket-list a:hover {
  border-color: rgba(143, 168, 255, 0.42);
  background: rgba(143, 168, 255, 0.12);
}

.admin-ticket-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-ticket-list b {
  color: var(--muted);
  font-size: 12px;
}

.admin-ticket-panel > p {
  color: var(--muted);
}

.activity > div {
  grid-template-columns: 1.5fr 1fr 1fr;
}

.privacy-card {
  min-height: 190px;
}

.conversation-page {
  grid-template-columns: minmax(0, 1fr) 320px;
  height: calc(100vh - 96px);
  min-height: 0;
}

.conversation-main {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.conversation-title {
  min-width: 0;
}

.conversation-title h1 {
  margin-bottom: 6px;
}

.conversation-title p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.chat-tools {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.conversation-feed {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding: 18px 54px 18px 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-color: rgba(143, 168, 255, 0.46) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.conversation-feed::-webkit-scrollbar {
  width: 10px;
}

.conversation-feed::-webkit-scrollbar-track {
  border-radius: 999px;
  background: transparent;
}

.conversation-feed::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(143, 168, 255, 0.72), rgba(211, 173, 255, 0.44));
  background-clip: content-box;
}

.conversation-feed::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(143, 168, 255, 0.92), rgba(211, 173, 255, 0.62));
  background-clip: content-box;
}

.conversation-feed .msg {
  max-width: min(74%, 860px);
}

.conversation-feed .msg.assistant {
  width: min(74%, 860px);
}

.conversation-feed .seed {
  line-height: 1.55;
}

.conversation-feed .msg.is-targeted {
  box-shadow: 0 0 0 2px rgba(143, 168, 255, 0.46), 0 16px 42px rgba(95, 115, 223, 0.22);
}

.question-jumper {
  position: absolute;
  top: 76px;
  right: 18px;
  z-index: 8;
}

.question-jumper-toggle {
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-color: rgba(255, 248, 238, 0.1);
  border-radius: 50%;
  padding: 0;
  color: var(--text);
  background: rgba(18, 18, 27, 0.72);
  box-shadow: 0 12px 34px rgba(4, 5, 11, 0.28);
  backdrop-filter: blur(14px);
}

.question-jumper-panel {
  position: absolute;
  top: 0;
  right: 46px;
  display: grid;
  gap: 5px;
  width: min(310px, calc(100vw - 96px));
  max-height: min(360px, calc(100vh - 190px));
  overflow-y: auto;
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 10px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(8px);
  color: var(--text);
  background: rgba(20, 19, 29, 0.94);
  box-shadow: 0 22px 60px rgba(4, 5, 11, 0.42), inset 0 1px 0 rgba(255, 248, 238, 0.05);
  backdrop-filter: blur(18px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.question-jumper:hover .question-jumper-panel,
.question-jumper:focus-within .question-jumper-panel,
.question-jumper.is-open .question-jumper-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.question-jumper-title {
  padding: 4px 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.question-jumper-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.question-jumper-item {
  display: block;
  width: 100%;
  min-height: auto;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  justify-content: flex-start;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.question-jumper-item:hover,
.question-jumper-item.active {
  color: var(--text);
  background: rgba(143, 168, 255, 0.13);
}

.file-message {
  max-width: 62%;
}

.conversation-composer {
  border: 0;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(31, 28, 43, 0.94), rgba(20, 19, 29, 0.96));
  box-shadow: 0 22px 58px rgba(4, 5, 11, 0.36), inset 0 1px 0 rgba(255, 248, 238, 0.05);
}

.conversation-composer .input-with-send textarea {
  min-height: 82px;
  border: 0;
  padding: 16px 72px 16px 16px;
  background: transparent;
}

.conversation-composer select {
  width: 190px;
}

.selected-model-card h2 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 22px;
}

.model-title-with-logo {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.model-logo-badge {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 248, 238, 0.1);
  border-radius: 12px;
  background: rgba(255, 248, 238, 0.82);
}

.model-logo-badge img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.selected-model-card p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.selected-model-card .button.full {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

.payments-page {
  max-width: 1160px;
  margin: 0 auto;
}

.payments-main {
  display: grid;
  gap: 16px;
}

.payments-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.payments-hero p {
  max-width: 700px;
  color: var(--muted);
}

.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.payment-summary-grid .panel {
  display: grid;
  gap: 6px;
  min-height: 128px;
}

.payment-summary-grid span,
.payment-summary-grid small {
  color: var(--muted);
}

.payment-summary-grid strong {
  font-size: 24px;
}

.payment-history-panel .section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.payment-list {
  display: grid;
  gap: 12px;
}

.payment-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border: 1px solid rgba(255, 248, 238, 0.09);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 248, 238, 0.035);
}

.payment-row-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.payment-provider-badge {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff8ee;
  background: linear-gradient(180deg, #5f86ff, #7f6dff);
  font-size: 20px;
  font-weight: 900;
}

.payment-row-main h3,
.payment-row-main p {
  margin: 0;
}

.payment-row-main p,
.payment-row-details dt {
  color: var(--muted);
}

.payment-row-amount {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.payment-row-amount strong {
  font-size: 22px;
}

.payment-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.payment-status.success {
  color: #80efb7;
  background: rgba(57, 217, 138, 0.13);
}

.payment-status.pending,
.payment-status.neutral {
  color: #d9e1ff;
  background: rgba(143, 168, 255, 0.14);
}

.payment-status.danger {
  color: #ffb7b7;
  background: rgba(255, 96, 96, 0.14);
}

.payment-row-details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.payment-row-details div {
  display: grid;
  gap: 3px;
  border-right: 1px solid var(--line);
  padding: 11px 12px;
}

.payment-row-details div:last-child {
  border-right: 0;
}

.payment-row-details dt,
.payment-row-details dd {
  margin: 0;
}

.payment-row-details dd {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  border: 1px dashed rgba(143, 168, 255, 0.28);
  border-radius: 14px;
  padding: 28px;
  background: rgba(143, 168, 255, 0.07);
}

.empty-state p {
  max-width: 620px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .dashboard-page,
  .pricing-page,
  .profile-page,
  .support-page,
  .admin-page,
  .conversation-page {
    grid-template-columns: 1fr;
    height: auto;
  }

  .right-rail {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  }
}

@media (max-width: 1080px) {
  .overview-panel,
  .scenario-grid,
  .pricing,
  .topup-grid,
  .payment-summary-grid,
  .profile-grid,
  .admin-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

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

  .overview-panel article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-hero,
  .pricing-head,
  .security-band {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f2f5;
  --bg-deep: #eaf3f2;
  --panel: #fffaf7;
  --panel-soft: #f4edf8;
  --line: #e2d9e3;
  --line-bright: #c7bbcf;
  --text: #25212c;
  --muted: #756d7d;
  --blue: #667ee8;
  --green: #2e8b57;
  --orange: #c96f42;
  --violet: #8a67c7;
  --danger: #c2414b;
}

html[data-theme="light"] body {
  background:
    linear-gradient(140deg, rgba(244, 196, 178, 0.34) 0%, transparent 40%),
    linear-gradient(220deg, rgba(176, 206, 213, 0.34) 0%, transparent 46%),
    linear-gradient(180deg, #fffaf7 0%, var(--bg-deep) 100%);
}

html[data-theme="light"] a,
html[data-theme="light"] .link-button,
html[data-theme="light"] .caption,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .history-link.active,
html[data-theme="light"] .history-link:hover {
  color: var(--blue);
}

html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 250, 247, 0.94), rgba(238, 246, 245, 0.94));
}

html[data-theme="light"] .topbar {
  background: rgba(255, 250, 247, 0.78);
}

html[data-theme="light"] .mini-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .prompt-panel,
html[data-theme="light"] .company-info-panel,
html[data-theme="light"] .model-tile,
html[data-theme="light"] .hint-card,
html[data-theme="light"] .overview-panel,
html[data-theme="light"] .price,
html[data-theme="light"] .topup-card,
html[data-theme="light"] .model-price-card {
  border-color: rgba(114, 91, 116, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 240, 248, 0.96));
  box-shadow: 0 20px 48px rgba(99, 81, 70, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .input-with-send,
html[data-theme="light"] .quick-actions span,
html[data-theme="light"] .pill,
html[data-theme="light"] .model-chip,
html[data-theme="light"] .small-button,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .button.ghost,
html[data-theme="light"] .btn.ghost,
html[data-theme="light"] .billing-toggle,
html[data-theme="light"] .filter-chip {
  background: rgba(255, 252, 248, 0.76);
}

html[data-theme="light"] .filter-chip:hover,
html[data-theme="light"] .filter-chip:focus-visible,
html[data-theme="light"] .filter-chip.active {
  background: rgba(102, 126, 232, 0.09);
}

html[data-theme="light"] .model-task-tags span {
  border-color: rgba(114, 91, 116, 0.12);
  background: rgba(102, 126, 232, 0.07);
}

html[data-theme="light"] .model-filter-empty {
  border-color: rgba(114, 91, 116, 0.18);
  background: rgba(255, 252, 248, 0.68);
}

html[data-theme="light"] select {
  color-scheme: light;
}

html[data-theme="light"] select option {
  color: #25212c;
  background: #fffaf7;
}

html[data-theme="light"] .input-with-send {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(249, 243, 249, 0.86));
  box-shadow: 0 18px 42px rgba(99, 81, 70, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .composer-menu-button {
  color: #5f6374;
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .composer-actions.is-open {
  border-color: rgba(114, 91, 116, 0.14);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 240, 248, 0.98));
  box-shadow: 0 18px 44px rgba(99, 81, 70, 0.16);
}

html[data-theme="light"] .company-info-panel::before {
  background:
    repeating-linear-gradient(115deg, rgba(114, 91, 116, 0.1) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(22deg, rgba(102, 126, 232, 0.1) 0 1px, transparent 1px 42px);
}

html[data-theme="light"] .auth-method-tabs {
  background: rgba(255, 252, 248, 0.66);
}

html[data-theme="light"] .file-chip {
  border-color: rgba(114, 91, 116, 0.12);
  background: rgba(255, 252, 248, 0.72);
}

html[data-theme="light"] .security-action-button {
  color: var(--blue);
  border-color: rgba(102, 126, 232, 0.26);
  background: rgba(102, 126, 232, 0.09);
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(37, 33, 44, 0.32);
}

html[data-theme="light"] .modal-window {
  border-color: rgba(114, 91, 116, 0.14);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 240, 248, 0.98));
  box-shadow: 0 30px 80px rgba(99, 81, 70, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .support-feature-list div,
html[data-theme="light"] .support-model-grid article,
html[data-theme="light"] .privacy-info-grid article,
html[data-theme="light"] .faq-list details,
html[data-theme="light"] .admin-ticket-list a {
  background: rgba(138, 103, 199, 0.04);
}

html[data-theme="light"] .support-widget {
  border-color: rgba(114, 91, 116, 0.14);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.99), rgba(247, 240, 248, 0.99));
  box-shadow: 0 30px 80px rgba(99, 81, 70, 0.22);
}

html[data-theme="light"] .support-widget-form input,
html[data-theme="light"] .support-widget-form textarea,
html[data-theme="light"] .admin-reply-form textarea {
  background: rgba(255, 255, 255, 0.64);
}

html[data-theme="light"] .composer-template-menu {
  border-color: rgba(114, 91, 116, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 240, 248, 0.98));
  box-shadow: 0 22px 58px rgba(99, 81, 70, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .composer-template-menu button:hover,
html[data-theme="light"] .composer-template-menu button:focus-visible,
html[data-theme="light"] .template-menu-button[aria-expanded="true"] {
  background: rgba(102, 126, 232, 0.09);
}

html[data-theme="light"] .export-option {
  border-color: rgba(114, 91, 116, 0.12);
  background: rgba(255, 252, 248, 0.76);
}

html[data-theme="light"] .model-logo-inline,
html[data-theme="light"] .model-logo-badge {
  border-color: rgba(114, 91, 116, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .model-meter b {
  border-color: rgba(114, 91, 116, 0.16);
  background: rgba(114, 91, 116, 0.055);
}

html[data-theme="light"] .conversation-feed {
  scrollbar-color: rgba(102, 126, 232, 0.42) transparent;
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .history-link.active,
html[data-theme="light"] .history-link:hover {
  border-color: rgba(102, 126, 232, 0.2);
  background: rgba(102, 126, 232, 0.09);
  color: var(--blue);
}

html[data-theme="light"] .scenario-card,
html[data-theme="light"] .msg.assistant,
html[data-theme="light"] .data-table .table-header,
html[data-theme="light"] .compare-table .table-header,
html[data-theme="light"] .payment-row-card {
  background: rgba(138, 103, 199, 0.055);
}

html[data-theme="light"] .payment-provider-badge {
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .msg.user,
html[data-theme="light"] .billing-toggle b,
html[data-theme="light"] .info-line,
html[data-theme="light"] .security-band {
  background: rgba(102, 126, 232, 0.09);
}

html[data-theme="light"] .conversation-composer {
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 240, 248, 0.96));
  box-shadow: 0 20px 48px rgba(99, 81, 70, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .question-jumper-toggle {
  border-color: rgba(114, 91, 116, 0.12);
  background: rgba(255, 252, 248, 0.88);
  box-shadow: 0 12px 30px rgba(99, 81, 70, 0.16);
}

html[data-theme="light"] .question-jumper-panel {
  border-color: rgba(114, 91, 116, 0.12);
  background: rgba(255, 252, 248, 0.96);
  box-shadow: 0 22px 56px rgba(99, 81, 70, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .question-jumper-item:hover,
html[data-theme="light"] .question-jumper-item.active {
  background: rgba(102, 126, 232, 0.09);
}

html[data-theme="light"] .button.primary,
html[data-theme="light"] .btn,
html[data-theme="light"] button.primary,
html[data-theme="light"] .send-button,
html[data-theme="light"] .billing-toggle em {
  color: #ffffff;
}

html[data-theme="light"] .spark,
html[data-theme="light"] .popular {
  color: var(--blue);
  background: rgba(49, 94, 234, 0.1);
}

html[data-theme="light"] .avatar,
html[data-theme="light"] .avatar-mini {
  background: var(--profile-avatar-image) center / cover no-repeat;
}

html[data-theme="light"] .provider-logo.openai {
  color: #111827;
  background: rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .progress {
  background: rgba(93, 109, 132, 0.16);
}

html[data-theme="light"] .toggle-row.off i {
  background: rgba(93, 109, 132, 0.22);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: relative;
    top: auto;
    z-index: 3;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 0;
    min-width: 0;
    gap: 16px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }

  .brand {
    white-space: nowrap;
  }

  .nav-section {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }

  .sidebar-bottom {
    min-width: 190px;
  }

  .sidebar .mini-card {
    gap: 6px;
    padding: 12px;
  }

  .sidebar .mini-card p,
  .sidebar .mini-card .button.full {
    display: none;
  }

  .sidebar-history {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    margin-top: 0;
    overflow-x: auto;
    padding-top: 10px;
    scrollbar-width: none;
  }

  .sidebar-history::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .guest-history-list,
  .saved-history-list {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-title,
  .sidebar-history p,
  .history-link {
    flex: 0 0 auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    padding: 12px 18px;
    backdrop-filter: blur(16px);
  }

  .top-actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .content {
    max-width: 100%;
    min-width: 0;
    padding: 14px;
  }

  .dashboard-page,
  .pricing-page,
  .profile-page,
  .support-page,
  .admin-page,
  .conversation-page {
    grid-template-columns: 1fr;
    height: auto;
  }

  .right-rail {
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  }

  .overview-panel,
  .scenario-grid,
  .privacy-info-grid,
  .topup-grid,
  .admin-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

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

  .wallet-hero {
    grid-template-columns: 1fr;
  }

  .model-price-top {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .model-price-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .conversation-main {
    height: calc(100vh - 176px);
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
    font-size: 14px;
  }

  body.menu-open {
    overflow: hidden;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 17px;
  }

  .mobile-menu-button {
    display: inline-flex;
    flex: 0 0 auto;
    order: 1;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    display: block;
    opacity: 0;
    pointer-events: none;
    background: rgba(3, 8, 17, 0.58);
    transition: opacity 0.2s ease;
  }

  .menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(320px, calc(100vw - 48px));
    max-width: min(320px, calc(100vw - 48px));
    height: 100dvh;
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.28);
  }

  .sidebar.has-chat-history {
    grid-template-rows: none;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar > .brand,
  .sidebar > .nav-section,
  .sidebar > .sidebar-history,
  .sidebar > .sidebar-bottom {
    grid-column: 1;
  }

  .sidebar-close-button {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
  }

  .brand {
    width: 100%;
    padding-right: 52px;
    margin-bottom: 18px;
    font-size: 20px;
  }

  .brand-mark {
    font-size: 26px;
  }

  .nav-section {
    display: grid;
    flex: 0 0 auto;
    gap: 8px;
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    padding-bottom: 0;
  }

  .nav-item {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    font-size: 14px;
  }

  .sidebar-history {
    display: grid;
    flex: 0 0 auto;
    grid-template-rows: auto minmax(104px, auto) auto;
    gap: 8px;
    width: 100%;
    min-height: 0;
    max-height: none;
    overflow: visible;
    margin-top: 18px;
    padding-top: 14px;
    padding-bottom: 4px;
  }

  .guest-history-list,
  .saved-history-list {
    display: grid;
    min-height: 0;
    max-height: min(280px, 34dvh);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .sidebar-bottom {
    flex: 0 0 auto;
    min-width: 0;
    margin-top: 18px;
    align-self: stretch;
  }

  .sidebar .mini-card {
    display: grid;
    align-items: stretch;
    gap: 10px;
  }

  .sidebar .mini-card .caption {
    display: block;
  }

  .sidebar .mini-card p {
    display: block;
  }

  .sidebar .mini-card .button.full {
    display: inline-flex;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
  }

  .topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-height: 0;
    gap: 10px;
    padding: 12px;
  }

  .top-actions {
    order: 2;
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .top-actions .button.primary {
    flex: 1 1 auto;
    min-width: 0;
  }

  .top-actions .button.ghost {
    flex: 0 0 auto;
  }

  .top-actions .user-pill {
    flex: 1 1 auto;
    justify-content: center;
  }

  .content {
    padding: 10px;
  }

  .auth-page {
    grid-template-columns: minmax(0, 560px);
    place-content: center;
    min-height: calc(100dvh - 96px);
    padding: 18px 0;
  }

  .auth-page-wide {
    grid-template-columns: minmax(0, 560px);
  }

  .auth,
  .auth-side {
    max-width: 100%;
  }

  .page-heading,
  .workspace-head,
  .pricing-head,
  .profile-hero,
  .security-band {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .page-card,
  .panel,
  .prompt-panel,
  .company-info-panel,
  .model-tile,
  .hint-card,
  .price {
    padding: 14px;
  }

  .company-info-panel h2 {
    font-size: 22px;
  }

  .company-info-panel p {
    font-size: 15px;
  }

  .auth-method-tabs {
    grid-template-columns: 1fr;
  }

  .hint-card {
    min-height: auto;
  }

  .hero-prompt {
    min-height: min(620px, calc(100dvh - 150px));
    max-height: none;
    resize: none;
  }

  .quick-actions,
  .chat-tools {
    flex-wrap: wrap;
  }

  .composer,
  .conversation-composer {
    position: relative;
  }

  .input-with-send {
    min-height: 92px;
  }

  .composer-menu-button {
    position: absolute;
    left: 12px;
    bottom: 14px;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border: 1px solid rgba(255, 248, 238, 0.1);
    border-radius: 12px;
    padding: 0;
    color: var(--text);
    background: rgba(255, 248, 238, 0.07);
    box-shadow: none;
  }

  .composer-menu-button[aria-expanded="true"] {
    border-color: rgba(143, 168, 255, 0.44);
    color: #d9e1ff;
    background: rgba(143, 168, 255, 0.16);
  }

  .input-with-send textarea,
  .conversation-composer .input-with-send textarea {
    min-height: 92px;
    padding: 16px 70px 16px 68px;
  }

  .composer-actions {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: calc(100% - 4px);
    z-index: 8;
    display: none;
    align-items: stretch;
    max-height: min(330px, calc(100dvh - 190px));
    overflow-y: auto;
    border: 1px solid rgba(255, 248, 238, 0.1);
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(31, 28, 43, 0.98), rgba(18, 17, 27, 0.98));
    box-shadow: 0 18px 44px rgba(4, 5, 11, 0.34);
  }

  .composer-actions.is-open {
    display: grid;
    gap: 10px;
  }

  .composer-actions .composer-template-menu {
    position: static;
    width: 100%;
    max-height: 230px;
    box-shadow: none;
  }

  .composer-actions .pill,
  .composer-actions a,
  .composer-actions .muted {
    width: 100%;
    min-width: 0;
  }

  .composer-actions .file-attach-button {
    width: 100%;
    align-self: stretch;
  }

  .model-strip,
  .overview-panel,
  .scenario-grid,
  .privacy-info-grid,
  .pricing,
  .topup-grid,
  .profile-grid,
  .support-model-grid,
  .admin-stat-grid,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .support-widget {
    right: 10px;
    bottom: 72px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 92px);
  }

  .support-floating-button {
    right: 10px;
    bottom: 14px;
  }

  .wallet-hero,
  .models-head {
    display: grid;
    grid-template-columns: 1fr;
    text-align: left;
  }

  .pricing-note {
    max-width: none;
    text-align: left;
  }

  .model-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .model-price-card {
    padding: 16px;
  }

  .model-price-top {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .provider-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 14px;
  }

  .provider-logo.openai {
    font-size: 28px;
  }

  .model-price-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .model-price-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-price-metrics div:nth-child(2n) {
    border-right: 0;
  }

  .model-price-metrics div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .model-price-metrics strong {
    font-size: 17px;
  }

  .payments-hero,
  .payment-row-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payment-row-amount {
    justify-items: start;
    text-align: left;
  }

  .payment-row-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-row-details div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .payment-row-details div:last-child {
    border-bottom: 0;
  }

  .overview-panel article {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .overview-panel article:last-child {
    border-bottom: 0;
  }

  .scenario-card {
    min-height: auto;
  }

  .price ul {
    min-height: auto;
  }

  .data-table,
  .compare-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table > div,
  .compare-table > div {
    min-width: 640px;
  }

  .profile-hero {
    text-align: left;
  }

  .avatar.large {
    width: 92px;
    height: 92px;
  }

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

  .security-list div,
  .field-row,
  .toggle-row,
  .rail-total,
  .metric-list > div,
  .metric-list > a,
  .metric-list > button,
  .history-item,
  .table-row {
    flex-wrap: wrap;
  }

  .quick-prompt-list .quick-prompt-item {
    grid-template-columns: minmax(0, 1fr) auto;
    flex-wrap: nowrap;
  }

  .conversation-main {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: calc(100dvh - 86px);
    min-height: 0;
  }

  .conversation-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-tools {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .chat-tools .small-button.wide {
    flex: 1 1 140px;
    min-width: max-content;
  }

  .conversation-feed {
    padding: 14px 44px 14px 0;
  }

  .question-jumper {
    top: 70px;
    right: 14px;
  }

  .question-jumper-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .question-jumper-panel {
    top: 40px;
    right: 0;
    width: min(290px, calc(100vw - 48px));
    max-height: min(320px, calc(100dvh - 190px));
  }

  .conversation-feed .msg,
  .conversation-feed .file-message,
  .msg {
    max-width: 100%;
  }

  .conversation-feed .msg.assistant {
    width: 100%;
  }

  .conversation-composer {
    padding: 14px;
  }

  .conversation-composer select {
    width: 100%;
  }

  .send-button {
    align-self: flex-end;
    margin-left: auto;
  }

  .messages.compact {
    max-height: none;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 22px;
  }

  .button,
  .btn,
  button {
    min-height: 40px;
    padding: 0 12px;
  }

  .small-button.wide {
    width: 100%;
    min-width: 0;
  }

  .icon-button {
    width: 40px;
    min-width: 40px;
  }

  .top-actions .button.primary {
    flex: 1 1 150px;
  }

  .payment-summary-grid,
  .payment-row-details {
    grid-template-columns: 1fr;
  }

  .top-actions > .icon-button:first-of-type {
    display: none;
  }

  .mini-card strong,
  .user-pill {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .data-table > div,
  .compare-table > div {
    min-width: 560px;
  }

  .model-meter {
    grid-template-columns: 64px minmax(0, 1fr) 38px;
  }

  .line-chart,
  .bar-chart {
    gap: 4px;
  }
}
