:root {
  --surface: #121414;
  --surface-lowest: #0c0f0f;
  --surface-low: #1a1c1c;
  --surface-mid: #1e2020;
  --surface-high: #282a2b;
  --surface-bright: #37393a;
  --text: #e2e2e2;
  --muted: #c1c6d7;
  --faint: #8b90a0;
  --line: #414755;
  --primary: #adc6ff;
  --primary-strong: #4b8eff;
  --primary-ink: #002e69;
  --danger: #ffb4ab;
  --success: #9ad6b0;
  --warn: #ffd38a;
  --white: #ffffff;
  --bg-dot: rgba(173, 198, 255, 0.12);
  --panel-border: rgba(255, 255, 255, 0.09);
  --soft-border: rgba(255, 255, 255, 0.08);
  --card-sheen: rgba(255, 255, 255, 0.024);
  --card-sheen-low: rgba(255, 255, 255, 0.012);
  --overlay: rgba(3, 5, 5, 0.72);
  --topbar-bg: rgba(18, 20, 20, 0.88);
  --sidebar-bg: rgba(12, 15, 15, 0.92);
  --popover-bg: rgba(18, 20, 20, 0.98);
  --input-bg: rgba(12, 15, 15, 0.74);
  --table-sticky-bg: rgba(18, 20, 20, 0.98);
  --shadow-soft: rgba(0, 0, 0, 0.2);
  --shadow-strong: rgba(0, 0, 0, 0.34);
  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-code: "Geist", "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="light"] {
  --surface: #f7f9fc;
  --surface-lowest: #eef3f8;
  --surface-low: #ffffff;
  --surface-mid: #f1f5fa;
  --surface-high: #e5ebf3;
  --surface-bright: #d8e1ec;
  --text: #18202d;
  --muted: #536073;
  --faint: #6d7888;
  --line: #c9d4e2;
  --primary: #1d5fd1;
  --primary-strong: #174cb0;
  --primary-ink: #ffffff;
  --danger: #b42318;
  --success: #18794e;
  --warn: #9a6700;
  --bg-dot: rgba(29, 95, 209, 0.12);
  --panel-border: rgba(24, 32, 45, 0.12);
  --soft-border: rgba(24, 32, 45, 0.1);
  --card-sheen: rgba(29, 95, 209, 0.045);
  --card-sheen-low: rgba(255, 255, 255, 0.72);
  --overlay: rgba(24, 32, 45, 0.22);
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --sidebar-bg: rgba(255, 255, 255, 0.92);
  --popover-bg: rgba(255, 255, 255, 0.98);
  --input-bg: rgba(255, 255, 255, 0.86);
  --table-sticky-bg: rgba(255, 255, 255, 0.98);
  --shadow-soft: rgba(24, 32, 45, 0.08);
  --shadow-strong: rgba(24, 32, 45, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-color: rgba(173, 198, 255, 0.42) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.045);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  border: 2px solid rgba(18, 20, 20, 0.98);
  border-radius: 999px;
  background: rgba(173, 198, 255, 0.46);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: rgba(173, 198, 255, 0.66);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body.is-transitioning #app {
  opacity: 0;
}

#app {
  min-height: 100vh;
  opacity: 1;
  transition: opacity 220ms ease;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
}

.dot-bg {
  background-color: var(--surface);
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px);
  background-size: 24px 24px;
}

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

.light-page {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--text);
  --mouse-x: 50vw;
  --mouse-y: 30vh;
  background:
    radial-gradient(circle at 50% 4%, rgba(75, 142, 255, 0.18), transparent 34rem),
    radial-gradient(circle at 20% 28%, rgba(173, 198, 255, 0.08), transparent 22rem),
    #030505;
}

:root[data-theme="light"] .light-page {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 4%, rgba(29, 95, 209, 0.14), transparent 34rem),
    radial-gradient(circle at 20% 28%, rgba(75, 142, 255, 0.1), transparent 22rem),
    #f7f9fc;
}

:root[data-theme="light"] .star-field {
  filter: invert(1) saturate(0.82) contrast(0.9);
  opacity: 0.72;
}

:root[data-theme="light"] .cursor-glow {
  opacity: 0.48;
  background: radial-gradient(circle, rgba(29, 95, 209, 0.16), rgba(75, 142, 255, 0.07) 34%, transparent 68%);
}

.light-page > * {
  position: relative;
  z-index: 1;
}

.star-field {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  transform: translateZ(0);
}

.cursor-glow {
  position: fixed;
  left: var(--mouse-x, 50vw);
  top: var(--mouse-y, 30vh);
  z-index: 0;
  width: 520px;
  height: 520px;
  pointer-events: none;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(173, 198, 255, 0.14), rgba(75, 142, 255, 0.06) 34%, transparent 68%);
  filter: blur(12px);
  opacity: 0.7;
  transform: translate(-50%, -50%);
  transition: opacity 220ms ease;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--soft-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
}

.home-progress {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 21;
  height: 3px;
  overflow: hidden;
  background: rgba(173, 198, 255, 0.12);
}

.home-progress span {
  display: block;
  width: calc(var(--home-progress, 0) * 100%);
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #4b8eff, #adc6ff);
  box-shadow: 0 0 18px rgba(75, 142, 255, 0.75);
  transition: width 140ms ease;
}

.light-page .topbar {
  color: #e8eefc;
  background: rgba(3, 5, 5, 0.76);
}

:root[data-theme="light"] .light-page .topbar {
  color: var(--text);
  border-bottom-color: rgba(24, 32, 45, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--primary);
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-right: auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.topnav a {
  padding: 20px 0;
  border-bottom: 2px solid transparent;
}

.topnav a.active {
  color: var(--primary);
  border-color: var(--primary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  width: 56px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(173, 198, 255, 0.22);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.icon-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-btn {
  position: relative;
  width: 36px;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
}

.icon-btn.has-unread::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #ff4d4f;
}

.icon-btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(75, 142, 255, 0.22);
}

.btn.secondary {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
}

.btn.ghost {
  border-color: var(--line);
  color: var(--muted);
}

.home-stage {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.home-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  will-change: opacity;
}

.home-scene.is-active {
  z-index: 2;
  opacity: 1;
  pointer-events: auto;
}

.home-scene.is-entering {
  z-index: 3;
  opacity: 1;
  pointer-events: none;
}

.home-scene.no-transition {
  transition: none !important;
}

.docs-app-page {
  min-height: 100vh;
  padding-top: 64px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(173, 198, 255, 0.035), transparent 260px),
    var(--surface);
}

.docs-app-page .topbar {
  color: var(--text);
  border-bottom: 1px solid var(--soft-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
}

.docs-app-page .brand,
.docs-app-page .topnav a.active {
  color: var(--primary);
}

.docs-app-page .topnav,
.docs-app-page .icon-btn {
  color: var(--muted);
}

.docs-sidebar {
  position: fixed;
  top: 64px;
  bottom: 0;
  left: 0;
  width: 392px;
  padding: 22px 30px 36px 144px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--soft-border);
  background: var(--sidebar-bg);
  scrollbar-color: rgba(173, 198, 255, 0.32) transparent;
}

.docs-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0 0 22px;
  padding: 0 10px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  color: var(--faint);
  background: var(--input-bg);
}

.docs-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.docs-search input::placeholder {
  color: var(--faint);
}

.docs-search-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.docs-nav-group {
  display: grid;
  gap: 7px;
  margin: 0 0 28px;
  padding-top: 16px;
  border-top: 1px solid var(--soft-border);
}

.docs-nav-group strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.docs-nav-group strong .material-symbols-outlined {
  color: var(--primary);
  font-size: 18px;
}

.docs-nav-group a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.docs-nav-group a:hover,
.docs-nav-group a.active {
  color: var(--text);
  background: rgba(173, 198, 255, 0.09);
}

.docs-nav-group a.active {
  font-weight: 700;
}

.docs-item-icon {
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
}

.docs-item-icon .material-symbols-outlined {
  font-size: 16px;
}

.docs-main {
  margin-left: 392px;
  margin-right: 390px;
  padding: 54px 0 96px;
}

.docs-toc {
  position: fixed;
  top: 112px;
  right: 144px;
  bottom: 72px;
  width: 240px;
  padding-left: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  scrollbar-color: rgba(173, 198, 255, 0.32) transparent;
}

.docs-toc strong {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
}

.docs-toc a {
  display: block;
  padding: 7px 0;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.35;
}

.docs-toc a:hover {
  color: var(--primary);
}

.docs-toc a.sub {
  padding-left: 16px;
}

.docs-article {
  max-width: 740px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
}

.docs-prose h2,
.docs-prose h3 {
  scroll-margin-top: 92px;
  margin: 0;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
}

.docs-prose h2 {
  padding-top: 0;
  font-size: 28px;
  line-height: 1.25;
}

.docs-prose h2 + p {
  margin-top: 22px;
}

.docs-prose h2:not(:first-child) {
  padding-top: 46px;
}

.docs-prose h3 {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 22px;
}

.docs-prose p {
  margin: 18px 0;
  color: rgba(226, 226, 226, 0.88);
  font-size: 16px;
  line-height: 1.85;
}

.docs-note-line {
  color: var(--primary) !important;
  font-weight: 700;
}

.docs-callout {
  position: relative;
  margin: 22px 0 30px;
  padding: 18px 20px 18px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 138, 0.24);
  border-radius: 8px;
  background: rgba(255, 211, 138, 0.11);
}

.docs-callout::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: #b46a35;
}

.docs-callout strong {
  display: block;
  margin-bottom: 10px;
  color: #ffd38a;
  font-weight: 800;
}

.docs-callout p {
  margin: 0;
  color: #ffdca6;
  font-size: 15px;
  line-height: 1.8;
}

.docs-inline-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.docs-inline-link:hover {
  color: var(--text);
}

.docs-link-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 12px;
  margin: 18px 0 28px;
  padding: 16px;
  border: 1px solid rgba(173, 198, 255, 0.18);
  border-radius: 8px;
  color: var(--text);
  background: rgba(173, 198, 255, 0.055);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.docs-link-card:hover {
  border-color: rgba(173, 198, 255, 0.38);
  background: rgba(173, 198, 255, 0.09);
  transform: translateY(-1px);
}

.docs-link-card > span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
}

.docs-link-card strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.docs-link-card small {
  color: var(--faint);
  line-height: 1.55;
}

.docs-data-table {
  overflow-x: auto;
  margin: 20px 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.docs-data-table table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.docs-data-table th,
.docs-data-table td {
  padding: 14px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.7;
}

.docs-data-table th:last-child,
.docs-data-table td:last-child {
  border-right: 0;
}

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

.docs-data-table th {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-weight: 800;
}

.docs-data-table td {
  color: rgba(226, 226, 226, 0.88);
}

.docs-data-table code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  color: #cfe0ff;
  background: rgba(173, 198, 255, 0.09);
  font-family: var(--font-code);
  font-size: 12px;
}

.docs-bullet {
  position: relative;
  padding-left: 22px;
}

.docs-bullet::before {
  content: "";
  position: absolute;
  top: 0.86em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(173, 198, 255, 0.08);
}

.docs-updated {
  margin-top: 52px !important;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--faint) !important;
  font-size: 13px !important;
}

