:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar-bg: #ffffff;
  --panel-bg: #ffffff;
  --input-bg: #ffffff;
  --border: #e5e7eb;
  --active: #f3f4f6;
  --hover: #f5f5f5;
  --text: #111827;
  --muted: #6b7280;
  --accent: #5b6cff;
  --danger: #dc2626;
  --shadow: 0 16px 48px rgba(17, 24, 39, .10);
  --soft-shadow: 0 8px 24px rgba(17, 24, 39, .08);
  --rail: 76px;
  --sidebar: 280px;
  --admin-sidebar: 306px;
  --admin-sidebar-collapsed: 76px;
  --radius: 16px;
}
body.theme-dark {
  color-scheme: dark;
  --bg: #0b0f16;
  --sidebar-bg: #0f141d;
  --panel-bg: #121824;
  --input-bg: #0d121b;
  --border: #253041;
  --active: #1d2634;
  --hover: #182131;
  --text: #edf2f8;
  --muted: #9aa7b8;
  --accent: #8ea2ff;
  --danger: #ff6b73;
  --shadow: 0 18px 52px rgba(0, 0, 0, .42);
  --soft-shadow: 0 10px 28px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}
@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}
body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
body.auth-boot .app-shell { display: none; }

button, textarea, input { font: inherit; }
button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
body,
body *:not(input):not(textarea):not([contenteditable="true"]) {
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  caret-color: #111827;
}
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark [contenteditable="true"] {
  caret-color: #edf2f8;
}
body.theme-dark .auth-screen {
  background: rgba(4, 8, 14, .72);
}
body.theme-dark .auth-card,
body.theme-dark .admin-login-card,
body.theme-dark .verify-panel,
body.theme-dark .admin-table-card,
body.theme-dark .admin-chart-card,
body.theme-dark .metric-card,
body.theme-dark .admin-topbar,
body.theme-dark .admin-sidebar,
body.theme-dark .search-box,
body.theme-dark .code-card,
body.theme-dark .attachment-chip {
  background: var(--panel-bg);
  border-color: var(--border);
  color: var(--text);
}
body.theme-dark textarea::placeholder,
body.theme-dark input::placeholder {
  color: #8592a5;
}
body.theme-dark .profile-logout:hover,
body.theme-dark .history-menu:hover {
  background: var(--active);
}
body.theme-dark .avatar-button.default-logo-avatar {
  background-color: #1b2433;
}
body.theme-dark .account-menu-icon,
body.theme-dark .theme-choice-icon {
  color: #b8c3ff;
  background: #222b45;
}
body.theme-dark .account-menu-icon.pro-icon,
body.theme-dark .ultra-badge {
  color: #ffd071;
  background: #382a12;
}
body.theme-dark .account-menu-icon.dark-icon,
body.theme-dark .plan-badge {
  color: #b8c3ff;
  background: #222b45;
}
body.theme-dark .admin-dashboard {
  background: var(--bg);
}
body.theme-dark .admin-nav.active,
body.theme-dark .admin-nav:hover {
  color: #b8c3ff;
  background: #222b45;
}
body.theme-dark .payment-request-card {
  background: var(--input-bg);
  border-color: var(--border);
}
body.theme-dark .admin-card-head button,
body.theme-dark .payment-request-actions button,
body.theme-dark .admin-row-actions button,
body.theme-dark .admin-model-item input,
body.theme-dark .admin-model-item textarea,
body.theme-dark .admin-model-item select,
body.theme-dark .admin-credit-form input,
body.theme-dark .admin-credit-form select,
body.theme-dark .broadcast-form input,
body.theme-dark .broadcast-form textarea {
  border-color: var(--border);
  background: var(--input-bg);
  color: var(--text);
}
body.theme-dark .theme-toggle {
  background: #344054;
}
body.theme-dark .theme-toggle span {
  background: #f8fafc;
}
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid rgba(91, 108, 255, .38);
  outline-offset: 2px;
}
i[data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2.1px;
  flex: 0 0 auto;
}

