:root {
  --bg: #171717;
  --panel: #171717;
  --panel-soft: rgba(23, 23, 23, 0.78);
  --surface: #212121;
  --surface-2: #2f2f2f;
  --surface-3: #303030;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f4;
  --muted: #b4b4b4;
  --faint: #8f8f8f;
  --accent: #5b4a83;
  --accent-2: #f4f4f4;
  --brand-teal: #1198a8;
  --brand-teal-soft: rgba(17, 152, 168, 0.22);
  --success: #22c55e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --sidebar-width: 276px;
  --chat-viewport-height: 100vh;
  --chat-safe-top: env(safe-area-inset-top, 0px);
  --composer-safe-bottom: env(safe-area-inset-bottom, 0px);
  --composer-mobile-control-clearance: 0px;
}

@supports (height: 100dvh) {
  :root {
    --chat-viewport-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  direction: rtl;
  min-height: var(--chat-viewport-height);
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  font-family: Vazirmatn, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
}

body.auth-page {
  overflow: auto;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

svg path[fill] {
  stroke: none;
}

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: var(--chat-viewport-height);
  min-height: var(--chat-viewport-height);
  overflow: hidden;
  background:
    radial-gradient(circle at 48% 8%, rgba(255, 255, 255, 0.035), transparent 30rem),
    var(--surface);
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  grid-column: 1;
  display: flex;
  min-height: var(--chat-viewport-height);
  max-height: var(--chat-viewport-height);
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(23, 23, 23, 0.96);
  color: #e8e8ea;
  transition: width 220ms ease, transform 220ms ease, opacity 180ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 9px;
  background: linear-gradient(180deg, var(--bg) 64%, rgba(15, 15, 15, 0));
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  border-radius: 14px;
  color: inherit;
  padding: 6px 8px;
  text-decoration: none;
  transition: background 160ms ease;
}

.brand:hover,
.icon-btn:hover,
.nav-row:hover,
.chat-row:hover,
.user-card:hover,
.tool-chip:hover,
.round-action:hover,
.pill-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.model-avatar,
.user-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
}

.brand-wordmark {
  display: block;
  width: 30px;
  height: auto;
  max-height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.brand-title {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: transparent;
  color: #d8d8dc;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.icon-btn:active,
.nav-row:active,
.chat-row:active,
.send-button:active {
  transform: scale(0.98);
}

.icon-btn svg {
  width: 25px;
  height: 25px;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 18px;
  scrollbar-width: none;
}

.sidebar-scroll::-webkit-scrollbar,
.conversation::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  display: none;
}

.nav-group,
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-section {
  margin-top: 18px;
}

.nav-row,
.chat-row,
.section-title,
.user-card {
  width: 100%;
  background: transparent;
  text-align: right;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.nav-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-radius: 16px;
  padding: 9px 10px;
  color: #ededf0;
  font-size: 14px;
  font-weight: 520;
  text-decoration: none;
}

.nav-row.active {
  background: rgba(255, 255, 255, 0.09);
}

.nav-row svg,
.section-title svg,
.chat-row svg {
  width: 18px;
  height: 18px;
}

kbd {
  direction: ltr;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 600;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 7px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.user-meta strong,
.user-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-avatar {
  width: 34px;
  height: 34px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.3);
}

.gradient-blue {
  background: linear-gradient(135deg, #f4f4f4, #8f8f8f);
  color: #111;
}

.gradient-green {
  background: linear-gradient(135deg, #d8d8d8, #676767);
  color: #111;
}

.gradient-purple {
  background: linear-gradient(135deg, var(--brand-teal), #b4b4b4);
}

.time-label {
  margin: 12px 0 5px;
  padding: 0 10px;
  color: #74747b;
  font-size: 11px;
  font-weight: 700;
}

.chat-row {
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border-radius: 13px;
  padding: 7px 10px;
  color: #d8d8dc;
  cursor: pointer;
  font-size: 13px;
}

.chat-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row time {
  color: #707077;
  font-size: 11px;
}

.chat-history-group {
  display: grid;
  gap: 3px;
  margin-top: 11px;
}

.chat-history-group-label {
  margin: 8px 0 2px;
  padding: 0 10px;
  color: #85858b;
  font-size: 11px;
  font-weight: 800;
}

.chat-row-actions {
  position: relative;
  display: inline-grid;
  overflow: visible;
  place-items: center;
}

.chat-row-menu-trigger {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: #a7a7ad;
  transition: background 160ms ease, color 160ms ease;
}

.chat-row-menu-trigger:hover,
.chat-row-menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
}

.chat-row-menu-trigger svg {
  width: 17px;
  height: 17px;
}

.chat-row-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: 120px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(36, 36, 36, 0.98);
  padding: 6px;
  overflow: visible;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.chat-row-menu[hidden] {
  display: none;
}

.chat-row-delete {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  border-radius: 9px;
  background: transparent;
  color: #ffb4b4;
  padding: 8px 10px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chat-row-delete:hover {
  background: rgba(248, 113, 113, 0.12);
}

.chat-row.active-chat,
.chat-row.pinned {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px 9px 11px;
  background: linear-gradient(0deg, var(--bg) 66%, rgba(15, 15, 15, 0));
}

.user-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: center;
  border-radius: 18px;
  padding: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand-teal), #5b4a83);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.user-meta strong {
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.user-meta small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--success);
}

.main {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  height: var(--chat-viewport-height);
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.06), transparent 24rem),
    radial-gradient(circle at 50% 105%, rgba(17, 152, 168, 0.09), transparent 31rem),
    linear-gradient(180deg, #242424 0%, #212121 52%, #1f1f1f 100%);
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 18px 7px;
  background: linear-gradient(180deg, rgba(33, 33, 33, 0.94), rgba(33, 33, 33, 0));
}