.docs-code {
  overflow: hidden;
  margin: 18px 0 30px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.docs-code-head,
.docs-code-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.docs-code-head {
  padding: 12px 24px;
}

.docs-code-tabbar {
  min-height: 48px;
  padding: 0 16px 0 18px;
}

.docs-code-tabs-list {
  display: flex;
  align-items: stretch;
  gap: 18px;
  min-width: 0;
  overflow-x: auto;
}

.docs-code-tabs-list button {
  position: relative;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.docs-code-tabs-list button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.docs-code-tabs-list button:hover,
.docs-code-tabs-list button.active {
  color: var(--text);
}

.docs-code-tabs-list button.active::after {
  background: var(--primary-strong);
}

.docs-code pre {
  display: block;
  overflow: auto;
  margin: 0;
  padding: 22px 24px;
  color: #cfe0ff;
  font-family: var(--font-code);
  font-size: 13px;
  line-height: 1.8;
  user-select: text;
  white-space: pre;
}

.docs-code-tabs pre {
  display: none;
}

.docs-code-tabs pre.active {
  display: block;
}

.docs-code code {
  user-select: text;
}

.docs-page-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.docs-page-links > span {
  min-height: 76px;
}

.docs-page-links a {
  display: grid;
  gap: 8px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.docs-page-links a:hover {
  border-color: rgba(173, 198, 255, 0.36);
  background: rgba(173, 198, 255, 0.08);
  transform: translateY(-1px);
}

.docs-page-links small {
  color: var(--faint);
  font-size: 12px;
}

.docs-page-links span {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.docs-integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.docs-integration-grid article {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.docs-integration-grid span {
  color: var(--primary);
}

.docs-integration-grid strong,
.docs-integration-grid small {
  display: block;
  margin-top: 8px;
}

.docs-integration-grid small {
  color: var(--muted);
}

.docs-table {
  min-width: 0;
  margin-top: 18px;
}

@media (max-width: 1280px) {
  .docs-sidebar {
    width: 300px;
    padding-left: 28px;
  }

  .docs-main {
    margin-left: 300px;
    margin-right: 280px;
    padding-inline: 28px;
  }

  .docs-toc {
    right: 28px;
    width: 220px;
  }
}

.hero {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 80px 24px 64px;
  text-align: center;
}

.hero-inner {
  width: min(760px, 100%);
}

.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 5px 12px;
  border: 1px solid rgba(75, 142, 255, 0.18);
  border-radius: 999px;
  color: #6b90dd;
  background: rgba(75, 142, 255, 0.05);
  font-family: var(--font-code);
  font-size: 12px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary-strong);
  box-shadow: 0 0 0 5px rgba(75, 142, 255, 0.11);
}

.hero h1 {
  margin: 0;
  color: #f3f5f8;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.05;
  font-weight: 800;
}

.hero h1 span {
  display: block;
  color: #9ebaff;
}

.hero p {
  max-width: 680px;
  margin: 22px auto 32px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 0;
}

.code-window {
  position: relative;
  width: min(680px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(173, 198, 255, 0.18);
  border-radius: 8px;
  text-align: left;
  color: #d7e0f5;
  background:
    linear-gradient(145deg, rgba(173, 198, 255, 0.12), transparent 28%),
    linear-gradient(145deg, #262a2b, #101313);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.tilt-card {
  transition: transform 190ms ease, box-shadow 190ms ease, border-color 190ms ease;
}

.tilt-card:hover {
  transform: translateY(-6px) scale(1.018);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #c9d1e6;
  font-family: var(--font-code);
  font-size: 12px;
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d58f8b;
}

.window-dot:nth-child(2) {
  background: #bdc3cb;
}

.window-dot:nth-child(3) {
  background: #8ba6c7;
}

.window-title {
  margin-left: auto;
}

pre {
  margin: 0;
  padding: 22px 26px 28px;
  overflow: auto;
  font-family: var(--font-code);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.marketing-section {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 78px 0;
}

.home-overlay {
  position: absolute;
  width: min(1180px, calc(100% - 48px));
  max-width: none;
  inset: auto;
  left: 50%;
  top: 50%;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  background: transparent;
  border: 0;
  border-radius: 0;
  max-height: calc(100vh - 128px);
  overflow: auto;
  box-shadow: none;
}

.home-overlay + .home-overlay {
  margin: 0;
  background: transparent;
}

.home-scroll-spacer {
  height: 700vh;
  pointer-events: none;
}

.section-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.12;
}

.section-copy {
  margin: 0 0 34px;
  color: #a2acc1;
  font-size: 15px;
}

.section-note {
  max-width: 760px;
  margin: 22px auto 0;
  color: var(--faint);
  text-align: center;
  line-height: 1.6;
}

.gradient-word {
  display: inline-block;
  color: transparent;
  background: linear-gradient(90deg, #8cc7ff, #adc6ff, #d6b13f);
  -webkit-background-clip: text;
  background-clip: text;
}

.provider-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.provider-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #eef2fb;
  background: rgba(18, 22, 24, 0.46);
  backdrop-filter: blur(14px);
}

.ready-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(520px, 100%);
  margin: 34px auto 0;
  padding: 24px;
  border: 1px solid rgba(173, 198, 255, 0.18);
  border-radius: 12px;
  background: rgba(18, 22, 24, 0.56);
  backdrop-filter: blur(18px);
}

.ready-panel > span {
  color: var(--primary);
  font-size: 28px;
}

.ready-panel strong,
.ready-panel a {
  display: block;
}

.ready-panel a {
  margin-top: 6px;
  color: var(--primary);
  font-weight: 800;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, var(--card-sheen), var(--card-sheen-low)),
    var(--surface-low);
  box-shadow: 0 10px 34px var(--shadow-soft);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  animation: cardIn 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--stagger, 0ms);
}

.card:hover {
  border-color: rgba(173, 198, 255, 0.22);
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32), 0 0 20px rgba(75, 142, 255, 0.08);
}

.card.is-hiding {
  animation: cardOut 180ms ease both;
}

.marketing-card {
  min-height: 210px;
  padding: 26px;
  color: #eef2fb;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026)),
    rgba(18, 22, 24, 0.52);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border-color: rgba(255, 255, 255, 0.12);
}

.span-8 {
  grid-column: span 8;
}

.span-7 {
  grid-column: span 7;
}

.span-6 {
  grid-column: span 6;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

.metric-big {
  margin-top: 42px;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
}

.metric-big small {
  display: block;
  color: #d4dbea;
  font-size: 12px;
}

.tiny-label {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marketing-card h3,
.price-card h3,
.app-card h3 {
  margin: 0;
  font-size: 19px;
}

.marketing-card p,
.price-card p,
.app-card p {
  color: #c4ccdc;
  line-height: 1.55;
}

.light-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 190px;
  padding: 42px 32px;
  color: #e6ebf7;
  background: #101414;
}

:root[data-theme="light"] .card:hover {
  box-shadow: 0 18px 46px rgba(24, 32, 45, 0.12), 0 0 20px rgba(29, 95, 209, 0.08);
}

:root[data-theme="light"] .app-shell,
:root[data-theme="light"] .login-page,
:root[data-theme="light"] .docs-app-page {
  color: var(--text);
}

:root[data-theme="light"] .docs-toc {
  border-left-color: var(--soft-border);
}

:root[data-theme="light"] .docs-prose h3 {
  border-top-color: var(--soft-border);
}

:root[data-theme="light"] .docs-prose p,
:root[data-theme="light"] .docs-data-table td {
  color: var(--muted);
}

:root[data-theme="light"] .docs-data-table {
  border-color: var(--soft-border);
  background: var(--surface-low);
}

:root[data-theme="light"] .docs-data-table th,
:root[data-theme="light"] .docs-data-table td {
  border-color: var(--soft-border);
}

:root[data-theme="light"] .docs-data-table th {
  background: var(--surface-mid);
}

:root[data-theme="light"] .docs-data-table code {
  color: var(--primary);
  background: rgba(29, 95, 209, 0.08);
}

:root[data-theme="light"] .docs-code {
  border-color: #d6dee8;
  background: #f2f4f7;
  box-shadow: 0 10px 28px rgba(24, 32, 45, 0.06);
}

:root[data-theme="light"] .docs-code-head,
:root[data-theme="light"] .docs-code-tabbar {
  border-bottom-color: #d6dee8;
  color: #3f4a5a;
  background: #e9edf3;
}

:root[data-theme="light"] .docs-code-tabs-list button {
  color: #4d5969;
}

:root[data-theme="light"] .docs-code-tabs-list button:hover,
:root[data-theme="light"] .docs-code-tabs-list button.active {
  color: #111827;
}

:root[data-theme="light"] .docs-code pre,
:root[data-theme="light"] .docs-code code {
  color: #111827;
}

:root[data-theme="light"] .docs-prose > pre {
  border: 1px solid #d6dee8;
  border-radius: 7px;
  color: #111827;
  background: #f2f4f7;
}

:root[data-theme="light"] .docs-prose > pre code {
  color: #111827;
}

:root[data-theme="light"] .hero h1 {
  color: #172033;
}

:root[data-theme="light"] .hero h1 span {
  color: #1d5fd1;
}

:root[data-theme="light"] .hero p,
:root[data-theme="light"] .section-copy,
:root[data-theme="light"] .marketing-card p,
:root[data-theme="light"] .price-card p,
:root[data-theme="light"] .app-card p {
  color: var(--muted);
}

:root[data-theme="light"] .system-pill {
  border-color: rgba(29, 95, 209, 0.18);
  color: var(--primary);
  background: rgba(29, 95, 209, 0.07);
}

:root[data-theme="light"] .marketing-card {
  color: var(--text);
  border-color: rgba(24, 32, 45, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 46px rgba(24, 32, 45, 0.1);
}

:root[data-theme="light"] .metric-big small {
  color: var(--muted);
}

:root[data-theme="light"] .provider-strip span,
:root[data-theme="light"] .ready-panel {
  color: var(--text);
  border-color: rgba(24, 32, 45, 0.12);
  background: rgba(255, 255, 255, 0.74);
}

:root[data-theme="light"] .light-footer {
  color: var(--text);
  background: #edf2f8;
}

:root[data-theme="light"] .footer-links {
  color: var(--muted);
}

:root[data-theme="light"] .account-trigger:hover,
:root[data-theme="light"] .account-menu-wrap.is-open .account-trigger,
:root[data-theme="light"] .side-link.active,
:root[data-theme="light"] .side-link:hover,
:root[data-theme="light"] .page-buttons button.active,
:root[data-theme="light"] .page-buttons button:hover,
:root[data-theme="light"] .custom-select-option:hover,
:root[data-theme="light"] .custom-select-option.selected {
  background: rgba(29, 95, 209, 0.09);
}

:root[data-theme="light"] .btn.secondary,
:root[data-theme="light"] .filter-btn.active {
  background: rgba(24, 32, 45, 0.05);
}

:root[data-theme="light"] .provider-logo {
  color: #ffffff;
}

:root[data-theme="light"] .price-card .provider-logo {
  color: var(--vendor-color);
}

:root[data-theme="light"] .login-control {
  border: 1px solid var(--line);
}

:root[data-theme="light"] .field-control:has(input[type="date"]),
:root[data-theme="light"] .field-control:has(input[type="time"]),
:root[data-theme="light"] .field-control:has(select) {
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

:root[data-theme="light"] .field-control:has(input[type="date"]) input,
:root[data-theme="light"] .field-control:has(input[type="time"]) input,
:root[data-theme="light"] .field-control:has(select) select {
  min-height: 42px;
}

:root[data-theme="light"] .subscription-meta-grid div {
  background: rgba(24, 32, 45, 0.04);
}

:root[data-theme="light"] .subscription-progress {
  background: rgba(24, 32, 45, 0.1);
}

:root[data-theme="light"] .danger-text,
:root[data-theme="light"] .login-error {
  color: #b42318;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: #c5ccdc;
  font-size: 14px;
}

.app-shell {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 256px;
  height: 100vh;
  padding: 28px 16px;
  border-right: 1px solid var(--soft-border);
  background: var(--sidebar-bg);
  overflow-y: auto;
}

.side-brand {
  padding: 0 12px 32px;
}

.side-brand .brand {
  align-items: center;
  font-size: 24px;
  line-height: 1.12;
}

.side-brand small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-nav-group {
  display: grid;
  gap: 6px;
}

.side-nav-group + .side-nav-group {
  margin-top: 18px;
}

.side-section-title {
  padding: 10px 14px 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  font: inherit;
  text-align: left;
}

.side-link.active,
.side-link:hover {
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
}

.side-bottom {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--soft-border);
}

.account-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 0 14px;
}

.account-menu-wrap {
  position: relative;
  margin-top: 18px;
}

.account-trigger {
  width: 100%;
  min-height: 48px;
  margin-top: 0;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.account-trigger:hover,
.account-menu-wrap.is-open .account-trigger {
  background: rgba(173, 198, 255, 0.1);
}

.account-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-text strong,
.account-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text span {
  display: block;
}

.account-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: 0 18px 42px var(--shadow-strong);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.account-menu-wrap.is-open .account-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--danger);
  background: transparent;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.account-menu-item:hover {
  background: rgba(255, 180, 171, 0.1);
}

.dashboard-account {
  margin-top: 0;
}

.dashboard-user {
  align-items: center;
  gap: 10px;
}

.dashboard-theme-toggle,
.dashboard-lang-toggle {
  min-height: 40px;
}

.dashboard-account .account-popover {
  top: calc(100% + 8px);
  bottom: auto;
}

.avatar {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  aspect-ratio: 1;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.17);
  font-weight: 800;
  line-height: 1;
}

.app-main {
  min-width: 0;
  margin-left: 256px;
  padding: 48px 32px 64px;
  overflow-x: hidden;
}

.app-shell[data-view="ai"] .sidebar {
  display: none;
}

.app-shell[data-view="ai"] .app-main {
  margin-left: 0;
  padding: 0;
  overflow: hidden;
}

.app-shell[data-view="ai"] .app-container {
  height: 100vh;
}

.app-shell[data-view="ai"] #view {
  height: 100vh;
  min-height: 100vh;
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

.app-shell[data-view="ai"] #view.view-leaving,
.app-shell[data-view="ai"] #view.view-entering {
  opacity: 1;
  transform: none;
  filter: none;
  animation: none;
}