.auth-screen,
.verify-screen,
.admin-login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.95), rgba(249,250,251,.92) 44%, #eef0f3 100%);
}
.auth-screen {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  z-index: 80;
  background: rgba(248, 250, 252, .72);
  backdrop-filter: blur(10px);
}
.auth-card,
.admin-login-card {
  width: min(370px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 22px 60px rgba(17, 24, 39, .13);
  padding: 30px;
  display: grid;
  gap: 14px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.auth-logo {
  width: 52px;
  height: 52px;
  justify-self: center;
}
.auth-card h1,
.admin-login-card h1,
.verify-panel h1 {
  margin: 0;
  text-align: center;
  font-size: 30px;
  line-height: 1.08;
}
.auth-form {
  display: grid;
  gap: 12px;
}
.auth-field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.auth-field input,
.admin-search input {
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  outline: 0;
}
.auth-primary {
  min-height: 42px;
  border-radius: 8px;
  background: #050505;
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0;
}
.auth-separator::before,
.auth-separator::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}
.auth-provider {
  min-height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-weight: 700;
  background: #fff;
}
.google-button-wrap {
  min-height: 42px;
  display: grid;
  place-items: center;
}
.google-button-wrap > div,
.google-button-wrap iframe {
  max-width: 100% !important;
}
.google-g {
  font-size: 22px;
  font-weight: 800;
  color: #4285f4;
}
.auth-switch,
.auth-legal,
.admin-login-card small {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.auth-switch button,
.admin-link {
  color: #1f5d86;
  font-weight: 700;
  text-decoration: none;
}
.auth-legal {
  font-size: 12px;
}
.auth-error {
  margin: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}
.topbar-auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.topbar-login,
.topbar-register {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
}
.topbar-login {
  background: #050505;
  color: #fff;
}
.topbar-register {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #050505;
}
.guest-card {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px 10px 0;
  display: grid;
  gap: 14px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.guest-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.32;
  max-width: 22ch;
}
.guest-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14.5px;
}
.guest-login-button {
  min-height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
}
.guest-login-button:hover,
.topbar-register:hover {
  background: var(--hover);
}
.verify-panel {
  width: min(440px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}
.verify-panel p {
  margin: 0;
  line-height: 1.45;
}
.verify-panel .auth-primary {
  width: 100%;
  max-width: 420px;
}
.verify-code-field {
  width: min(240px, 100%);
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.verify-code-field input {
  width: 100%;
  height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .22em;
  outline: 0;
}
.verify-icon {
  width: 112px;
  height: 112px;
  border: 6px solid #9dd8f1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #4f82dc;
  box-shadow: 0 18px 34px rgba(79, 130, 220, .22);
}
.verify-icon i {
  width: 54px;
  height: 54px;
}
.admin-login-card {
  width: min(486px, 100%);
  border-radius: 14px;
  padding: 48px 44px;
}
.admin-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 30px;
}
.admin-dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--admin-sidebar) minmax(0, 1fr);
  background: var(--bg);
  transition: grid-template-columns .18s ease;
}
.admin-dashboard.admin-nav-collapsed {
  grid-template-columns: var(--admin-sidebar-collapsed) minmax(0, 1fr);
}
.admin-sidebar {
  background: var(--panel-bg);
  color: var(--text);
  border-right: 1px solid var(--border);
  padding: 20px 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.admin-mobile-nav-toggle,
.admin-sidebar-backdrop {
  display: none !important;
}
.admin-side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  min-height: 50px;
}
.admin-side-brand .brand-mark {
  width: 34px;
  height: 34px;
}
.admin-side-brand strong {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-sidebar-toggle {
  width: 50px;
  height: 50px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--input-bg);
  color: var(--muted);
}
.admin-sidebar-toggle:hover {
  color: var(--text);
  background: var(--active);
}
.admin-nav {
  min-height: 50px;
  border-radius: 14px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.admin-nav span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-nav.active,
.admin-nav:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.admin-nav:hover {
  transform: translateX(2px);
}
.admin-dashboard.admin-nav-collapsed .admin-side-brand {
  justify-content: center;
  gap: 0;
}
.admin-dashboard.admin-nav-collapsed .admin-side-brand strong,
.admin-dashboard.admin-nav-collapsed .admin-nav span {
  display: none;
}
.admin-dashboard.admin-nav-collapsed .admin-side-brand .brand-mark {
  display: none;
}
.admin-dashboard.admin-nav-collapsed .admin-sidebar-toggle {
  margin-inline: auto;
}
.admin-dashboard.admin-nav-collapsed .admin-nav {
  justify-content: center;
  padding: 0;
}
.admin-dashboard.admin-nav-collapsed .admin-nav:hover {
  transform: none;
}
.admin-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 20px;
}
.admin-view-panel {
  display: grid;
  gap: 16px;
}
.admin-topbar {
  min-height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.admin-topbar h1,
.admin-card-head h2 {
  margin: 0;
}
.admin-topbar h1 {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 38px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-top-actions,
.admin-search {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-search {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 14px;
  background: var(--input-bg);
  min-width: 268px;
}
.admin-search input {
  border: 0;
  min-height: 42px;
  padding: 0;
  background: transparent;
}
.admin-metrics {
  padding: 2px 28px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.metric-card,
.admin-chart-card,
.admin-table-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-bg);
  box-shadow: var(--soft-shadow);
}
.metric-card {
  min-height: 112px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.metric-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--active);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.metric-card strong {
  display: block;
  font-size: 25px;
  line-height: 1.08;
}
.metric-card small {
  color: #15803d;
}
.admin-chart-card,
.admin-table-card {
  margin: 0 28px;
  overflow: hidden;
}
.admin-card-head {
  min-height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.admin-hint {
  color: var(--muted);
  font-size: 13px;
}
.admin-card-head button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
}
.admin-chart {
  height: 288px;
  padding: 26px 20px;
}
.admin-chart svg {
  width: 100%;
  height: 100%;
}
.admin-chart path {
  fill: none;
  stroke: #4778c7;
  stroke-width: 3;
}
.admin-chart .line-dark {
  stroke: #0f172a;
}
.admin-table-card table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-card th,
.admin-table-card td {
  height: 62px;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  text-align: left;
}
.admin-do-card {
  margin-top: 18px;
}
.admin-do-body {
  padding: 16px 20px 20px;
  display: grid;
  gap: 14px;
}
.admin-do-account {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--input-bg);
}
.admin-do-account span,
.admin-do-account small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-do-account span {
  font-weight: 900;
}
.admin-do-account small {
  color: var(--muted);
}
.admin-do-billing {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, #eff6ff, #fff);
}
.admin-do-billing.warning {
  border-color: #fed7aa;
  background: #fff7ed;
}
.admin-do-billing-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-do-billing-title > i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  padding: 9px;
  color: #1d4ed8;
  background: #dbeafe;
}
.admin-do-billing.warning .admin-do-billing-title > i {
  color: #c2410c;
  background: #ffedd5;
}
.admin-do-billing-title div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.admin-do-billing-title strong {
  font-size: 15px;
}
.admin-do-billing-title span,
.admin-do-billing > small,
.admin-do-billing-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.admin-do-billing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.admin-do-billing-card {
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 5px;
  background: #fff;
}
.admin-do-billing-card i {
  width: 18px;
  height: 18px;
  color: #2563eb;
}
.admin-do-billing-card span,
.admin-do-billing-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}
.admin-do-billing-card strong {
  font-size: 20px;
  line-height: 1.05;
}
.admin-do-billing-history {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.admin-do-credit-row {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  background: #fff;
}
.admin-do-credit-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.admin-do-credit-row span,
.admin-do-credit-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.admin-do-credit-row strong,
.admin-do-credit-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-do-billing-row {
  min-height: 42px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(100px, auto);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.admin-do-billing-row:last-child {
  border-bottom: 0;
}
.admin-do-billing-row span,
.admin-do-billing-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-do-billing-row small {
  color: var(--muted);
  text-align: right;
}
.admin-do-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.admin-do-stat {
  min-height: 82px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 5px;
  background: #fff;
}
.admin-do-stat i {
  width: 18px;
  height: 18px;
  color: #2563eb;
}
.admin-do-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.admin-do-stat strong {
  font-size: 20px;
  line-height: 1;
}
.admin-do-list {
  display: grid;
  gap: 10px;
}
.admin-do-row {
  min-height: 74px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) minmax(190px, .9fr) minmax(220px, 1fr) minmax(150px, .75fr);
  gap: 12px;
  align-items: center;
}
.admin-do-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-do-main div,
.admin-do-ip {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.admin-do-main strong,
.admin-do-main small,
.admin-do-ip span,
.admin-do-ip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-do-main small,
.admin-do-ip small {
  color: var(--muted);
}
.do-status {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .13);
}
.do-status.active {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .14);
}
.admin-do-specs {
  min-width: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-do-live {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.admin-do-specs span,
.admin-do-live span {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.admin-do-live span {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.admin-do-live strong {
  color: #0f172a;
}
.admin-do-metric-error {
  border-color: #fed7aa !important;
  background: #fff7ed !important;
  color: #9a3412 !important;
  border-radius: 8px !important;
  white-space: normal;
}
.admin-do-empty {
  margin: 16px 20px 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  background: var(--input-bg);
}
.admin-do-empty i {
  width: 22px;
  height: 22px;
  color: #2563eb;
  flex: 0 0 auto;
}
.admin-do-empty div {
  display: grid;
  gap: 3px;
}
.admin-do-empty strong {
  color: var(--text);
}
.admin-do-empty.danger {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff1f2;
}
.admin-do-empty.danger i {
  color: #dc2626;
}
.status-pill {
  border-radius: 999px;
  padding: 4px 10px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
}
.status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}
.status-pill.frozen {
  background: #fee2e2;
  color: #991b1b;
}
.admin-plan-select {
  min-height: 36px;
  min-width: 96px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 34px 0 12px;
  background: var(--input-bg);
  color: var(--text);
  font-weight: 900;
}
.admin-plan-cell {
  display: inline-grid;
  gap: 5px;
}
.admin-plan-cell small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.admin-plan-select.plan-free {
  background: #ecfdf5;
  color: #047857;
}
.admin-plan-select.plan-pro {
  background: #eef2ff;
  color: #3440b8;
}
.admin-plan-select.plan-ultra {
  background: #fff3d6;
  color: #9a5b00;
}
.admin-plan-select.plan-admin {
  background: #f8fafc;
  color: #111827;
}
.admin-users-card {
  overflow-x: auto;
}
.admin-users-card table {
  min-width: 1180px;
}
.payment-request-list {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.payment-request-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: #fff;
}
.payment-request-card > img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}
.payment-request-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.payment-request-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.payment-request-copy strong,
.payment-request-copy small,
.payment-request-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.payment-request-copy small,
.payment-request-copy > span {
  color: var(--muted);
}
.payment-request-actions {
  display: flex;
  gap: 8px;
}
.payment-request-actions button {
  min-height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}
.payment-request-actions button:hover:not(:disabled) {
  background: var(--active);
}
.payment-request-actions button.danger {
  color: var(--danger);
}
.payment-request-actions button:disabled {
  opacity: .48;
  cursor: not-allowed;
}
.admin-range-pill {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--input-bg);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.admin-analytics-summary {
  padding: 16px 16px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.analytics-insight {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: var(--input-bg);
}
.analytics-insight-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.analytics-insight small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.analytics-insight strong {
  display: block;
  min-width: 0;
  margin-top: 3px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.analytics-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.analytics-stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--input-bg);
}
.analytics-stat > span {
  width: 10px;
  height: 46px;
  border-radius: 999px;
  background: var(--stat-color);
}
.analytics-stat strong,
.analytics-stat b {
  color: var(--text);
  font-size: 18px;
}
.analytics-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.admin-model-chart {
  padding: 16px;
  display: grid;
  gap: 12px;
}
.model-chart-canvas {
  position: relative;
  min-height: 330px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--input-bg), var(--panel-bg));
  padding: 14px 14px 38px 50px;
  overflow: hidden;
}
.model-chart-canvas svg {
  width: 100%;
  height: 270px;
  display: block;
}
.model-chart-canvas path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 10px rgba(17, 24, 39, .10));
}
.model-chart-canvas circle {
  stroke: var(--panel-bg);
  stroke-width: 2.4px;
  filter: drop-shadow(0 4px 6px rgba(17, 24, 39, .12));
}
.chart-grid line {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-y-labels {
  position: absolute;
  top: 14px;
  left: 12px;
  width: 30px;
  height: 270px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.chart-y-labels span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
}
.chart-axis-labels {
  position: absolute;
  left: 50px;
  right: 14px;
  bottom: 12px;
  height: 18px;
}
.chart-axis-labels span {
  position: absolute;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.analytics-legend span {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: var(--input-bg);
  font-size: 13px;
  font-weight: 800;
}
.analytics-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}
.admin-model-list {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.admin-model-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--input-bg);
  display: grid;
  gap: 12px;
}
.admin-model-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.admin-model-title strong {
  display: block;
  color: var(--text);
}
.admin-model-title small {
  color: var(--muted);
  font-size: 13px;
}
.admin-model-item label,
.admin-credit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.admin-model-item input,
.admin-model-item textarea,
.admin-model-item select,
.admin-credit-form input,
.admin-credit-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-bg);
  color: var(--text);
  padding: 0 11px;
  min-height: 40px;
}
.admin-model-item textarea {
  min-height: 84px;
  padding-top: 10px;
  resize: vertical;
}
.admin-credit-policy {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel-bg);
  display: grid;
  gap: 12px;
}
.admin-credit-policy-head {
  display: grid;
  gap: 3px;
}
.admin-credit-policy-head strong {
  color: var(--text);
}
.admin-credit-policy-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.admin-credit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-credit-grid label {
  min-width: 0;
}
.admin-credit-grid input:disabled {
  opacity: .55;
  background: var(--active);
}
.admin-switch {
  display: inline-flex !important;
  align-items: center;
  justify-content: end;
}
.admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.admin-switch span {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background .16s ease;
}
.admin-switch span::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
  transition: transform .16s ease;
}
.admin-switch input:checked + span {
  background: var(--accent);
}
.admin-switch input:checked + span::after {
  transform: translateX(20px);
}
.admin-credit-form {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.admin-credit-form .primary-button {
  min-height: 40px;
}
.broadcast-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 16px;
  align-items: stretch;
}
.broadcast-form {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.broadcast-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.broadcast-form input,
.broadcast-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-bg);
  color: var(--text);
  padding: 0 12px;
  min-height: 42px;
}
.broadcast-form textarea {
  min-height: 180px;
  padding-top: 12px;
  line-height: 1.55;
  resize: vertical;
}
.broadcast-form .primary-button {
  min-height: 38px;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1;
}
.broadcast-form .primary-button i {
  width: 17px;
  height: 17px;
}
.broadcast-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.broadcast-status.success { color: #15803d; }
.broadcast-status.warning { color: #92400e; }
.broadcast-status.error { color: var(--danger); }
.broadcast-preview {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f4f6fb;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.broadcast-email-card {
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 22px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 42px rgba(17, 24, 39, .08);
}
.broadcast-email-head {
  padding: 26px 28px;
  background: #070b15;
  color: #fff;
}
.broadcast-email-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .02em;
}
.broadcast-preview-kicker {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 7px 10px;
  color: #2563eb;
  background: #eaf2ff;
  font-size: 12px;
  font-weight: 900;
}
.broadcast-email-kicker {
  display: block;
  margin-top: 18px;
  color: #93c5fd;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.broadcast-preview h3 {
  margin: 8px 0 0;
  color: #fff;
  font-size: 26px;
  line-height: 1.25;
}
.broadcast-email-content {
  padding: 28px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.7;
}
.broadcast-email-content p {
  margin: 0 0 16px;
}
.broadcast-preview-body {
  min-height: 74px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 22px;
  background: #f8fafc;
  color: #111827;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.broadcast-email-note {
  margin-top: 20px !important;
  color: #4b5563;
}
.broadcast-email-button {
  display: inline-block;
  margin-top: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-weight: 900;
}
.broadcast-email-thanks {
  margin-top: 20px !important;
  margin-bottom: 0 !important;
  color: #4b5563;
}
.broadcast-email-sender {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-weight: 900;
}
.broadcast-email-footer {
  padding: 18px 28px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.6;
}
.broadcast-preview small {
  color: var(--muted);
  line-height: 1.45;
}
.broadcast-history {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.broadcast-history-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  background: var(--input-bg);
}
.broadcast-history-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.broadcast-history-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.broadcast-history-title strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.broadcast-history-main p {
  max-height: 84px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow: hidden;
}
.broadcast-history-main small {
  color: var(--muted);
}
.broadcast-history-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.broadcast-history-meta b {
  color: var(--text);
  font-size: 17px;
}
.admin-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}
.admin-row-actions button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}
.admin-row-actions button:hover {
  background: var(--active);
}
.admin-row-actions button.danger {
  color: var(--danger);
}
.admin-user-editor {
  gap: 13px;
}
.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  color: var(--text) !important;
}
.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.terms-modal::backdrop {
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(4px);
}
.terms-panel {
  width: min(760px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  padding: 28px;
  display: grid;
  gap: 18px;
}
.terms-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.terms-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}
.terms-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}
.terms-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.terms-content {
  max-height: min(46vh, 390px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
  display: grid;
  gap: 16px;
}
.terms-content h3 {
  margin: 0 0 7px;
  font-size: 16px;
}
.terms-content p,
.terms-content li {
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
}
.terms-content p,
.terms-content ul {
  margin: 0;
}
.terms-content ul {
  padding-left: 20px;
}
.terms-checks {
  display: grid;
  gap: 10px;
}
.terms-checks .checkbox-row {
  align-items: flex-start;
  color: #111827 !important;
  font-weight: 800;
  line-height: 1.45;
}
.terms-confirm {
  width: 100%;
}
.terms-confirm:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: var(--bg);
  padding-left: var(--rail);
  overflow-x: hidden;
  transition: grid-template-columns .2s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 12px 16px;
  z-index: 40;
}
.rail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 19px;
  margin-top: 28px;
}
.rail-avatar { margin-top: auto; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 var(--rail);
  width: var(--sidebar);
  height: 100vh;
  max-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  overscroll-behavior: contain;
  z-index: 35;
  transition: transform .2s ease, width .2s ease, padding .2s ease;
}
.sidebar.collapsed {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  border-right: 0;
}
.app-shell:not(.sidebar-collapsed) .sidebar {
  width: var(--sidebar);
  padding: 20px;
  border-right: 1px solid var(--border);
}
.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  border-right: 0;
}