.topbar-left,
.topbar-actions,
.composer-toolbar,
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
}

.topbar-left,
.topbar-actions {
  gap: 8px;
}

.mobile-menu {
  display: none;
}

body.sidebar-collapsed .mobile-menu {
  display: inline-grid;
}

.model-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  background: transparent;
  color: #f7f7f7;
  padding: 9px 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: background 160ms ease, transform 160ms ease;
}

.model-selector:hover {
  background: rgba(255, 255, 255, 0.06);
}

.model-selector-group-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  color: #d7d7df;
  background: rgba(255, 255, 255, 0.08);
}

.model-selector-group-icon[hidden] {
  display: none;
}

.model-selector-group-icon img,
.model-selector-group-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-selector svg {
  width: 17px;
  height: 17px;
}

.pill-button,
.get-plus {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.pill-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #dfdfe4;
}

.get-plus {
  background: linear-gradient(135deg, #5b4a83, #6d5d95);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
}

.pill-button svg,
.get-plus svg {
  width: 16px;
  height: 16px;
}

.chat-account-summary {
  min-width: 0;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
}

.chat-stat-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(22, 22, 22, 0.42);
  color: #f4f4f4;
  padding: 6px 10px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06);
}

.chat-account-summary > .chat-stat-card,
.chat-account-summary > .chat-stat-price-wrap {
  width: 122px;
}

.chat-stat-card-price {
  width: 100%;
  max-width: none;
}

.chat-stat-price-wrap {
  position: relative;
  display: inline-grid;
}

.chat-price-trigger {
  justify-content: flex-start;
  min-width: 0;
}

.chat-price-trigger-text {
  justify-items: start;
  gap: 2px;
}

.chat-price-trigger-arrow {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: #bcbcc6;
  transition: transform 180ms ease, color 180ms ease;
}

.chat-price-trigger-arrow svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.chat-stat-price-wrap.is-open .chat-price-trigger-arrow {
  transform: rotate(180deg);
  color: #f0f0f4;
}

.chat-price-panel {
  position: fixed;
  top: var(--chat-price-panel-top, calc(68px + var(--chat-safe-top)));
  left: var(--chat-price-panel-left, 18px);
  right: auto;
  z-index: 12;
  width: min(420px, calc(100vw - 36px));
  max-width: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(44, 44, 44, 0.96), rgba(30, 30, 30, 0.98)),
    rgba(26, 26, 26, 0.96);
  padding: 8px 9px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.price-breakdown {
  display: grid;
  gap: 5px;
}

.price-track {
  display: grid;
  gap: 2px;
}

.price-track-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.price-track-label {
  color: #e9e9ee;
  font-size: 11px;
  font-weight: 800;
}

.price-track-unit {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  color: #8e8e96;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
}

.price-track-values {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.price-value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.price-value b {
  direction: ltr;
  unicode-bidi: plaintext;
  color: #e5e5ea;
  text-align: left;
  font-size: 15px;
  font-weight: 820;
  line-height: 1.35;
}

.price-value small {
  color: #8f8f97;
  font-size: 9px;
  font-weight: 700;
}

.price-value-original {
  text-decoration: line-through;
  text-decoration-thickness: 1.8px;
  text-decoration-color: red;
  color: #9797a0;
}

.price-discount-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 20px;
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.16);
  color: #ffb4b4;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.price-value-final b {
  color: #b6f2c9;
}

.price-empty {
  color: #d8d8dc;
  font-size: 12px;
  font-weight: 800;
}

.chat-stat-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgba(139, 214, 225, 0.13);
  color: #8bd6e1;
  font-size: 12px;
  font-weight: 900;
}