.app-container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-width: 0;
}

#view {
  min-height: calc(100vh - 112px);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

#view.view-leaving {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(4px);
}

#view.view-entering {
  animation: viewIn 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.1;
  font-weight: 800;
}

.page-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.page-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  min-height: 150px;
  padding: 22px;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.stat-value {
  margin-top: 34px;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 0.95;
  font-weight: 800;
}

.stat-value small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 16px;
}

.app-card {
  padding: 22px;
}

.chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  align-items: end;
  gap: 32px;
  height: 330px;
  padding: 42px 2px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trend-metric {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  height: 100%;
  min-width: 0;
}

.bar-group {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 12px;
  height: 100%;
}

.bar {
  width: 24px;
  min-height: 24px;
  border-radius: 3px 3px 0 0;
  background: #93a8d4;
}

.bar.alt {
  background: #454a56;
}

.bar-label {
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.bar-value {
  margin-top: 5px;
  color: var(--text);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.quick-value {
  margin-left: auto;
  color: var(--primary);
  font-weight: 800;
}

.loading-value {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(173, 198, 255, 0.14);
  border-top-color: rgba(173, 198, 255, 0.52);
  border-radius: 50%;
  transform-origin: 50% 50%;
  vertical-align: middle;
  animation: loadingSpin 820ms linear infinite;
  will-change: transform;
}

.quick-value .loading-value {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

@keyframes loadingSpin {
  to {
    transform: rotate(360deg);
  }
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.affiliate-share-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.copy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 0 12px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
  font-family: var(--font-code);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.copy-field:hover {
  border-color: rgba(173, 198, 255, 0.38);
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
}

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

.table-card {
  padding: 0;
  min-width: 0;
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 24px;
  border-bottom: 1px solid var(--soft-border);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(173, 198, 255, 0.42) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar,
.announcement-dialog::-webkit-scrollbar,
.key-form textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track,
.announcement-dialog::-webkit-scrollbar-track,
.key-form textarea::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.table-wrap::-webkit-scrollbar-thumb,
.announcement-dialog::-webkit-scrollbar-thumb,
.key-form textarea::-webkit-scrollbar-thumb {
  border: 2px solid rgba(18, 20, 20, 0.98);
  border-radius: 999px;
  background: rgba(173, 198, 255, 0.46);
}

.table-wrap::-webkit-scrollbar-thumb:hover,
.announcement-dialog::-webkit-scrollbar-thumb:hover,
.key-form textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(173, 198, 255, 0.66);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1260px;
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--soft-border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 14px;
}

th.sticky-col,
td.sticky-col {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--table-sticky-bg);
  box-shadow: -16px 0 24px var(--shadow-soft);
}

th.sticky-col {
  z-index: 3;
}

td.code,
.code {
  font-family: var(--font-code);
}

.empty-cell {
  padding: 34px 24px;
  color: var(--muted);
  text-align: center;
}

.key-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.key-name-cell .avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.key-inline-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

td > .key-inline-copy {
  margin-top: 0;
  min-width: 250px;
  justify-content: space-between;
}

.key-inline-copy:hover {
  color: var(--primary);
}

.key-inline-copy .material-symbols-outlined {
  font-size: 18px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-actions .icon-btn {
  width: 34px;
  height: 34px;
}

.danger-action {
  color: var(--danger);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(173, 198, 255, 0.24);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.chip.danger {
  border-color: rgba(255, 180, 171, 0.3);
  color: var(--danger);
  background: rgba(255, 180, 171, 0.12);
}

.chip.hot {
  border-radius: 4px;
  border: 0;
  color: #ffd7d0;
  background: rgba(255, 119, 103, 0.28);
  font-size: 11px;
}

.chip.official {
  border-radius: 4px;
  border: 0;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.18);
  font-size: 11px;
}

.chip.discount {
  border-radius: 4px;
  border: 0;
  color: #dfe6f5;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

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

.danger-text {
  color: #d41f2d;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin: 0 -32px 44px;
  padding: 18px 32px;
  border-top: 1px solid var(--soft-border);
  border-bottom: 1px solid var(--soft-border);
  background: color-mix(in srgb, var(--surface-low) 78%, transparent);
  backdrop-filter: blur(12px);
}

.filter-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.segmented {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.filter-btn.active {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.filter-btn.dashed {
  border-style: dashed;
  border-color: var(--line);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 375px);
  justify-content: start;
  gap: 18px;
}

.price-card {
  --vendor-color: #0f9f68;
  --vendor-color-2: #1fc981;
  --vendor-ink: #ffffff;
  --vendor-soft: #eefbf5;
  --vendor-soft-border: rgba(12, 180, 118, 0.18);
  --vendor-muted: #008e62;
  display: flex;
  flex-direction: column;
  width: 375px;
  height: 320px;
  min-height: 320px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: #e6edf4;
  background: #171d23;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

:root[data-theme="light"] .price-card {
  border-color: rgba(12, 30, 24, 0.1);
  color: #17212b;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(8, 18, 28, 0.08);
}

.price-card.vendor-open {
  --vendor-color: #0e9a63;
  --vendor-color-2: #31d28b;
  --vendor-soft: rgba(14, 154, 99, 0.14);
  --vendor-soft-border: rgba(14, 154, 99, 0.24);
  --vendor-muted: #14b978;
}

.price-card.vendor-gemini {
  --vendor-color: #2264d9;
  --vendor-color-2: #52a1ff;
  --vendor-soft: rgba(82, 161, 255, 0.14);
  --vendor-soft-border: rgba(82, 161, 255, 0.26);
  --vendor-muted: #52a1ff;
}

.price-card.vendor-claude {
  --vendor-color: #7a1f22;
  --vendor-color-2: #b4493f;
  --vendor-soft: rgba(180, 73, 63, 0.16);
  --vendor-soft-border: rgba(180, 73, 63, 0.28);
  --vendor-muted: #e0786c;
}

.price-card.vendor-other {
  --vendor-color: #5f6272;
  --vendor-color-2: #8a8f9f;
  --vendor-soft: rgba(138, 143, 159, 0.16);
  --vendor-soft-border: rgba(138, 143, 159, 0.26);
  --vendor-muted: #a8adbb;
}

:root[data-theme="light"] .price-card.vendor-open {
  --vendor-soft: #eefbf5;
  --vendor-muted: #008e62;
}

:root[data-theme="light"] .price-card.vendor-gemini {
  --vendor-soft: #eef6ff;
  --vendor-muted: #2264d9;
}

:root[data-theme="light"] .price-card.vendor-claude {
  --vendor-soft: #fff2f0;
  --vendor-muted: #9c2f2d;
}

:root[data-theme="light"] .price-card.vendor-other {
  --vendor-soft: #f3f5f8;
  --vendor-muted: #5f6272;
}

.price-card.hidden {
  display: none;
}

.price-card.revealed {
  animation: cardIn 440ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.price-card:hover {
  border-color: var(--vendor-soft-border);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] .price-card:hover {
  box-shadow: 0 18px 34px rgba(8, 18, 28, 0.12);
}

.price-card-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 14px 20px;
  color: var(--vendor-ink);
  background: linear-gradient(135deg, var(--vendor-color-2) 0%, var(--vendor-color) 100%);
}

.price-card-hero span,
.price-card-hero strong {
  display: block;
}

.price-card-hero .material-symbols-outlined {
  font-size: 18px;
}

.price-card-hero span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.price-card-hero strong {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
}

.price-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 14px 16px 14px;
}

.price-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-title h3 {
  margin: 0;
  color: #eef4fb;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
}

:root[data-theme="light"] .price-title h3 {
  color: #0f172a;
}

.price-title .icon-btn {
  width: 24px;
  height: 24px;
  color: #91a0b0;
  background: transparent;
}

.price-title .material-symbols-outlined {
  font-size: 17px;
}

.model-card-description {
  display: -webkit-box;
  min-height: 38px;
  margin: 10px 0 0;
  overflow: hidden;
  color: #a9b6c5;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

:root[data-theme="light"] .model-card-description {
  color: #4d6175;
}

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

.provider-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: var(--vendor-color);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 800;
}

.model-price-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.model-price-stack strong {
  color: var(--vendor-muted);
  font-family: var(--font-code);
  font-size: 13px;
  line-height: 1.1;
}

.model-price-stack small {
  color: #9aabbc;
  font-family: var(--font-code);
  font-size: 10px;
  font-weight: 700;
}

.model-price-official {
  color: #7f8b99;
  font-size: 10px;
  line-height: 1.1;
  opacity: 0.82;
}

:root[data-theme="light"] .model-price-stack small {
  color: #5f7183;
}

:root[data-theme="light"] .model-price-official {
  color: #9aa7b4;
}

.price-card .btn {
  min-height: 36px;
  padding: 0 12px;
}

.price-card .chip {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10px;
  line-height: 1.1;
}

.price-card .chip.official {
  border: 1px solid var(--vendor-soft-border);
  color: var(--vendor-muted);
  background: var(--vendor-soft);
}

.price-card .chip.discount {
  border: 0;
  color: var(--vendor-muted);
  background: var(--vendor-soft);
}

.model-price-empty {
  color: #9aa7b4;
  font-family: var(--font-code);
}

.price-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .price-pair {
  background: #fbfcfe;
}

.price-metric {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 0 6px;
}

.price-metric .tiny-label,
.price-metric .model-price-stack {
  grid-column: 2;
}

.price-metric .tiny-label {
  color: #93a4b5;
  font-size: 10px;
  line-height: 1.1;
}

:root[data-theme="light"] .price-metric .tiny-label {
  color: #516579;
}

.metric-icon {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  color: var(--vendor-muted);
  background: var(--vendor-soft);
}

.metric-icon.warn {
  color: #f4a100;
  background: #fff4d8;
}

.metric-icon .material-symbols-outlined {
  font-size: 15px;
}

.model-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  color: #8f9dad;
  font-size: 11px;
}

.model-card-footer > span {
  padding: 4px 8px;
  border: 1px solid var(--vendor-soft-border);
  border-radius: 7px;
  color: var(--vendor-muted);
  background: var(--vendor-soft);
  font-weight: 800;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: 0;
  color: #97a5b6;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.detail-link .material-symbols-outlined {
  font-size: 16px;
}

.model-market-filters {
  margin-bottom: 48px;
}

.model-empty-state {
  margin-top: 16px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.model-empty-state.hidden {
  display: none;
}

.model-details-dialog {
  width: min(760px, calc(100vw - 32px));
}

.model-details-dialog .announcement-head {
  align-items: flex-start;
}

.model-details-dialog .announcement-head h3 {
  margin-top: 6px;
  font-family: var(--font-code);
}

.model-details-description {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.model-details-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.model-details-meta div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .model-details-meta div {
  background: rgba(24, 32, 45, 0.04);
}

.model-details-meta span,
.model-detail-price-row > span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-details-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-details-prices {
  display: grid;
  gap: 10px;
}

.model-detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="light"] .model-detail-price-row {
  background: rgba(24, 32, 45, 0.03);
}

.model-detail-price-row div {
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.model-detail-price-row strong {
  color: var(--text);
  font-family: var(--font-code);
  font-size: 16px;
}

.model-detail-price-row small,
.model-detail-price-row em,
.model-detail-price-row s {
  color: var(--faint);
  font-family: var(--font-code);
  font-size: 11px;
  font-style: normal;
}

.model-details-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.recharge-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px;
  overflow: hidden;
  border-color: rgba(119, 210, 172, 0.18);
  background:
    linear-gradient(135deg, rgba(119, 210, 172, 0.12), transparent 42%),
    linear-gradient(110deg, rgba(173, 198, 255, 0.08), transparent 58%),
    var(--surface-low);
}

.recharge-hero h2 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.recharge-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.recharge-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
  min-width: min(360px, 100%);
}

.recharge-hero-metrics div {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

:root[data-theme="light"] .recharge-hero-metrics div {
  background: rgba(255, 255, 255, 0.72);
}

.recharge-hero-metrics span,
.recharge-status-line span,
.recharge-status-meta span,
.recharge-manual-code span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recharge-hero-metrics strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.recharge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.recharge-grid-simple {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
}

.recharge-workbench,
.recharge-side {
  min-width: 0;
}

.recharge-side {
  display: grid;
  gap: 20px;
}

.recharge-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.recharge-card-head h3 {
  margin: 6px 0 0;
}

.recharge-card-head > .material-symbols-outlined {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #77d2ac;
  background: rgba(119, 210, 172, 0.12);
}

.recharge-network-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(119, 210, 172, 0.28);
  border-radius: 999px;
  color: #98e0bf;
  background: rgba(119, 210, 172, 0.1);
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

:root[data-theme="light"] .recharge-network-pill {
  color: #14724b;
  background: rgba(20, 114, 75, 0.08);
}

.recharge-section {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.recharge-options,
.recharge-amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.recharge-options.compact {
  grid-template-columns: repeat(auto-fit, minmax(96px, 132px));
}

.recharge-network-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.recharge-network-row .field {
  min-width: 0;
}

.recharge-hero,
.recharge-grid .card {
  animation: none;
}

.recharge-option,
.recharge-amount,
.recharge-custom {
  display: grid;
  gap: 5px;
  min-height: 66px;
  padding: 13px 14px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.recharge-option:hover,
.recharge-amount:hover,
.recharge-custom:hover {
  border-color: rgba(119, 210, 172, 0.34);
  transform: translateY(-1px);
}

.recharge-option.active,
.recharge-amount.active,
.recharge-custom.active {
  border-color: rgba(119, 210, 172, 0.54);
  background: rgba(119, 210, 172, 0.12);
  box-shadow: inset 0 0 0 1px rgba(119, 210, 172, 0.12);
}

.recharge-option span,
.recharge-amount span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.recharge-custom {
  grid-template-columns: 22px auto minmax(150px, 1fr);
  align-items: center;
  min-height: 56px;
  margin-top: 10px;
}

.recharge-custom .material-symbols-outlined {
  color: #77d2ac;
  font-size: 20px;
}

.recharge-custom input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  text-align: right;
}

.ai-page {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  min-width: 0;
  background: var(--bg);
}

.ai-page > [data-ai-panel] {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.ai-history {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--soft-border);
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
  overflow: hidden;
}

.ai-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.ai-back-link:hover {
  color: var(--primary);
}

.ai-new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
  font-weight: 700;
}

.ai-new-chat:hover {
  border-color: rgba(173, 198, 255, 0.42);
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
}

.ai-history-title {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ai-history-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.ai-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.ai-history-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 40px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ai-history-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.ai-history-delete .material-symbols-outlined {
  font-size: 18px;
}

.ai-history-row:hover .ai-history-delete,
.ai-history-row.active .ai-history-delete {
  opacity: 1;
}

.ai-history-delete:hover {
  color: var(--danger);
  background: rgba(255, 180, 171, 0.1);
}

.ai-history-item span:not(.material-symbols-outlined) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ai-history-item strong,
.ai-history-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-history-item strong {
  font-size: 14px;
  font-weight: 700;
}

.ai-history-item small {
  color: var(--muted);
  font-size: 11px;
}

.ai-history-row:hover,
.ai-history-row.active {
  border-color: rgba(173, 198, 255, 0.18);
  color: var(--text);
  background: rgba(173, 198, 255, 0.09);
}

.ai-history-item:disabled,
.ai-history-delete:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.ai-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ai-chat-card {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  gap: 0;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  overflow: hidden;
}

.ai-chat-card:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.ai-chat-toolbar {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--soft-border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.ai-toolbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.ai-toolbar-main .page-header-actions {
  flex: 0 0 auto;
}

.ai-compact-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1.1fr) minmax(180px, 0.8fr) minmax(130px, 0.55fr);
  gap: 14px;
}

.ai-compact-controls .field {
  min-width: 0;
}

.ai-select-field {
  position: relative;
}

.ai-select-field label {
  margin: 0 0 6px 12px;
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.ai-select-field .field-control {
  position: relative;
  min-height: 46px;
  gap: 9px;
  padding: 0 38px 0 13px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    color-mix(in srgb, var(--input-bg) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ai-select-field .field-control::after {
  content: "expand_more";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  font-weight: normal;
  line-height: 1;
  pointer-events: none;
}

.ai-select-field .field-control:hover {
  border-color: rgba(173, 198, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.026)),
    color-mix(in srgb, var(--input-bg) 92%, transparent);
}

.ai-select-field .field-control:focus-within {
  border-color: rgba(173, 198, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(173, 198, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-select-field .field-control .material-symbols-outlined {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 19px;
}

.ai-select-field select {
  min-height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.ai-select-field select:disabled {
  color: var(--muted);
  cursor: wait;
}

.ai-select-field .field-control:has(select:disabled) {
  opacity: 0.78;
}

:root[data-theme="light"] .ai-select-field .field-control {
  border-color: rgba(95, 111, 139, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .ai-select-field .field-control:hover,
:root[data-theme="light"] .ai-select-field .field-control:focus-within {
  border-color: rgba(50, 101, 217, 0.34);
  background: #fff;
}

.ai-conversation {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(173, 198, 255, 0.06), transparent 26rem),
    transparent;
}

.ai-message-stack {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  margin: 0 auto;
}

.ai-message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.ai-message-row.user {
  justify-content: flex-end;
}

.ai-message-row.assistant {
  justify-content: flex-start;
}

.ai-message-content {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: min(680px, calc(100% - 48px));
}

.ai-avatar {
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(139, 164, 209, 0.16);
  border-radius: 999px;
  color: #dce5ff;
  background: rgba(143, 169, 223, 0.16);
  font-size: 13px;
  font-weight: 900;
}

.ai-avatar.assistant {
  color: #172033;
  background: #8fa9df;
}

.ai-avatar .material-symbols-outlined {
  font-size: 18px;
}

.ai-bubble {
  max-width: min(680px, 88%);
  padding: 14px 16px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-message-meta {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.ai-message-row.user .ai-bubble {
  border-color: rgba(173, 198, 255, 0.2);
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
}

.ai-bubble.muted {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.ai-bubble.muted .loading-value {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.ai-bubble.error {
  color: var(--danger);
  background: rgba(255, 180, 171, 0.08);
  border-color: rgba(255, 180, 171, 0.24);
}

.ai-bubble.image {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
  gap: 12px;
  width: fit-content;
  max-width: min(680px, 100%);
  padding: 10px;
}

.ai-bubble.image figure {
  display: grid;
  grid-template-rows: auto;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.ai-bubble.image img {
  display: block;
  width: auto;
  max-width: min(620px, 100%);
  height: auto;
  max-height: min(70vh, 720px);
  min-height: 0;
  object-fit: contain;
}

.ai-empty {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.ai-empty .material-symbols-outlined {
  color: var(--primary);
  font-size: 34px;
}

.ai-composer-wrap {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--soft-border);
}

.ai-file-input {
  display: none;
}

.ai-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(760px, 100%);
  margin: 0 auto;
}

.ai-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(280px, 100%);
  min-height: 38px;
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.ai-attachment-chip img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.ai-attachment-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.ai-attachment-chip .icon-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.ai-upload {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 160px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  overflow: hidden;
}

.ai-upload.compact {
  width: min(260px, 100%);
  min-height: 96px;
}

.ai-upload:hover {
  border-color: rgba(173, 198, 255, 0.38);
  color: var(--primary);
  background: rgba(173, 198, 255, 0.07);
}

.ai-upload img {
  display: block;
  width: 100%;
  max-height: 180px;
  border-radius: 8px;
  object-fit: contain;
}

.ai-upload.has-preview > .material-symbols-outlined {
  display: none;
}

.ai-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ai-composer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
}

.ai-composer textarea {
  width: 100%;
  min-width: 0;
  max-height: 160px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: var(--text);
  background: transparent;
  line-height: 1.55;
}

.ai-composer textarea::placeholder {
  color: rgba(193, 198, 215, 0.48);
}

.ai-composer .icon-btn.primary {
  flex: 0 0 auto;
  color: var(--primary-ink);
  background: var(--primary);
}

.ai-composer .icon-btn.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Chat Playground redesign */
.app-shell[data-view="ai"],
.app-shell[data-view="ai"] .app-main,
.app-shell[data-view="ai"] .app-container {
  background: #090d0f;
  color: #d7dbe5;
}

.ai-page {
  grid-template-columns: 224px minmax(0, 1fr);
  background-color: #090d0f;
  background-image: radial-gradient(circle, rgba(127, 153, 195, 0.28) 1px, transparent 1.4px);
  background-size: 24px 24px;
}

.ai-page > [data-ai-panel] {
  min-height: 100vh;
}

.ai-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 284px;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 100vh;
}

.ai-history {
  position: relative;
  padding: 76px 8px 18px;
  border-right: 1px solid rgba(123, 146, 182, 0.14);
  background: rgba(8, 12, 14, 0.68);
}

.ai-back-link {
  position: absolute;
  top: 12px;
  left: 10px;
  right: 10px;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(139, 164, 209, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #a9b7d5;
  font-size: 12px;
}

.ai-new-chat {
  min-height: 34px;
  border-color: rgba(139, 164, 209, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: #c8d3eb;
  font-size: 12px;
}

.ai-history-title,
.ai-config-head {
  color: #9bb7ed;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.ai-history-item {
  min-height: 54px;
  border-radius: 8px;
  color: #9aa4b6;
}

.ai-history-row.active {
  border-color: rgba(159, 188, 245, 0.24);
  color: #e7ebf4;
  background: rgba(255, 255, 255, 0.105);
}

.ai-chat-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-row: 1;
  background: transparent;
}

.ai-playground-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: auto auto minmax(180px, 228px) auto auto;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 18px;
}

.ai-playground-topbar h1 {
  margin: 0;
  color: #a8c0fa;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.ai-playground-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.ai-playground-nav button {
  min-height: 34px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #8c96a8;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.ai-playground-nav button.active {
  border-color: #9ebafa;
  color: #dce5ff;
}

.ai-session-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(123, 146, 182, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: #778294;
}

.ai-session-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #d7dbe5;
  background: transparent;
  font-size: 12px;
}

.ai-session-search input::placeholder {
  color: #6f7785;
}

.ai-playground-topbar .page-header-actions {
  display: flex;
  gap: 10px;
}

.ai-playground-topbar .icon-btn,
.ai-playground-topbar .lang-toggle {
  color: #aab4c5;
  background: transparent;
  border-color: transparent;
}

.ai-deploy-btn {
  min-height: 34px;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  color: #172033;
  background: #a9c3ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.ai-chat-toolbar {
  justify-items: center;
  gap: 16px;
  padding: 24px 18px 16px;
  border-bottom: 0;
  background: transparent;
}

.ai-mode-tabs {
  flex-wrap: nowrap;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(123, 146, 182, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.ai-mode-tabs .filter-btn {
  min-height: 28px;
  padding: 0 18px;
  border-radius: 7px;
  color: #a1a9b9;
  background: transparent;
  font-size: 12px;
}

.ai-mode-tabs .filter-btn.active {
  color: #16223a;
  background: #9ebafa;
}

.ai-session-pill {
  padding: 7px 18px;
  border: 1px solid rgba(123, 146, 182, 0.14);
  border-radius: 999px;
  color: #9ba6bb;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.ai-conversation {
  padding: 26px 22px 120px;
  background: transparent;
}

.ai-message-stack {
  width: min(760px, 100%);
  gap: 30px;
}

.ai-message-row.user .ai-bubble {
  border-color: rgba(255, 255, 255, 0.06);
  color: #d9dde6;
  background: #24282d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.ai-message-row.assistant .ai-bubble:not(.image) {
  border-color: rgba(148, 163, 184, 0.18);
  color: #d7dbe5;
  background: rgba(17, 21, 22, 0.92);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.18);
}

.ai-bubble {
  border-radius: 10px;
  font-size: 15px;
  font-weight: 650;
}

.ai-composer-wrap {
  padding: 0 18px 18px;
  border-top: 0;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 14, 0.78) 35%, rgba(8, 12, 14, 0.96));
}

.ai-composer {
  width: min(795px, 100%);
  min-height: 62px;
  padding: 10px 12px 10px 18px;
  border-color: rgba(139, 164, 209, 0.2);
  border-radius: 14px;
  background: rgba(17, 21, 22, 0.92);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
}

.ai-composer textarea {
  color: #d7dbe5;
  font-size: 14px;
  resize: none;
}

.ai-composer textarea::placeholder {
  color: #707a8b;
}

.ai-composer .icon-btn.primary {
  color: #172033;
  background: #8fa9df;
}

.ai-output-note {
  margin: 10px 0 0;
  color: #657184;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.ai-config-panel {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 22px;
  border-left: 1px solid rgba(123, 146, 182, 0.1);
  background: rgba(8, 12, 14, 0.36);
}

.ai-config-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-config-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-config-actions .icon-btn,
.ai-config-actions .lang-toggle {
  color: #aab4c5;
  background: transparent;
  border-color: rgba(123, 146, 182, 0.12);
}

.ai-config-card {
  display: grid;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(123, 146, 182, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.ai-config-card.compact {
  gap: 10px;
}

.ai-config-card .ai-compact-controls {
  grid-template-columns: 1fr;
}

.ai-manage-keys {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(123, 146, 182, 0.12);
  border-radius: 7px;
  color: #9ebafa;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 900;
}

.ai-config-label {
  color: #707a8b;
  font-size: 10px;
  font-weight: 900;
}

.ai-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b6bfce;
  font-size: 12px;
  font-weight: 800;
}

.ai-status-line span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2ce27c;
  box-shadow: 0 0 0 4px rgba(44, 226, 124, 0.1);
}

.ai-select-field label {
  margin-left: 0;
  color: #6f7785;
  font-size: 10px;
}

.app-shell[data-view="ai"] .ai-select-field .field-control {
  min-height: 42px;
  padding: 0 36px 0 12px;
  border-color: rgba(143, 169, 223, 0.11);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(5, 8, 10, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 8px 18px rgba(0, 0, 0, 0.14);
}

.app-shell[data-view="ai"] .ai-select-field select {
  min-height: 40px;
  color: #dce5f7;
  font-size: 13px;
  font-weight: 750;
}

.app-shell[data-view="ai"] .ai-select-field label {
  margin: 0 0 7px;
  color: #7f8ca6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.app-shell[data-view="ai"] .ai-select-field .field-control .material-symbols-outlined {
  color: #86a6f2;
  opacity: 0.95;
}

.app-shell[data-view="ai"] .ai-select-field .field-control::after {
  right: 11px;
  color: #7d879b;
}

.app-shell[data-view="ai"] .ai-select-field .field-control:hover {
  border-color: rgba(158, 186, 250, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    rgba(7, 11, 14, 0.88);
}

.app-shell[data-view="ai"] .ai-select-field .field-control:focus-within {
  border-color: rgba(158, 186, 250, 0.42);
  box-shadow: 0 0 0 3px rgba(158, 186, 250, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.app-shell[data-view="ai"] .ai-select-field:has(.ai-custom-select.is-open) {
  z-index: 40;
}

.app-shell[data-view="ai"] .ai-native-select-hidden {
  display: none;
}

.app-shell[data-view="ai"] .ai-custom-select {
  min-width: 0;
  flex: 1 1 auto;
}

.app-shell[data-view="ai"] .ai-custom-select-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #dce5f7;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.app-shell[data-view="ai"] .ai-custom-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell[data-view="ai"] .ai-custom-select-trigger:disabled {
  color: #7f8ca6;
  cursor: wait;
}

.app-shell[data-view="ai"] .ai-custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 42;
  display: none;
  max-height: 252px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(143, 169, 223, 0.18);
  border-radius: 9px;
  background: rgba(10, 14, 18, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.app-shell[data-view="ai"] .ai-custom-select.is-open .ai-custom-select-menu {
  display: grid;
  gap: 4px;
}

.app-shell[data-view="ai"] .ai-custom-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #c5d1e5;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.app-shell[data-view="ai"] .ai-custom-select-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell[data-view="ai"] .ai-custom-select-option:hover,
.app-shell[data-view="ai"] .ai-custom-select-option.selected {
  border-color: rgba(158, 186, 250, 0.16);
  color: #eef4ff;
  background: rgba(158, 186, 250, 0.12);
}

.app-shell[data-view="ai"] .ai-custom-select-option.selected::after {
  content: "check";
  flex: 0 0 auto;
  margin-left: auto;
  color: #9ebafa;
  font-family: "Material Symbols Outlined";
  font-size: 17px;
  font-weight: normal;
  line-height: 1;
}

.app-shell[data-view="ai"] .ai-custom-select-empty {
  padding: 10px;
  color: #7f8ca6;
  font-size: 12px;
  font-weight: 750;
}

:root[data-theme="light"] .app-shell[data-view="ai"],
:root[data-theme="light"] .app-shell[data-view="ai"] .app-main,
:root[data-theme="light"] .app-shell[data-view="ai"] .app-container {
  background: #eef3fb;
  color: #162033;
}

:root[data-theme="light"] .ai-page {
  background-color: #eef3fb;
  background-image: radial-gradient(circle, rgba(68, 92, 132, 0.22) 1px, transparent 1.4px);
}

:root[data-theme="light"] .ai-history,
:root[data-theme="light"] .ai-config-panel {
  border-color: rgba(70, 87, 116, 0.14);
  background: rgba(246, 249, 253, 0.76);
}

:root[data-theme="light"] .ai-back-link,
:root[data-theme="light"] .ai-new-chat,
:root[data-theme="light"] .ai-config-card,
:root[data-theme="light"] .ai-manage-keys {
  border-color: rgba(70, 87, 116, 0.16);
  color: #33415c;
  background: rgba(255, 255, 255, 0.74);
}

:root[data-theme="light"] .ai-history-title,
:root[data-theme="light"] .ai-config-head {
  color: #4a68a5;
}

:root[data-theme="light"] .ai-history-item {
  color: #56627a;
}

:root[data-theme="light"] .ai-history-row.active {
  border-color: rgba(74, 104, 165, 0.24);
  color: #172033;
  background: rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .ai-mode-tabs {
  border-color: rgba(70, 87, 116, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .ai-mode-tabs .filter-btn {
  color: #526079;
}

:root[data-theme="light"] .ai-mode-tabs .filter-btn.active {
  color: #10213d;
  background: #b5caff;
}

:root[data-theme="light"] .ai-session-pill,
:root[data-theme="light"] .ai-bubble {
  border-color: rgba(70, 87, 116, 0.14);
  color: #3e4b63;
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .ai-message-row.user .ai-bubble {
  border-color: rgba(74, 104, 165, 0.18);
  color: #172033;
  background: #dfe9ff;
}

:root[data-theme="light"] .ai-message-row.assistant .ai-bubble:not(.image) {
  border-color: rgba(70, 87, 116, 0.16);
  color: #172033;
  background: rgba(255, 255, 255, 0.86);
}

:root[data-theme="light"] .ai-avatar {
  border-color: rgba(74, 104, 165, 0.2);
  color: #29416f;
  background: rgba(181, 202, 255, 0.6);
}

:root[data-theme="light"] .ai-avatar.assistant {
  color: #10213d;
  background: #b5caff;
}

:root[data-theme="light"] .ai-composer-wrap {
  background: linear-gradient(180deg, transparent, rgba(238, 243, 251, 0.82) 35%, rgba(238, 243, 251, 0.96));
}

:root[data-theme="light"] .ai-composer {
  border-color: rgba(70, 87, 116, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 54px rgba(61, 78, 110, 0.16);
}

:root[data-theme="light"] .ai-composer textarea {
  color: #172033;
}

:root[data-theme="light"] .ai-composer textarea::placeholder,
:root[data-theme="light"] .ai-output-note,
:root[data-theme="light"] .ai-config-label {
  color: #68758d;
}

:root[data-theme="light"] .ai-config-actions .icon-btn,
:root[data-theme="light"] .ai-config-actions .lang-toggle {
  color: #33415c;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(70, 87, 116, 0.14);
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field .field-control {
  border-color: rgba(70, 87, 116, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 249, 255, 0.86)),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(61, 78, 110, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field select {
  color: #172033;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-trigger {
  color: #172033;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-trigger:disabled {
  color: #6c7890;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-menu {
  border-color: rgba(70, 87, 116, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(61, 78, 110, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-option {
  color: #3b4860;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-option:hover,
:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-option.selected {
  border-color: rgba(49, 89, 184, 0.14);
  color: #10213d;
  background: rgba(181, 202, 255, 0.32);
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-option.selected::after {
  color: #3159b8;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-custom-select-empty {
  color: #6c7890;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field label {
  color: #5f6f8d;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field .field-control .material-symbols-outlined {
  color: #3159b8;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field .field-control::after {
  color: #64728a;
}

:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field .field-control:hover,
:root[data-theme="light"] .app-shell[data-view="ai"] .ai-select-field .field-control:focus-within {
  border-color: rgba(49, 89, 184, 0.28);
  background: #fff;
}

:root[data-theme="light"] .ai-status-line {
  color: #34435e;
}

.recharge-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid rgba(119, 210, 172, 0.18);
  border-radius: 8px;
  background: rgba(119, 210, 172, 0.08);
}

.recharge-summary div {
  display: grid;
  gap: 4px;
}

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

.recharge-summary strong {
  color: var(--text);
  font-size: 24px;
}

.recharge-address-card,
.recharge-status-card {
  display: grid;
  gap: 16px;
}

.recharge-qr {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 260px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(255, 255, 255, 0.04);
}

.recharge-qr > div {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.recharge-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.recharge-qr > .material-symbols-outlined {
  color: var(--faint);
  font-size: 68px;
}

.recharge-address-card p,
.recharge-status-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.recharge-check-btn {
  width: 100%;
  min-height: 44px;
}

.recharge-status-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.recharge-status-line,
.recharge-status-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recharge-status-line strong {
  color: #98e0bf;
  font-size: 16px;
}

.recharge-status-meta {
  padding-top: 10px;
  border-top: 1px solid var(--soft-border);
}

.recharge-status-meta button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-code);
  font-size: 12px;
}

.recharge-status-meta .material-symbols-outlined {
  font-size: 16px;
}

.recharge-log-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--soft-border);
}

.recharge-log-list div {
  display: grid;
  gap: 3px;
}

.recharge-log-list span {
  color: var(--faint);
  font-family: var(--font-code);
  font-size: 11px;
}

.recharge-log-list strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.recharge-manual-code {
  display: grid;
  gap: 8px;
}

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

.recharge-empty-option {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.app-shell[data-view="recharge"] .app-main {
  padding: 0;
  background: #0e1111;
}

:root[data-theme="light"] .app-shell[data-view="recharge"] .app-main {
  background: #f4f7fb;
}

.app-shell[data-view="recharge"] #view {
  min-height: 100vh;
}

.app-shell[data-view="recharge"] .recharge-loading {
  margin: 48px 32px;
}

.recharge-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  color: #e7e8ec;
}

:root[data-theme="light"] .recharge-checkout {
  color: #162033;
}

.recharge-panel {
  min-width: 0;
  padding: 84px clamp(28px, 5vw, 74px) 64px;
}

.recharge-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: clamp(24px, 4vw, 54px);
  width: min(100%, 1180px);
  padding-right: clamp(22px, 4vw, 48px);
}

.recharge-side-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding-top: 82px;
}

.recharge-side-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)),
    rgba(18, 21, 21, 0.78);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

:root[data-theme="light"] .recharge-side-card {
  border-color: rgba(22, 32, 51, 0.1);
  background:
    linear-gradient(135deg, rgba(29, 95, 209, 0.05), rgba(255, 255, 255, 0.76)),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 44px rgba(24, 32, 45, 0.08);
}

.recharge-side-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.recharge-side-head.inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.recharge-side-head h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.recharge-side-head p {
  margin: 0;
  color: #aeb6c9;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

:root[data-theme="light"] .recharge-side-head p {
  color: #607086;
}

.recharge-side-head a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #adc6ff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

:root[data-theme="light"] .recharge-side-head a {
  color: #174cb0;
}

.recharge-side-head a .material-symbols-outlined {
  font-size: 15px;
}

.recharge-redeem-card .redeem-form.compact {
  gap: 12px;
}

.recharge-redeem-card .redeem-code-field.compact {
  min-height: 52px;
  padding-inline: 14px;
}

.recharge-redeem-card .redeem-code-field.compact input {
  font-size: 14px;
  font-weight: 800;
}

.recharge-redeem-card .redeem-form.compact .btn {
  width: 100%;
  min-height: 52px;
}

.recharge-side-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .recharge-side-balance {
  border-top-color: rgba(22, 32, 51, 0.1);
}

.recharge-side-balance span {
  color: #9099ab;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.recharge-side-balance strong {
  color: #e7e8ec;
  font-size: 20px;
}

:root[data-theme="light"] .recharge-side-balance strong {
  color: #162033;
}

.recharge-redeem-card .redeem-result-card.compact {
  margin-top: 14px;
  padding: 12px;
}

.recharge-redeem-card .redeem-result-success .recharge-status-line,
.recharge-redeem-card .redeem-result-success .recharge-status-meta {
  gap: 8px;
  font-size: 12px;
}

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

.redeem-mini-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.redeem-mini-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.1);
}

.redeem-mini-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.redeem-mini-row strong {
  overflow: hidden;
  color: #dfe4f1;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.redeem-mini-row small {
  overflow: hidden;
  color: #8790a3;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.redeem-mini-row b {
  color: #57d68d;
  font-size: 12px;
}

.redeem-mini-empty {
  margin: 0;
  color: #8f96a7;
  font-size: 13px;
  font-weight: 700;
}

:root[data-theme="light"] .redeem-mini-icon {
  color: #174cb0;
  background: rgba(29, 95, 209, 0.08);
}

:root[data-theme="light"] .redeem-mini-row strong {
  color: #22314a;
}

:root[data-theme="light"] .redeem-mini-row small,
:root[data-theme="light"] .redeem-mini-empty {
  color: #64748c;
}

:root[data-theme="light"] .redeem-mini-row b {
  color: #18794e;
}

.recharge-security-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
}

.recharge-security-card > span {
  color: #adc6ff;
}

.recharge-security-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.recharge-security-card p {
  margin: 0;
  color: #aeb6c9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

:root[data-theme="light"] .recharge-security-card > span {
  color: #174cb0;
}

:root[data-theme="light"] .recharge-security-card p {
  color: #607086;
}

.recharge-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 44px;
}

.app-shell[data-view="recharge"] .recharge-title-row .page-header-actions {
  position: fixed;
  top: 30px;
  right: 32px;
  z-index: 56;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(9, 12, 12, 0.48);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

:root[data-theme="light"] .app-shell[data-view="recharge"] .recharge-title-row .page-header-actions {
  border-color: rgba(22, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.recharge-title-block h2 {
  margin: 0 0 10px;
  color: inherit;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.08;
  font-weight: 800;
}

.recharge-title-block p {
  max-width: 640px;
  margin: 0;
  color: #c1c6d7;
  font-size: 15px;
  line-height: 1.55;
}

:root[data-theme="light"] .recharge-title-block p {
  color: #607086;
}

.recharge-step {
  display: grid;
  gap: 22px;
  max-width: 610px;
}

.recharge-step + .recharge-step {
  margin-top: 54px;
}

.recharge-step-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recharge-step-head > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(173, 198, 255, 0.4);
  border-radius: 999px;
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.06);
  font-weight: 800;
}

:root[data-theme="light"] .recharge-step-head > span {
  color: #1d5fd1;
  background: rgba(29, 95, 209, 0.08);
}

.recharge-step-head h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.recharge-checkout .recharge-amount-grid {
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 14px;
}

.recharge-checkout .recharge-amount,
.recharge-choice,
.recharge-checkout .recharge-custom {
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: #d9dde8;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

:root[data-theme="light"] .recharge-checkout .recharge-amount,
:root[data-theme="light"] .recharge-choice,
:root[data-theme="light"] .recharge-checkout .recharge-custom {
  border-color: rgba(22, 32, 51, 0.1);
  color: #22314a;
  background: rgba(255, 255, 255, 0.82);
}

.recharge-checkout .recharge-amount {
  display: grid;
  place-items: center;
  min-height: 70px;
  padding: 0 14px;
  text-align: center;
}

.recharge-checkout .recharge-amount strong {
  color: inherit;
  font-size: 20px;
}

.recharge-checkout .recharge-amount:hover,
.recharge-choice:hover,
.recharge-checkout .recharge-custom:hover {
  border-color: rgba(173, 198, 255, 0.45);
  background: rgba(173, 198, 255, 0.08);
  transform: translateY(-1px);
}

.recharge-checkout .recharge-amount.active,
.recharge-choice.active,
.recharge-checkout .recharge-custom.active {
  border-color: #9fbdff;
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.085);
  box-shadow: inset 0 0 0 1px rgba(173, 198, 255, 0.18);
}

:root[data-theme="light"] .recharge-checkout .recharge-amount.active,
:root[data-theme="light"] .recharge-choice.active,
:root[data-theme="light"] .recharge-checkout .recharge-custom.active {
  color: #174cb0;
  background: rgba(29, 95, 209, 0.07);
}

.recharge-checkout .recharge-custom {
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 56px;
  margin-top: 0;
  padding: 0 18px;
}

.recharge-currency-symbol {
  color: #cfd5e5;
  font-size: 20px;
  font-weight: 800;
}

:root[data-theme="light"] .recharge-currency-symbol {
  color: #445572;
}

.recharge-checkout .recharge-custom input {
  color: inherit;
  font-size: 20px;
  font-weight: 800;
  text-align: left;
}

.recharge-checkout .recharge-custom input::placeholder {
  color: #7d8495;
}

.recharge-checkout .recharge-custom strong {
  color: #d6dbea;
  font-size: 11px;
  letter-spacing: 0.03em;
}

:root[data-theme="light"] .recharge-checkout .recharge-custom strong {
  color: #4e5f78;
}

.recharge-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
}

.recharge-field-label {
  display: block;
  margin-bottom: 14px;
  color: #b9c1d4;
  font-size: 11px;
  font-weight: 800;
}

:root[data-theme="light"] .recharge-field-label {
  color: #5d6c84;
}

.recharge-choice-list {
  display: grid;
  gap: 8px;
}

.recharge-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
}

.recharge-choice strong,
.recharge-choice span {
  min-width: 0;
}

.recharge-choice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.recharge-choice .material-symbols-outlined {
  color: #adc6ff;
  font-size: 21px;
}

.recharge-token-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid color-mix(in srgb, var(--token-accent) 52%, transparent);
  border-radius: 999px;
  color: var(--token-accent);
  background: color-mix(in srgb, var(--token-accent) 14%, transparent);
  font-size: 11px;
  font-weight: 900;
}

.recharge-choice.network {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-height: 64px;
  align-content: center;
}

.recharge-choice.network span {
  color: #8d95a8;
  font-size: 12px;
}

:root[data-theme="light"] .recharge-choice.network span {
  color: #697890;
}

.recharge-action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 610px;
  margin-top: 34px;
  padding: 16px;
  border: 1px solid rgba(173, 198, 255, 0.12);
  border-radius: 8px;
  background: rgba(173, 198, 255, 0.045);
}

:root[data-theme="light"] .recharge-action-strip {
  border-color: rgba(29, 95, 209, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.recharge-action-strip div {
  display: grid;
  gap: 4px;
}

.recharge-action-strip span,
.recharge-detail-list span {
  color: #b9c1d4;
  font-size: 13px;
}

:root[data-theme="light"] .recharge-action-strip span,
:root[data-theme="light"] .recharge-detail-list span {
  color: #52637c;
}

.recharge-action-strip strong {
  color: #e7e8ec;
  font-size: 23px;
}

:root[data-theme="light"] .recharge-action-strip strong {
  color: #162033;
}

.recharge-payment-summary {
  position: fixed;
  top: 82px;
  right: 32px;
  z-index: 54;
  display: grid;
  align-content: start;
  gap: 24px;
  width: min(440px, calc(100vw - 304px));
  max-height: calc(100vh - 112px);
  min-width: 0;
  overflow-y: auto;
  padding: 34px clamp(24px, 2.8vw, 42px) 22px 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(9, 12, 12, 0.86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(100% + 46px));
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.18, 0.82, 0.18, 1), visibility 0ms linear 520ms;
}

.recharge-payment-summary.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0ms;
}

.recharge-payment-summary > * {
  min-width: 0;
}

:root[data-theme="light"] .recharge-payment-summary {
  border-color: rgba(22, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(24, 32, 45, 0.14);
}

.recharge-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recharge-summary-head strong {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffd38a;
  background: rgba(255, 179, 40, 0.13);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.recharge-qr-frame {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 18px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

:root[data-theme="light"] .recharge-qr-frame {
  border-color: rgba(22, 32, 51, 0.1);
  background: #fff;
}

.recharge-qr-frame > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8f96a7;
  font-size: 12px;
  font-weight: 800;
}

.recharge-payment-summary .recharge-qr {
  position: relative;
  max-width: 174px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.recharge-payment-summary .recharge-qr::after {
  content: none;
}

.recharge-payment-summary .recharge-qr > div {
  padding: 0;
}

.recharge-payment-summary .recharge-qr img {
  background: #fff;
}

.recharge-payment-summary .recharge-qr .material-symbols-outlined {
  color: rgba(173, 198, 255, 0.62);
  font-size: 56px;
}

.recharge-address-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  margin-top: 0;
  padding-block: 10px;
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.055);
  font-size: 12px;
  line-height: 1.35;
}

.recharge-address-copy span {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

:root[data-theme="light"] .recharge-address-copy {
  border-color: rgba(22, 32, 51, 0.1);
  background: #fff;
}

.recharge-detail-list {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.recharge-detail-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recharge-detail-list strong {
  color: #adc6ff;
  text-align: right;
}

:root[data-theme="light"] .recharge-detail-list strong {
  color: #174cb0;
}

.success-text {
  color: #57d68d !important;
}

:root[data-theme="light"] .success-text {
  color: #18794e !important;
}

.recharge-summary-actions {
  display: grid;
  gap: 12px;
  margin-top: clamp(18px, 6vh, 96px);
}

.recharge-summary-actions .btn {
  min-height: 52px;
}

.recharge-summary-actions .btn.ghost {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .recharge-summary-actions .btn.ghost {
  border-color: rgba(22, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.recharge-payment-summary .recharge-status-box {
  gap: 10px;
  padding: 12px;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

:root[data-theme="light"] .recharge-payment-summary .recharge-status-box {
  border-color: rgba(22, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.74);
}

.recharge-confirmation-note {
  margin: -6px 0 0;
  color: #6f7480;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

:root[data-theme="light"] .recharge-confirmation-note {
  color: #8490a3;
}

.recharge-success-dialog {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 420px;
  padding: 34px;
  text-align: center;
}

.recharge-success-dialog h3 {
  margin: 0;
  font-size: 24px;
}

.recharge-success-dialog p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.recharge-success-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: #57d68d;
  background: rgba(87, 214, 141, 0.12);
}

.recharge-success-mark .material-symbols-outlined {
  font-size: 34px;
}

.recharge-success-dialog .btn {
  min-width: 150px;
  min-height: 44px;
  margin-top: 4px;
}

@media (max-height: 780px) and (min-width: 901px) {
  .recharge-payment-summary {
    gap: 18px;
  }

  .recharge-qr-frame {
    padding: 18px;
  }

  .recharge-summary-actions {
    margin-top: 0;
  }

  .recharge-payment-summary .recharge-status-box,
  .recharge-confirmation-note {
    display: none;
  }
}

.redeem-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  gap: 20px;
  align-items: stretch;
}

.redeem-card,
.redeem-account-card,
.redeem-result-card {
  min-width: 0;
}

.redeem-account-card,
.redeem-card {
  display: grid;
  border-color: rgba(173, 198, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--surface-low);
}

.redeem-account-card {
  display: grid;
  align-content: center;
  gap: 34px;
  padding: 28px;
}

.redeem-account-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.redeem-avatar {
  display: grid;
  flex: 0 0 54px;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(173, 198, 255, 0.25);
  border-radius: 14px;
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(173, 198, 255, 0.22), rgba(119, 210, 172, 0.12)),
    rgba(12, 15, 15, 0.72);
  font-weight: 900;
}

.redeem-account-card h3 {
  margin: 0;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.redeem-account-identity p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.redeem-account-balance {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
  gap: 6px 10px;
}

.redeem-account-balance span {
  grid-column: 1 / -1;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.redeem-account-balance strong {
  color: var(--primary);
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 700;
  line-height: 1;
}

.redeem-account-balance small {
  align-self: end;
  margin-bottom: 3px;
  padding: 4px 7px;
  border: 1px solid rgba(173, 198, 255, 0.24);
  border-radius: 5px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.redeem-card {
  gap: 22px;
  padding: 28px;
}

.redeem-card-copy {
  display: grid;
  gap: 12px;
  max-width: 620px;
}

.redeem-card-copy h3 {
  margin: 0;
  font-size: 18px;
}

.redeem-card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.redeem-form {
  display: grid;
  gap: 18px;
}

.redeem-code-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 0 18px;
  border: 1px solid rgba(173, 198, 255, 0.14);
  border-radius: 9px;
  background: var(--input-bg);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.redeem-code-field:focus-within {
  border-color: rgba(173, 198, 255, 0.44);
  box-shadow: 0 0 0 4px rgba(173, 198, 255, 0.08);
}

.redeem-code-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: "Microsoft YaHei", "微软雅黑", var(--font-ui);
  font-size: 17px;
  letter-spacing: 0;
}

.redeem-code-field input::placeholder {
  color: rgba(193, 198, 215, 0.28);
}

.redeem-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.redeem-actions .btn {
  min-width: 220px;
  min-height: 56px;
  border-radius: 9px;
  font-size: 15px;
}

.redeem-action-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.redeem-action-hint .material-symbols-outlined {
  font-size: 17px;
}

.redeem-result-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(173, 198, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.redeem-result-card:has(.redeem-empty-result) {
  display: none;
}

.redeem-result-success {
  display: grid;
  gap: 10px;
}

.redeem-result-success .recharge-status-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.redeem-history-card {
  margin-top: 20px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(173, 198, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.01)),
    var(--surface-low);
}

.redeem-history-card .table-head h3 {
  margin: 0;
  font-size: 17px;
}

.redeem-export-btn {
  min-width: 104px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--primary);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.redeem-export-btn:hover {
  color: var(--primary-strong);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.redeem-export-btn:disabled {
  opacity: 0.48;
  color: var(--faint);
  background: transparent;
  border-color: transparent;
  cursor: not-allowed;
}

.redeem-history-card > [data-redeem-history] {
  min-height: 92px;
}

.redeem-history-card .recharge-loading,
.redeem-history-card .danger-text {
  margin: 18px 24px 24px;
}

.redeem-history-wrap {
  border-top: 1px solid var(--soft-border);
}

.redeem-history-wrap table {
  min-width: 820px;
}

.redeem-history-wrap code {
  font-family: var(--font-code);
  color: var(--primary);
}

.redeem-history-amount {
  color: var(--primary);
  font-weight: 900;
}

.redeem-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--soft-border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.redeem-status-pill span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.redeem-status-pill.success {
  border-color: rgba(20, 184, 133, 0.26);
  color: #44e0ad;
  background: rgba(20, 184, 133, 0.1);
}

.redeem-status-pill.muted {
  opacity: 0.72;
}

:root[data-theme="light"] .redeem-account-card,
:root[data-theme="light"] .redeem-card,
:root[data-theme="light"] .redeem-history-card {
  border-color: rgba(24, 32, 45, 0.1);
  background:
    linear-gradient(180deg, rgba(29, 95, 209, 0.035), rgba(255, 255, 255, 0.72)),
    var(--surface-low);
}

:root[data-theme="light"] .redeem-avatar {
  border-color: rgba(29, 95, 209, 0.18);
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(29, 95, 209, 0.12), rgba(24, 121, 78, 0.08)),
    rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .redeem-code-field,
:root[data-theme="light"] .redeem-result-card {
  border-color: rgba(24, 32, 45, 0.11);
  background: rgba(255, 255, 255, 0.84);
}

:root[data-theme="light"] .redeem-code-field input::placeholder {
  color: rgba(83, 96, 115, 0.52);
}

:root[data-theme="light"] .redeem-status-pill.success {
  border-color: rgba(24, 121, 78, 0.24);
  color: #18794e;
  background: rgba(24, 121, 78, 0.09);
}

:root[data-theme="light"] .settings-user-meta div {
  border-color: rgba(24, 32, 45, 0.1);
  background: rgba(255, 255, 255, 0.74);
}

:root[data-theme="light"] .settings-control {
  border-color: rgba(24, 32, 45, 0.12);
  background: rgba(255, 255, 255, 0.84);
}

:root[data-theme="light"] .settings-control:focus-within {
  border-color: rgba(29, 95, 209, 0.3);
  background: rgba(29, 95, 209, 0.06);
}

:root[data-theme="light"] .settings-control input::placeholder {
  color: rgba(83, 96, 115, 0.52);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--soft-border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active {
  border-color: rgba(119, 210, 172, 0.34);
  color: #98e0bf;
  background: rgba(119, 210, 172, 0.1);
}

.btn .loading-value {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-card {
  display: grid;
  gap: 22px;
  min-height: 240px;
}

.settings-card.span-wide {
  grid-column: 1 / -1;
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.settings-card-head > .material-symbols-outlined {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
}

.settings-card-head p {
  margin: 8px 0 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-border);
}

.settings-row div {
  display: grid;
  gap: 6px;
}

.settings-row strong {
  color: var(--text);
}

.settings-row span {
  color: var(--muted);
}

.settings-account {
  width: min(100%, 360px);
}

.settings-account.account-menu-wrap {
  margin-top: 0;
}

.settings-user-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  color: var(--muted);
  font-weight: 700;
}

.settings-user-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.settings-user-meta div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-user-meta dt {
  margin: 0 0 7px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-user-meta dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.settings-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--input-bg);
  transition: border-color 160ms ease, background 160ms ease;
}

.settings-control:focus-within {
  border-color: rgba(173, 198, 255, 0.42);
  background: rgba(173, 198, 255, 0.07);
}

.settings-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.settings-control input::placeholder {
  color: rgba(193, 198, 215, 0.45);
}

.settings-form-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: #ff8f8f;
  font-size: 13px;
  font-weight: 700;
}

.settings-form .btn {
  justify-self: start;
}

.usage-filters {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(2, minmax(180px, 1fr)) minmax(190px, auto);
  align-items: end;
  gap: 22px;
  width: 100%;
  margin-bottom: 30px;
  padding: 26px 30px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.field-control {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.field-control input,
.field-control select {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.field-control input::placeholder {
  color: rgba(193, 198, 215, 0.45);
}

.usage-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.usage-filter-actions .btn {
  min-height: 44px;
}

.usage-key-cell {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.usage-key-cell small {
  color: var(--muted);
}

.subscription-picker {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin-bottom: 22px;
  padding: 24px 28px;
}

.subscription-picker .field {
  flex: 1 1 380px;
  max-width: 560px;
}

.subscription-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.98fr);
  gap: 18px;
  align-items: stretch;
}

.subscription-card {
  grid-column: 1 / -1;
}

.subscription-overview,
.subscription-features {
  padding: 26px;
}

.subscription-plan-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.subscription-plan-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.16);
}

.subscription-plan-icon .material-symbols-outlined {
  font-size: 30px;
}

.subscription-plan-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.subscription-plan-title h2,
.subscription-features h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
}

.subscription-plan-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.subscription-balance {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 190px;
}

.subscription-balance span,
.subscription-meta-grid span,
.subscription-meter-head span,
.subscription-feature span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.subscription-balance strong {
  color: var(--primary);
  font-size: 17px;
}

.subscription-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 26px;
}

.subscription-meta-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.subscription-meta-grid strong {
  overflow-wrap: anywhere;
}

.subscription-section-label {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subscription-meter + .subscription-meter {
  margin-top: 24px;
}

.subscription-meter-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.subscription-meter-head > div:first-child {
  display: grid;
  gap: 5px;
}

.subscription-meter-value {
  color: var(--primary);
  font-family: var(--font-code);
  font-weight: 800;
  text-align: right;
}

.subscription-meter-value small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
}

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

.subscription-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
}

.subscription-feature-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.subscription-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.subscription-feature > .material-symbols-outlined {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(173, 198, 255, 0.38);
  border-radius: 50%;
  color: var(--primary);
  font-size: 17px;
}

.subscription-feature div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.subscription-feature strong,
.subscription-feature span {
  overflow-wrap: anywhere;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-buttons button {
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.page-buttons button.active,
.page-buttons button:hover {
  border-color: var(--line);
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
}

.page-buttons button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.login-page {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
}

.login-page > .page-header-actions {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
}

.login-card {
  width: min(440px, 100%);
  padding: 44px 36px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-low) 72%, transparent);
  backdrop-filter: blur(12px);
}

.login-card h1 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.login-field {
  margin-bottom: 22px;
}

.login-field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.login-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  color: #4d5667;
}

.login-control input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #111827;
}

.login-error {
  min-height: 20px;
  margin-top: 10px;
  color: #ff8f8f;
  font-size: 14px;
  text-align: center;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.social-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.social-row .btn {
  width: 100%;
}

.center-note {
  margin-top: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}

.center-note a {
  color: var(--primary);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  padding: 12px 16px;
  border: 1px solid rgba(173, 198, 255, 0.28);
  border-radius: 8px;
  color: var(--primary);
  background: var(--popover-bg);
  box-shadow: 0 18px 40px var(--shadow-soft);
}

.delete-popover {
  position: fixed;
  z-index: 90;
  width: 260px;
  padding: 14px;
  border: 1px solid rgba(255, 180, 171, 0.24);
  border-radius: 8px;
  color: var(--text);
  background: var(--popover-bg);
  box-shadow: 0 24px 70px var(--shadow-strong);
}

.delete-popover strong {
  display: block;
  margin-bottom: 6px;
  color: var(--danger);
}

.delete-popover p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.delete-popover > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.delete-popover .btn {
  min-height: 34px;
  padding: 0 12px;
}

.danger-btn {
  background: var(--danger) !important;
  color: #4b0905 !important;
  box-shadow: none !important;
}

.announcement-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(10px);
}

.announcement-dialog {
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(173, 198, 255, 0.2);
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: 0 28px 80px var(--shadow-strong);
}

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

.announcement-head h3 {
  margin: 0;
  font-size: 20px;
}

.announcement-list {
  display: grid;
  gap: 14px;
  max-height: 480px;
  margin-bottom: 18px;
  overflow-y: auto;
}

.announcement-item {
  padding: 16px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: var(--surface-mid);
}

.announcement-item h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 15px;
}

.announcement-item.is-unread {
  border-color: rgba(255, 77, 79, 0.24);
}

.announcement-unread-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff4d4f;
}

.announcement-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.announcement-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.support-dialog {
  width: min(420px, 100%);
}

.google-register-dialog {
  width: min(460px, 100%);
}

.google-account-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--surface-low);
}

.google-account-preview .avatar {
  overflow: hidden;
}

.google-account-preview .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.google-account-preview strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.google-register-dialog .btn.primary {
  width: 100%;
  min-height: 46px;
}

.google-register-dialog input[readonly] {
  color: var(--muted);
}

.support-mail-card {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .support-mail-card {
  background: rgba(24, 32, 45, 0.04);
}

.support-mail-card strong {
  color: var(--text);
  font-family: var(--font-code);
  font-size: 15px;
}

.support-mail-card a:hover strong {
  color: var(--primary);
}

.key-dialog {
  width: min(900px, 100%);
  overflow-y: auto;
}

.key-form {
  display: grid;
  gap: 16px;
}

.key-form .field-control {
  min-height: 46px;
  padding: 0 2px;
}

.key-form input[type="number"]::-webkit-outer-spin-button,
.key-form input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.key-form input[type="number"] {
  appearance: textfield;
}

.custom-select {
  position: relative;
}

.custom-select-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
}

.custom-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 800;
}

.custom-select-trigger small {
  color: var(--primary);
  font-family: var(--font-code);
  font-weight: 800;
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 6;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(173, 198, 255, 0.22);
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: 0 22px 60px var(--shadow-strong);
}

.custom-select.is-open .custom-select-menu {
  display: grid;
  gap: 6px;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option.selected {
  border-color: rgba(173, 198, 255, 0.18);
  background: rgba(173, 198, 255, 0.1);
}

.custom-select-option small {
  color: var(--muted);
  font-family: var(--font-code);
}

.custom-select-empty {
  padding: 12px;
  color: var(--muted);
}

.key-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: var(--input-bg);
  font-family: var(--font-code);
}

.field-help {
  margin: 7px 0 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.45;
}

.key-form-section {
  padding-top: 4px;
}

.key-form-section h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.key-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.key-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.key-toggle-section {
  border: 1px solid var(--soft-border);
  border-radius: 8px;
  background: var(--surface-mid);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 50px;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-row i {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 160ms ease;
}

.switch-row i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d6dcec;
  transition: transform 160ms ease, background 160ms ease;
}

.switch-row input:checked + i {
  background: rgba(173, 198, 255, 0.34);
}

.switch-row input:checked + i::after {
  transform: translateX(18px);
  background: var(--primary);
}

.key-toggle-body {
  display: none;
  padding: 0 14px 16px;
}

.key-toggle-section.is-open .key-toggle-body {
  display: block;
}

.currency-prefix {
  color: var(--muted);
  font-family: var(--font-code);
  font-weight: 800;
}

.number-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.number-stepper button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
  cursor: pointer;
}

.number-stepper input {
  text-align: center;
}

.key-expiry label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.key-expiry label:has(input:checked) {
  color: var(--primary);
  background: rgba(173, 198, 255, 0.1);
}

.custom-expiry-field {
  display: none;
  margin-top: 12px;
}

.custom-expiry-field.is-visible {
  display: block;
}

.date-picker-control {
  position: relative;
  max-width: 292px;
}

.date-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: auto;
  max-width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
  font-family: var(--font-code);
}

.date-trigger span {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.date-trigger .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 18px;
}

.date-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 8;
  display: none;
  width: min(292px, calc(100vw - 56px));
  padding: 10px;
  border: 1px solid rgba(173, 198, 255, 0.22);
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: 0 24px 70px var(--shadow-strong);
}

.date-picker-control.is-open .date-popover {
  display: block;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.calendar-head button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: rgba(173, 198, 255, 0.08);
  cursor: pointer;
}

.calendar-head strong {
  font-size: 13px;
}

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

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.calendar-grid button {
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-mid);
  cursor: pointer;
}

.calendar-grid button:hover,
.calendar-grid button.selected {
  border-color: rgba(173, 198, 255, 0.24);
  color: var(--primary);
  background: rgba(173, 198, 255, 0.12);
}

.calendar-grid button.outside {
  color: var(--faint);
  opacity: 0.48;
  background: transparent;
}

.calendar-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-time input {
  width: 112px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: var(--input-bg);
  font-family: var(--font-code);
}

:root[data-theme="light"] .field-control input[type="date"],
:root[data-theme="light"] .field-control input[type="time"],
:root[data-theme="light"] .calendar-time input {
  color-scheme: light;
  color: var(--text);
  background: var(--input-bg);
}

:root[data-theme="light"] .field-control input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="light"] .field-control input[type="time"]::-webkit-calendar-picker-indicator,
:root[data-theme="light"] .calendar-time input::-webkit-calendar-picker-indicator {
  opacity: 0.72;
  filter: none;
}

.created-key-box {
  padding: 14px;
  border: 1px solid rgba(173, 198, 255, 0.18);
  border-radius: 8px;
  background: rgba(173, 198, 255, 0.06);
}

.key-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes cardOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .tilt-card {
    transform: none !important;
  }

  .home-scene {
    transition-duration: 300ms !important;
    transition-property: opacity !important;
  }

  .loading-value {
    animation: loadingSpin 820ms linear infinite !important;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0 18px;
  }

  .topnav {
    display: none;
  }

  .docs-sidebar {
    position: static;
    width: auto;
    padding: 18px;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .docs-main {
    margin-left: 0;
    margin-right: 0;
    padding: 38px 18px 64px;
  }

  .docs-toc {
    display: none;
  }

  .docs-page-links {
    grid-template-columns: 1fr;
  }

  .docs-integration-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 18px;
    overflow: visible;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-nav-group {
    display: contents;
  }

  .side-section-title {
    grid-column: 1 / -1;
    padding-top: 14px;
  }

  .side-bottom,
  .account-user {
    display: none;
  }

  .app-main {
    margin-left: 0;
    padding: 32px 18px 48px;
  }

  .app-shell[data-view="ai"] .sidebar {
    display: none;
  }

  .app-shell[data-view="ai"] .app-main,
  .app-shell[data-view="ai"] .app-container,
  .app-shell[data-view="ai"] #view,
  .app-shell[data-view="ai"] .ai-page,
  .app-shell[data-view="ai"] .ai-chat-card {
    height: 100vh;
    min-height: 100vh;
  }

  .app-shell[data-view="ai"] .ai-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell[data-view="ai"] .ai-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell[data-view="ai"] .ai-history {
    grid-template-rows: auto auto auto;
    height: auto;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--soft-border);
  }

  .app-shell[data-view="ai"] .ai-history-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .app-shell[data-view="ai"] .ai-history-row {
    flex: 0 0 220px;
  }

  .app-shell[data-view="ai"] .ai-config-panel {
    grid-column: 1;
    grid-row: 1;
    padding: 14px;
    border-left: 0;
    border-bottom: 1px solid rgba(123, 146, 182, 0.12);
  }

  .app-shell[data-view="ai"] .ai-config-card .ai-compact-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell[data-view="ai"] .ai-playground-topbar {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 1fr auto;
    justify-content: stretch;
  }

  .app-shell[data-view="ai"] .ai-chat-card {
    grid-column: 1;
    grid-row: 2;
  }

  .app-shell[data-view="ai"] .ai-playground-nav,
  .app-shell[data-view="ai"] .ai-session-search,
  .app-shell[data-view="ai"] .ai-deploy-btn {
    display: none;
  }

  .filter-block {
    width: 100%;
    margin-left: 0;
  }

  .stats,
  .settings-grid,
  .usage-filters,
  .subscription-layout,
  .subscription-meta-grid,
  .endpoint-grid,
  .affiliate-share-grid,
  .ai-compact-controls,
  .recharge-grid,
  .recharge-network-row,
  .redeem-layout,
  .dashboard-grid,
  .key-form-grid,
  .key-form-grid.three {
    grid-template-columns: 1fr;
  }

  .recharge-checkout {
    grid-template-columns: 1fr;
  }

  .recharge-workspace {
    grid-template-columns: 1fr;
    width: 100%;
    padding-right: 0;
  }

  .recharge-panel {
    padding: 38px 22px 34px;
  }

  .recharge-side-panel {
    padding: 0 22px 34px;
  }

  .recharge-payment-summary {
    top: 76px;
    right: 18px;
    width: min(440px, calc(100vw - 36px));
    max-height: calc(100vh - 96px);
  }

  .recharge-summary-actions {
    margin-top: 24px;
  }

  .pricing-grid {
    grid-template-columns: minmax(0, min(375px, 100%));
  }

  .price-card {
    width: min(375px, 100%);
  }

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

  .usage-filter-actions {
    justify-content: stretch;
  }

  .usage-filter-actions .btn {
    flex: 1;
  }

  .subscription-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .subscription-picker .field {
    max-width: none;
  }

  .subscription-plan-head {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .subscription-balance {
    justify-items: start;
    min-width: 0;
  }

  .recharge-hero {
    flex-direction: column;
  }

  .ai-toolbar-main {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ai-toolbar-main .page-header-actions {
    margin-left: auto;
  }

  .recharge-hero-metrics {
    width: 100%;
  }

  .redeem-layout {
    align-items: stretch;
  }

  .settings-card.span-wide {
    grid-column: auto;
  }

  .settings-user-meta {
    grid-template-columns: 1fr;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4 {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .top-actions .btn.secondary,
  .top-actions .icon-btn {
    display: none;
  }

  .marketing-section {
    width: min(100% - 32px, 1180px);
    padding: 56px 0;
  }

  .home-overlay {
    width: min(100% - 32px, 1180px);
    padding: 0;
    max-height: calc(100vh - 112px);
  }

  .light-footer,
  .page-header,
  .pagination {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .model-details-meta {
    grid-template-columns: 1fr;
  }

  .model-detail-price-row,
  .model-details-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .model-detail-price-row div {
    justify-items: start;
    text-align: left;
  }

  .recharge-hero,
  .recharge-summary,
  .recharge-status-line,
  .recharge-status-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-chat-toolbar,
  .ai-composer-wrap {
    padding-inline: 12px;
  }

  .app-shell[data-view="ai"] .ai-config-card .ai-compact-controls {
    grid-template-columns: 1fr;
  }

  .ai-conversation {
    padding-inline: 12px;
  }

  .ai-bubble {
    max-width: 94%;
  }

  .ai-composer {
    align-items: flex-end;
  }

  .ai-upload.compact {
    width: 100%;
  }

  .redeem-account-card {
    gap: 24px;
  }

  .redeem-account-balance {
    grid-template-columns: auto auto;
  }

  .redeem-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .redeem-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .redeem-code-field {
    min-height: 62px;
  }

  .redeem-history-card .table-head {
    gap: 12px;
  }

  .redeem-result-success .recharge-status-meta strong {
    text-align: left;
  }

  .recharge-hero-metrics,
  .recharge-custom {
    grid-template-columns: 1fr;
  }

  .recharge-title-row,
  .recharge-action-strip,
  .recharge-detail-list div,
  .recharge-side-head.inline,
  .recharge-side-balance {
    align-items: stretch;
    flex-direction: column;
  }

  .recharge-side-head a {
    width: max-content;
  }

  .recharge-title-row .page-header-actions {
    justify-content: flex-start;
  }

  .recharge-checkout .recharge-amount-grid,
  .recharge-method-grid {
    grid-template-columns: 1fr;
  }

  .recharge-step + .recharge-step {
    margin-top: 38px;
  }

  .recharge-payment-summary {
    right: 12px;
    width: calc(100vw - 24px);
    padding: 28px 18px 24px;
  }

  .recharge-detail-list strong {
    text-align: left;
  }

  .recharge-custom input {
    text-align: left;
  }

  .filters {
    margin-inline: -18px;
    padding-inline: 18px;
  }

  .chart {
    gap: 14px;
  }

  th,
  td {
    padding: 14px 16px;
  }
}