.sidebar-top {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-block;
  flex: 0 0 auto;
  background-image: url("/depoizon-logo.png?v=snake-logo-20260525");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  transform: none;
  filter: drop-shadow(0 1px 0 rgba(17, 24, 39, .08));
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.brand-mark.small {
  width: 32px;
  height: 32px;
}
.hero-mark {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  filter: drop-shadow(0 12px 24px rgba(17, 24, 39, .10));
  animation: logoFloat 12s ease-in-out infinite;
}
.hero-mark::after {
  content: "";
  position: absolute;
  inset: -34%;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.72) 0 7%, rgba(255,255,255,.26) 17%, rgba(91,108,255,.10) 27%, transparent 48%);
  filter: blur(9px);
  transform: translate(-78%, 44%) rotate(-18deg);
  animation: logoShine 14s cubic-bezier(.45, 0, .2, 1) infinite;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.icon-button,
.tool-button,
.round-action {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background .2s ease, color .2s ease, transform .2s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.icon-button.compact {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
.icon-button:hover,
.tool-button:hover,
.round-action:hover,
.icon-button.active {
  background: var(--active);
}
.auth-card .auth-close {
  position: absolute;
}
.brand-button:hover { background: transparent; }
.subtle { color: var(--muted); }

.nav-list {
  display: grid;
  gap: 7px;
}
.search-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}
.search-box {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, .04);
}
.search-box i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--text);
  background: transparent;
}
.search-results {
  display: grid;
  gap: 8px;
  max-height: min(360px, calc(100vh - 260px));
  overflow: auto;
  padding: 2px 2px 4px;
  scrollbar-gutter: stable;
}
.search-result {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .035);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.search-result:hover {
  border-color: #d1d5db;
  background: #fafafa;
  box-shadow: 0 12px 24px rgba(17, 24, 39, .07);
  transform: translateY(-1px);
}
.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  background: var(--active);
  flex: 0 0 auto;
}
.search-result-icon i {
  width: 17px;
  height: 17px;
}
.search-result-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
}
.search-result-copy strong,
.search-result-copy small {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.search-result-copy strong {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1.25;
}
.search-result-copy small,
.search-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.search-empty {
  margin: 0;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fafafa;
}
.nav-item,
.muted-action {
  min-height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 14px;
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  text-align: left;
  transition: background .2s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.nav-item:hover,
.muted-action:hover,
.nav-item.active {
  background: var(--active);
}
.muted-action {
  color: var(--muted);
  font-weight: 500;
}
.sidebar-section {
  margin-top: 24px;
  min-width: 0;
}
.history-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-section.section-focus {
  border-radius: 16px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px var(--border);
  padding: 10px;
  margin-left: -10px;
  margin-right: -10px;
}
.section-title {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.section-title i { width: 16px; height: 16px; }
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.text-button {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 8px;
  color: var(--muted);
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.text-button:hover { background: var(--hover); }
.text-button.danger { color: var(--danger); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  position: absolute;
  top: 10px;
  right: 9px;
}
.dot.inline {
  position: static;
  margin-left: auto;
  width: 7px;
  height: 7px;
}

.history-groups {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 8px;
}
.history-groups::-webkit-scrollbar {
  width: 8px;
}
.history-groups::-webkit-scrollbar-track {
  background: transparent;
}
.history-groups::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}
.history-groups:hover::-webkit-scrollbar-thumb {
  background: #d1d5db;
}
.history-section.collapsed .history-groups { display: none; }
.history-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
}
.history-label::after {
  content: "";
  height: 1px;
  flex: 1;
  min-width: 0;
  background: var(--border);
}
.history-item {
  width: 100%;
  min-height: 42px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  color: #374151;
  font-size: 15px;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.history-item:hover,
.history-item.active { background: var(--active); color: var(--text); }
.history-item .history-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.history-retention {
  min-width: 0;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
}
.history-retention svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}
.history-menu {
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.history-menu:hover {
  background: #e5e7eb;
  color: var(--text);
}
.history-groups .muted-action {
  min-height: auto;
  margin-top: 12px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-card {
  width: 100%;
  min-height: 72px;
  margin-top: 12px;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: background .2s ease;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  overflow: hidden;
}
.profile-card:hover { background: var(--hover); }
.profile-logout {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
  transition: background .16s ease, color .16s ease;
}
.profile-logout i {
  width: 17px;
  height: 17px;
}
.profile-logout:hover {
  background: #e5e7eb;
  color: var(--danger);
}
.account-menu {
  position: fixed;
  left: 12px;
  bottom: 74px;
  width: 268px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel-bg) 96%, transparent);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 60;
  backdrop-filter: blur(14px);
}
.app-shell:not(.sidebar-collapsed) + .account-menu,
.account-menu.from-sidebar {
  left: calc(var(--rail) + 20px);
  bottom: 88px;
}
.account-menu-item {
  width: 100%;
  min-height: 58px;
  border-radius: 14px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--text);
}
.account-menu-item:hover {
  background: var(--hover);
}
.account-menu-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  background: #edf2ff;
}
.account-menu-icon i {
  width: 19px;
  height: 19px;
}
.account-menu-icon.pro-icon {
  color: #8a4a00;
  background: #fff2cc;
}
.account-menu-icon.dark-icon {
  color: #3644d9;
  background: #e9edff;
}
.account-menu-item span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.account-menu-item strong,
.account-menu-item small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.account-menu-item strong {
  font-size: 14px;
  font-weight: 800;
}
.account-menu-item small {
  color: var(--muted);
  font-size: 12px;
}
.profile-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 4px;
  line-height: 1.2;
}
.profile-copy small {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.profile-copy strong {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.18;
}
.profile-copy strong > span:first-child {
  display: block;
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-plan-badge {
  flex: 0 0 auto;
  height: 18px;
  max-width: 66px;
  padding: 0 7px 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #075985, #2563eb);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 7px 16px rgba(37, 99, 235, .22);
}
.profile-plan-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-plan-badge.ultra {
  background: linear-gradient(135deg, #25104b, #6d28d9 54%, #d97706);
  box-shadow: 0 7px 18px rgba(109, 40, 217, .28);
}
.profile-plan-badge.ultra i {
  color: #ffe08a;
}
.profile-plan-badge.admin {
  background: linear-gradient(135deg, #020617, #334155);
  box-shadow: 0 7px 18px rgba(15, 23, 42, .28);
}
.profile-plan-badge.admin i {
  color: #fde68a;
}
.profile-plan-badge i {
  width: 10px;
  height: 10px;
  stroke-width: 2.5;
}
.profile-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.avatar-button {
  position: relative;
  width: 38px;
  height: 38px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: #e5e7eb;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #111827;
  flex: 0 0 auto;
  overflow: visible;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .08);
}
.avatar-photo-frame {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  display: block;
  background: #e5e7eb;
}
.avatar-photo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 116%;
  height: 116%;
  max-width: none;
  transform: translate(-50%, -50%);
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}
.avatar-plan-badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 17px;
  height: 17px;
  border: 2px solid var(--panel-bg);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  box-shadow: 0 6px 14px rgba(17, 24, 39, .2);
  z-index: 2;
}
.avatar-plan-badge.ultra {
  background: linear-gradient(135deg, #111827, #7c3aed);
}
.avatar-plan-badge.pro {
  background: linear-gradient(135deg, #064e3b, #16a34a);
}
.avatar-plan-badge.admin {
  background: linear-gradient(135deg, #020617, #334155);
}
.avatar-plan-badge i {
  width: 9px;
  height: 9px;
  stroke-width: 3;
}
.avatar-button.default-logo-avatar {
  color: #111827;
  background-color: #e5e7eb;
  background-image: url("/depoizon-logo.png?v=snake-logo-20260525");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 76%;
}
.avatar-button.has-photo {
  color: transparent;
}
.profile-card .avatar-button {
  width: 48px;
  height: 48px;
  font-size: 15px;
}
.profile-card .avatar-plan-badge {
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
}
.profile-card .avatar-plan-badge i {
  width: 10px;
  height: 10px;
}
.rail-avatar .avatar-plan-badge {
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
}
.rail-avatar .avatar-plan-badge i {
  width: 10px;
  height: 10px;
}
.rail-avatar {
  width: 46px;
  height: 46px;
  margin-bottom: 2px;
}

.main-panel {
  grid-column: 2;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  overflow: hidden;
}
.topbar {
  height: 72px;
  padding: 0 34px 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-spacer { flex: 1; }
.topbar-item {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #111827;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 14px;
  padding: 0 8px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.topbar-item:hover { background: var(--hover); }
.topbar-item i { width: 19px; height: 19px; }
.topbar-item.text-only {
  padding: 0 10px;
}
.topbar-promo {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4f46e5;
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  transition: background .16s ease, transform .16s ease;
}
.topbar-promo:hover {
  background: rgba(79, 70, 229, .08);
  transform: translateY(-1px);
}
.topbar-promo i {
  width: 19px;
  height: 19px;
  fill: currentColor;
}
.topbar-edit {
  border: 1px solid var(--border);
  border-radius: 999px;
}

.welcome-view {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px 190px;
}
.welcome-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transform: translateY(-24px);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: .28em;
  color: #0f172a;
  font-size: clamp(50px, 4.8vw, 72px);
  line-height: .94;
  font-weight: 800;
  letter-spacing: 0;
  font-family: "Manrope", "Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
  transform: translateY(-2px);
  position: relative;
  isolation: isolate;
  text-shadow: 0 12px 34px rgba(15, 23, 42, .10);
}
.brand-wordmark span {
  background: linear-gradient(110deg, #0f172a 0%, #0f172a 40%, #3046ff 48%, #eef4ff 50%, #6d7cff 53%, #0f172a 62%, #0f172a 100%);
  background-size: 340% 100%;
  background-position: 125% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wordmarkShine 15s cubic-bezier(.45, 0, .2, 1) infinite;
}
.brand-wordmark span:first-child {
  letter-spacing: .01em;
}
.brand-wordmark span:last-child {
  font-weight: 800;
  letter-spacing: .04em;
  animation-delay: .08s;
}

@keyframes wordmarkShine {
  0%, 24% { background-position: 125% 0; }
  84%, 100% { background-position: -125% 0; }
}

@keyframes logoShine {
  0%, 26% { transform: translate(-78%, 44%) rotate(-18deg); opacity: 0; }
  44% { opacity: .36; }
  82%, 100% { transform: translate(78%, -44%) rotate(-18deg); opacity: 0; }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.008); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mark,
  .hero-mark::after,
  .brand-wordmark span {
    animation: none;
  }
}

.chat-view {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 24px min(8vw, 128px) 190px;
}
.hidden { display: none !important; }
.message-list {
  width: min(980px, 100%);
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.message {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.bubble {
  width: min(760px, 100%);
  max-width: 100%;
  border-radius: 22px;
  padding: 14px 18px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  line-height: 1.55;
  font-size: 16px;
  cursor: default;
  caret-color: transparent;
}
.message.user {
  align-items: flex-end;
}
.message.user .bubble {
  background: var(--active);
  border: 1px solid transparent;
  border-bottom-right-radius: 8px;
}
.message.user .bubble .command-user-link {
  color: #2563eb;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.message.user .bubble .command-user-link:hover {
  color: #1d4ed8;
}
.message.user .bubble.editing-bubble {
  position: relative;
  width: min(920px, 100%);
  min-height: 138px;
  padding: 20px 24px 14px;
  border-radius: 24px;
  background: var(--active);
  white-space: normal;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .02);
}
.message.user .bubble.editing-bubble.long-edit-bubble {
  width: min(920px, 100%);
  min-height: 350px;
}
.inline-edit {
  display: block;
  min-height: 104px;
  min-width: 0;
}
.inline-edit.long-edit {
  min-height: 316px;
}
.inline-edit-input {
  width: 100%;
  min-height: 44px;
  max-height: 280px;
  padding: 0 34px 56px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  caret-color: #111827;
  user-select: text;
  -webkit-user-select: text;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 24, 39, .24) transparent;
}
.inline-edit.long-edit .inline-edit-input {
  min-height: 230px;
}
.inline-edit-input::-webkit-scrollbar {
  width: 10px;
}
.inline-edit-input::-webkit-scrollbar-track {
  background: transparent;
}
.inline-edit-input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 3px solid transparent;
  background: rgba(17, 24, 39, .18);
  background-clip: content-box;
}
.inline-edit-input::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 24, 39, .28);
  background-clip: content-box;
}
.inline-edit-input::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}
.inline-edit-actions {
  position: absolute;
  right: 24px;
  bottom: 14px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0;
  pointer-events: auto;
}
.inline-edit-actions .secondary-button,
.inline-edit-actions .primary-button {
  min-width: 68px;
  height: 38px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
}
.message.assistant .bubble {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 8px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .06);
  color: var(--text);
  min-width: 120px;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  caret-color: transparent;
}
.message.assistant .bubble *,
.message.assistant .message-media-slot *,
.message.assistant .response-text *,
.message.assistant .code-card code,
.message.assistant .code-card pre {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}
.message.user .bubble {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
  caret-color: transparent;
}
.message.user .bubble * {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}
.message.assistant .bubble.rich-response {
  width: min(820px, 100%);
  max-width: 100%;
  padding: 22px 24px;
  background: #f4f7fb;
  border: 0;
  border-radius: 22px;
  box-shadow: none;
  white-space: normal;
  overflow: hidden;
}
.message.assistant .bubble.raw-provider-response {
  width: fit-content;
  max-width: min(760px, 100%);
  min-width: 0;
  padding: 13px 17px;
  white-space: normal;
  line-height: 1.55;
}
.message.assistant .bubble.raw-provider-response p {
  margin: 0 0 10px;
}
.message.assistant .bubble.raw-provider-response h3 {
  margin: 16px 0 7px;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 800;
}
.message.assistant .bubble.raw-provider-response h3:first-child {
  margin-top: 0;
}
.message.assistant .bubble.raw-provider-response ul,
.message.assistant .bubble.raw-provider-response ol {
  margin: 6px 0 14px;
  padding-left: 22px;
}
.message.assistant .bubble.raw-provider-response li {
  margin: 4px 0;
}
.message.assistant .bubble.raw-provider-response > *:last-child {
  margin-bottom: 0;
}
.message.assistant .bubble.raw-provider-response a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.message.assistant .bubble.rich-response.raw-provider-response {
  white-space: normal;
}
.response-text {
  width: 100%;
  max-width: 100%;
  margin: 0 0 18px;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.58;
  font-size: 15.5px;
  color: #071a3d;
}
.response-text:empty {
  display: none;
}
.response-text > *:first-child {
  margin-top: 0;
}
.response-text > *:last-child {
  margin-bottom: 0;
}
.response-text p {
  margin: 0 0 14px;
  white-space: pre-wrap;
}
.response-text h3,
.response-text h4,
.response-text h5 {
  margin: 18px 0 10px;
  color: var(--text);
  line-height: 1.25;
  font-weight: 800;
}
.response-text h3 + p,
.response-text h4 + p,
.response-text h5 + p {
  max-width: 68ch;
  color: #10234a;
  font-size: 15.5px;
  font-weight: 500;
}
.response-text h3 {
  font-size: clamp(22px, 2vw, 28px);
  color: #001b52;
  letter-spacing: 0;
}
.response-text h4,
.response-text h5 {
  font-size: clamp(18px, 1.55vw, 22px);
  color: #001b52;
  letter-spacing: 0;
}
.response-text ul,
.response-text ol {
  margin: 8px 0 14px;
  padding-left: 22px;
}
.response-text li {
  margin: 5px 0;
  padding-left: 2px;
}
.response-text li > ul,
.response-text li > ol {
  margin: 6px 0 8px;
}
.response-text .list-continuation {
  margin: 3px 0 8px;
}
.response-text strong {
  font-weight: 800;
}
.response-text em {
  font-style: italic;
}
.response-text code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}
.response-text hr {
  height: 1px;
  border: 0;
  margin: 16px 0;
  background: var(--border);
}
.markdown-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 14px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.markdown-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14.5px;
  line-height: 1.55;
}
.markdown-table th,
.markdown-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}
.markdown-table th {
  background: #f8fafc;
  color: var(--text);
  font-weight: 850;
}
.markdown-table tr:last-child td {
  border-bottom: 0;
}
.markdown-table-code {
  margin: 0;
  padding: 13px 14px;
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}
.markdown-table-code code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.code-card {
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: #f7f7f8;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .05);
}
.code-card.prompt-card {
  position: relative;
  margin: 10px 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.prompt-card .code-card-head {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  min-height: 0;
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}
.prompt-card .code-card-title,
.prompt-card .code-run {
  display: none;
}
.prompt-card .code-card-actions {
  width: 100%;
  justify-content: flex-end;
}
.prompt-card .code-copy {
  width: 34px;
  height: 32px;
  min-width: 34px;
  padding: 0;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  gap: 0;
  background: rgba(255, 255, 255, .92);
  color: #10234a;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
  font-size: 12px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prompt-card .code-copy::after {
  content: none;
}
.code-card-head {
  min-height: 54px;
  padding: 0 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  font-weight: 700;
}
.code-card-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
}
.code-card-title i {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.code-card-file {
  min-width: 0;
  max-width: min(42vw, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}
.code-card-title small {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ececef;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.code-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.code-copy {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  transition: color .16s ease, background .16s ease, transform .16s ease;
  flex: 0 0 auto;
}
.code-run {
  height: 34px;
  border-radius: 11px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  transition: transform .16s ease, background .16s ease;
}
.code-run:hover {
  background: #020617;
  transform: translateY(-1px);
}
.code-copy i,
.code-run i {
  width: 19px;
  height: 19px;
}
.code-copy:hover,
.code-copy.copied {
  color: var(--text);
  background: #ececef;
  transform: translateY(-1px);
}
.code-card pre {
  margin: 0;
  padding: 0 28px 24px;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prompt-card pre {
  padding: 18px 58px 18px 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}
.code-card code {
  display: block;
  min-width: 0;
  color: #111827;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prompt-card code {
  min-width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}
.program-download-row {
  width: min(760px, 100%);
  display: flex;
  justify-content: flex-start;
  margin: -2px 0 14px;
}
.program-download-button {
  min-height: 42px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--panel-bg);
  color: var(--text);
  box-shadow: var(--soft-shadow);
  font-size: 14px;
  font-weight: 800;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.program-download-button:hover {
  transform: translateY(-1px);
  background: var(--active);
  border-color: #cfd5df;
}
.program-download-button i {
  width: 18px;
  height: 18px;
}
.program-download-button span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tok-tag,
.tok-keyword {
  color: #005cc5;
}
.tok-attr {
  color: #b7791f;
}
.tok-string {
  color: #16833a;
}
.tok-number {
  color: #7c3aed;
}
.tok-comment {
  color: #7a7a7a;
  font-style: italic;
}
.tok-preprocessor {
  color: #005cc5;
}
.tok-function {
  color: #6f42c1;
}
.html-runner-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .44);
}
.html-runner-panel {
  width: min(1040px, 100%);
  height: min(760px, calc(100vh - 48px));
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 52px 1fr;
  background: #fff;
  box-shadow: 0 28px 80px rgba(2, 6, 23, .26);
}
.html-runner-head {
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.html-runner-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
.html-runner-close:hover {
  background: #f3f4f6;
  color: var(--text);
}
.html-runner-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.message.loading .bubble,
.message.animating .bubble:has(.typing-status) {
  color: var(--muted);
  background: #fbfbfc;
  min-width: 230px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  cursor: progress;
}
.message.loading .message-actions,
.message.animating .message-actions {
  display: none;
}
.typing-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #9ca3af;
  animation: typingBounce 1.15s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .16s; }
.typing-indicator span:nth-child(3) { animation-delay: .32s; }
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.message-meta,
.message-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  width: max-content;
  max-width: 100%;
  justify-content: flex-start;
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px;
  border-radius: 12px;
}
.message.user .message-actions {
  justify-content: flex-start;
  align-self: flex-end;
}
.message-actions button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.message-actions button i {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}
.message-actions button:hover {
  color: var(--text);
  background: var(--hover);
  transform: translateY(-1px);
}

.attachment-list,
.attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attachment-row {
  width: 100%;
  margin: 0;
}
.attachment-row:empty,
.message-media-slot:empty {
  display: none;
}
.attachment-chip {
  min-height: 34px;
  max-width: 280px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.attachment-chip small {
  color: var(--muted);
  flex: 0 0 auto;
}
.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-preview {
  width: 174px;
  height: 174px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
}
.attachment-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.attachment-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #05070b;
}
.video-preview,
.message-video-preview {
  width: min(320px, 72vw);
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: 520px;
}
.attachment-download {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .88);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 8px;
  left: 8px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .20);
}
.attachment-download i {
  width: 16px;
  height: 16px;
}
.attachment-download.chip-download {
  position: static;
  width: 28px;
  height: 28px;
  margin-left: auto;
  flex: 0 0 28px;
  text-decoration: none;
}
.attachment-remove {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 7px;
  right: 7px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, .20);
}
.attachment-remove i {
  width: 16px;
  height: 16px;
}
.attachment-remove.inline {
  position: static;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  color: var(--muted);
  background: var(--active);
  box-shadow: none;
}
.message-media-slot {
  display: flex;
  width: fit-content;
  max-width: min(760px, 82%);
  align-self: flex-start;
  justify-content: flex-start;
}
.message-media-slot .attachment-list {
  width: fit-content;
  max-width: 100%;
}
.message.user .message-media-slot {
  align-self: flex-end;
  justify-content: flex-end;
}
.message.user .attachment-list {
  justify-content: flex-end;
  width: fit-content;
  max-width: min(520px, 82vw);
}
.message-image-preview {
  width: fit-content;
  max-width: min(320px, 44vw);
  height: auto;
  max-height: min(420px, 56vh);
  aspect-ratio: auto;
  border: 0;
  border-radius: 26px;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
  transition: transform .16s ease, box-shadow .16s ease;
}
.message-image-preview img {
  width: auto;
  max-width: min(320px, 44vw);
  height: auto;
  max-height: min(420px, 56vh);
  object-fit: contain;
  border-radius: inherit;
  background: transparent;
}
.message-image-preview:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(17, 24, 39, .10);
}
.message-image-preview:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 3px;
}