.chat-stat-text {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.chat-stat-text small {
  color: #9b9ba2;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-stat-text b {
  min-width: 0;
  overflow: hidden;
  color: #f4f4f4;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.chat-stat-price-host {
  display: block;
  min-width: 0;
}

.conversation {
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 24px 60px;
  scroll-padding-bottom: var(--composer-bottom-space, 190px);
}

.hero-panel {
  width: min(820px, 100%);
  margin: 0 auto;
  text-align: center;
  transform: translateY(-70px);
}

.hero-panel h1 {
  margin: 0;
  color: #f5f5f5;
  font-size: clamp(29px, 4vw, 37px);
  font-weight: 650;
  letter-spacing: -0.055em;
}

.hero-panel p {
  width: min(640px, 100%);
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.message-stream {
  width: min(820px, 100%);
  max-width: 100%;
  min-width: 0;
  align-self: start;
  margin: 0 auto;
  padding: 28px 0 24px;
}

.message {
  display: flex;
  gap: 13px;
  max-width: 100%;
  min-width: 0;
  margin: 22px 0;
}

.message.user {
  justify-content: flex-start;
}

.message-content {
  display: flex;
  max-width: min(680px, 86%);
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.message.assistant .message-content {
  max-width: min(760px, 95%);
}

.message-bubble {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px 16px;
  color: #efeff1;
  font-size: 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
}

.message.assistant .message-bubble {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 0;
}

.message-bubble > :first-child {
  margin-top: 0;
}

.message-bubble > :last-child {
  margin-bottom: 0;
}

.message-bubble p,
.message-bubble ul,
.message-bubble ol,
.message-bubble blockquote,
.message-bubble pre,
.message-bubble table {
  margin: 0.72em 0;
}

.message-bubble .dir-ltr {
  direction: ltr;
  text-align: left;
}

.message-bubble .dir-rtl {
  direction: rtl;
  text-align: right;
}

.message-bubble ul,
.message-bubble ol {
  padding-inline-start: 1.35rem;
}

.message-bubble li + li {
  margin-top: 0.28em;
}

.message-bubble a {
  color: #8bd6e1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-bubble blockquote {
  border-inline-start: 3px solid rgba(255, 255, 255, 0.18);
  color: #d4d4d8;
  padding: 2px 12px;
}

.message-bubble code {
  direction: ltr;
  unicode-bidi: plaintext;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.24);
  padding: 0.12em 0.36em;
  font-family: Consolas, "Cascadia Code", "Courier New", monospace;
  font-size: 0.92em;
}

.message-bubble pre {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(139, 214, 225, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.95), rgba(10, 14, 24, 0.95));
  padding: 34px 13px 13px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.message-bubble pre::before {
  content: attr(data-code-lang);
  position: absolute;
  top: 8px;
  left: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #b4b4c7;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.message-bubble pre .code-copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7d7df;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.message-bubble pre .code-copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-bubble pre .code-copy-btn:hover,
.message-bubble pre .code-copy-btn.is-copied {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.message-bubble pre code {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  white-space: pre;
}

.message-bubble .md-code-token.tok-comment {
  color: #7f8da3;
}

.message-bubble .md-code-token.tok-keyword {
  color: #c792ea;
}

.message-bubble .md-code-token.tok-string {
  color: #ecc48d;
}

.message-bubble .md-code-token.tok-number {
  color: #f78c6c;
}

.message-bubble .md-code-token.tok-function {
  color: #82aaff;
}

.message-bubble pre code.hljs {
  color: #d4d4d8;
  background: transparent;
}

.message-bubble pre code.hljs .hljs-comment,
.message-bubble pre code.hljs .hljs-quote {
  color: #7f8da3;
}

.message-bubble pre code.hljs .hljs-keyword,
.message-bubble pre code.hljs .hljs-selector-tag,
.message-bubble pre code.hljs .hljs-literal,
.message-bubble pre code.hljs .hljs-name,
.message-bubble pre code.hljs .hljs-strong {
  color: #c792ea;
}

.message-bubble pre code.hljs .hljs-string,
.message-bubble pre code.hljs .hljs-title,
.message-bubble pre code.hljs .hljs-section,
.message-bubble pre code.hljs .hljs-attribute,
.message-bubble pre code.hljs .hljs-symbol,
.message-bubble pre code.hljs .hljs-bullet,
.message-bubble pre code.hljs .hljs-addition {
  color: #ecc48d;
}

.message-bubble pre code.hljs .hljs-number,
.message-bubble pre code.hljs .hljs-meta,
.message-bubble pre code.hljs .hljs-variable,
.message-bubble pre code.hljs .hljs-template-variable,
.message-bubble pre code.hljs .hljs-link,
.message-bubble pre code.hljs .hljs-selector-attr,
.message-bubble pre code.hljs .hljs-selector-pseudo,
.message-bubble pre code.hljs .hljs-type {
  color: #f78c6c;
}

.message-bubble pre code.hljs .hljs-function,
.message-bubble pre code.hljs .hljs-title.function_,
.message-bubble pre code.hljs .hljs-params,
.message-bubble pre code.hljs .hljs-selector-class,
.message-bubble pre code.hljs .hljs-regexp {
  color: #82aaff;
}

.message-bubble .katex {
  font-size: 1em;
  direction: ltr;
}

.message-bubble .katex-display {
  margin: 0.7em 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.message-bubble table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.message-bubble th,
.message-bubble td {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 9px;
}

.message-bubble th {
  background: rgba(255, 255, 255, 0.07);
  color: #f4f4f4;
  font-weight: 750;
}

.message-bubble mark {
  border-radius: 5px;
  background: rgba(250, 204, 21, 0.28);
  color: #fff8c5;
  padding: 0.05em 0.22em;
}

.message-bubble sub {
  font-size: 0.78em;
}

.message-bubble .footnotes {
  margin-top: 1rem;
  color: #c7c7c7;
  font-size: 0.9em;
}

.message-bubble .footnotes-sep {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 1rem 0 0.75rem;
}

.message-bubble .footnotes-list {
  padding-inline-start: 1.4rem;
}

.message-bubble .footnote-ref a,
.message-bubble .footnote-backref {
  color: #8bd6e1;
  text-decoration: none;
}

.message-bubble .md-container {
  margin: 0.85em 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-inline-start-width: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px 12px;
}

.message-bubble .md-container-info,
.message-bubble .md-container-tip {
  border-inline-start-color: #67e8f9;
}

.message-bubble .md-container-success {
  border-inline-start-color: #86efac;
}

.message-bubble .md-container-warning {
  border-inline-start-color: #facc15;
}

.message-bubble .md-container-danger {
  border-inline-start-color: #fca5a5;
}

.message-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding-inline: 4px;
  color: #85858b;
  font-size: 11px;
  line-height: 1;
}

.message.assistant.is-streaming .message-meta {
  display: none;
}

.thinking-stream-panel {
  width: min(720px, 100%);
  margin: 0 0 10px;
  color: #9f9fa7;
}

.thinking-stream-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  padding: 0;
  color: #c8c8cf;
  font-size: 12px;
  font-weight: 750;
}

.thinking-stream-summary::-webkit-details-marker {
  display: none;
}

.thinking-stream-arrow {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: currentColor;
}

.thinking-stream-arrow svg {
  width: 18px;
  height: 18px;
}

.thinking-stream-arrow svg path[fill] {
  stroke: currentColor;
}

.thinking-stream-arrow-left,
.thinking-stream-panel:not([open]) .thinking-stream-arrow-down {
  display: none;
}

.thinking-stream-panel:not([open]) .thinking-stream-arrow-left {
  display: block;
}

.thinking-stream-content {
  max-height: 96px;
  overflow-y: auto;
  margin-top: 7px;
  color: #8f8f98;
  padding-inline-start: 14px;
  font-size: 12.5px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.thinking-stream-content[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.thinking-stream-content[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

.search-stream-panel {
  width: min(720px, 100%);
  margin: 0 0 10px;
  color: #9f9fa7;
}

.search-stream-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  padding: 0;
  color: #c8c8cf;
  font-size: 12px;
  font-weight: 750;
}

.search-stream-summary::-webkit-details-marker {
  display: none;
}

.search-stream-panel:not([open]) .thinking-stream-arrow-left {
  display: block;
}

.search-stream-panel:not([open]) .thinking-stream-arrow-down {
  display: none;
}

.search-stream-content {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 7px;
  color: #8f8f98;
  padding-inline-start: 14px;
  font-size: 12.5px;
  line-height: 1.85;
  opacity: 0.86;
}

.search-stream-content p,
.search-stream-content li,
.search-stream-content h1,
.search-stream-content h2,
.search-stream-content h3 {
  color: inherit;
}

.search-stream-content a {
  color: #93c5fd;
  text-decoration: underline;
}

.message-copy-btn {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #85858b;
  transition: background 160ms ease, color 160ms ease;
}

.message-copy-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-copy-btn:hover,
.message-copy-btn.is-copied {
  background: rgba(255, 255, 255, 0.07);
  color: #f4f4f4;
}

.message-meta time {
  direction: ltr;
  unicode-bidi: plaintext;
}

.chat-attachments-list {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 10px;
}

.chat-attachment-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  padding: 8px;
  text-decoration: none;
  color: inherit;
}

.chat-attachment-item.is-image img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
}

.chat-attachment-icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #d9d9df;
}

.chat-attachment-icon svg {
  width: 22px;
  height: 22px;
}

.chat-attachment-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.chat-attachment-meta strong,
.chat-attachment-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-meta strong {
  color: #f4f4f4;
  font-size: 12.5px;
  font-weight: 700;
}

.chat-attachment-meta small {
  color: #a8a8af;
  font-size: 11px;
}

.message.assistant.is-streaming .message-bubble::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-start: 6px;
  border-radius: 999px;
  vertical-align: middle;
  background: rgba(245, 245, 245, 0.94);
  animation: stream-cursor-pulse 0.8s ease-in-out infinite;
}

@keyframes stream-cursor-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
  100% {
    transform: scale(0.55);
    opacity: 0.5;
  }
}

.message.assistant.is-streaming .message-bubble.has-loading-status {
  direction: ltr;
}

.message.assistant .message-bubble .assistant-loading-status {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  pointer-events: none;
  user-select: none;
  unicode-bidi: plaintext;
}

.assistant-loading-status-text {
  display: inline-block;
  color: #c8c8cf;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  unicode-bidi: plaintext;
  opacity: 0.5;
  animation: assistant-loading-pulse 0.8s ease-in-out infinite;
  will-change: opacity;
}

@keyframes assistant-loading-pulse {
  0% {
    opacity: 0.32;
  }
  50% {
    opacity: 0.82;
  }
  100% {
    opacity: 0.32;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-loading-status-text {
    animation: none;
    opacity: 0.55;
  }
}

.message.user .message-bubble {
  border-color: rgba(255, 255, 255, 0.07);
  background: #303030;
}

.assistant-avatar {
  display: inline-grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4f4f4, #8f8f8f);
  color: #111;
  font-size: 11px;
  font-weight: 800;
}

.composer-zone {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  transform: translateY(38px);
  z-index: 6;
  width: 100%;
  padding: 0 24px calc(13px + var(--composer-safe-bottom) + var(--composer-mobile-control-clearance));
  background: transparent;
  transition: top 220ms ease, bottom 220ms ease, transform 220ms ease, background 220ms ease;
}

.main.chat-active .conversation {
  align-items: start;
  padding-top: 68px;
  padding-bottom: var(--composer-bottom-space, 190px);
}

.main.chat-active .composer-zone {
  top: auto;
  bottom: 0;
  transform: translateY(0);
  background: linear-gradient(0deg, rgba(33, 33, 33, 1) 76%, rgba(33, 33, 33, 0));
}

.composer {
  width: min(820px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 28px;
  background: rgba(48, 48, 48, 0.92);
  padding: 7px 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.19);
  background: rgba(53, 53, 53, 0.97);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

textarea {
  display: block;
  width: 100%;
  max-height: 230px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f5f5f5;
  padding: 12px 12px 8px;
  font-size: 15px;
  line-height: 1.55;
  scrollbar-width: none;
  direction: rtl;
  text-align: right;
}

textarea::placeholder {
  color: #aaaab0;
}

.composer-toolbar {
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.composer-upload-panel {
  display: grid;
  gap: 8px;
  padding: 0 10px 8px;
}

.composer-upload-progress {
  display: grid;
  gap: 6px;
}

.composer-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #d8d8df;
  font-size: 11px;
  font-weight: 700;
}

.composer-upload-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.composer-upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8bd6e1, #f4f4f4);
  transition: width 150ms linear;
}

.composer-upload-files {
  display: grid;
  gap: 7px;
}

.composer-upload-file {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 8px;
}

.composer-upload-file-thumb {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #d9d9df;
  overflow: hidden;
  position: relative;
}

.composer-upload-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-upload-file-thumb svg {
  width: 18px;
  height: 18px;
}

.composer-upload-file-thumb.is-uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.uploading-spinner {
  position: absolute;
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #ffffff;
  z-index: 1;
}

.uploading-spinner svg {
  width: 24px;
  height: 24px;
  fill: none;
}

.composer-upload-file-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.composer-upload-file-meta strong,
.composer-upload-file-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-upload-file-meta strong {
  color: #f3f3f5;
  font-size: 12px;
  font-weight: 700;
}

.composer-upload-file-meta small {
  color: #a9a9b0;
  font-size: 10px;
}

.composer-upload-file-remove {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: #c7c7cf;
  font-size: 18px;
  line-height: 1;
}

.composer-upload-file-remove:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.toolbar-left,
.toolbar-right {
  gap: 6px;
  min-width: 0;
}

.toolbar-left {
  overflow: visible;
}

.attachment-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.attachment-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.09);
}