.image-preview-modal {
  width: fit-content;
  height: fit-content;
  max-width: 94vw;
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.image-preview-modal::backdrop {
  background: rgba(10, 15, 26, .76);
  backdrop-filter: blur(10px);
}
.image-preview-modal img {
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: 92vh;
  display: block;
  object-fit: contain;
  border-radius: 28px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
}
.image-preview-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .26);
  z-index: 2;
}
.image-preview-close i {
  width: 20px;
  height: 20px;
}

.composer-wrap {
  position: fixed;
  left: calc(var(--rail) + var(--sidebar));
  right: 0;
  bottom: 0;
  padding: 12px 24px 30px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 32%);
  z-index: 25;
  transition: left .2s ease;
}
.app-shell.sidebar-collapsed .composer-wrap {
  left: var(--rail);
}
.composer,
.reply-banner {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  box-shadow: var(--soft-shadow);
}
.composer {
  min-height: 68px;
  border-radius: 999px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.composer.has-text {
  border-radius: 28px;
  padding: 12px 14px;
}
.composer:focus-within {
  border-color: #d1d5db;
  box-shadow: 0 10px 32px rgba(17, 24, 39, .12), inset 0 0 0 1px rgba(17, 24, 39, .04);
}
.composer:has(.attachment-row:not(:empty)) {
  border-radius: 28px;
  padding: 12px;
}
.composer-input-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.composer-input-row:has(.composer-plus:not(.hidden)) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.composer-plus,
.tool-button,
.send-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background .2s ease, transform .2s ease;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.composer-plus { grid-column: 1; }
textarea { grid-column: 1; }
.composer-plus:not(.hidden) + input + textarea { grid-column: 2; }
.composer-tools { grid-column: 2; }
.composer-plus:not(.hidden) ~ .composer-tools { grid-column: 3; }
.composer-plus:hover,
.tool-button:hover { background: var(--hover); }
.composer-plus i,
.tool-button i,
.send-button i { width: 20px; height: 20px; }
textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  max-height: 170px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 9px 10px 9px 4px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.45;
  background: transparent;
  caret-color: #111827;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
textarea::-webkit-scrollbar {
  width: 8px;
}
textarea::-webkit-scrollbar-track {
  background: transparent;
}
textarea::-webkit-scrollbar-thumb {
  background: #c7c7c7;
  border-radius: 999px;
}
textarea:focus,
textarea:focus-visible {
  outline: none;
}
textarea::placeholder { color: #6b7280; }
textarea:placeholder-shown {
  caret-color: transparent;
}
textarea:focus:placeholder-shown {
  caret-color: #111827;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding-left: 2px;
  padding-right: 0;
  align-self: end;
  justify-self: end;
  padding-bottom: 1px;
  max-width: 100%;
}
.mode-button {
  height: 40px;
  border-radius: 999px;
  padding: 0 10px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.mode-button span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.mode-button:hover { background: var(--hover); }
.mode-button i { width: 16px; height: 16px; }
.send-button {
  background: #050505;
  color: #fff;
  box-shadow: 0 10px 22px rgba(17, 24, 39, .14);
}
.send-button:hover { transform: translateY(-1px); }
.send-button:disabled,
.send-button.is-waiting {
  background: #f8fafc;
  color: #111827;
  opacity: 1;
  transform: none;
  box-shadow: inset 0 0 0 1px #d9dee7, 0 8px 18px rgba(17, 24, 39, .08);
  border: 1px solid #d9dee7;
}
.send-button:disabled:hover,
.send-button.is-waiting:hover {
  transform: none;
}
.stop-icon {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  display: block;
  background: currentColor;
  box-shadow: 0 0 0 1px currentColor;
}
.reply-banner {
  min-height: 44px;
  margin-bottom: 8px;
  border-radius: 16px;
  padding: 7px 10px 7px 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.attach-menu,
.mode-menu,
.slash-command-menu {
  position: absolute;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 30;
}
.attach-menu {
  width: 210px;
  left: max(24px, calc(50% - 480px));
  bottom: 108px;
}
.mode-menu {
  width: 210px;
  right: max(88px, calc(50% - 472px));
  bottom: 108px;
}
.slash-command-menu {
  width: min(520px, calc(100vw - 48px));
  left: max(24px, calc(50% - 480px));
  bottom: 108px;
}
.mode-menu::before {
  content: "Pilih model";
  display: none;
}
.attach-menu button,
.mode-menu button,
.slash-command-menu button {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.slash-command-menu button {
  min-height: 58px;
  justify-content: flex-start;
}
.slash-command-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--active);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.slash-command-icon i {
  width: 17px;
  height: 17px;
}
.slash-command-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.slash-command-copy strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.slash-command-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.slash-command-badge {
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.slash-command-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mode-menu button {
  justify-content: space-between;
  position: relative;
}
.mode-menu button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.mode-menu button.locked {
  opacity: .48;
  cursor: not-allowed;
}
.mode-menu button.locked::after {
  content: none;
}
.mode-menu button.locked small::after {
  content: "  Terkunci";
  color: #ef4444;
}
.attach-menu button:hover,
.mode-menu button:hover,
.mode-menu button.active,
.slash-command-menu button:hover,
.slash-command-menu button.active { background: var(--active); }
.mode-menu button.active::after {
  content: "";
  width: 7px;
  height: 12px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.mode-menu button.locked:hover { background: transparent; }
.menu-trail { margin-left: auto; width: 17px !important; height: 17px !important; }

.modal {
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: var(--shadow);
  background: var(--panel-bg);
  color: var(--text);
  max-width: calc(100vw - 24px);
  overflow: hidden;
}
.modal::backdrop { background: rgba(17,24,39,.24); }
.modal-panel {
  width: min(420px, 92vw);
  max-width: 100%;
  padding: 24px;
  display: grid;
  gap: 16px;
  overflow-x: hidden;
}
.profile-panel {
  width: min(560px, 94vw);
  max-height: min(920px, calc(100dvh - 40px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.profile-heading-row {
  position: sticky;
  top: -24px;
  z-index: 3;
  margin: -24px -24px 0;
  padding: 32px 62px 12px 24px;
  background: var(--panel-bg);
  border-radius: 20px 20px 0 0;
}
.profile-heading-row h2 {
  margin: 0;
}
.profile-heading-row > #closeProfileTop {
  position: absolute;
  top: 30px;
  right: 22px;
  z-index: 12;
  background: var(--panel-bg);
  box-shadow: 0 0 0 1px var(--border), 0 8px 18px rgba(17, 24, 39, .08);
}
.subscription-panel {
  width: min(760px, 94vw);
  max-height: min(680px, calc(100dvh - 48px));
  display: grid;
  gap: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.subscription-panel .pricing-list {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  align-content: start;
}
.subscription-panel > .modal-heading-row {
  padding-right: 52px;
}
.subscription-panel > .modal-heading-row > .icon-button.compact {
  top: 4px;
  right: 4px;
}
.payment-panel {
  width: min(560px, 94vw);
  padding: 28px;
  gap: 18px;
}
.personalization-panel {
  width: min(520px, 92vw);
}
.modal-heading-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 46px;
}
.modal-heading-row h2 {
  margin-bottom: 6px;
}
.modal-heading-row > .icon-button.compact {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}
.pricing-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.pricing-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 16px;
  background: var(--panel-bg);
  overflow: hidden;
  position: relative;
}
.pricing-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #5b6cff, #19a974);
}
.ultra-card::before {
  background: linear-gradient(90deg, #ffb020, #7c3aed, #17a2b8);
}
.pricing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.plan-badge {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eef2ff;
  color: #3440b8;
  font-size: 13px;
  font-weight: 900;
}
.plan-badge i {
  width: 16px;
  height: 16px;
}
.ultra-badge {
  background: #fff3d6;
  color: #9a5b00;
}
.pricing-head strong {
  display: grid;
  justify-items: end;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}
.pricing-head strong span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.pricing-card ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}
.pricing-card li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.pricing-card li i {
  width: 18px;
  height: 18px;
  color: #19a974;
}
.ultra-card li i {
  color: #ffb020;
}
.plan-button {
  width: 100%;
  margin-top: auto;
  background: #111827;
}
.ultra-button {
  background: linear-gradient(135deg, #111827, #4c1d95 52%, #7c2d12);
}
.payment-qris-box {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  background: #f8fafc;
}
.payment-qris-box img {
  width: 176px;
  height: 176px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}
.payment-qris-copy {
  display: grid;
  gap: 7px;
}
.payment-qris-copy span,
.payment-qris-copy small {
  color: var(--muted);
  font-size: 13px;
}
.payment-qris-copy strong {
  color: var(--text);
  font-size: 31px;
  line-height: 1;
}
.payment-proof-picker {
  min-height: 68px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 12px 14px;
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--text) !important;
  cursor: pointer;
  background: #fbfdff;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.payment-proof-picker:hover,
.payment-proof-picker.has-file {
  border-color: #94a3b8;
  background: #f8fafc;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}
.payment-proof-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #3440b8;
}
.payment-proof-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.payment-proof-copy strong {
  font-weight: 800;
}
.payment-proof-copy small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.payment-proof-icon i {
  width: 20px;
  height: 20px;
}
.payment-proof-button {
  height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.payment-proof-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.payment-proof-preview {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f8fafc;
}
.payment-panel .modal-actions {
  justify-content: flex-end;
  gap: 10px;
}
.payment-panel .modal-actions .secondary-button,
.payment-panel .modal-actions .primary-button {
  height: 50px;
  border-radius: 16px;
  padding: 0 22px;
}
.theme-choice {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--panel-bg);
}
.theme-choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9edff;
  color: #4251dc;
}
.theme-choice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.theme-choice-copy strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.theme-choice-copy small {
  color: var(--muted);
  line-height: 1.35;
}
.theme-toggle {
  width: 56px;
  height: 32px;
  border-radius: 999px;
  padding: 3px;
  background: #d1d5db;
  transition: background .18s ease;
}
.theme-toggle span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: block;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .2);
  transition: transform .18s ease;
}
.theme-toggle[aria-checked="true"] {
  background: #5b6cff;
}
.theme-toggle[aria-checked="true"] span {
  transform: translateX(24px);
}
.memory-reset-choice {
  border-color: #fee2e2;
  background: #fffafa;
}
.memory-icon {
  color: #b91c1c;
  background: #fee2e2;
}
.memory-reset-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #b91c1c;
  background: #fff1f2;
  font-size: 13px;
  font-weight: 900;
  justify-self: end;
}
.memory-reset-button:disabled {
  opacity: .62;
  cursor: wait;
}
.memory-reset-status {
  margin: -4px 2px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.memory-reset-status.success {
  color: #047857;
}
.memory-reset-status.error {
  color: var(--danger);
}
.modal-panel h2 { margin: 0; }
.modal-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.modal-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}
.modal-panel input,
.modal-panel select {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--input-bg);
  color: var(--text);
}
.profile-editor {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--input-bg);
}
.profile-avatar-preview {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  padding: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-bg);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform .16s ease, box-shadow .16s ease;
}
.profile-avatar-preview:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px #d1d5db, 0 8px 20px rgba(17, 24, 39, .08);
}
.profile-avatar-large {
  width: 58px;
  height: 58px;
  font-size: 18px;
}
.profile-avatar-large.default-logo-avatar {
  background-size: 76%;
}
.profile-editor-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}
.profile-editor-copy strong {
  font-size: 15px;
  color: var(--text);
}
.profile-editor-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.profile-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.credit-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: var(--input-bg);
  display: grid;
  gap: 12px;
}
.credit-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.credit-panel-head strong {
  color: var(--text);
  font-size: 15px;
}
.credit-panel-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}
.credit-list {
  display: grid;
  gap: 10px;
}
.credit-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: var(--panel-bg);
}
.credit-card-top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.credit-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #3440b8;
}
.credit-ultra .credit-icon {
  background: #fff3d6;
  color: #9a5b00;
}
.credit-free .credit-icon {
  background: #ecfdf5;
  color: #047857;
}
.credit-icon.credit-pro {
  background: #eef2ff;
  color: #3440b8;
}
.credit-icon.credit-ultra {
  background: #fff3d6;
  color: #9a5b00;
}
.credit-icon.credit-free {
  background: #ecfdf5;
  color: #047857;
}
.credit-card-top strong,
.credit-card-top b {
  color: var(--text);
  font-size: 15px;
}
.credit-usage-list {
  display: grid;
  gap: 11px;
}
.credit-usage-row {
  display: grid;
  gap: 6px;
}
.credit-usage-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 12px;
}
.credit-usage-meta strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}
.credit-usage-meta span,
.credit-usage-meta time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.credit-card-top small,
.credit-card p,
.credit-card small,
.credit-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  margin: 0;
}
.credit-meter {
  height: 9px;
  border-radius: 999px;
  background: var(--active);
  overflow: hidden;
}
.credit-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #19a974, #5b6cff);
  transition: width .2s ease;
}
.credit-card.empty .credit-meter span {
  background: #ef4444;
}
.compact-button {
  min-height: 34px !important;
  border-radius: 10px !important;
  padding: 0 12px !important;
  font-size: 13px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 700;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}