.attachment-trigger:disabled,
.attachment-item:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.attachment-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: min(282px, calc(100vw - 34px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(36, 36, 36, 0.98);
  padding: 8px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.attachment-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  background: transparent;
  padding: 0 10px;
  color: #f1f1f3;
  text-align: right;
  font-size: 14px;
  font-weight: 500;
  transition: background 140ms ease;
}

.attachment-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.attachment-item svg {
  width: 17px;
  height: 17px;
  color: #d2d2d7;
}

.attachment-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-row,
.projects-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.projects-row {
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.attachment-divider {
  height: 1px;
  margin: 6px 4px;
  background: rgba(255, 255, 255, 0.12);
}

.round-action,
.send-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.round-action {
  background: transparent;
  color: #ececef;
}

.round-action svg,
.send-button svg {
  width: 19px;
  height: 19px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #dadae0;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tool-chip svg {
  width: 16px;
  height: 16px;
}

.tool-chip.active {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(17, 152, 168, 0.16), rgba(255, 255, 255, 0.06));
  color: #f4f4f4;
}

.thinking-chip[hidden] {
  display: none;
}

.thinking-chip {
  color: #bfc0c7;
}

.thinking-chip.active {
  border-color: rgba(139, 214, 225, 0.32);
  background: linear-gradient(135deg, rgba(17, 152, 168, 0.24), rgba(255, 255, 255, 0.07));
  color: #ffffff;
}

.reasoning-effort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #dadae0;
  font-size: 12px;
  font-weight: 600;
}

.reasoning-effort-wrap[hidden] {
  display: none;
}

.reasoning-effort-select {
  min-width: 84px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  outline: none;
}

.send-button {
  background: #f5f5f5;
  color: #111;
}

.send-button:hover {
  background: #fff;
}

.composer-note {
  margin: 8px auto 0;
  color: #85858b;
  text-align: center;
  font-size: 11.5px;
}

.wallet-main {
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  overflow-y: auto;
}

.wallet-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 28px 42px;
  overflow: visible;
}

.wallet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: stretch;
  margin-top: 8px;
}

.wallet-title {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.96);
  padding: 34px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.wallet-title p,
.wallet-card-heading p {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wallet-title h1 {
  margin: 0;
  color: #f7f7f7;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.2;
}

.wallet-title span {
  width: min(560px, 100%);
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.balance-card,
.wallet-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 10px;
  background: rgba(23, 23, 23, 0.96);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 24px 74px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.balance-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
}

.balance-card::before {
  content: "";
  position: absolute;
  inset: auto -18% -38% -18%;
  height: 180px;
  background: radial-gradient(circle, rgba(17, 152, 168, 0.24), transparent 65%);
  pointer-events: none;
}

.balance-card-header,
.wallet-card-heading,
.balance-meta,
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.balance-icon {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
}

.balance-status,
.wallet-badge,
.status-pill,
.table-action {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #e9e9ea;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
}

.balance-card p {
  position: relative;
  margin: 34px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.balance-card strong {
  position: relative;
  direction: rtl;
  display: block;
  color: #fff;
  font-family: Vazirmatn, Inter, sans-serif;
  font-size: clamp(31px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.balance-meta {
  position: relative;
  flex-wrap: wrap;
  margin-top: 30px;
  color: var(--faint);
  font-size: 12px;
}

.wallet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 20px;
  margin-top: 20px;
}

.wallet-card {
  padding: 24px;
}

.wallet-card-heading {
  margin-bottom: 22px;
}

.wallet-card-heading h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

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

.wallet-label {
  color: #ededed;
  font-size: 13px;
  font-weight: 700;
}

.amount-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(24, 24, 24, 0.58);
  padding: 0 17px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.amount-field:focus-within {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(48, 48, 48, 0.96);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.amount-field input {
  direction: ltr;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  font-family: Inter, Vazirmatn, sans-serif;
  font-size: 24px;
  font-weight: 750;
}

.amount-field input::placeholder {
  color: #747474;
}

.amount-field span,
.wallet-hint {
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
}

.wallet-hint {
  margin: 0;
  line-height: 1.8;
}

.wallet-feedback {
  min-height: 22px;
  margin: -5px 0 0;
  color: #b6f2c9;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.8;
}

.wallet-feedback.is-error {
  color: #ffb4b4;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.quick-amounts button,
.table-action {
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.quick-amounts button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #e9e9e9;
  font-size: 12px;
  font-weight: 700;
}

.quick-amounts button:hover,
.table-action:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.085);
}

.quick-amounts button:active,
.charge-submit:active,
.table-action:active {
  transform: scale(0.98);
}

.charge-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 999px;
  background: #f4f4f4;
  color: #111;
  font-size: 15px;
  font-weight: 800;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.charge-submit:hover {
  background: #fff;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.charge-submit svg {
  width: 18px;
  height: 18px;
  transform: scaleX(-1);
}

.summary-list {
  display: grid;
  gap: 11px;
}

.summary-row {
  min-height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  padding: 0 14px;
}

.summary-row span {
  color: var(--muted);
  font-size: 13px;
}

.summary-row strong {
  color: #f4f4f4;
  font-size: 13px;
}

.wallet-progress {
  height: 9px;
  overflow: hidden;
  margin: 20px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.wallet-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-teal), #f4f4f4);
}

.transactions-card {
  margin-top: 20px;
}

.transactions-table-wrap {
  overflow-x: auto;
}

.transactions-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  padding: 16px 12px;
  text-align: right;
  vertical-align: middle;
}

.transactions-table th:first-child,
.transactions-table td:first-child {
  width: 58px;
}

.transactions-table th:nth-child(3),
.transactions-table td:nth-child(3) {
  width: 180px;
}

.transactions-table th:nth-child(4),
.transactions-table td:nth-child(4) {
  width: 170px;
  color: var(--muted);
  white-space: nowrap;
}

.transactions-table th {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.transactions-table td {
  color: #dedede;
  font-size: 13px;
}

.transactions-table tbody tr {
  transition: background 140ms ease;
}

.transactions-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.transactions-table tbody tr:last-child td {
  border-bottom: 0;
}

.transaction-title {
  display: block;
  color: #f4f4f4;
  font-weight: 750;
}

.transactions-table small {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.65;
}

.transaction-type {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
}

.transaction-type svg {
  width: 18px;
  height: 18px;
}

.transaction-type.deposit {
  background: rgba(34, 197, 94, 0.13);
  color: #86efac;
}

.transaction-type.withdrawal {
  background: rgba(248, 113, 113, 0.13);
  color: #fca5a5;
}

.amount-positive,
.amount-negative {
  direction: ltr;
  white-space: nowrap;
  font-family: Inter, Vazirmatn, sans-serif;
  font-weight: 800;
  text-align: left;
}

.amount-positive {
  color: #86efac;
}

.amount-negative {
  color: #fca5a5;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-inline: 10px;
}

.status-pill.success {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.11);
  color: #b6f2c9;
}

.status-pill.pending {
  border-color: rgba(255, 255, 255, 0.12);
  color: #d9d9d9;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.45);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.06), transparent 24rem),
    radial-gradient(circle at 50% 105%, rgba(17, 152, 168, 0.09), transparent 31rem),
    linear-gradient(180deg, #242424 0%, #212121 52%, #1f1f1f 100%);
}

.auth-card {
  position: relative;
  width: min(410px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 34%),
    rgba(47, 47, 47, 0.74);
  padding: 32px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    0 32px 90px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px);
  animation: auth-card-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
}

.auth-logo {
  display: flex;
  width: fit-content;
  margin: 0 auto 28px;
  border-radius: 18px;
  padding: 8px 14px;
  transition: background 160ms ease, transform 160ms ease;
}

.auth-logo:hover {
  background: rgba(255, 255, 255, 0.06);
}

.auth-logo:active {
  transform: scale(0.98);
}

.auth-logo img {
  width: 128px;
  max-height: 34px;
  object-fit: contain;
}

.auth-heading {
  text-align: center;
}

.auth-heading p {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.auth-heading h1 {
  margin: 0;
  color: #f4f4f4;
  font-size: clamp(23px, 4vw, 30px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.4;
}

.auth-heading span {
  display: block;
  margin: 11px auto 0;
  max-width: 310px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.auth-heading b {
  direction: ltr;
  display: inline-block;
  color: #fff;
  font-weight: 700;
}

.auth-form {
  margin-top: 28px;
}

.auth-label {
  display: block;
  margin: 0 2px 8px;
  color: #e8e8e8;
  font-size: 13px;
  font-weight: 650;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  direction: ltr;
  width: 100%;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  outline: 0;
  background: rgba(24, 24, 24, 0.72);
  color: #f4f4f4;
  padding: 0 16px;
  text-align: left;
  font-family: Inter, Vazirmatn, sans-serif;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.03em;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-input:focus,
.otp-input:focus {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(48, 48, 48, 0.98);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.045);
}

.auth-input.is-invalid,
.otp-group.is-invalid .otp-input {
  border-color: rgba(255, 134, 134, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 80, 80, 0.07);
}

.auth-input::placeholder {
  color: #777;
}

.auth-hint,
.auth-error,
.auth-footer {
  margin: 8px 2px 0;
  font-size: 12px;
  line-height: 1.8;
}

.auth-hint,
.auth-footer {
  color: var(--faint);
}

.auth-error {
  min-height: 22px;
  color: #ffb4b4;
}

.auth-submit {
  display: grid;
  width: 100%;
  height: 46px;
  place-items: center;
  margin-top: 16px;
  border-radius: 999px;
  background: #f4f4f4;
  color: #111;
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover {
  background: #fff;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.auth-submit:active {
  transform: scale(0.985);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
}

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

.otp-input {
  direction: ltr;
  width: 100%;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  outline: 0;
  background: rgba(24, 24, 24, 0.72);
  color: #f4f4f4;
  text-align: center;
  font-family: Inter, Vazirmatn, sans-serif;
  font-size: 24px;
  font-weight: 750;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.auth-row a,
.auth-link-button {
  border: 0;
  background: transparent;
  color: #f4f4f4;
  padding: 0;
  text-decoration: none;
  transition: color 160ms ease;
}

.auth-row a:hover,
.auth-link-button:hover {
  color: #fff;
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.welcome-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 24rem),
    rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(16px);
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  background: linear-gradient(180deg, #303030 0%, #252525 46%, #212121 100%);
  padding: 34px;
  text-align: right;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.62);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
}

.welcome-modal.is-visible .modal-card {
  animation: modal-enter 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-modal.is-hiding {
  opacity: 0;
}

.welcome-modal.is-hiding .modal-card {
  animation: modal-exit 180ms ease forwards;
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7d7d7;
  transition: background 160ms ease, transform 160ms ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.11);
}

.modal-close:active {
  transform: scale(0.96);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-brand {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 32% 24%, #ffffff 0 18%, #f4f4f4 52%, #d8d8d8 100%);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.05),
    0 18px 54px rgba(0, 0, 0, 0.38),
    0 0 42px rgba(17, 152, 168, 0.16);
}

.modal-brand::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.58);
  pointer-events: none;
}

.modal-brand-ring {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(17, 152, 168, 0.34);
  border-radius: 34px;
  opacity: 0.78;
  animation: brand-ring 2.8s ease-in-out infinite;
}

.modal-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.24));
}

.modal-kicker {
  margin: 0 0 10px;
  color: #b4b4b4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.modal-card h2 {
  margin: 0;
  color: #f4f4f4;
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.35;
}

.modal-copy {
  margin: 14px 0 0;
  color: #c7c7c7;
  font-size: 14.5px;
  line-height: 1.9;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.modal-primary,
.modal-secondary {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.modal-primary {
  background: #f4f4f4;
  color: #111;
}

.modal-primary:hover {
  background: #fff;
}

.modal-secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f4f4f4;
}

.modal-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.modal-primary:active,
.modal-secondary:active {
  transform: scale(0.98);
}

.modal-actions a.modal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

@keyframes modal-enter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  58% {
    opacity: 1;
    transform: translateY(-5px) scale(1.012);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-exit {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes brand-ring {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.04);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 268px;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 30;
    width: var(--sidebar-width);
    transform: translateX(102%);
    transition: transform 220ms ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: -28px 0 70px rgba(0, 0, 0, 0.5);
  }

  .mobile-menu {
    display: inline-grid;
  }

  .main {
    min-height: 100vh;
  }

  .wallet-content {
    width: 100%;
    padding: 18px 18px 34px;
  }

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

  .wallet-title,
  .balance-card {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  :root {
    --composer-mobile-control-clearance: 14px;
  }

  .topbar {
    padding-inline: 10px;
  }

  .model-selector {
    font-size: 16px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .chat-account-summary {
    align-items: flex-end;
    flex-direction: column;
  }

  .chat-account-summary > .chat-stat-card,
  .chat-account-summary > .chat-stat-price-wrap {
    width: 122px;
  }

  .chat-stat-card {
    min-height: 34px;
    padding: 5px 8px;
    border-radius: 14px;
  }

  .chat-stat-card-price {
    width: 100%;
    max-width: none;
  }

  .chat-price-panel {
    position: fixed;
    top: calc(58px + var(--chat-safe-top));
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  .chat-stat-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .chat-stat-text small {
    display: none;
  }

  .chat-price-trigger-text small {
    display: block;
  }

  .chat-account-summary > .chat-stat-card:not(.chat-stat-card-price) .chat-stat-text small {
    display: block;
  }

  .chat-stat-text b {
    font-size: 11px;
  }

  .chat-stat-price-host {
    width: 100%;
  }

  .price-track-values {
    gap: 6px;
    flex-wrap: wrap;
  }

  .price-value b {
    font-size: 10px;
  }

  .price-discount-badge {
    min-width: 40px;
    min-height: 18px;
    padding: 0 6px;
    font-size: 9px;
  }

  .model-node {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
  }

  .model-node input {
    margin-top: 6px;
  }

  .model-node-price {
    grid-column: 1 / -1;
    min-width: 0;
    margin-top: 4px;
  }

  .model-node-price .price-track {
    gap: 7px;
  }

  .model-node-price .price-track-values {
    gap: 5px;
    flex-wrap: wrap;
  }

  .conversation {
    padding: 10px 14px 210px;
  }

  .hero-panel {
    transform: translateY(-54px);
  }

  .hero-panel h1 {
    font-size: 30px;
  }

  .hero-panel p {
    font-size: 14px;
  }

  .composer-zone {
    padding-inline: 10px;
  }

  .main.chat-active .conversation {
    padding-top: 58px;
    padding-bottom: var(--composer-bottom-space, 190px);
  }

  .composer {
    border-radius: 26px;
  }

  .tool-chip {
    display: none;
  }

  .thinking-chip:not([hidden]) {
    display: inline-flex;
  }

  .reasoning-effort-wrap:not([hidden]) {
    display: inline-flex;
  }

  .attachment-menu {
    width: min(300px, calc(100vw - 22px));
  }

  .tool-chip.active {
    display: inline-flex;
  }

  .message-bubble {
    max-width: 92%;
  }

  .welcome-modal {
    padding: 14px;
  }

  .modal-card {
    border-radius: 24px;
    padding: 28px 22px 22px;
  }

  .modal-actions {
    flex-direction: column;
  }

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

  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    border-radius: 24px;
    padding: 28px 20px;
  }

  .otp-group {
    gap: 7px;
  }

  .otp-input {
    height: 52px;
    border-radius: 15px;
  }

  .auth-row {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .wallet-content {
    padding: 10px 12px 28px;
  }

  .wallet-title,
  .wallet-card,
  .balance-card {
    border-radius: 10px;
    padding: 20px;
  }

  .wallet-title h1 {
    font-size: 34px;
  }

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

  .wallet-card-heading,
  .balance-card-header,
  .balance-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .amount-field {
    min-height: 54px;
  }

  .amount-field input {
    font-size: 20px;
  }
}

.topbar-left {
  position: relative;
}

.chat-retention-note {
  margin: 8px 10px 6px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.8;
}

.composer-error {
  position: fixed;
  right: 50%;
  top: calc(16px + var(--chat-safe-top));
  z-index: 50;
  display: grid;
  width: min(420px, calc(100vw - 28px));
  gap: 10px;
  transform: translateX(50%);
  pointer-events: none;
}

.chat-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid rgba(255, 134, 134, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(104, 32, 32, 0.94), rgba(59, 25, 25, 0.96)),
    rgba(72, 28, 28, 0.94);
  color: #ffe1e1;
  padding: 12px 13px 12px 11px;
  font-size: 13px;
  line-height: 1.8;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-14px) scale(0.98);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chat-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.chat-toast-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.chat-toast-message {
  margin: 0;
  min-width: 0;
}

.chat-toast-close {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 20px;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
}

.chat-toast-close:hover,
.chat-toast-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .chat-toast {
    transition: opacity 120ms ease;
    transform: none;
  }

  .chat-toast.is-visible,
  .chat-toast.is-leaving {
    transform: none;
  }
}

.send-button.is-loading {
  background: #f5f5f5;
}

.send-stop-icon {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #111;
}

.chat-row:disabled {
  cursor: default;
  opacity: 0.7;
}

.model-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

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

.model-picker-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.model-picker-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), transparent 24rem),
    rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px);
}