.primary-button { background: #050505; color: #fff; }
.primary-button.ultra-button {
  background: linear-gradient(135deg, #111827, #4c1d95 52%, #7c2d12);
}
.secondary-button { background: var(--active); }
.danger-button { background: var(--danger); color: #fff; }
body.theme-dark .primary-button,
body.theme-dark .send-button {
  background: #f8fafc;
  color: #0b0f16;
}
body.theme-dark .send-button.is-waiting {
  background: #1d2634;
  color: #edf2f8;
  border-color: #344054;
  box-shadow: inset 0 0 0 1px #344054, 0 8px 18px rgba(0, 0, 0, .28);
}
body.theme-dark .ultra-button {
  color: #fff;
  background: linear-gradient(135deg, #111827, #4c1d95 52%, #7c2d12);
}
.action-panel {
  gap: 14px;
}
.action-panel #actionInput {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--text);
}
.action-panel .modal-actions {
  margin-top: 4px;
  flex-wrap: wrap;
}

.mobile-only { display: none; }

@media (max-width: 1400px) {
  :root { --admin-sidebar: 274px; }
  .admin-sidebar {
    padding-left: 14px;
  }
  .admin-side-brand {
    margin-bottom: 20px;
    gap: 10px;
  }
  .admin-sidebar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }
  .admin-nav {
    padding: 0 14px;
    gap: 12px;
  }
  .admin-topbar {
    min-height: 68px;
    padding: 0 24px;
  }
  .admin-topbar h1 {
    font-size: 34px;
  }
  .admin-search {
    min-width: 240px;
  }
  .admin-chart-card,
  .admin-table-card {
    margin: 0 24px;
  }
  .admin-card-head,
  .admin-table-card th,
  .admin-table-card td {
    padding-left: 18px;
    padding-right: 18px;
  }
  .admin-table-card th,
  .admin-table-card td {
    font-size: 14px;
  }
  .admin-users-card table {
    table-layout: fixed;
    min-width: 0;
  }
  .admin-users-card th:nth-child(1),
  .admin-users-card td:nth-child(1) { width: 18%; }
  .admin-users-card th:nth-child(2),
  .admin-users-card td:nth-child(2) { width: 22%; }
  .admin-users-card th:nth-child(3),
  .admin-users-card td:nth-child(3) { width: 14%; }
  .admin-users-card th:nth-child(4),
  .admin-users-card td:nth-child(4) { width: 10%; }
  .admin-users-card th:nth-child(5),
  .admin-users-card td:nth-child(5) { width: 10%; }
  .admin-users-card th:nth-child(6),
  .admin-users-card td:nth-child(6) { width: 14%; }
  .admin-users-card th:nth-child(7),
  .admin-users-card td:nth-child(7) { width: 12%; }
  .admin-users-card td {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-users-card .admin-row-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .admin-users-card .admin-row-actions button {
    min-width: 0;
    padding: 0 9px;
    font-size: 12px;
  }
}

@media (max-width: 1100px) {
  :root { --sidebar: 260px; --admin-sidebar: 250px; }
  .topbar { padding-right: 24px; gap: 16px; }
  .composer { max-width: 900px; }
  .admin-analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-do-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-do-billing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-do-row {
    grid-template-columns: minmax(220px, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --rail: 0px;
    --admin-sidebar: min(282px, 76vw);
  }
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
  body,
  .app-shell,
  .main-panel,
  .topbar,
  .welcome-view,
  .chat-view,
  .message-list,
  .composer-wrap,
  .composer,
  .admin-dashboard,
  .admin-main,
  .admin-view-panel {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  input,
  textarea,
  select {
    font-size: 16px;
  }
  body.keyboard-open,
  body.keyboard-open .app-shell,
  body.keyboard-open .main-panel,
  body.keyboard-open .chat-view,
  body.keyboard-open .message-list,
  body.keyboard-open .composer-wrap,
  body.keyboard-open .composer {
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }
  .auth-screen {
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
    overflow: auto;
    overflow-x: hidden;
  }
  .auth-card {
    width: min(100%, 330px);
    max-height: calc(100svh - 24px);
    align-self: center;
    margin-top: 0;
    border-radius: 8px;
    padding: 22px 24px 18px;
    gap: 9px;
    overflow-y: auto;
    transition: transform .22s ease, margin .22s ease;
  }
  body.keyboard-open .auth-screen {
    align-items: start;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  body.keyboard-open .auth-card {
    align-self: start;
    margin-top: 0;
    transform: translateY(0);
  }
  .auth-close {
    top: 10px;
    right: 10px;
    left: auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .auth-logo {
    width: 34px;
    height: 34px;
    margin-top: 16px;
  }
  .auth-card h1 {
    font-size: 23px;
    line-height: 1.05;
    max-width: 12ch;
    justify-self: center;
    margin-bottom: 4px;
  }
  .auth-form {
    gap: 8px;
  }
  .auth-field {
    gap: 6px;
    font-size: 12px;
  }
  .auth-field input {
    min-height: 34px;
    border-radius: 7px;
    padding: 0 11px;
    font-size: 16px;
  }
  .auth-primary,
  .auth-provider,
  .google-button-wrap {
    min-height: 34px;
    border-radius: 7px;
    font-size: 13px;
  }
  .auth-provider {
    grid-template-columns: 24px 1fr;
    padding: 0 10px;
  }
  .google-g {
    font-size: 18px;
  }
  .auth-separator {
    gap: 10px;
    margin: 1px 0;
    font-size: 12px;
  }
  .auth-switch {
    font-size: 12px;
  }
  .admin-link {
    font-size: 13px;
  }
  .auth-legal {
    font-size: 10px;
  }
  .admin-dashboard,
  .admin-dashboard.admin-nav-collapsed {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 75;
    width: min(282px, 76vw);
    max-width: 282px;
    min-width: 0;
    min-height: 100svh;
    padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .admin-dashboard.admin-mobile-nav-open .admin-sidebar {
    transform: translateX(0);
  }
  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block !important;
    background: rgba(15, 23, 42, .18);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .admin-dashboard.admin-mobile-nav-open .admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .admin-mobile-nav-toggle {
    display: inline-grid !important;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--muted);
    place-items: center;
  }
  .admin-side-brand {
    margin-bottom: 14px;
    flex: 0 0 auto;
  }
  .admin-side-brand strong {
    display: block;
  }
  .admin-dashboard.admin-nav-collapsed .admin-side-brand strong {
    display: block;
  }
  .admin-sidebar-toggle,
  .admin-dashboard.admin-nav-collapsed .admin-sidebar-toggle {
    display: grid;
  }
  .admin-dashboard.admin-nav-collapsed .admin-side-brand .brand-mark {
    display: block;
  }
  .admin-nav,
  .admin-dashboard.admin-nav-collapsed .admin-nav {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 13px;
    justify-content: flex-start;
  }
  .admin-nav span,
  .admin-dashboard.admin-nav-collapsed .admin-nav span {
    display: inline;
  }
  .admin-topbar {
    min-height: 60px;
    padding: max(6px, env(safe-area-inset-top)) 12px 10px;
    max-width: 100%;
    gap: 10px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 45;
  }
  .admin-topbar h1 {
    flex: 1 1 calc(100% - 110px);
    font-size: clamp(23px, 7vw, 28px);
    line-height: 1.1;
    white-space: normal;
  }
  .admin-top-actions {
    width: 100%;
    gap: 8px;
    flex: 1 0 100%;
    justify-content: space-between;
  }
  .admin-search {
    width: calc(100% - 50px);
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 10px;
  }
  .admin-search input {
    min-width: 0;
    width: 100%;
    font-size: 13px;
  }
  .admin-main,
  .admin-view-panel {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  .admin-metrics {
    padding: 12px 14px 0;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .metric-card {
    min-height: 108px;
    padding: 16px;
    gap: 14px;
  }
  .metric-card > div {
    min-width: 0;
  }
  .metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }
  .admin-chart-card,
  .admin-table-card {
    margin: 0 14px;
    width: auto;
    min-width: 0;
  }
  .admin-card-head {
    min-height: auto;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-do-body {
    padding: 14px;
  }
  .admin-do-account {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-do-stats {
    grid-template-columns: 1fr;
  }
  .admin-do-billing-grid,
  .admin-do-billing-row,
  .admin-do-credit-row {
    grid-template-columns: 1fr;
  }
  .admin-do-billing-row small {
    text-align: left;
  }
  .admin-do-row {
    grid-template-columns: 1fr;
  }
  .admin-do-empty {
    margin: 14px;
    align-items: flex-start;
  }
  .admin-chart {
    height: clamp(220px, 54vw, 260px);
    padding: 16px 12px 18px;
  }
  .admin-chart svg {
    overflow: visible;
  }
  .admin-table-card table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .admin-table-card thead {
    display: none;
  }
  .admin-table-card tbody {
    display: grid;
    gap: 10px;
    padding: 12px;
  }
  .admin-table-card tr {
    display: grid;
    gap: 9px;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--input-bg);
  }
  .admin-table-card td {
    min-height: auto;
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(82px, .36fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    overflow-wrap: anywhere;
  }
  .admin-table-card td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }
  .admin-table-card td[colspan] {
    display: block;
    color: var(--muted);
  }
  .admin-table-card td[colspan]::before {
    content: none;
  }
  .admin-row-actions {
    justify-content: flex-start;
  }
  .admin-row-actions button {
    flex: 1 1 auto;
    min-width: 74px;
  }
  .admin-users-card {
    overflow: visible;
  }
  .admin-users-card table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    table-layout: auto;
  }
  .admin-users-card tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }
  .admin-users-card tr {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--input-bg);
    box-shadow: 0 8px 20px rgba(17, 24, 39, .04);
  }
  .admin-users-card td,
  .admin-users-card td:nth-child(n) {
    width: 100% !important;
    min-width: 0;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    overflow: visible;
    text-overflow: clip;
  }
  .admin-users-card td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
  }
  .admin-users-card td,
  .admin-users-card td strong,
  .admin-users-card td span,
  .admin-users-card td small {
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .admin-users-card .admin-plan-cell {
    justify-items: start;
  }
  .admin-users-card .admin-plan-select {
    min-width: 116px;
    max-width: 100%;
  }
  .admin-users-card .status-pill {
    width: fit-content;
  }
  .admin-users-card .admin-row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .admin-users-card .admin-row-actions button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
  }
  .admin-analytics-summary,
  .analytics-plan-grid,
  .broadcast-grid {
    grid-template-columns: 1fr;
  }
  .admin-credit-grid {
    grid-template-columns: 1fr;
  }
  .broadcast-grid {
    padding: 14px;
  }
  .broadcast-form .primary-button {
    width: 100%;
    justify-content: center;
  }
  .broadcast-preview h3 {
    font-size: 21px;
  }
  .broadcast-history-item {
    grid-template-columns: 1fr;
  }
  .broadcast-history-meta {
    justify-items: start;
  }
  .model-chart-canvas {
    min-height: 280px;
    padding-left: 44px;
  }
  html, body {
    min-height: 100svh;
  }
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 0;
    min-height: 100svh;
    width: 100%;
    contain: inline-size;
  }
  .app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail { display: none; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(292px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 100dvh;
    max-height: 100dvh;
    transform: translateX(-105%);
    z-index: 50;
    box-shadow: var(--shadow);
    padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
  }
  @supports not (height: 100dvh) {
    .sidebar {
      height: 100svh;
      max-height: 100svh;
    }
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    width: min(292px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 100dvh;
    max-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--border);
    transform: translateX(-105%);
  }
  .app-shell:not(.sidebar-collapsed) .sidebar,
  .app-shell.sidebar-collapsed .sidebar {
    width: min(292px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 100dvh;
    max-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    border-right: 1px solid var(--border);
  }
  .sidebar.open,
  .app-shell.sidebar-collapsed .sidebar.open,
  .app-shell:not(.sidebar-collapsed) .sidebar.open {
    transform: translateX(0);
  }
  @supports not (height: 100dvh) {
    .sidebar.collapsed,
    .app-shell:not(.sidebar-collapsed) .sidebar,
    .app-shell.sidebar-collapsed .sidebar {
      height: 100svh;
      max-height: 100svh;
    }
  }
  .sidebar-top {
    flex: 0 0 auto;
    height: 38px;
    margin-bottom: 24px;
  }
  .nav-list,
  .project-section {
    flex: 0 0 auto;
  }
  .nav-list {
    gap: 8px;
  }
  .nav-item,
  .muted-action {
    min-height: 40px;
    border-radius: 12px;
    gap: 12px;
    padding: 0 10px;
    font-size: 13px;
  }
  .sidebar-section {
    margin-top: 22px;
  }
  .history-section {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .section-title {
    min-height: 32px;
    font-size: 13px;
  }
  .history-groups {
    max-height: none;
    margin-top: 10px;
    overflow-y: auto;
    padding-bottom: 10px;
  }
  .history-item {
    min-height: 38px;
    border-radius: 12px;
    padding: 0 10px;
    font-size: 13px;
  }
  .profile-card {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex: 0 0 auto;
    min-height: 62px;
    margin-top: auto;
    padding: 8px 8px;
    border-radius: 14px;
    background: var(--sidebar-bg);
    box-shadow: 0 -10px 18px rgba(255, 255, 255, .92);
    gap: 10px;
  }
  body.theme-dark .profile-card {
    box-shadow: 0 -10px 18px rgba(15, 20, 29, .92);
  }
  .profile-card .avatar-button {
    width: 40px;
    height: 40px;
  }
  .profile-copy {
    min-width: 0;
    gap: 3px;
  }
  .profile-copy strong {
    font-size: 13px;
  }
  .profile-copy small {
    font-size: 11px;
    max-width: 100%;
  }
  .profile-logout {
    width: 34px;
    height: 34px;
  }
  @media (max-height: 740px) {
    .sidebar {
      padding-top: max(12px, env(safe-area-inset-top));
      padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .sidebar-top {
      margin-bottom: 16px;
    }
    .sidebar-section {
      margin-top: 16px;
    }
    .history-groups {
      gap: 6px;
      margin-top: 8px;
    }
    .profile-card {
      min-height: 58px;
      padding: 7px 8px;
    }
  }
  .account-menu,
  .app-shell:not(.sidebar-collapsed) + .account-menu,
  .account-menu.from-sidebar {
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(268px, calc(100vw - 32px));
    z-index: 70;
    background: var(--panel-bg);
    box-shadow: 0 10px 24px rgba(17, 24, 39, .10);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    contain: layout paint;
    content-visibility: auto;
    transform: translateZ(0);
    will-change: transform, opacity;
  }
  body.account-menu-opening .message-list,
  body.account-menu-opening .history-groups,
  body.account-menu-opening .chat-view {
    pointer-events: none;
  }
  .account-menu-item {
    min-height: 52px;
    border-radius: 12px;
    transition: none;
  }
  .account-menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 11px;
  }
  .account-menu-icon i {
    width: 17px;
    height: 17px;
  }
  .guest-card {
    margin-top: 18px;
    padding: 18px 8px 0;
    gap: 10px;
    max-width: 100%;
  }
  .guest-card h3 {
    font-size: 16px;
    line-height: 1.25;
    max-width: 21ch;
  }
  .guest-card p {
    font-size: 13px;
    line-height: 1.38;
  }
  .guest-login-button {
    min-height: 42px;
    font-size: 14px;
    margin-top: 2px;
  }
  .mobile-only { display: inline-flex; }
  .main-panel {
    grid-column: 1;
    width: 100%;
    max-width: 100%;
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
  }
  .topbar {
    height: 62px;
    padding: max(6px, env(safe-area-inset-top)) 12px 0;
    gap: 10px;
    position: relative;
    z-index: 45;
    width: 100%;
  }
  .topbar-item { display: none; }
  .topbar-auth-actions {
    gap: 8px;
  }
  .topbar-promo {
    min-height: 38px;
    padding: 0 9px;
    gap: 6px;
    font-size: 13px;
  }
  .topbar-promo i {
    width: 16px;
    height: 16px;
  }
  .topbar-login,
  .topbar-register {
    min-height: 40px;
    padding: 0 13px;
    font-size: 14px;
  }
  .topbar-edit {
    width: 42px;
    height: 42px;
  }
  .welcome-view {
    min-height: calc(100svh - 62px);
    padding: 0 clamp(18px, 6vw, 28px) 132px;
    align-items: center;
  }
  .welcome-brand {
    width: min(100%, 420px);
    flex-direction: column;
    gap: 15px;
    transform: translateY(-34px);
  }
  .hero-mark {
    width: 64px;
    height: 64px;
  }
  .brand-wordmark {
    max-width: 100%;
    font-size: clamp(31px, 8.2vw, 40px);
    line-height: 1.05;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }
  .chat-view {
    padding: 8px clamp(12px, 4vw, 18px) 146px;
    width: 100%;
  }
  .message-list { gap: 24px; }
  .bubble {
    width: min(620px, 100%);
    max-width: 100%;
    font-size: 15px;
    padding: 12px 15px;
  }
  .message.user .bubble.editing-bubble {
    width: 100%;
    min-height: 122px;
    padding: 16px 16px 12px;
    border-radius: 20px;
  }
  .message.user .bubble.editing-bubble.long-edit-bubble {
    width: 100%;
    min-height: 300px;
    padding: 16px 16px 12px;
    border-radius: 20px;
  }
  .inline-edit {
    min-height: 94px;
  }
  .inline-edit.long-edit {
    min-height: 270px;
  }
  .inline-edit-input {
    max-height: 180px;
    font-size: 15px;
    padding: 0 24px 48px 0;
  }
  .inline-edit.long-edit .inline-edit-input {
    min-height: 190px;
  }
  .inline-edit-actions {
    right: 16px;
    bottom: 12px;
    min-height: 34px;
  }
  .inline-edit-actions .secondary-button,
  .inline-edit-actions .primary-button {
    height: 34px;
    min-width: 58px;
    padding: 0 13px;
    font-size: 13.5px;
  }
  .message.assistant .bubble.rich-response {
    width: 100%;
    max-width: 100%;
  }
  .response-text {
    font-size: 15px;
  }
  .code-card {
    border-radius: 18px;
  }
  .code-card-head {
    min-height: 48px;
    padding: 0 12px 0 16px;
  }
  .code-card pre {
    padding: 0 16px 18px;
  }
  .code-card code {
    font-size: 13px;
  }
  .composer-wrap {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
    padding: 10px clamp(10px, 3.6vw, 16px) max(14px, env(safe-area-inset-bottom));
  }
  .app-shell.sidebar-collapsed .composer-wrap { left: 0; }
  .composer {
    width: 100%;
    min-height: 58px;
    border-radius: 999px;
    padding: 7px 8px;
    gap: 6px;
  }
  .composer.has-text {
    border-radius: 22px;
    padding: 9px 9px 9px 12px;
  }
  .composer:focus-within,
  .composer:has(textarea:not(:placeholder-shown)) {
    border-radius: 22px;
  }
  .composer-input-row {
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 7px;
  }
  .composer-input-row:has(.composer-plus:not(.hidden)) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .composer-plus,
  .send-button {
    width: 38px;
    height: 38px;
  }
  textarea {
    font-size: 16px;
    min-height: 38px;
    max-height: min(30svh, 150px);
    padding: 7px 10px 7px 0;
    line-height: 1.45;
  }
  .composer-tools {
    gap: 5px;
    padding-left: 0;
    padding-right: 0;
  }
  .mode-button {
    height: 36px;
    padding: 0 8px 0 11px;
    min-width: 68px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .045);
    gap: 4px;
    font-size: 13px;
    font-weight: 800;
  }
  .mode-button #activeMode {
    display: inline-flex !important;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mode-button i {
    width: 14px;
    height: 14px;
  }
  .tool-button { display: none; }
  .attach-menu {
    width: min(236px, calc(100vw - 28px));
    left: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .mode-menu {
    position: fixed;
    left: clamp(10px, 3.6vw, 16px);
    right: clamp(10px, 3.6vw, 16px);
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(42svh, 276px);
    overflow-y: auto;
    z-index: 220;
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 18px 50px rgba(17, 24, 39, .18), 0 0 0 1px rgba(17, 24, 39, .05);
  }
  .mode-menu::before {
    display: block;
    padding: 2px 7px 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
  }
  .mode-menu button {
    min-height: 50px;
    padding: 0 14px;
    border-radius: 12px;
    background: transparent;
    font-size: 14px;
  }
  .mode-menu button small {
    font-size: 11.5px;
    max-width: 58%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mode-menu button.active {
    background: #f1f5f9;
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .05);
  }
  .mode-menu button.active {
    padding-right: 32px;
  }
  .mode-menu button.active small {
    margin-right: 2px;
  }
  .mode-menu button.active::after {
    position: absolute;
    right: 13px;
  }
  .slash-command-menu {
    position: fixed;
    left: clamp(10px, 3.6vw, 16px);
    right: clamp(10px, 3.6vw, 16px);
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(50svh, 324px);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 230;
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 18px 50px rgba(17, 24, 39, .18), 0 0 0 1px rgba(17, 24, 39, .05);
  }
  .slash-command-menu button {
    min-height: 56px;
    padding: 0 10px;
    border-radius: 12px;
    gap: 10px;
  }
  .slash-command-icon {
    width: 32px;
    height: 32px;
  }
  .slash-command-copy strong {
    gap: 5px;
  }
  .slash-command-copy small {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .slash-command-badge {
    padding: 2px 6px;
    font-size: 9.5px;
  }
  .slash-command-copy em {
    max-width: 100%;
  }
  .pricing-list {
    grid-template-columns: 1fr;
  }
  .payment-qris-box {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .payment-proof-picker {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .payment-proof-button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .payment-panel .modal-actions {
    grid-template-columns: 1fr;
  }
  .payment-panel .modal-actions .secondary-button,
  .payment-panel .modal-actions .primary-button {
    width: 100%;
  }
  .payment-request-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .payment-request-card > img {
    width: 72px;
    height: 72px;
  }
  .payment-request-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .subscription-panel,
  .profile-panel,
  .payment-panel,
  .personalization-panel {
    width: min(calc(100vw - 32px), 520px);
    max-width: calc(100vw - 32px);
    max-height: min(78dvh, calc(100dvh - 112px));
    padding: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .subscription-panel {
    height: auto;
    max-height: min(78dvh, calc(100dvh - 112px));
    display: grid;
    gap: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .subscription-panel .pricing-list {
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-right: 0;
    align-content: start;
  }
  @supports not (height: 100dvh) {
    .subscription-panel,
    .profile-panel,
    .payment-panel,
    .personalization-panel {
      max-height: min(78svh, calc(100svh - 112px));
    }
    .subscription-panel {
      height: min(78svh, calc(100svh - 112px));
    }
  }
  .subscription-panel *,
  .profile-panel *,
  .payment-panel *,
  .personalization-panel * {
    max-width: 100%;
    min-width: 0;
  }
  .subscription-panel > .modal-heading-row,
  .profile-panel > .modal-heading-row,
  .payment-panel > .modal-heading-row,
  .personalization-panel > .modal-heading-row {
    position: sticky;
    top: -18px;
    z-index: 8;
    margin: -18px -18px 0;
    padding: 18px 46px 12px 18px;
    background: var(--panel-bg);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 8px 14px rgba(255, 255, 255, .92);
  }
  .subscription-panel > .modal-heading-row {
    position: sticky;
    top: -18px;
    z-index: 12;
    margin: -18px -18px 0;
    padding: 24px 48px 12px 18px;
    border-radius: 20px 20px 0 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
  }
  body.theme-dark .subscription-panel > .modal-heading-row,
  body.theme-dark .profile-panel > .modal-heading-row,
  body.theme-dark .payment-panel > .modal-heading-row,
  body.theme-dark .personalization-panel > .modal-heading-row {
    box-shadow: 0 8px 14px rgba(18, 24, 36, .92);
  }
  body.theme-dark .subscription-panel > .modal-heading-row {
    box-shadow: none;
  }
  .modal-heading-row .icon-button {
    flex: 0 0 auto;
  }
  .subscription-panel > .modal-heading-row > .icon-button.compact,
  .profile-panel > .modal-heading-row > .icon-button.compact,
  .payment-panel > .modal-heading-row > .icon-button.compact,
  .personalization-panel > .modal-heading-row > .icon-button.compact {
    top: 14px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: transparent;
    box-shadow: none;
    border-radius: 8px;
  }
  .subscription-panel > .modal-heading-row > .icon-button.compact {
    top: 22px;
    right: 12px;
  }
  .profile-heading-row {
    top: -18px;
    margin: -18px -18px 0;
    padding: 26px 46px 12px 14px;
  }
  .profile-heading-row > #closeProfileTop {
    top: 22px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: transparent;
    box-shadow: none;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
  }
  .profile-panel {
    padding-right: 14px;
    scrollbar-gutter: stable;
  }
  .profile-editor {
    align-items: center;
    padding: 12px;
    gap: 12px;
  }
  .profile-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
  .profile-avatar-large {
    width: 52px;
    height: 52px;
  }
  .pricing-list,
  .credit-list,
  .profile-editor,
  .credit-panel,
  .pricing-card,
  .payment-qris-box,
  .payment-proof-picker {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .pricing-card {
    padding: 14px;
  }
  .pricing-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .pricing-head strong {
    font-size: 28px;
  }
  .credit-panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .credit-panel-head small {
    text-align: left;
  }
  .credit-card-top {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }
  .credit-card {
    padding: 11px;
    gap: 7px;
  }
  .credit-usage-list {
    gap: 9px;
  }
  .credit-usage-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
  }
  .credit-usage-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .credit-usage-meta time {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .theme-choice {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .theme-toggle {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .memory-reset-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .chat-view {
    padding: 6px 8px 132px;
  }
  .message-list {
    gap: 18px;
  }
  .message.assistant,
  .message.assistant .bubble.rich-response {
    width: 100%;
    max-width: 100%;
  }
  .message.assistant .bubble.rich-response {
    padding: 14px 12px;
    border-radius: 18px;
    background: #f3f6fb;
  }
  .response-text {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.52;
  }
  .response-text p {
    margin-bottom: 10px;
  }
  .response-text h3 {
    margin: 10px 0 8px;
    font-size: 18px;
    line-height: 1.18;
    font-weight: 850;
    overflow-wrap: anywhere;
  }
  .response-text h4,
  .response-text h5 {
    margin: 14px 0 8px;
    font-size: 16px;
    line-height: 1.22;
    font-weight: 850;
    overflow-wrap: anywhere;
  }
  .response-text h3 + p,
  .response-text h4 + p,
  .response-text h5 + p {
    max-width: none;
    font-size: 13.5px;
    font-weight: 500;
  }
  .response-text ul,
  .response-text ol {
    padding-left: 18px;
  }
  .markdown-table-wrap {
    margin: 10px 0 12px;
    border-radius: 8px;
  }
  .markdown-table {
    min-width: 320px;
    font-size: 12px;
  }
  .markdown-table th,
  .markdown-table td {
    padding: 9px 10px;
  }
  .prompt-card {
    margin: 8px 0 16px;
  }
  .prompt-card .code-card-head {
    top: 8px;
    right: 8px;
  }
  .prompt-card .code-copy {
    width: 30px;
    min-width: 30px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
  }
  .prompt-card .code-copy i {
    width: 16px;
    height: 16px;
  }
  .prompt-card pre {
    max-height: min(52svh, 430px);
    padding: 44px 12px 13px;
    border-radius: 7px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .prompt-card code {
    font-size: 11.5px;
    line-height: 1.62;
  }
  .code-card:not(.prompt-card) {
    border-radius: 12px;
  }
  .code-card:not(.prompt-card) pre {
    max-height: min(52svh, 430px);
    padding: 0 12px 14px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .code-card:not(.prompt-card) code {
    font-size: 12px;
    line-height: 1.6;
  }
  .composer-tools { gap: 4px; }
  .composer-plus,
  .send-button { width: 38px; height: 38px; }
  .mode-button {
    width: auto;
    min-width: 66px;
    height: 35px;
    padding: 0 7px 0 10px;
    justify-content: center;
  }
  .message-actions { flex-wrap: nowrap; }
}

@media (max-width: 380px) {
  .topbar { padding-left: 10px; padding-right: 10px; }
  .welcome-view { padding-left: 14px; padding-right: 14px; }
  .welcome-brand { gap: 13px; transform: translateY(-28px); }
  .hero-mark {
    width: 56px;
    height: 56px;
  }
  .brand-wordmark { font-size: clamp(28px, 8vw, 34px); }
  .composer { min-height: 56px; padding-left: 10px; padding-right: 8px; }
  .composer.has-text { padding-left: 10px; padding-right: 8px; }
  .composer-input-row { gap: 5px; }
  .composer-plus,
  .send-button { width: 36px; height: 36px; }
  .mode-button {
    min-width: 62px;
    padding: 0 7px;
    font-size: 13px;
  }
  .chat-view {
    padding-left: 6px;
    padding-right: 6px;
  }
  .message.assistant .bubble.rich-response {
    padding: 12px 10px;
    border-radius: 16px;
  }
  .response-text h3 {
    font-size: 17px;
  }
  .response-text h4,
  .response-text h5 {
    font-size: 15px;
  }
  .prompt-card code {
    font-size: 11px;
  }
  textarea {
    font-size: 16px;
    padding-left: 0;
    padding-right: 8px;
  }
}