.model-picker-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  height: min(720px, calc(100dvh - 36px));
  max-height: min(720px, 86vh);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: linear-gradient(180deg, #303030 0%, #252525 46%, #212121 100%);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.62);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.model-picker-modal.is-open .model-picker-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.model-picker-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 18px;
}

.model-picker-modal-header h2 {
  margin: 0;
  color: #f4f4f4;
  font-size: 17px;
  font-weight: 750;
}

.model-picker-modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7d7d7;
  font-size: 22px;
  line-height: 1;
}

.model-picker-modal-close:hover {
  background: rgba(255, 255, 255, 0.11);
}

.model-picker-modal-desc {
  margin: 0;
  padding: 12px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.model-picker-tree {
  display: block;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.model-provider-node {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
}

.model-provider-node + .model-provider-node {
  margin-top: 8px;
}

.model-provider-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 800;
}

.model-provider-summary::-webkit-details-marker {
  display: none;
}

.model-provider-summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-left: 2px solid #b9b9c0;
  border-bottom: 2px solid #b9b9c0;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.model-provider-node[open] .model-provider-summary::before {
  transform: rotate(-45deg);
}

.model-provider-summary-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: #d7d7df;
}

.model-provider-summary-icon img,
.model-provider-summary-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.model-provider-models {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  padding: 6px;
}

.model-node {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.42);
  padding: 6px 8px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.model-node:hover,
.model-node.is-selected {
  border-color: rgba(139, 214, 225, 0.34);
  background: rgba(139, 214, 225, 0.075);
}

.model-node:active {
  transform: scale(0.99);
}

.model-node input {
  margin: 0;
  accent-color: var(--brand-teal);
}

.model-node-title {
  min-width: 0;
  overflow: hidden;
  color: #f4f4f4;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.model-node-price {
  min-width: 0;
}

.model-node-price .price-breakdown {
  gap: 4px;
}

.model-node-price .price-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
}

.model-node-price .price-track-head {
  align-items: center;
  flex: 0 0 auto;
  gap: 0;
}

.model-node-price .price-track-label {
  font-size: 10px;
  color: #b8b8bf;
}

.model-node-price .price-track-unit {
  display: none;
}

.model-node-price .price-track-values {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.model-node-price .price-value {
  gap: 3px;
}

.model-node-price .price-value b {
  font-size: 13px;
}

.model-node-price .price-value small {
  font-size: 8px;
}

.model-node-price .price-discount-badge {
  min-width: 36px;
  min-height: 17px;
  padding: 0 5px;
  font-size: 8.5px;
}

.model-provider-empty,
.model-picker-empty {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.7;
}

.model-provider-empty {
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  font-weight: 700;
}

.model-picker-modal-error {
  margin: 0 18px 12px;
  color: #ffb4b4;
  font-size: 12px;
  font-weight: 700;
}

.model-picker-modal-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 18px 16px;
}

.model-picker-modal-confirm {
  min-height: 40px;
  border-radius: 999px;
  background: #f4f4f4;
  color: #111;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
}

.model-picker-modal-confirm:hover {
  background: #fff;
}
